Peformance Data in a Database

Ben Clewett Ben at clewett.org.uk
Thu Apr 15 15:35:19 CEST 2004


Hi Chris,

The problem of simply getting the performance data into a MySQL table is 
not that complex.  I have suggested this line of UNIX script will do 
this as-is:

tail -f /usr/local/nagios/var/serviceperf.log | awk -F"\t" '{ print 
"INSERT INTO service_performance (hostname, servicename, time, output, 
perfdata) values (\"" $2 "\", \"" $3 "\", from_unixtime(\"" $1 "\"), \"" 
$4 "\", \"" $5 "\");" }' | mysql -u nagios -pnagios -D nagios -h localhost

But sensibly this does not address several problems:
-	Handling the zero, one or many metrics of performance data from each 
line of data, extracting the true figures.
-	Patching Nagios to use this data for it's own use.  Ie, hystergrams of 
past performance.  (Or a great idea I think: projected figures for 
estimated time of failure, using one of many exciting algorithms.)
-	Including this as a patch on MySQL.

Looking at the excellent work Druzhinin Eugene has done along these 
lines, this is a much bigger project than I had originally thought.

What I would like to do is complete this in two iterations.  Firstly, a 
robust parser, as above but properly written.  Designed using nagios 
libraries, config files, nagios mysql handler.  Also to take each line 
cold so that this can be used as a line-by-line parser.

Secondly, if it works and is liked, to patch Nagios with this work and 
offer it to those who are, for those that would like.

If I get a working parser, I'll post a link.

Regards, Ben.


Chris Wilson wrote:

> Hi Ben,
> 
> 
>>I notice there are plans to move the Object Data to Database, but I 
>>cannot see anywhere in the documentation, plans to add Peformance Data 
>>to Database.  I believe there is no better place to add data so that 
>>many applications can access it concurrently and with great performance.
>>
>>I a interested in knowing if any person is considering working on this, 
>>and if so, whether I could help them.
> 
> 
> I'm very interested in this, but unfortunately I don't think I have time 
> to implement it myself. I'm happy to help you test it, though. Please keep 
> me (or the list) informed of your progress.
> 
> Cheers, Chris.



-------------------------------------------------------
This SF.Net email is sponsored by: IBM Linux Tutorials
Free Linux tutorial presented by Daniel Robbins, President and CEO of
GenToo technologies. Learn everything from fundamentals to system
administration.http://ads.osdn.com/?ad_id=1470&alloc_id=3638&op=click




More information about the Developers mailing list