Page 2 of 2
Re: How to trigger Event_handler execution on WARNING?
Posted: Thu Mar 08, 2018 3:13 pm
by dlukinski
Re-configured nagios-side
client side script does not run on WARNING (got the condition right now)
Zipped NSclient ini and client-side CMD file attached.
Re: How to trigger Event_handler execution on WARNING?
Posted: Thu Mar 08, 2018 3:48 pm
by scottwilkerson
I think you might need to change this line
Code: Select all
diskcleanup1=scripts\\custom\\diskcleanup1.cmd
to this
Code: Select all
diskcleanup1=scripts\custom\diskcleanup1.cmd
then restart
then I would dry running the command from the nagios server to verify it runs
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H "IP_ADDRESS" -p 5666 -c diskcleanup1
If that runs then your event handler should run ad well
Code: Select all
/usr/local/nagios/libexec/diskcleanup.sh WARNING IP_ADDRESS
Finally, if both of those run it should work if you have that event handler specified in the service and it return a warning.
If it isn't running on the remote server, you may need to look in the nsclient.log file for clues to what is erroring.
Re: How to trigger Event_handler execution on WARNING?
Posted: Thu Mar 08, 2018 3:56 pm
by dlukinski
scottwilkerson wrote:I think you might need to change this line
Code: Select all
diskcleanup1=scripts\\custom\\diskcleanup1.cmd
to this
Code: Select all
diskcleanup1=scripts\custom\diskcleanup1.cmd
then restart
then I would dry running the command from the nagios server to verify it runs
Code: Select all
/usr/local/nagios/libexec/check_nrpe -H "IP_ADDRESS" -p 5666 -c diskcleanup1
If that runs then your event handler should run ad well
Code: Select all
/usr/local/nagios/libexec/diskcleanup.sh WARNING IP_ADDRESS
Finally, if both of those run it should work if you have that event handler specified in the service and it return a warning.
If it isn't running on the remote server, you may need to look in the nsclient.log file for clues to what is erroring.
check_nrpe have failed:
[root@fikc-nagxiprod01 libexec]# /usr/local/nagios/libexec/check_nrpe -H 10.102.33.100 -p 5666 -c diskcleanup1
The filename, directory name, or volume label syntax is incorrect.
ERROR: Input redirection is not supported, exiting the process immediately.
Re: How to trigger Event_handler execution on WARNING?
Posted: Thu Mar 08, 2018 4:31 pm
by scottwilkerson
This error is coming form trying to find the diskcleanup1.cmd file I think
can you also see the nsclient.log and share that
Re: How to trigger Event_handler execution on WARNING?
Posted: Thu Mar 08, 2018 4:54 pm
by dlukinski
scottwilkerson wrote:This error is coming form trying to find the diskcleanup1.cmd file I think
can you also see the nsclient.log and share that
Here it is (no records in LOG)
Re: How to trigger Event_handler execution on WARNING?
Posted: Fri Mar 09, 2018 9:39 am
by tgriep
When using an external script, you have to have a setting in the wrappings section so NSClient++ knows how to execute it.
Edit your nsclient.ini file and under this section
Code: Select all
[/settings/external scripts/wrappings]
Add this
Save the file and restart NSClient++
After the change the agent should know how to execute the cmd file.
Let us know if it works for you.
Another option is to change the script to a .bat file and update the command definition in the ini file.