Nagios, MySQL and trending

Carroll, Jim P [Contractor] jcarro10 at sprintspectrum.com
Mon Dec 30 19:03:25 CET 2002


Eep!  Ah well, it was an interesting exercise, nonetheless.

Alright, this brings me full circle back to working with:

  xpdfile_service_perfdata_file=/usr/local/nagios/var/serviceperf.log

Nagios logs to this file.  But it never closes the file, so renaming the
file before slurping it into a Perl script won't help matters.  I suppose I
could have a cronjob do a rename then stop/start Nagios, but I'd like to
slurp the data every 5 mins; bouncing Nagios every 5 mins seems excessive.
I suppose I could just leave serviceperf.log alone and just use seek/tell,
but at some point serviceperf.log will get large enough that I'll want to
reset it to 0 bytes, which will then mean I'll have to restart Nagios
anyway; however, any data written since the last slurp until the file is
reset will be lost.

I'm trying to think this one through as I type.  Ideally, Nagios would dump
this directly to MySQL, but since database support is going away, that
approach should be discouraged.  Perhaps Nagios could close serviceperf.log
between writes, which would eliminate the filehandle problem.

I suppose I could slurp serviceperf.log and immediately reset it to 0 bytes
("cat /dev/null > /usr/local/nagios/var/serviceperf.log"), but I still feel
there's a risk that a bit of data will be lost.  It might be an acceptable
risk, all things considered.

Can anyone make any other suggestions?

jc

> -----Original Message-----
> From: Rue Turner [mailto:rue at thinlayer.co.uk]
> Sent: Monday, December 30, 2002 3:42 AM
> To: Naios Users
> Subject: Re: [Nagios-users] Nagios, MySQL and trending
> 
> 
> > After a few bumps and bruises, I succeeded in converting my 
> existing Nagios
> > installation to include MySQL support (except for the 
> host/service extended
> > info, which I deliberately avoided).
> 
> Jim,
> 
> It might interest you to know that database support is being dropped.
> There's a full discussion on it somewhere and I believe it's 
> also in the
> docs somewhere - something to do with it being such a headache to deal
> with (sorry for simplification, Ethan.)
> 
> I am waiting for a while to build up courage before removing 
> the db from
> my installation - I use extended data a lot!
> 
> don't shoot the messenger
> rue
> 
> 
> -------------------------------------------------------
> This sf.net email is sponsored by:ThinkGeek
> Welcome to geek heaven.
> http://thinkgeek.com/sf
> _______________________________________________
> Nagios-users mailing list
> Nagios-users at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/nagios-users
> 


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




More information about the Users mailing list