We are planning to monitor Switches using Nagios XI triggering an event handler to call an exe when a switch changes state, to send a message into our system software. My question is when the Nagio XI Computer/Software restarts will Nagio XI call the event handlers for the states of the switches, or will it only call the event handler exe when there is a change of state in the Switch?
Example: switches A and B are up, switch A has an error, Switch B has no error. The Nagio XI is started, the state of the switches do not change. Will the error event handle for switch A be called? and no error event handle (error cleared) for Switch B be called?
I apologise for asking a question that I would normally find the answer by trying it, but I am currently unable to access the equipment due to Covid-19 lockdown.
Are Nagios XI Event Handlers called on startup.
Re: Are Nagios XI Event Handlers called on startup.
I do not believe that the event handlers are triggered immediately after startup.
https://assets.nagios.com/downloads/nag ... dlers.html
The state of the host or service upon startup is stored in the retention.dat file.
Nagios Core - Understanding retention.dat and modified_attributes
It is also worth mentioning that this feature is highly configurable, and you may need to look in /usr/local/nagios/libexec/eventhandlers/, your nagios.cfg file, or objects.cache file.
Please refer to the following linked documentation for more information about how event handlers operate in Nagios.Event handlers are executed when a service or host:
Is in a SOFT problem state
Initially goes into a HARD problem state
Initially recovers from a SOFT or HARD problem state
https://assets.nagios.com/downloads/nag ... dlers.html
The state of the host or service upon startup is stored in the retention.dat file.
Nagios Core - Understanding retention.dat and modified_attributes
It is also worth mentioning that this feature is highly configurable, and you may need to look in /usr/local/nagios/libexec/eventhandlers/, your nagios.cfg file, or objects.cache file.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
Be sure to check out our Knowledgebase for helpful articles and solutions!
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Are Nagios XI Event Handlers called on startup.
Thankyou for your replay.
My understanding from the “Understanding retention.dat” link is that if we have the follow sequence:-
1) Nagios XI running monitoring switches. Switch A has no faults. Switch B has a fault.
2) Nagios XI machine shutdown.
3) Fault occurs on a Switch A while Nagios XI machine shutdown.
4) The fault on Switch B is cleared while Nagios XI machine is shutdown.
5) Nagios XI machine restarts.
Then Switch A fault occurred event handler for the would be called, and the Switch B fault occurred event handle would be called. Would this be correct?
Alternatively if as part of our start-up of Nagios XI we replaced retention.dat file with one that indicates there are no errors then would it always trigger all the fault occurred event handler for any fault that is present?
My understanding from the “Understanding retention.dat” link is that if we have the follow sequence:-
1) Nagios XI running monitoring switches. Switch A has no faults. Switch B has a fault.
2) Nagios XI machine shutdown.
3) Fault occurs on a Switch A while Nagios XI machine shutdown.
4) The fault on Switch B is cleared while Nagios XI machine is shutdown.
5) Nagios XI machine restarts.
Then Switch A fault occurred event handler for the would be called, and the Switch B fault occurred event handle would be called. Would this be correct?
Alternatively if as part of our start-up of Nagios XI we replaced retention.dat file with one that indicates there are no errors then would it always trigger all the fault occurred event handler for any fault that is present?
Re: Are Nagios XI Event Handlers called on startup.
Taken from here:Event handlers are executed when a service or host:
1. Is in a SOFT problem state
2. Initially goes into a HARD problem state
3. Initially recovers from a SOFT or HARD problem state
Code: Select all
https://assets.nagios.com/downloads/nagioscore/docs/nagioscore/4/en/eventhandlers.htmlSince Switch B was in a problem state, the next check would be an OK (since it recovered when XI was down), this would be the initial recovery (#3) and the event handler would be called.