How to Read the received alert from Nagios DataBase

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
shtrudhan
Posts: 5
Joined: Sun Feb 18, 2018 4:09 am

How to Read the received alert from Nagios DataBase

Post by shtrudhan »

Hi Team,

I have a requirement where need to incoming event from database from different application. Please let me know where the data base stored and how to read it.

Regards
Shtrudhan
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How to Read the received alert from Nagios DataBase

Post by mcapra »

Nagios Core's database (which is less "database" and more ORM) is in-memory and inaccessible. Nagios XI uses a MariaDB database.

That said, if you want to programatically pull a specific piece of information out of Nagios Core, the JSON CGIs exist:
https://labs.nagios.com/2014/06/19/expl ... -7-part-1/

From that documentation, assuming you are using the latest version of Nagios Core, you can skip to the "To get started using the CGIs" section.

Or, if you want to manually submit checks to Nagios Core, passive checks are a good option for this.
Former Nagios employee
https://www.mcapra.com/
kyang

Re: How to Read the received alert from Nagios DataBase

Post by kyang »

Thanks for the help @mcapra!

shtrudhan, let us know if you have any more questions.
shtrudhan
Posts: 5
Joined: Sun Feb 18, 2018 4:09 am

Re: How to Read the received alert from Nagios DataBase

Post by shtrudhan »

Thank you. when i open the json query generator page, the Send Query is disabled. Could you please help me to resolve this
User avatar
mcapra
Posts: 3739
Joined: Thu May 05, 2016 3:54 pm

Re: How to Read the received alert from Nagios DataBase

Post by mcapra »

Please refer to the documentation I have provided:
https://labs.nagios.com/2014/06/19/expl ... -7-part-1/

You'll need to select the relevant CGI for the information you're trying to access. Here's an example of generating a query for the status of host CENESPROD00:
2018_02_21_13_40_41_JSON_Query_Generator.png
Notice how I have selected the "Status JSON CGI".
Former Nagios employee
https://www.mcapra.com/
kyang

Re: How to Read the received alert from Nagios DataBase

Post by kyang »

Thanks again @mcapra!
Locked