Hi all,
I need some help. i am trying to schedule a downtime only for 1 service. However its is scheduling all the host services for downtime. I am using this command
curl -d "cmd_typ=86&cmd_mod=2&host=esx&service=Check Borgbackup Nextcloud&com_data=TestingDowntime&trigger=0&start_time=08-08-2024 01:55:00&end_time=08-08-2024 02:30:00&fixed=1&childoptions=0&btnSubmit=Commit" "http://192.168.2.7/nagios/cgi-bin/cmd.cgi" -u username:password
any ideas?
nagios cmd schedule service downtime
-
gwesterman
- Posts: 268
- Joined: Wed Aug 23, 2023 11:29 am
Re: nagios cmd schedule service downtime
Hi @ckruijntjens,
If you are using Nagios XI, you can use the API to do something like this. Namely, if you navigate to Help -> Documentation -> API Docs -> System Reference, there are a number of ways to mess with scheduled downtime via the API.
If you would rather stick with this curl, I believe cmd 86 is to schedule host_svc downtime (i.e. schedule downtime for all hosts on a service). I would try cmd_typ=56 for scheduling downtime for a specific service.
Let us know if this works for you and if you have any additional questions.
Thank you!
If you are using Nagios XI, you can use the API to do something like this. Namely, if you navigate to Help -> Documentation -> API Docs -> System Reference, there are a number of ways to mess with scheduled downtime via the API.
If you would rather stick with this curl, I believe cmd 86 is to schedule host_svc downtime (i.e. schedule downtime for all hosts on a service). I would try cmd_typ=56 for scheduling downtime for a specific service.
Let us know if this works for you and if you have any additional questions.
Thank you!
-
ckruijntjens
- Posts: 5
- Joined: Wed Oct 16, 2019 3:11 pm
Re: nagios cmd schedule service downtime
Hi @gwesterman,
How would my commando look like? i am using the community edition of nagios.
kind regards,
Chris
How would my commando look like? i am using the community edition of nagios.
kind regards,
Chris
Re: nagios cmd schedule service downtime
I second the recommendation to try your hand with the API.
In the NagiosXI API you can use the the "System/ScheduleDowntime" endpoint or for more advanced options the "System/CoreCommand" endpoint to interact with XI's downtime workflows for;
SCHEDULE_HOSTGROUP_HOST_DOWNTIME
SCHEDULE_HOSTGROUP_SERVICE_DOWNTIME
SCHEDULE_SERVICEGROUP_HOST_DOWNTIME
SCHEDULE_SERVICEGROUP_SERVICE_DOWNTIME
Be sure to check the Nagios Core external command reference for the variables and the flags needed for use.
https://assets.nagios.com/downloads/nag ... /index.php
In the NagiosXI API you can use the the "System/ScheduleDowntime" endpoint or for more advanced options the "System/CoreCommand" endpoint to interact with XI's downtime workflows for;
SCHEDULE_HOSTGROUP_HOST_DOWNTIME
SCHEDULE_HOSTGROUP_SERVICE_DOWNTIME
SCHEDULE_SERVICEGROUP_HOST_DOWNTIME
SCHEDULE_SERVICEGROUP_SERVICE_DOWNTIME
Be sure to check the Nagios Core external command reference for the variables and the flags needed for use.
https://assets.nagios.com/downloads/nag ... /index.php
-
ckruijntjens
- Posts: 5
- Joined: Wed Oct 16, 2019 3:11 pm
Re: nagios cmd schedule service downtime
Perfect
i got it. thank you.
i got it. thank you.
-
gwesterman
- Posts: 268
- Joined: Wed Aug 23, 2023 11:29 am
Re: nagios cmd schedule service downtime
Glad you got it figured out.
If you have any other questions, please reach out.
Thank you!
If you have any other questions, please reach out.
Thank you!