Nagios, MySQL and trending

Schimpke, Dr. Thomas / bhn Schimpke at Lenze.de
Thu Jan 2 10:47:03 CET 2003


Hello,

during the configuration of nagios at out site I found out (rather soon)
that I need to store trend data for later analysis in a database. The
management likes to see pretty pictures of the machine's CPU load, network
traffic and the like. So I had the choice to integrate (somehow) database
access into the check scripts or drop nagios completely and switch to
Openview or (even worse) netIQ. So I was in a hurry and needed a quick
solution: I open the connection to the mysql database every time the check
scripts (i.e. a perl script) runs. This is bad (I know) but at the moment it
works. I would be intrested reading about the (ongoing ?) discussion on
database support in nagios. Where can I find it ?

> At our site, I am currently experimenting with having the 
> serviceperfdata written to a FIFO, and having a (perl) daemon 
> read from 
> this pipe and pop the data into a mysql database.

That's a better way to do...but I think there was a hint in the docs, that
you should not write any data into files or something like that. That's the
reason why I decided to open a new connection to my database every time I
need it.

> This is not perfect, given that it adds another point of failure, but 
> the current results look good.

Thinking, during I type...

what we need is a database handle, that is valid as long nagios is alive. I
read about the embedded perl interpreter in nagios, perhaps we could do some
dirty tricks with it: Write a small perl script, that opens the connection
to the database, keeps it open and accepts some telegrams from the check
scripts (perhaps there is a way to fork() this script and let it become the
check script (something like exec or so) so the check script can use the
handle...). 

Anyway: I think that sooner or later everyone will need something like
database support, so if database support is going away in nagios we'll have
to find another way to implement it. Independent on the implementation we
should do it "coordinated", avoiding twenty different releases of nagios...

Thomas


-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf




More information about the Users mailing list