Page 1 of 1

Feature Request: multiple event handlers

Posted: Tue Jul 07, 2020 11:18 am
by mbeebe
Hello,

I'd like to put in a feature request: hierarchical event handlers. For complex environments like ours, we may need a half-dozen different event handlers for a single service, many of which are co-dependent or at least sequential. This feature would aid us immensely in turning Nagios from reactive to proactive.

Thank you.

-- Mike Beebe

Re: Feature Request: multiple event handlers

Posted: Tue Jul 07, 2020 1:50 pm
by scottwilkerson
We can add this as a feature request for the underlying Core engine, but I did want to make you aware that many people accomplish what you are looking to do by creating one script that calls multiple other script passing the argument to each.

this can easily be done in bash

for example, if you have an event handler defined as something like the following:

Code: Select all

$USER1$/my_multi_handler.sh "$HOSTADDRESS$" "$HOSTNAME$" "$HOSTSTATE$"
In my_multi_handler.sh you can call any number of additional scripts passing the same args, such as

Code: Select all

#!/bin/bash

/path/to/1st_event.sh "$1" "$2" "$3"
/path/to/2nd_event.sh "$1" "$2" "$3"
/path/to/3rd_event.sh "$1" "$2" "$3"

Re: Feature Request: multiple event handlers

Posted: Wed Jul 08, 2020 1:10 pm
by mbeebe
Yes, that's what we're doing right now, but's it's not scalable or long-term supportable.

Feel free to close ticket and thanks for submitting the suggestion.

-- Mike Beebe

Re: Feature Request: multiple event handlers

Posted: Wed Jul 08, 2020 2:40 pm
by scottwilkerson
mbeebe wrote:Yes, that's what we're doing right now, but's it's not scalable or long-term supportable.

Feel free to close ticket and thanks for submitting the suggestion.

-- Mike Beebe
Great!

Locking thread