abrist wrote:So the echo runs from the event handler, try adding a different echo to the clean_wlan_arc.sh script called by the nrpe script. You may want to change all your echos to redirect ( >> ) to the /tmp file as you will not see any of the echos when run as an event handler anyways.
My one file looks like this now:
Code: Select all
#!/bin/sh
#
# Delete WLAN Archives older than 10 days
# Modified 02/26/2013 LBW
#
echo $(date) "Searching and removing older files" >> /tmp/event_test
/usr/bin/find /var/bu/wlanadmin/*.gpg -mtime +5 -exec sudo /bin/rm {} \;
/usr/bin/find /var/bu/wlanadmin/*.cfg -mtime +5 -exec sudo /bin/rm {} \;
exit
and my event_test file has this:
Code: Select all
Thu Nov 14 12:59:20 EST 2013 WARNING SOFT 1
Thu Nov 14 12:59:20 EST 2013 Searching and removing older files
But the files it should have deleted are still there. Same thing happens when I manually run using this from Nagios server:
Code: Select all
[nagios@svwdcnagios02 libexec]$ ./check_nrpe -H svwdcnetmg02 -t 30 -c clean_drive -a 'WARNING SOFT 1'
NRPE: Unable to read output
Not sure why I am getting the unable to read, but it is running the scripts as the event_test file does get appended to.
EDIT: it has to be a permissions issue or something with the rm command in my script. I'm just lost
2 of XI5.6.14 Prod/DR/DEV - Nagios LogServer 2 Nodes
See my projects on the Exchange at
BanditBBS - Also check out my Nagios stuff on my personal page at
Bandit's Home and at
github