[mrtg] Monitoring CPU Utilization on a CentOS Machine
Matt Baer
matt at baerconsult.com
Thu Sep 24 20:27:07 CEST 2009
I love how I can scour the internet for 2 weeks trying to find the answer and all I had to do was ask the right people. That worked, thank you very much.
Now, for the n00b questions. SNMP is worse than programming to me, it doesn't make sense and I am way too ADD to be able to sit down and figure it out.
Where can I find these OIDs? I have Zimbra on that same machine and I'd like to monitor much more stuff.
I noticed that the title reads "2 CPUs". Is it a problem that the machine only has one CPU? I tacked the same method on to localhost which is a dual core and the graphs look the same so I'm curious as to which line stands for what.
----- Original Message -----
From: "Max Hetrick" <maxhetrick at verizon.net>
To: mrtg at lists.oetiker.ch
Sent: Thursday, September 24, 2009 6:18:43 AM GMT -06:00 US/Canada Central
Subject: Re: [mrtg] Monitoring CPU Utilization on a CentOS Machine
Matt Baer wrote:
> Hello.
>
> I'm having some issues getting the CPU utilization for any machine. For
> testing purposes, I'll only include one machine here. It is a single
> core CPU running CentOS. The machine that MRTG is running on is Ubuntu
> 9.04 Desktop and it's using MRTGv2.16.2. Here the relevant portion of
> my mrtg.cfg file:
>
> LoadMIBs: /usr/share/snmp/mibs/UCD-SNMP-MIB.txt
> Target[mailserv.cpu]:ssCpuRawUser.0&ssCpuRawUser.0:public at 10.0.0.10 +
> ssCpuRawSystem.0&ssCpuRawSystem.0:public at 10.0.0.10 +
> ssCpuRawNice.0&ssCpuRawNice.0:pub$
> MaxBytes[mailserv.cpu]: 100
> Title[mailserv.cpu]: CPU LOAD
> PageTop[mailserv.cpu]: <H1>Active CPU Load %</H1>
> Unscaled[mailserv.cpu]: ymwd
> ShortLegend[mailserv.cpu]: %
> YLegend[mailserv.cpu]: CPU Utilization
> Legend1[mailserv.cpu]: Active CPU in % (Load)
> Legend2[mailserv.cpu]:
> Legend3[mailserv.cpu]:
> Legend4[mailserv.cpu]:
> LegendI[mailserv.cpu]: Active
> LegendO[mailserv.cpu]:
> Options[mailserv.cpu]: growright,nopercent,gauge
>
> I have tried many many many different changes to this but they all
> warrant the same results. I get a graph, but nothing populates within
> the graph. I notice that I'm getting things in the /var/mail/root.
> Here is my latest excerpt from that:
>
> Unknown SNMP var ssCpuRawUser.0
> at /usr/bin/mrtg line 2207
> Unknown SNMP var ssCpuRawUser.0
> at /usr/bin/mrtg line 2207
> 2009-09-24 00:35:01: WARNING: Expected a number but got '11:49:28'
> 2009-09-24 00:35:01: WARNING: Expected a number but got 'nas2'
> Unknown SNMP var ssCpuRawSystem.0
> at /usr/bin/mrtg line 2207
> Unknown SNMP var ssCpuRawSystem.0
> at /usr/bin/mrtg line 2207
> 2009-09-24 00:35:01: WARNING: Expected a number but got '11:49:28'
> 2009-09-24 00:35:01: WARNING: Expected a number but got 'nas2'
> Unknown SNMP var ssCpuRawNice.0
> at /usr/bin/mrtg line 2207
> Unknown SNMP var ssCpuRawNice.0
> at /usr/bin/mrtg line 2207
> 2009-09-24 00:35:01: WARNING: Expected a number but got '11:49:28'
> 2009-09-24 00:35:01: WARNING: Expected a number but got 'nas2'
> Unknown SNMP var ssCpuRawUser.0
> at /usr/bin/mrtg line 2207
> Unknown SNMP var ssCpuRawUser.0
> at /usr/bin/mrtg line 2207
> 2009-09-24 00:35:01: WARNING: Expected a number but got '34 days, 7:01:39'
> 2009-09-24 00:35:01: WARNING: Expected a number but got 'mail.server.com'
> Unknown SNMP var ssCpuRawSystem.0
> at /usr/bin/mrtg line 2207
> Unknown SNMP var ssCpuRawSystem.0
> at /usr/bin/mrtg line 2207
> 2009-09-24 00:35:01: WARNING: Expected a number but got '34 days, 7:01:39'
> 2009-09-24 00:35:01: WARNING: Expected a number but got 'mail.server.com'
> Unknown SNMP var ssCpuRawNice.0
> at /usr/bin/mrtg line 2207
> Unknown SNMP var ssCpuRawNice.0
> at /usr/bin/mrtg line 2207
> 2009-09-24 00:35:01: WARNING: Expected a number but got '34 days, 7:01:39'
> 2009-09-24 00:35:13: ERROR: Target[localhost.cpu][_IN_] '
> $target->[18]{$mode} + $target->[19]{$mode} + $target->[20]{$mode} '
> (warn): Use of uninitialized value in addition (+) at (eval 54) line 1.
> 2009-09-24 00:35:13: ERROR: Target[localhost.cpu][_OUT_] '
> $target->[18]{$mode} + $target->[19]{$mode} + $target->[20]{$mode} '
> (warn): Use of uninitialized value in addition (+) at (eval 55) line 1.
> 2009-09-24 00:35:13: ERROR: Target[mailserv.cpu][_IN_] '
> $target->[22]{$mode} + $target->[23]{$mode} + $target->[24]{$mode} '
> (warn): Use of uninitialized value in addition (+) at (eval 58) line 1.
> 2009-09-24 00:35:13: ERROR: Target[mailserv.cpu][_OUT_] '
> $target->[22]{$mode} + $target->[23]{$mode} + $target->[24]{$mode} '
> (warn): Use of uninitialized value in addition (+) at (eval 59) line 1.
>
> As I'm sure you've noticed, it's almost as iff ssCpuRawUser.0 returns
> 'uptime'. I cannot find an answer that works anywhere. Does anyone
> have a fix for this?
Have you tried the actual OID path? I'm graphing a CPU load in CentOS 4
with the following:
Target[machine_1]:
1.3.6.1.4.1.2021.11.50.0&1.3.6.1.4.1.2021.11.50.0:public at machine +
1.3.6.1.4.1.2021.11.52.0&.1.3.6.1.4.1.2021.11.52.0:public at machine +
.1.3.6.1.4.1.2021.11.51.0&.1.3.6.1.4.1.2021.11.51.0:public at machine
MaxBytes[machine_1]: 100
Title[machine_1]: CPU LOAD
PageTop[machine_1]: <H1>Active CPU Load % (2 CPUs)</H1>
Unscaled[machine_1]: ymwd
ShortLegend[machine_1]: %
YLegend[machine_1]: CPU Utilization
Legend1[machine_1]: Active CPU in % (Load)
Legend2[machine_1]:
Legend3[machine_1]:
Legend4[machine_1]:
LegendI[machine_1]: Active
LegendO[machine_1]:
Options[machine_1]: growright,nopercent
Try it out with the actual OID here and see what you get.
Regards,
Max
_______________________________________________
mrtg mailing list
mrtg at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.oetiker.ch/pipermail/mrtg/attachments/20090924/f176f24e/attachment-0001.htm
More information about the mrtg
mailing list