Hi, I recently created a Nagios check that checks the event log to see if a specific event has occurred. Upon the occurrence of the event I needed Nagios to perform an iis reset. From what I have read I need to create a script and add it to the scripts folder in the agent on the specific machine and then point the check to that script. I have never done something like this so any guidance/help would be much appreciated.
thanks
How to configure nagios to take action
Re: How to configure nagios to take action
What agent is being used on the Windows machine? NSClient++ and NCPA are the two most common.
This documentation covers leveraging a Nagios event handler with NSClient++:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
The documentation mentions "Nagios XI" many times, but the documentation is just as relevant for Nagios Core aside from configuring the Nagios Core objects required.
Here's a blog post that does similar things, but covers configuring raw Nagios Core objects:
http://www.katherinevillyard.com/2013/0 ... n-windows/
This documentation covers leveraging a Nagios event handler with NSClient++:
https://assets.nagios.com/downloads/nag ... ios-XI.pdf
The documentation mentions "Nagios XI" many times, but the documentation is just as relevant for Nagios Core aside from configuring the Nagios Core objects required.
Here's a blog post that does similar things, but covers configuring raw Nagios Core objects:
http://www.katherinevillyard.com/2013/0 ... n-windows/
Former Nagios employee
https://www.mcapra.com/
https://www.mcapra.com/
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: How to configure nagios to take action
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!
Re: How to configure nagios to take action
thank you for your prompt responses, it is much appreciated. I am using nsclient++ and have copy pasted the code listed in the XI document you provided and saved it as a batch file under scripts. the next step says to add the restart_service=... line to the ini file. I have attached my ini file and just wanted to make sure the placement was correct. Also, in the following step I am unsure about where allow needs to be set to arguments = true as I cannot find the exact sections in my ini file as listed on the document. Sorry if my questions seem basic as I only have basic knowledge of Nagios core.
- Attachments
-
- nsc2.txt
- (11.33 KiB) Downloaded 178 times
Re: How to configure nagios to take action
The placement of the restart_service command looks good but under this section
Add these so the client will receive arguments, etc... when running external scripts.
Code: Select all
[External Script]
Code: Select all
allow_arguments=1
allow_nasty_meta_chars=1
script_dir=C:\Program Files\NSClient++\scripts
Be sure to check out our Knowledgebase for helpful articles and solutions!