Multiple nsca check results for same service

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
sahina
Posts: 4
Joined: Tue Jan 28, 2014 4:34 am

Multiple nsca check results for same service

Post by sahina »

Hi all,

Is this possible?

I define a service in Nagios, and the service status is dependent on multiple NSCA checks.

If any of the NSCA checks report a problem, the service state is changed to WARNING/CRITICAL. But I want to make sure that a check result does not override the result from another service check.
What I'm looking for is something like a pre process for a host/service check. Is this possible?


thanks!
sahina
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Multiple nsca check results for same service

Post by scottwilkerson »

Setup a seperate service for each, and use the check_cluster plugin to create the check you are interested in
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
sahina
Posts: 4
Joined: Tue Jan 28, 2014 4:34 am

Re: Multiple nsca check results for same service

Post by sahina »

Thanks. That's one possible option, but we wanted to avoid multiple service definitions. So were looking for other alternatives to achieve this.

We created a plugin that's executed whenever it receives a syslog alert message for an app. This changes the app service status using nsca. The alerts could be for different conditions, and each time the nsca receives the service result, we would like to compare with the previous result and append or change as needed.
Any other suggestions on how to hook into the process check result command?
abrist
Red Shirt
Posts: 8334
Joined: Thu Nov 15, 2012 1:20 pm

Re: Multiple nsca check results for same service

Post by abrist »

As this is a passive, local check (to the host), I would suggest saving the last few checks (before or at the same time as sending the result) in a text file for your script to compare against. Otherwise, you could try to use one of the nagios apis to check the previous state of the check in your plugin - using the json cgis (requires 4.0.4) or scraping the html cgis (fun with regex).
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.
Locked