SOLVED. notification based on status information/data

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
marcha83
Posts: 5
Joined: Mon Feb 15, 2016 1:23 pm

SOLVED. notification based on status information/data

Post 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.
Attachments
service.jpg
Last edited by marcha83 on Sun Feb 28, 2016 5:57 am, edited 1 time in total.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: notification based on status information/data

Post 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?
Former Nagios Employee
marcha83
Posts: 5
Joined: Mon Feb 15, 2016 1:23 pm

Re: notification based on status information/data

Post 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.
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: notification based on status information/data

Post 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.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
marcha83
Posts: 5
Joined: Mon Feb 15, 2016 1:23 pm

Re: notification based on status information/data

Post 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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: notification based on status information/data

Post by rkennedy »

Thanks for your contribution!

Are we good to mark this thread as resolved?
Former Nagios Employee
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: notification based on status information/data

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: notification based on status information/data

Post by bwallace »

Excellent tip there, eloyd. Keep us posted marcha83.
Be sure to check out the Knowledgebase for helpful articles and solutions!
marcha83
Posts: 5
Joined: Mon Feb 15, 2016 1:23 pm

Re: notification based on status information/data

Post by marcha83 »

I think that we could mark this thread as solved. Any hint how to do it, I don't have experience?
User avatar
eloyd
Cool Title Here
Posts: 2190
Joined: Thu Sep 27, 2012 9:14 am
Location: Rochester, NY
Contact:

Re: notification based on status information/data

Post 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.
Image
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Locked