Alignak-monitoring-contrib / alignak-app

Desktop application in system tray for Alignak users.
GNU Affero General Public License v3.0
6 stars 2 forks source link

Use the Alignak Web Service module to ack, downtime ... #279

Closed mohierf closed 6 years ago

mohierf commented 6 years ago

Rather than posting some events to the backend the Alignak app should allow to use tha Alignak Web Service module ... to be discussed @algorys

This will allow to simplify some Alignak treatments:

algorys commented 6 years ago

@mohierf ok.

  1. Alignak Web Service is not necessarily installed, how I can detect it ?
    • If it is installed, is it better to pass the actions on this module ?
  2. What are the advantages for managing the items in the backend of this module ?
  3. What do you call "external commands" ?

I ask all these questions to understand the value of the module.

In addition, I would have liked to add the possibility for administrators to add hosts or services via the application.

mohierf commented 6 years ago
  1. If Alignak WS is installed, you can get on http://alignak-ws:port and you will not have an HTTP 404. Either it will be a 200 or 401 HTTP code. If 401, you will need to POST /login (same as for the alignak backend) to get a token. See: http://alignak-module-ws.readthedocs.io/en/develop/ for a full documentation

  2. It is the only interface that will manage all the existing Alignak commands 😉 and the backend current endpoints (actionack, ...) will be deprecated in a future version!

  3. See http://alignak-doc.readthedocs.io/en/develop/20_annexes/external_commands_list.html

algorys commented 6 years ago

@mohierf ok.

  1. I saw that we could have the data of a host or a service easily ... but I did not find a way to have all the hosts or all the services with web service.

  2. If these endpoints (actionack, ...) will be deprecated, does this module will be mandatory ? Or alignak without web services will not allow these features ?

  3. I did not understand how to use external commands... :confused:

mohierf commented 6 years ago

Perharps there are still some missing endpoints in the WS interface, especially one to get the hosts list, I am currenlty documenting this part for the Alignak daemons because there are still some service exposed by all the daemons ...

For the commands, there are some examples in the WS module doc: http://alignak-module-ws.readthedocs.io/en/develop/04_services/07-external-command.html and the available commands are listed in the alignak doc

algorys commented 6 years ago

@mohierf I add ACK and DOWNTIME with WS client. Can you look at the functions I did to find out if the code looks good or not ?

Ack: https://github.com/Alignak-monitoring-contrib/alignak-app/blob/a8d0442182f5f12c79f18531373205639d7903b6/alignak_app/backend/backend.py#L241

Donwtime: https://github.com/Alignak-monitoring-contrib/alignak-app/blob/a8d0442182f5f12c79f18531373205639d7903b6/alignak_app/backend/backend.py#L306

:wink:

algorys commented 6 years ago

Done.