Page 3 of 4
Re: Event handler not working
Posted: Thu Nov 14, 2013 3:48 pm
by abrist
Hug the grep. Seduce the sed. Swear fealty to the awk. Unite the logs under one motd banner. Your quest is the search for the holy regex.
Re: Event handler not working
Posted: Thu Nov 14, 2013 3:57 pm
by tmcdonald
abrist wrote:Hug the grep. Seduce the sed. Swear fealty to the awk. Unite the logs under one motd banner. Your quest is the search for the holy regex.
The | is thy sword and the 2>&1 thy armor.
Re: Event handler not working
Posted: Thu Nov 14, 2013 3:59 pm
by slansing
Yeah...... so let us know what you come up with!
Re: Event handler not working
Posted: Thu Nov 14, 2013 4:46 pm
by BanditBBS
OMFG - I changed the script to only have 'exit 0' in it, everything else was commented out and I still get the error. I see nothing in messages from nrpe either.
p.s. The FNG made me LOL
Re: Event handler not working
Posted: Thu Nov 14, 2013 4:49 pm
by BanditBBS
if I add an echo "test" before the exit 0 and run the command, I get no error...AHHHH
Re: Event handler not working
Posted: Thu Nov 14, 2013 4:58 pm
by abrist
Is it working though when you add the echo?
Re: Event handler not working
Posted: Thu Nov 14, 2013 5:12 pm
by BanditBBS
Let me try and give an overview again, as we've tried so many things.......
If I login to the server and su as nagios, I can run the script and it performs perfectly.
If from the Nagios server, I try and run the script using NRPE from the cli or eventhandler it does not function, no matter what I do to the script. NRPE is configured to run as the user nagios on the destination server.
The command that is not working is this:
Code: Select all
/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 {} \;
And in the sudoers file I have this:
Code: Select all
User_Alias NAGIOSXI=nagios
NAGIOSXI ALL = NOPASSWD:/bin/rm
Which should be proven good since it works when I am logged in as nagios locally on that server.
Re: Event handler not working
Posted: Thu Nov 14, 2013 5:34 pm
by abrist
BanditBBS wrote:Which should be proven good since it works when I am logged in as nagios locally on that server.
I would agree. Do you want to escalate to a remote tomorrow? I am fresh out of options. . .
Re: Event handler not working
Posted: Thu Nov 14, 2013 7:13 pm
by BanditBBS
Sure Andy, me and my linux admin are both clueless as to why it isn't working. I should be good all day.
Re: Event handler not working
Posted: Fri Nov 15, 2013 11:30 am
by abrist
Great. Shoot
[email protected] an email and we will schedule up a remote.