Page 1 of 1

Troubles running Linux Event-Handled script (Nagiso sample)

Posted: Thu Mar 08, 2018 5:06 pm
by dlukinski
Hello XI Support

Please keep this case separate

https://assets.nagios.com/downloads/nag ... 1497983898

- configured yum update as per sample document to run on remote Linux server (essentially XI Production to monitor XI Dev and keep it updated)
- it does not run :-\

[root@fikc-nagxiprod01 libexec]# /usr/local/nagios/libexec/event_handler_yum1.sh WARNING 10.96.30.40
You have mail in /var/spool/mail/root

Re: Troubles running Linux Event-Handled script (Nagiso samp

Posted: Thu Mar 08, 2018 5:18 pm
by scottwilkerson
not sure of the contents of event_handler_yum1.sh but if it performs a yum update it will also need sudo access

Please share file

Re: Troubles running Linux Event-Handled script (Nagiso samp

Posted: Thu Mar 08, 2018 5:29 pm
by scottwilkerson
I just revisited the document and saw the example on page 13, and that actually is a terrible example because it will run the command locally, and you are somewhat mixing the commands on that example with the one on your other thread which actually does reach out to a host you pass.

I am going to have the doc change to give a better example, but if you wanted to see the work (assuming a copy past out of the doc) you would want to run

Code: Select all

/usr/local/nagios/libexec/event_handler_yum1.sh WARNING HARD

Re: Troubles running Linux Event-Handled script (Nagiso samp

Posted: Fri Mar 09, 2018 8:16 am
by dlukinski
scottwilkerson wrote:I just revisited the document and saw the example on page 13, and that actually is a terrible example because it will run the command locally, and you are somewhat mixing the commands on that example with the one on your other thread which actually does reach out to a host you pass.

I am going to have the doc change to give a better example, but if you wanted to see the work (assuming a copy past out of the doc) you would want to run

Code: Select all

/usr/local/nagios/libexec/event_handler_yum1.sh WARNING HARD
Yes please

I actually liked an idea of being able to keep some commands server-side (unless you tell me this is impractical and should not be pursued)
- we are trying to to automate both Windows and Linux infra and this is why I am looking for working examples together with your expert opinion on the best way of implementing them (preferably one way per OS type)

Re: Troubles running Linux Event-Handled script (Nagiso samp

Posted: Fri Mar 09, 2018 10:03 am
by scottwilkerson
dlukinski wrote:I actually liked an idea of being able to keep some commands server-side (unless you tell me this is impractical and should not be pursued)
- we are trying to to automate both Windows and Linux infra and this is why I am looking for working examples together with your expert opinion on the best way of implementing them (preferably one way per OS type)
I agree and you can do this but you need a way to reash out to the remote machine if they need something done on them, and that is usually accomplished via an agent such as NCPA, NRPE or NSClient, or an alternative connection such as ssh where you can run the command

Re: Troubles running Linux Event-Handled script (Nagiso samp

Posted: Fri Mar 09, 2018 2:22 pm
by scottwilkerson
Closing assisted directly

Re: Troubles running Linux Event-Handled script (Nagiso samp

Posted: Fri Mar 09, 2018 2:23 pm
by scottwilkerson
Closing assisted directly, seems to be a permissions issue on the client side script.