You take an action, when a certain predefined condition evaluates to true or false. I you would like to learn more about the Nagios Reactor and what it does, I would recommend visiting: http://www.nagios.com/products/nagios-reactor
You can review the Reactor documentation here:
http://library.nagios.com/library/produ ... umentation
Nagios Reactor
Re: Nagios Reactor
Be sure to check out our Knowledgebase for helpful articles and solutions!
-
- Posts: 142
- Joined: Fri Jan 16, 2015 5:22 am
Re: Nagios Reactor
ok i've followed the instructions and made the first event chain , but now i wanna made chains for my hosts and services in nagios core in the other server .
How can i do it ? as i can see now my nagios Reactor is not integrated with my nagios core .
Sorry for many questions and thanks a lot for help nagios team
How can i do it ? as i can see now my nagios Reactor is not integrated with my nagios core .
Sorry for many questions and thanks a lot for help nagios team
Re: Nagios Reactor
Your service definitions need to call an event handler which will call the URL/API for Reactor so that Reactor will fire that chain.
-
- Posts: 142
- Joined: Fri Jan 16, 2015 5:22 am
Re: Nagios Reactor
thanks ssax , its very clear , but the docs that i have seen talks about Reactor intergration with Nagios XI is there any docs that show me or at least gives me an examplessax wrote:Your service definitions need to call an event handler which will call the URL/API for Reactor so that Reactor will fire that chain.
of Reactor integration with Nagios Core ?
i know its the same logic as with Nagios XI but in Nagios Core we don't have the Reactor Integration menu option like in Nagios XI
Re: Nagios Reactor
There is no real integration with Nagios Core, you just setup and event handler on your service and have it call (with curl or wget) the event chain URL.
You can follow this information for event handlers:
http://nagios.sourceforge.net/docs/nagi ... dlers.html
And you can grab the URL of the event chain by going into your even chain and clicking more info (see screenshot).
When anything accesses that URL it will automatically run that event chain, so when curl or wget runs from your event handler it will run that chain.
You can follow this information for event handlers:
http://nagios.sourceforge.net/docs/nagi ... dlers.html
And you can grab the URL of the event chain by going into your even chain and clicking more info (see screenshot).
When anything accesses that URL it will automatically run that event chain, so when curl or wget runs from your event handler it will run that chain.
-
- Posts: 142
- Joined: Fri Jan 16, 2015 5:22 am
Re: Nagios Reactor
Hey ssax,
(sorry for my questions since i'm new to reactor ) i wanna confirm something , when you told me you just setup and event handler on your service and have it call (with curl or wget) the event chain URL , it means my service will be similar to that? :
thanks
(sorry for my questions since i'm new to reactor ) i wanna confirm something , when you told me you just setup and event handler on your service and have it call (with curl or wget) the event chain URL , it means my service will be similar to that? :
Code: Select all
define service{
host_name somehost
service_description HTTP
max_check_attempts 4
event_handler restart-httpd
...
}
Code: Select all
define command{
command_name restart-httpd
command_line <curl or wget of the event chain URL>
}
Re: Nagios Reactor
I'll give a better example here so that you can use it to run any chain that you want:
The "4" in the event handler command below is the chain you want it to run.
See the attached file, read through it so you understand what is happening.
You would need to modify it to change the max_check_attempts if yours is different, make sure to change YOUR_REACTOR_IP_ADDRESS and YOUR_API_KEY.
Copy run_chain.sh to /usr/local/nagios/libexec/eventhandlers
The "4" in the event handler command below is the chain you want it to run.
Code: Select all
define service{
use local-service
host_name localhost
service_description SSH
check_command check_ssh
check_interval 1
max_check_attempts 3
retry_interval 1
event_handler run_chain!4
notifications_enabled 0
}
Code: Select all
define command{
command_name run_chain
command_line $USER1$/eventhandlers/run_chain.sh $SERVICESTATE$ $SERVICESTATETYPE$ $SERVICEATTEMPT$ $ARG1$
}
You would need to modify it to change the max_check_attempts if yours is different, make sure to change YOUR_REACTOR_IP_ADDRESS and YOUR_API_KEY.
Copy run_chain.sh to /usr/local/nagios/libexec/eventhandlers
Code: Select all
chown nagios.nagios /usr/local/nagios/libexec/eventhandlers/run_chain.sh
chmod 774 /usr/local/nagios/libexec/eventhandlers/run_chain.sh
- Attachments
-
- run_chain.zip
- (1.17 KiB) Downloaded 148 times