Nagios Global Event Handler
Nagios Global Event Handler
In the "Global Event Handler" Component, if we configure the shell file under the "Service State Change Handler Commands", when it will get execute? and how the Nagios monitor the system services?
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios Global Event Handler
This will execute is the state of a service changes.selvi wrote:In the "Global Event Handler" Component, if we configure the shell file under the "Service State Change Handler Commands", when it will get execute? ?
ie.
from OK to Warning
from Warning to OK
from OK to Critical
etc.
Re: Nagios Global Event Handler
Thank you for your timely reply for my doubt regarding event handler.
In Nagios i am able to see the change in host status ( OK - Critical and Critical - OK), but the Global Event Handler command was not executed ?
In Nagios i am able to see the change in host status ( OK - Critical and Critical - OK), but the Global Event Handler command was not executed ?
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios Global Event Handler
Does the nagios user have permissions on the script you are attempting to run?
ie. from the command prompt, can you run
From our doc
http://assets.nagios.com/downloads/nagi ... ndlers.pdf
ie. from the command prompt, can you run
Code: Select all
su nagios -c '/path/to/the/event/handler.sh'
http://assets.nagios.com/downloads/nagi ... ndlers.pdf
General Considerations
Keep these considerations in mind when utilizing global event handler commands:
• Global event handlers will run with the privileges of the nagios user on the local Nagios XI server
• Make sure event handlers execute quickly, so they can return control to Nagios XI to process other events
• Time-intensive global event handlers should be executed as a background or daemon process to prevent blocking behavior
Re: Nagios Global Event Handler
1) The User had the privilege to execute the Event Handler, but the event handler command was not executed when the host state and service state got changed.
2) In Reports --> Notification i can see the changes in state. i have configured Email notification for receiving the event status, but i am not receiving any emails. I have received sample test mail.
3) Exactly i want to know when the Global Event Handler will execute automatically, is there any way test it manually
2) In Reports --> Notification i can see the changes in state. i have configured Email notification for receiving the event status, but i am not receiving any emails. I have received sample test mail.
3) Exactly i want to know when the Global Event Handler will execute automatically, is there any way test it manually
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios Global Event Handler
I just tested this on my test machine and worked as expected.
Can you post the permissions of your script ie.
Also, a screenshot of Admin -> Manage Components -> Global Event Handlers -> Edit
Thanks
Can you post the permissions of your script ie.
Code: Select all
ls -l /path/to/your/script.sh
Thanks
Re: Nagios Global Event Handler
I have here by attached the screen shots of the Global Event handler and also the permission of shell file. Pls help me out regarding this.
Thanks for your reply....
Regards,
Selvi
Thanks for your reply....
Regards,
Selvi
You do not have the required permissions to view the files attached to this post.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios Global Event Handler
In your screen shots of the Global Event handler, I see a period . in front of the commands...
remove the . from the beginning of each command.
remove the . from the beginning of each command.
Re: Nagios Global Event Handler
We have already tried without . (dot) in the Event Handler but the command did not executed.
-
- DevOps Engineer
- Posts: 19396
- Joined: Tue Nov 15, 2011 3:11 pm
- Location: Nagios Enterprises
- Contact:
Re: Nagios Global Event Handler
For sure it shouldn't have the .
Also, form the command line it may be a good idea that the nagios user can execute the script and get the desired results
Also, form the command line it may be a good idea that the nagios user can execute the script and get the desired results
Code: Select all
su nagios -c '/root/SomClient/bin/somClient.sh'