More on nagios performance data (or the lack of it)

Hugo van der Kooij hvdkooij at vanderkooij.org
Tue Feb 7 23:07:14 CET 2006


Right,

I did send the nagios performance data to a file and wrote a perlscript to
count the events recorded and calculate the average time between events
recorded.

<script name=checkperf.pl>
#!/usr/bin/perl
my $filename="/var/log/nagios/service-perfdata.out";
open(FILE, "<$filename");
while ($line = <FILE>) {
   chomp($line);
   @fields = split(/\t/,$line);
   $timestamp = @fields[0];
   $host = @fields[1];
   $service = @fields[2];
   $count{$host}{$service}++;
   if ( $min{$host}{$service} ) {
      if ( $min{$host}{$service} > $timestamp ) {
         $min{$host}{$service} = $timestamp;
      }
   } else {
      $min{$host}{$service} = $timestamp;
   }
   if ( $max{$host}{$service} < $timestamp ) {
      $max{$host}{$service} = $timestamp;
   }
}
close(FILE);
if (keys %count) {
   foreach $host (sort keys %count) {
      if (keys %{$count{$host}}) {
         foreach $service (sort keys %{$count{$host}}) {
             $time = $max{$host}{$service} - $min{$host}{$service};
             $average = $time / ($count{$host}{$service} - 1);
             print "$host\t$service\t= $average\n";
         }
      }
   }
}
</script>

The results should average the time between events per service per host.
But the results are not at all what they should be.

For example:

aleph   DNS     = 3599.01728395062
aleph   HTTP-lugww.counter.li.org       = 3616.66749379653
aleph   PING    = 179.218954248366
aleph   SMTP    = 3599.01481481481
aleph   SSH     = 3616.65756823821
anfalas Internet        = 1040.43540328337
anfalas InternetV6      = 1040.33618843683
anfalas PING    = 176.439102564103
anfalas SSH     = 3616.69975186104

As each service is supposed to be checked every 3 minutes the average
should be 180. As the test period may cause some deviation I can
understand anything ~10 seconds off.

But many of the services do not seem to report their performance data on
each poll.

Is there a way to find out why nagios is not generating the performancce
data as I expect it to?

Short reminder: Nagios v2.0 RC2

Hugo.

-- 
	I hate duplicates. Just reply to the relevant mailinglist.
	hvdkooij at vanderkooij.org		http://hvdkooij.xs4all.nl/
		Don't meddle in the affairs of magicians,
		for they are subtle and quick to anger.


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Nagios-users mailing list
Nagios-users at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/nagios-users
::: Please include Nagios version, plugin version (-v) and OS when reporting any issue. 
::: Messages without supporting info will risk being sent to /dev/null





More information about the Users mailing list