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.
How to trigger Event_handler execution on WARNING?
Re: How to trigger Event_handler execution on WARNING?
You do not have the required permissions to view the files attached to this post.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: How to trigger Event_handler execution on WARNING?
I think you might need to change this line
to this
then restart
then I would dry running the command from the nagios server to verify it runs
If that runs then your event handler should run ad well
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.
Code: Select all
diskcleanup1=scripts\\custom\\diskcleanup1.cmdCode: Select all
diskcleanup1=scripts\custom\diskcleanup1.cmdthen 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 diskcleanup1Code: Select all
/usr/local/nagios/libexec/diskcleanup.sh WARNING IP_ADDRESSIf 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?
check_nrpe have failed:scottwilkerson wrote:I think you might need to change this lineto thisCode: Select all
diskcleanup1=scripts\\custom\\diskcleanup1.cmdthen restartCode: Select all
diskcleanup1=scripts\custom\diskcleanup1.cmd
then I would dry running the command from the nagios server to verify it runsIf that runs then your event handler should run ad wellCode: Select all
/usr/local/nagios/libexec/check_nrpe -H "IP_ADDRESS" -p 5666 -c diskcleanup1Finally, if both of those run it should work if you have that event handler specified in the service and it return a warning.Code: Select all
/usr/local/nagios/libexec/diskcleanup.sh WARNING IP_ADDRESS
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.
[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.
-
scottwilkerson
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: How to trigger Event_handler execution on WARNING?
This error is coming form trying to find the diskcleanup1.cmd file I think
can you also see the nsclient.log and share that
can you also see the nsclient.log and share that
Re: How to trigger Event_handler execution on WARNING?
Here it is (no records in LOG)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
You do not have the required permissions to view the files attached to this post.
Re: How to trigger Event_handler execution on WARNING?
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
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.
Edit your nsclient.ini file and under this section
Code: Select all
[/settings/external scripts/wrappings]Code: Select all
cmd = scripts\\%SCRIPT% %ARGS%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.
Be sure to check out our Knowledgebase for helpful articles and solutions!