Troubles running Linux Event-Handled script (Nagiso sample)

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

Troubles running Linux Event-Handled script (Nagiso sample)

Post 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
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
dlukinski
Posts: 1130
Joined: Tue Oct 06, 2015 9:42 am

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

Post 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)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post 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
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

Closing assisted directly
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

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

Post by scottwilkerson »

Closing assisted directly, seems to be a permissions issue on the client side script.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked