Page 2 of 2
Re: checks fails at one script callback second script
Posted: Fri Sep 19, 2014 4:10 pm
by sreinhardt
You can use your script as a plugin, it conforms to the nagios exit codes, and output requests just fine. If you are looking to run that on a remote system, check_by_ssh would be my suggested route.
Re: checks fails at one script callback second script
Posted: Mon Sep 22, 2014 8:43 am
by ganeshanrs1983
hello,
I have followed the below pdf to create the text file (First Event Handler In Nagios XI) if the host is down. I am stuck with the final step. It's not creating the txt file /tmp/hostinfo.txt on the localhost. What might be the issue ? Please suggest.
http://assets.nagios.com/downloads/nagi ... ios-XI.pdf
Re: checks fails at one script callback second script
Posted: Mon Sep 22, 2014 12:12 pm
by tmcdonald
What are the permissions on the event handler script?
Re: checks fails at one script callback second script
Posted: Mon Sep 22, 2014 12:25 pm
by ganeshanrs1983
-rwxr-xr-x 1 nagios nagios 189 Sep 22 09:25 event_handler_test.sh
Re: checks fails at one script callback second script
Posted: Mon Sep 22, 2014 1:40 pm
by ganeshanrs1983
Here is the below information got from eventlog :
[09-22-2014 14:06:26] wproc: stderr line 01: execvp(“/usr/local/nagios/libexec/event_handler_test.sh, ...) failed. errno is 2: No such file or directory
Informational Message[09-22-2014 14:06:26] wproc: early_timeout=0; exited_ok=1; wait_status=512; error_code=0;
Informational Message[09-22-2014 14:06:26] wproc: HOST EVENTHANDLER job 185 from worker Core Worker 12331 is a non-check helper but exited with return code 2
Host Down[09-22-2014 14:06:26] HOST ALERT: event_handler_test;DOWN;HARD;1;TEST
Re: checks fails at one script callback second script
Posted: Mon Sep 22, 2014 5:04 pm
by abrist
Well, it *looks* like everything is configured correctly, but just to be sure, lets check a few things:
Code: Select all
ls -la /usr/local/nagios/libexec/event_handler_test.sh
chage -l nagios
getenforce
Re: checks fails at one script callback second script
Posted: Tue Sep 23, 2014 12:11 am
by ganeshanrs1983
Please find the output. Please let me know in case of anything wrong.
-bash-4.1$ id
uid=39209(nagios) gid=9010(nagios) groups=9010(nagios),9011(nagcmd)
-bash-4.1$ cd /usr/local/nagios/libexec/
-bash-4.1$ ls -la /usr/local/nagios/libexec/event_handler_test.sh
-rwxrwxr-x 1 nagios nagios 189 Sep 22 13:33 /usr/local/nagios/libexec/event_handler_test.sh
-bash-4.1$ chage -l nagios
Last password change : Jun 26, 2014
Password expires : never
Password inactive : never
Account expires : never
Minimum number of days between password change : 1
Maximum number of days between password change : 4294967295
Number of days of warning before password expires : 7
-bash-4.1$ getenforce
Disabled
Re: checks fails at one script callback second script
Posted: Tue Sep 23, 2014 9:19 am
by ganeshanrs1983
Hello friends,
This issue is resolved.Now it's creating the txt file on localhost if the host is down.
Thanks a lot for your response and time.
Regards
Ganeshan S