Hello All,
My organization would like to import Nagios data to SQL Server for some custom reporting we'd like to do. I'd like to trigger Nagios reports from command line. Is there an online source for writing shell scripts that interact with Nagios?
Thanks,
K
Accessing data - Nagios 2.7
Re: Accessing data - Nagios 2.7
To export the data from Nagios to a SQL database there's a plugin called NDOUtils - http://exchange.nagios.org/directory/Ad ... ls/details. From there you can pretty much use your favourite language for retrieving the information with SQL queries.
Re: Accessing data - Nagios 2.7
Is there a way to directly access the data? Where/how is Nagios data stored?
Re: Accessing data - Nagios 2.7
Maybe I'm misunderstanding the question, but you will be able to access the data from SQL queries. Are you asking how is the data stored before installing the database sync tool? It's stored in a whole lot of flat files in /opt/nagios/var/spool/checkresults/ but this is of no use to you, it's all untranslated data used by the Nagios engine.
You can't query the Nagios engine directly, which is why the Nagios team released the database sync tool.
You can't query the Nagios engine directly, which is why the Nagios team released the database sync tool.
Re: Accessing data - Nagios 2.7
I thought that might be the case. I had read in an admin post that it was possible to parse the log files: http://www.steveshipway.org/forum/viewt ... 579#p12579
Also, strange that the checkresults directory is empty... ?
Also, strange that the checkresults directory is empty... ?
Re: Accessing data - Nagios 2.7
the spool directory is all transient data... it's temporary. Well yes you could parse the log files but it's not going to be fast; I don't know why I didn't think of that when answering you last time, pretty obvious thinking about it . I've never attempted to parse the logs though so I'm afraid I won't be much help.
Re: Accessing data - Nagios 2.7
For historical information, use ndoutils. You can parse the nagios.log file, and the old logs in the archive directory, but that's going to be painfully slow compared to a database. Current status information is located in a file called status.dat.
-
- Posts: 63
- Joined: Fri Sep 09, 2011 1:14 am
Re: Accessing data - Nagios 2.7
Can you please let me know that what is the default database of nagios and how can we access it or there is'nt any database we have to add any plugin for accessing current data and history ?
Hopes for your suggestions
Best Regards!
Hopes for your suggestions
Best Regards!