sending msg to Nagios server and show it as separate alerts

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
natalia
Posts: 8
Joined: Sun Jul 28, 2013 5:38 am

sending msg to Nagios server and show it as separate alerts

Post by natalia »

Hello,

I am looking for solution how to config sending diff message to Nagios/NagiosXI server and to show them in dashboard as separate alerts:

For example, we have E2E script that checking user experience and send output with details in format : <status:OK/Problem> <host name> <location> <application name> <availability/runtime>
Output examples :
PROBLEM host1 report US runtime
PROBLEM host1 chat IL availability
PROBLEM host2 report US runtime

I want to see in dashboard/console the following alerts :

check_E2E Critical 3h 1m 7s 1/1 2013-08-14 14:57:52 host1 report US runtime
check_E2E Critical 3h 1m 7s 1/1 2013-08-14 14:57:52 host1 chat IL availability
check_E2E Critical 3h 1m 7s 1/1 2013-08-14 14:57:52 host2 report US runtime

Once sending OK alert it should ack. only relevant alert, for example “OK host1 chat IL availability” will ack only “PROBLEM host1 chat IL availability“

I tried to config "Passive Service" but every new message overwrite the old one instead of appeared as separate alert.

Thanks for the help !
Natalia
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: sending msg to Nagios server and show it as separate ale

Post by jsmurphy »

The Achilles heel of Nagios is it's inflexibility when it comes to handling event driven monitoring (it's caused me more than a few headaches and if there's anything I've learned over the years it's that every user expects a different solution to the problem). If it's going to be a passive check you will need to separate the monitoring into different services... if it's active you can just display the "worst" state. Same suggestions I made in your other thread.
natalia
Posts: 8
Joined: Sun Jul 28, 2013 5:38 am

Re: sending msg to Nagios server and show it as separate ale

Post by natalia »

Hello,

the "E2E script" is running only on one host (host11) and the output can be relate to ~1000 hosts, is it any way to assign output message to relevant host instead of checking host (host11) ?

btw, if Nagios always display the last message handed to STDOUT (print, echo, etc) as the description displayed in the console, how can I show all SNMP traps coming from application servers as separate alerts instead of only the last one ?

Thanks for your help!
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: sending msg to Nagios server and show it as separate ale

Post by abrist »

Any chance your snmp trap server could forward the traps separately?
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
User avatar
jsmurphy
Posts: 989
Joined: Wed Aug 18, 2010 9:46 pm

Re: sending msg to Nagios server and show it as separate ale

Post by jsmurphy »

Answering your questions directly Natalia:

1. Absolutely there are ways of dealing with checks of that nature where a single host is acting as a monitoring proxy for multiple hosts, however the solution is going to depend largely on how that information is gathered and returned to Nagios. I'm going to give you an example of how you would do that for an active check using nsclient++ / NRPE and a script that runs on the proxy server... from there hopefully you get the idea and can reverse engineer something that will work for your particular situation.

First of all I will assume that your check_e2e script accepts 1 argument that is a hostname to check. Next we need to set up a Nagios command for specifically this check:

define command {
command_name check_nrpe_E2E
command_line $USER1$/check_nrpe -H host11 -u -t 30 -c check_e2e -a $HOSTADDRESS$
}

You would then create a service as you normally would and attach that to the relevant hosts (host1, host2, etc) so when the check runs on those servers it will send the query to host11 but it will be asking for information about host1. Hopefully I understood the question correctly and you can make use of an approach that works something like this.

2. You can use snmptrapd and snmptt to direct different traps to specific services, but for a single service you cannot display any more information on the dashboard other than the last trap received. As a Nagios administrator SNMP traps are the bane of my existence... I strongly suggest avoiding them whenever humanly possible.
natalia
Posts: 8
Joined: Sun Jul 28, 2013 5:38 am

Re: sending msg to Nagios server and show it as separate ale

Post by natalia »

Hello jsmurphy,

regarding the traps I inderstand, thanks for the explanation !

Sorry, I was not clear, nagios will not run the script "check_e2e" - this script is running by another tools and send output to nagios (via send_nsca maybe ) (this is a reason that I define "passive check")
the output can be relate to diff hosts and I want to show alerts in dashboard as separate alerts and assign to the host instead of nagios server.

for example:
script will send output "PROBLEM host1 report US runtime" and "PROBLEM host2 report US runtime" ,
in dashboard I want to see 2 alerts:
host1 PROBLEM report US runtime
host2 PROBLEM host2 report US runtime

Thanks a lot for your help !
sreinhardt
-fno-stack-protector
Posts: 4366
Joined: Mon Nov 19, 2012 12:10 pm

Re: sending msg to Nagios server and show it as separate ale

Post by sreinhardt »

To do what you are talking about, you will either need to modify the plugin\script to send each host individually via the nsca\nrds protocol back to nagios, or setup individual checks per host you want to monitor with nsca\nrds. Neither client would have the built-in functionality to differentiate separate hosts and services without following standard nagios result formatting guidelines. Otherwise it would show as a single host\service as a jumble of text instead of individually separate ones as you would like.
Nagios-Plugins maintainer exclusively, unless you have other C language bugs with open-source nagios projects, then I am happy to help! Please pm or use other communication to alert me to issues as I no longer track the forum.
Locked