Turn off monitoring for servers shutdown gracefully.
-
NagiosIMCS
- Posts: 20
- Joined: Mon Mar 19, 2018 2:55 pm
Turn off monitoring for servers shutdown gracefully.
Can you help me please?
I am new to Nagios so apologies if I am asking something obvious I couldn't find anything online.
We have a number of servers in AWS and Azure that are only powered on when required to limit costs. They are automatically started and then shutdown when they have been finished with. There is no set date or time when this might occur. When the servers are powered on and off is totally out of my remit
Is it possible that if a server is shutdown gracefully Nagios wont alarm on the server in question but instead be aware that it has been shutdown by design.
Thank you for your help and recommendations.
I am new to Nagios so apologies if I am asking something obvious I couldn't find anything online.
We have a number of servers in AWS and Azure that are only powered on when required to limit costs. They are automatically started and then shutdown when they have been finished with. There is no set date or time when this might occur. When the servers are powered on and off is totally out of my remit
Is it possible that if a server is shutdown gracefully Nagios wont alarm on the server in question but instead be aware that it has been shutdown by design.
Thank you for your help and recommendations.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Turn off monitoring for servers shutdown gracefully.
Hi @NagiosIMCS,
That's a great question, and this could be easily worked out if you set up a simple script to automatically run on startup and shutdown.
Within the script, you can either run API calls to turn off notifications or put the host and service is scheduled downtime. One advantage of using scheduled downtime is the ability to include or exclude this into your Availability Reports.
Configuring Downtime In Nagios XI
To see example API commands, in the Nagios XI interface, go to Help > API Docs > System Reference > Scheduled Downtime
Let us know if that would work for you.
That's a great question, and this could be easily worked out if you set up a simple script to automatically run on startup and shutdown.
Within the script, you can either run API calls to turn off notifications or put the host and service is scheduled downtime. One advantage of using scheduled downtime is the ability to include or exclude this into your Availability Reports.
Configuring Downtime In Nagios XI
To see example API commands, in the Nagios XI interface, go to Help > API Docs > System Reference > Scheduled Downtime
Let us know if that would work for you.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
NagiosIMCS
- Posts: 20
- Joined: Mon Mar 19, 2018 2:55 pm
Re: Turn off monitoring for servers shutdown gracefully.
Thank you very much Ben I will look into this.
Very helpful thank you very much.

Very helpful thank you very much.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Turn off monitoring for servers shutdown gracefully.
Happy to help! We'll keep this open if you have any more questions.Very helpful thank you very much.![]()
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
NagiosIMCS
- Posts: 20
- Joined: Mon Mar 19, 2018 2:55 pm
Re: Turn off monitoring for servers shutdown gracefully.
Hi Ben,
I hope you are well apologies for the long delay. I have been working on other things so this has taken a back seat.
Hope you don't mind me asking do you have an sample scripts to achieve this please? All the servers are running Windows.
Would really appreciate it. My research hasn't been that fruitful.
Thank you for all your help.

I hope you are well apologies for the long delay. I have been working on other things so this has taken a back seat.
Hope you don't mind me asking do you have an sample scripts to achieve this please? All the servers are running Windows.
Would really appreciate it. My research hasn't been that fruitful.
Thank you for all your help.
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Turn off monitoring for servers shutdown gracefully.
Hi,
Benjamin
No problem! Let me do a little testing here and I'll follow up shortly with some suggestions.Thank you for all your help.
![]()
![]()
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
NagiosIMCS
- Posts: 20
- Joined: Mon Mar 19, 2018 2:55 pm
Re: Turn off monitoring for servers shutdown gracefully.
Thank you Ben greatly appreciated.
I am still struggling with Nagios.
Thank you so much.
Stephen P
I am still struggling with Nagios.
Thank you so much.
Stephen P
-
benjaminsmith
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Turn off monitoring for servers shutdown gracefully.
Hi Stephen,
After digging into this further, what operating systems are these AWS and Azure VM's running?
Benjamin
After digging into this further, what operating systems are these AWS and Azure VM's running?
Benjamin
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
NagiosIMCS
- Posts: 20
- Joined: Mon Mar 19, 2018 2:55 pm
Re: Turn off monitoring for servers shutdown gracefully.
Hi Ben,
Thank you for the response, they are pretty much running Windows servers 2012 to Windows 2016.
Thank you very much for your help and have a good weekend.
Stephen P
Thank you for the response, they are pretty much running Windows servers 2012 to Windows 2016.
Thank you very much for your help and have a good weekend.
Stephen P
Re: Turn off monitoring for servers shutdown gracefully.
You would need to do it like this (or through group policy):
https://docs.microsoft.com/en-us/previo ... 0(v=ws.11)
Note that in order to do this you'll need to know the exact hostname in XI, it's case-sensitive and would need to match exactly to what the servername is in order for it to work.
Are you trying to schedule downtime for the host and all it's services, disable notifications for the host and all it's services, or disable checks from even occurring for the host and all of it's services?
Either way, once we know that you're essentially going to need to write a script that calls this API endpoint:
- Go there and look at the example
Then you're going to submit some of these (depending on what you want to accomplish) through the API endpoint above:
https://old.nagios.org/developerinfo/externalcommands/
There will be two scripts, one for startup and one for shutdown. Once you let us know what you'd prefer to do (downtime, disable notifications, disable checks) that will give us more to go for what the scripts should be like.
https://docs.microsoft.com/en-us/previo ... 0(v=ws.11)
Note that in order to do this you'll need to know the exact hostname in XI, it's case-sensitive and would need to match exactly to what the servername is in order for it to work.
Are you trying to schedule downtime for the host and all it's services, disable notifications for the host and all it's services, or disable checks from even occurring for the host and all of it's services?
Either way, once we know that you're essentially going to need to write a script that calls this API endpoint:
- Go there and look at the example
Code: Select all
http://YOURXISERVER/nagiosxi/help/api-system-reference.php#system-core-commandhttps://old.nagios.org/developerinfo/externalcommands/
There will be two scripts, one for startup and one for shutdown. Once you let us know what you'd prefer to do (downtime, disable notifications, disable checks) that will give us more to go for what the scripts should be like.