[mrtg] Re: CPU monitoring

Stieers, Ken KStieers at dainrauscher.com
Fri Nov 19 15:29:13 MET 1999


Daniel, 

I'm assuming that the logs are showing all zeros except for the first line
and you have all zeros on the graphs?  I'm assuming this just gives you the
momentary utilization of the CPU?  This is also a gauge value, so you need
to add "gauge" to the Options line. 

Ken 


****************************************
Ken Stieers
Lan Administrator
Dain Rauscher Information Services
(612)607-8924


> -----Original Message-----
> From: Daniel Curry [mailto:dcurry at dollar.com]
> Sent: Friday, November 19, 1999 8:11 AM
> To: 'mrtg'
> Subject: [mrtg] CPU monitoring
> 
> 
> Thanks to everyone that helped me get the Disk monitoring working.  My
> management is VERY pleased with the kind of quality support available
> for Open Source software.
> 
> But, I am still having problems with the cpuinfo.pl script.
> 
> Here is a manual run:
> 
> [dcurry at neon run]$ ./cpuinfo.pl 
> 49
> 47
> up 43 days, 12:26, 49 users,
> viper
> [dcurry at neon run]$ 
> 
> Here is the excerpt from mrtg.cfg file:
> 
> Target[viper.cpu]: `/home/dcurry/mrtg-2.8.9/run/cpuinfo.pl`
> MaxBytes[viper.cpu]: 100
> Options[viper.cpu]: nopercent
> Unscaled[viper.cpu]: dwym
> YLegend[viper.cpu]: % of CPU used
> ShortLegend[viper.cpu]: %
> LegendO[viper.cpu]:  CPU System:
> LegendI[viper.cpu]:  CPU User:
> Title[viper.cpu]: Machine name
> PageTop[viper.cpu]: <H1>CPU usage for Machine name
>  </H1>
>  <TABLE>
>    <TR><TD>System:</TD><TD>Machine name</TD></TR>
>  </TABLE>
> 
> Here is the actual script ( just the portion I modified to support
> digital unix 4.0d):
> 
> sub digital
>   {
>    # Run commands
>    $getcpu = `rsh $machine "sar -u 1 10 | grep Average"`;
>    $getuptime = `rsh $machine "uptime"`;
> 
>    # Parse though getcpu and get data
>    $getcpu =~ s/^[ \t]+\n$//;
> #   print $getcpu;
>    @gotcpu = split(/      /, $getcpu);
>    @gotcpu[1] =~ s/^[ \t]+//;
>    $getcpuusr = @gotcpu[1];
>    $getcpusys = @gotcpu[4];
> 
>    # Print getcpu data for mrtg
>    print $getcpuusr."\n";
>    print $getcpusys;
> 
>    # Parse though getuptime and get data
>    $getuptime =~ /^\s+(\d{1,2}:\d{2}..)\s+up\s+(\d+)\s+(\w+),/;
>    $getuptime =~ s/^[ \t]+//;
>    @gotuptime = split(/  /, $getuptime);
> 
>    # Print getuptime data for mrtg
>    print @gotuptime[1]." ". at gotuptime[2]."\n";
> 
>    # Print machine name for mrtg
>    print $machine."\n";
> 
>   }
> 
> --
> * To unsubscribe from the mrtg mailing list, send a message with the
>   subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> * The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg
> 

--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list