Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nagios-api | schedule_downtime does not seem to take any actions on the server side #93

Open
humblepilot opened this issue Sep 4, 2018 · 2 comments

Comments

@humblepilot
Copy link

Hello Folks,

I have written a wrapper to run schedule downtime from the client-side. It used to work sometime back (scheduling downtime on nagios server) but at the moment it does not. The wrapper executes the command successfully from the client side as follows:

XXXXXX@XXXXXX:/$ sudo python nagios.py -host XXXXXXXX -D 61 -v Nagios server='NAGIOS_SERVER' found for datacenter='XXX' NAGIOS_HOST - Making HTTP POST request to url='http://NAGIOS_SERVER:NAGIOS_API_PORT/schedule_downtime' with payload='{'duration': 61, 'comment': None, 'host': 'XXXXXXXX', 'author': 'root', 'services_too': True}', headers='{'content-type': 'application/json'}', retries='Retry(total=3, connect=None, read=None, redirect=None)' CLIENT_HOST - Completed successfully HTTP POST call with return status='200' and resp length=77 bytes Nagios downtime_notification completed on host=XXXXXXXX for duration=61 seconds in time=0 secs

I did run it from command line and this is the output
curl -d '{"host": "XXXXXXXX", "duration": 61}' -H 'Content-Type: application/json' http://NAGIOS_SERVER:NAGIOS_API_PORT/schedule_downtime {"content": "External commands not enabled on nagios-api.", "success": false}

May be I m missing something, can you please help figure what could be the issue
Appreciate your prompt reply soon

Thanks

@zorkian
Copy link
Owner

zorkian commented Sep 5, 2018

This error means you're not passing in the -c flag to point a Nagios external command file. Without this flag, the Nagios API service doesn't know how to submit commands to Nagios.

@NiniiGit
Copy link

NiniiGit commented Jan 10, 2020

Hi , can someone help me to know how i can use this api to find out last schedule down time from history of server if i pass Server name as a host

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants