Team,
I have 2 services: Service-A & Service-B.
Service B takes 2 arguments (Which are NOT Macro Variables).
Service-B needs to be called when Service-A - Recovers or Critical.
Is there a way to pass these NON Macro Variables to event handlers?
Pass Non-Macro Arguments to Event Handlers
-
- Posts: 5324
- Joined: Wed Aug 22, 2018 4:39 pm
- Location: saint paul
Re: Pass Non-Macro Arguments to Event Handlers
Hi @vlakshman,
In Nagios you have macros and custom or free variables. You have the option of creating variables for your arguments in the service definition and calling those custom object variables ( similar to using macros ).
For example, from the documentation,
However, if you are trying to run an event handler on Service B whenever Service A recovers, then I believe you would want to create a custom script to be called by Service A. Event handlers are executed for hard problem and recovery states.
See: Event Handlers
In Nagios you have macros and custom or free variables. You have the option of creating variables for your arguments in the service definition and calling those custom object variables ( similar to using macros ).
For example, from the documentation,
The _MACADDRESS custom variable would be available in a macro called $_HOSTMACADDRESS$.define host {
host_name linuxbox
address 192.168.1.1
_MACADDRESS 00:01:02:03:04:05
...
}
However, if you are trying to run an event handler on Service B whenever Service A recovers, then I believe you would want to create a custom script to be called by Service A. Event handlers are executed for hard problem and recovery states.
See: Event Handlers
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!