Event handler not working

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Event handler not working

Post 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.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Event handler not working

Post 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.
Former Nagios employee
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Event handler not working

Post by slansing »

Yeah...... so let us know what you come up with!
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Event handler not working

Post 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
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
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Event handler not working

Post by BanditBBS »

if I add an echo "test" before the exit 0 and run the command, I get no error...AHHHH
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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Event handler not working

Post by abrist »

Is it working though when you add the echo?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Event handler not working

Post 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.
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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Event handler not working

Post 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. . .
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
BanditBBS
Posts: 2474
Joined: Tue May 31, 2011 12:57 pm
Location: Scio, OH
Contact:

Re: Event handler not working

Post 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.
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
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Event handler not working

Post by abrist »

Great. Shoot [email protected] an email and we will schedule up a remote.
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Locked