Page 1 of 1

SOLVED. notification based on status information/data

Posted: Mon Feb 15, 2016 2:26 pm
by marcha83
Is there any possibility under nagios settings to gets notification based on status information/data (attached picture), similar to SNMP trap monitoring?

For example, I'm using 'check_multi' plugin who check about 10 tcp listen ports on one server, so my problem is that when any of this ports going down I get first notification and the service state is critical, wich is ok, but in next check it can be situation that another parallel port is also down and in this situation I don't get notification because of the first one. So for me it would be great when I could get notification based on every status information changes, something like stalking options for logging.

Re: notification based on status information/data

Posted: Mon Feb 15, 2016 2:39 pm
by rkennedy
This should be possible, except it sounds like you're looking to monitor each individual port.

I think this would be better handled with a check, per each port, thus giving you the notifications based on the different ports states.

Is there a specific reason you're using check_multi instead?

Re: notification based on status information/data

Posted: Mon Feb 15, 2016 3:13 pm
by marcha83
Well, monitoring each individual port as particular check is always option. But, if you have 50 servers and each server has about 10 different listen tcp ports that you need to check and not only the ports, you can combine with other checks, so i think it is much more work than when you use one check_multi plugin and just need to change config.cmd. E.g. my config.cmd

command [ listen_443 ] = check_tcp -p 443
command [ listen_80 ] = check_tcp -p 80
command [ listen_oracle_1524 ] = check_tcp -p 1524
....
....

But as I wrote the problem is with notifications, that's why I open this topic.

Re: notification based on status information/data

Posted: Mon Feb 15, 2016 6:26 pm
by Box293
Unfortunately this is how core works, the only way around it would be to write an event handler that tracked the last state and sent a notification if it changed.

Re: notification based on status information/data

Posted: Sat Feb 20, 2016 6:27 am
by marcha83
I found workaround solution with event handler based on Box293 hint, this is steps:

1. create service that over ssh runs check_multi plugin on remote server
2. enable 'Is Volatile' option
3. disable default notification
4. create 'event handler' who calls my script that based on $SERVICEOUTPUT$ standard macros checks if there is differences. If have difference call service notification (nagios_send_service_mail.pl --> http://nagios.fm4dd.com/howto/nagios-fl ... ations.htm) and that's it.

I had problems with $CONTACEMAIL$ and $NOTIFICATIONTYPE$ macros because (https://assets.nagios.com/downloads/nag ... olist.html) this macros is not available, so i had to improvise in my event handler script.

I hope it could help someone with similar issues.

Re: notification based on status information/data

Posted: Mon Feb 22, 2016 10:17 am
by rkennedy
Thanks for your contribution!

Are we good to mark this thread as resolved?

Re: notification based on status information/data

Posted: Mon Feb 22, 2016 10:23 am
by eloyd
Before it gets closed, another option would be BPI where you can tell it how many things have to fail before it's considered a problem. Don't know if it really helps you, but it might be worth looking into.

Re: notification based on status information/data

Posted: Mon Feb 22, 2016 12:00 pm
by bwallace
Excellent tip there, eloyd. Keep us posted marcha83.

Re: notification based on status information/data

Posted: Sat Feb 27, 2016 9:06 am
by marcha83
I think that we could mark this thread as solved. Any hint how to do it, I don't have experience?

Re: notification based on status information/data

Posted: Sat Feb 27, 2016 1:40 pm
by eloyd
Are you talking about BPI or something else, now? If you're looking for information on BPI, this document (https://assets.nagios.com/downloads/nag ... BPI_v2.pdf) has a great overview of how it works.