Getting info about services state from nagios

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
belogrud
Posts: 15
Joined: Mon Dec 07, 2015 10:34 am

Getting info about services state from nagios

Post by belogrud »

Hello everybody.

Could someone of experienced users help me to get right way.
Task, that I want to resolve, described below.

I'd like to get information from nagios about hosts and services, that have defined status (critical or warning) and have this status unchanged for a long time.
Next type of task is to find all hosts and services that have no notification configured for them, but have critical or warning state.

I think, I will write special programm (script), that will compute appropriate time lenght and other conditions and send special notification in according to it.

This specific task needs us because we have lot of services monitored by nagios and sometimes one of our admins accidentally forget to fix issue during long time. Simultaneously, this services have created downtime, so we cannot receive any notification. Only, accidentally, we can see something wrong during inspect nagios web-pages.
Another one reason is when someone of our developers or other owners of monitored by nagios services, ask us to turn on downtime for their services for long period. And then, them forget about it at all.

So, I ask your advices - what is better way should I use to resolve these tasks?

I think, there are two methods, that can help me.
1. One is to use "NDOUtils" ( https://exchange.nagios.org/directory/A ... ls/details ). This way suppose, that my script will get some info from mysql database, that contain everything about current state of all nagios checks.
2. Another one way is to use "MK Livestatus" ( http://mathias-kettner.de/checkmk_livestatus.html ). This way suppose that my script will get appropriate information with "LQL - The Livestatus Query Language".

So, whay you say?

With best regards,
Sergey.
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Getting info about services state from nagios

Post by tmcdonald »

I would also look at our JSON CGI for pulling info from Core:

https://labs.nagios.com/2014/06/19/expl ... -7-part-1/

As for the specifics of how you implement this, we typically don't address custom development architecture unless you have specific questions about a part of our software. We need to focus on actual issues/errors and not stray too far into the hypothetical realm.
Former Nagios employee
belogrud
Posts: 15
Joined: Mon Dec 07, 2015 10:34 am

Re: Getting info about services state from nagios

Post by belogrud »

tmcdonald wrote:I would also look at our JSON CGI for pulling info from Core...
Thank you, indeed.
I will keep it in my mind.

Have a good day,
Sergey.
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: Getting info about services state from nagios

Post by hsmith »

Is there anything else we can do for you in this thread?
Former Nagios Employee.
me.
belogrud
Posts: 15
Joined: Mon Dec 07, 2015 10:34 am

Re: Getting info about services state from nagios

Post by belogrud »

hsmith wrote:Is there anything else we can do for you in this thread?
There are no other questions at this moment.
Big thanks.

Sergey.
bwallace
Posts: 1145
Joined: Tue Nov 17, 2015 1:57 pm

Re: Getting info about services state from nagios

Post by bwallace »

Glad we were able to help. We'll lock this thread now and feel free to open another should you require assistance with anything else.
Be sure to check out the Knowledgebase for helpful articles and solutions!
Locked