Monitoring CPU on W2k3-Server with MRTG

Monitoring CPU on W2k3-Server with MRTG

Post by Sven Jenautzk » Sat, 21 Jun 2003 00:01:18



Hi all!

I got a Problem monitoring the CPU-Load on an Windows Server 2003 using
MRTG.

Config:
Win2k3 English
Active Perl 5.8.0 build 806
MRTG 2.9.29

I tried the CFG-Files from snmpboy but they wont work. So I created my own
(small) one:
NoMib2: Yes

Title[CPU0]: Test
MaxBytes[CPU0]: 523444000
WorkDir: e:\htdocs\mrtg

But when I start it, I get the following error:

D:\Programs2003\mrtg\bin>perl mrtg test2.cfg
SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 1 (OID: 1.3.6.1.2.1.25.3.3.1.2)
SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)
                  community: "public"
                 request ID: 1683235429
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
 at D:/Programs2003/mrtg/bin\..\lib\mrtg2/SNMP_util.pm line 458
SNMPGET Problem for .1.3.6.1.2.1.25.3.3.1.2 .1.3.6.1.2.1.25.3.3.1.2 on

calhost
 at mrtg line 1678
ERROR: Target[cpu0][_IN_] ' $$target[0]{$mode} ' did not eval into defined
data
ERROR: Target[cpu0][_OUT_] ' $$target[0]{$mode} ' did not eval into defined
data

WARNING: Skipping Update of cpu0, inlast is not defined
WARNING: Skipping Update of cpu0, outlast is not defined

I doublechecked the OID using "getif" and snmputil:
E:\Notebook\ResourceKits\win2000sup1>snmputil getnext localhost public
.1.3.6.1.
2.1.25.3.3.1.2
Variable = host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad.3
Value    = Integer32 8

Does anyone have an idea what the error could be?

Many thanks in advance!!!

Sven

 
 
 

Monitoring CPU on W2k3-Server with MRTG

Post by Mats » Sat, 21 Jun 2003 01:07:44



Quote:> Hi all!

> I got a Problem monitoring the CPU-Load on an Windows Server 2003 using
> MRTG.

> Config:
> Win2k3 English
> Active Perl 5.8.0 build 806
> MRTG 2.9.29

> I tried the CFG-Files from snmpboy but they wont work. So I created my
own
> (small) one:
> NoMib2: Yes
> Target[CPU0]:


> Title[CPU0]: Test
> MaxBytes[CPU0]: 523444000
> WorkDir: e:\htdocs\mrtg

> But when I start it, I get the following error:

> D:\Programs2003\mrtg\bin>perl mrtg test2.cfg
> SNMP Error:
> Received SNMP response with error code
>   error status: noSuchName
>   index 1 (OID: 1.3.6.1.2.1.25.3.3.1.2)
> SNMPv1_Session (remote host: "localhost" [127.0.0.1].161)
>                   community: "public"
>                  request ID: 1683235429
>                 PDU bufsize: 8000 bytes
>                     timeout: 2s
>                     retries: 5
>                     backoff: 1)
>  at D:/Programs2003/mrtg/bin\..\lib\mrtg2/SNMP_util.pm line 458
> SNMPGET Problem for .1.3.6.1.2.1.25.3.3.1.2 .1.3.6.1.2.1.25.3.3.1.2 on

> calhost
>  at mrtg line 1678
> ERROR: Target[cpu0][_IN_] ' $$target[0]{$mode} ' did not eval into defined
> data
> ERROR: Target[cpu0][_OUT_] ' $$target[0]{$mode} ' did not eval into
defined
> data

> WARNING: Skipping Update of cpu0, inlast is not defined
> WARNING: Skipping Update of cpu0, outlast is not defined

> I doublechecked the OID using "getif" and snmputil:
> E:\Notebook\ResourceKits\win2000sup1>snmputil getnext localhost public
> .1.3.6.1.
> 2.1.25.3.3.1.2
> Variable =

host.hrDevice.hrProcessorTable.hrProcessorEntry.hrProcessorLoad.3

Quote:> Value    = Integer32 8

> Does anyone have an idea what the error could be?

> Many thanks in advance!!!

> Sven

Change Active Perl 5.8.0 build 806 to the older 5.6.

/Mats

 
 
 

Monitoring CPU on W2k3-Server with MRTG

Post by Sven Jenautzk » Sat, 21 Jun 2003 07:29:38



Quote:

> Change Active Perl 5.8.0 build 806 to the older 5.6.

> /Mats

Switched back to 5.6.1 Build 635 (found no older one on activestate.com)
with the same results... :-(

Sven

 
 
 

Monitoring CPU on W2k3-Server with MRTG

Post by Martin Hell » Sat, 21 Jun 2003 21:49:25




Quote:> Hi all!

> I got a Problem monitoring the CPU-Load on an Windows Server 2003 using
> MRTG.

Why don't you use WMI information ?

Copy&paste this script:

http://www.eriador.dhs.org/mrtg/ShowSource.asp?filename=ProcessorUsag...

Save it as ProcessorUsage.wsf in your MRTG bin directory

Set the default scripting host to CSCript.exe:

C:\>CSCript /H:CSCript

Set the target in your cfg file to (notice the backticks, not single
quotes):

Target[localhost_cpuLoad]: `ProcessorUsage.wsf localhost //NoLogo`

This works fine on Windows 2000 single and dual cpu systems and should work
on Windows 2003 but I haven't tried that yet.

Martin.

 
 
 

Monitoring CPU on W2k3-Server with MRTG

Post by Martin Hell » Sun, 22 Jun 2003 00:00:04






> > Hi all!

> > I got a Problem monitoring the CPU-Load on an Windows Server 2003 using
> > MRTG.

> Why don't you use WMI information ?

> Copy&paste this script:

> http://www.eriador.dhs.org/mrtg/ShowSource.asp?filename=ProcessorUsag...

> Save it as ProcessorUsage.wsf in your MRTG bin directory

> Set the default scripting host to CSCript.exe:

> C:\>CSCript /H:CSCript

> Set the target in your cfg file to (notice the backticks, not single
> quotes):

> Target[localhost_cpuLoad]: `ProcessorUsage.wsf localhost //NoLogo`

> This works fine on Windows 2000 single and dual cpu systems and should
work
> on Windows 2003 but I haven't tried that yet.

> Martin.

You should also set the following in your config file, since we're logging
cpu load in %.

MaxBytes[localhost_cpuLoad]: 100
Options[localhost_cpuLoad]: gauge

Martin.

 
 
 

Monitoring CPU on W2k3-Server with MRTG

Post by alex » Tue, 24 Jun 2003 06:59:17


hi

don't use this - if you need average proc load... it is only a snapshot on
the mrtg run. if you load is between the run 100% and on the run 0% you load
will everytime 0% - therefor nothing accurate. i have postet a long time ago
a script here doing this average calculation based on a perfmon csv file and
using the last 20 entries (or more) based on 20 "shots" in the last 5
minutes...

Alex

 
 
 

Monitoring CPU on W2k3-Server with MRTG

Post by Martin Hell » Tue, 24 Jun 2003 08:24:31


Quote:> don't use this - if you need average proc load... it is only a snapshot on
> the mrtg run. if you load is between the run 100% and on the run 0% you
load
> will everytime 0% - therefor nothing accurate. i have postet a long time
ago
> a script here doing this average calculation based on a perfmon csv file
and
> using the last 20 entries (or more) based on 20 "shots" in the last 5
> minutes...

Could you please repost that script with a guidance for perfmon so I can
compare the results ? I'm curious. So far I've found that the results are
quite accurate, but since I'm a beginner I could definately be wrong.

Martin.

 
 
 

Monitoring CPU on W2k3-Server with MRTG

Post by Sven Jenautzk » Wed, 25 Jun 2003 06:10:58


I found my error... I used a wrong OID, the right one was
".1.3.6.1.2.1.25.3.3.1.2.3"... (instead of "1.3.6.1.2.1.25.3.3.1.2") ... it
was missing the last digit!

Thank you all for your help!

Sven

 
 
 

Monitoring CPU on W2k3-Server with MRTG

Post by alex » Fri, 27 Jun 2003 02:21:59


hi

Quote:> Could you please repost that script with a guidance for perfmon so I can
> compare the results ? I'm curious. So far I've found that the results are
> quite accurate, but since I'm a beginner I could definately be wrong.

as i you told - it is only a snapshot of *one* second and not timerange. the
following is bedder and i use it since 1 year... but i'd like progging this
script new - with strict and warnings on... it's based ob Paul Sommonsons
script and it's something like - my first steps in Perl :-). a new one will
looks smarter - i think so :-).

[getlog.pl]
# getlog.pl, v2.1
#
# Author: Paul Simmonson, Alex
#
# 17.08.2002 fixed BUG in split for Win2k
# 23.06.2002 IN and OUT possible
# 22.06.2002 get last X lines and calculate average data - for more
accuracy!
#  (5 minutes mrtg intervall * 60 sec / 15sec performancecounter intervall =
20 entries)
#
# Input: filename of Windows 2000 Performance monitor log file (must be CSV
format)
# Name of log item to extract
# eg. perl getlog-fixed.pl c:\perflogs\K6.csv "\\K6\LogicalDisk(C:)\% Disk
Time"
# Output: mrtg data format
#
############################################################################
###################

$x=20;  # get last X lines from logfile and calculate average data

############################################################################
###################




# if less then x lines set to real lines -1
if ($lines-1 <= $x) {$x = $lines-1}

#find the entry that matches $ARGV[1]
$index=-1;

 $index++;
 $entry0=~ tr/"//d;
 chomp ($entry0);
 $last0=$entry0;
 last if $entry0 eq $ARGV[1];
 }

if ($last0 eq $ARGV[1]) {
 # work with the last x lines
 for ($i = 0; $i < $x; $i++) {


  $data0=~ tr/"//d;
  $data0=~ tr/,/./d;

  # calculate average
  $completedata0=sprintf(+$completedata0+$data0);
  }
     #average calculation
     $average0=sprintf($completedata0/$x);
     $average0=int($average0+0.5);
 }
else {
     $average0 = 0;
 }

#find the entry that matches $ARGV[2]
$index=-1;

 $index++;
 $entry1=~ tr/"//d;
 chomp ($entry1);
 $last1=$entry1;
 last if $entry1 eq $ARGV[2];
 }

if ($last1 eq $ARGV[2]) {
 # work with the last x lines
 for ($i = 0; $i < $x; $i++) {


  $data1=~ tr/"//d;
  $data1=~ tr/,/./d;

  # calculate average
  $completedata1=sprintf(+$completedata1+$data1);
  }
     #average calculation
     $average1=sprintf($completedata1/$x);
     $average1=int($average1+0.5);
 }
else {
     $average1 = 0;
 }

print "$average1\n";
print "$average0\n";
print "0\n";
print "0\n";

Alex

 
 
 

Monitoring CPU on W2k3-Server with MRTG

Post by Martin Hell » Fri, 27 Jun 2003 17:18:50


Quote:> > Could you please repost that script with a guidance for perfmon so I can
> > compare the results ? I'm curious. So far I've found that the results
are
> > quite accurate, but since I'm a beginner I could definately be wrong.

> as i you told - it is only a snapshot of *one* second and not timerange.
the
> following is bedder and i use it since 1 year... but i'd like progging
this
> script new - with strict and warnings on... it's based ob Paul Sommonsons
> script and it's something like - my first steps in Perl :-). a new one
will
> looks smarter - i think so :-).

> [getlog.pl]

Thanx, I'll go play with it.

Martin.

 
 
 

1. CPU monitor of W2K Server using MRTG

Hi All,
I need your valuable help. I would like t monitor CPU & memory
utilization of Windows2000 Server with MRTG. But when runing it gives
below error & not giving any SNMP data. Anywone have idea how to fix
it. I will be very thanksful.

SNMP Error:
Received SNMP response with error code
  error status: noSuchName
  index 1 (OID: 1.3.6.1.2.1.25.3.3.1.2)
SNMPv1_Session (remote host: "212.xx.xx.xx" [212.xx.xx.xx].161)
                  community: "abcdefgh"
                 request ID: -492271507
                PDU bufsize: 8000 bytes
                    timeout: 2s
                    retries: 5
                    backoff: 1)
SNMPGET Problem for 1.3.6.1.2.1.25.3.3.1.2 1.3.6.1.2.1.25.3.3.1.2
sysUptime sysN

Use of uninitialized value in concatenation (.) or stringat
c:\mrtg-2.9.18pre9\bin\mrtg line 1580.
Use of uninitialized value in substitution (s///) at
c:\mrtg-2.9.18pre9\bin\mrtg
 line 1659.
Use of uninitialized value in substitution (s///) at
c:\mrtg-2.9.18pre9\bin\mrtg
 line 1659.
Use of uninitialized value in substitution (s///) at
c:\mrtg-2.9.18pre9\bin\mrtg
 line 1660.
Use of uninitialized value in substitution (s///) at
c:\mrtg-2.9.18pre9\bin\mrtg
 line 1660.
Use of uninitialized value in substitution (s///) at
c:\mrtg-2.9.18pre9\bin\mrtg
 line 1661.
Use of uninitialized value in substitution (s///) at
c:\mrtg-2.9.18pre9\bin\mrtg
 line 1661.
Use of uninitialized value in pattern match (m//) at
c:\mrtg-2.9.18pre9\bin\mrtg
 line 1667.
Use of uninitialized value in concatenation (.) or string at
c:\mrtg-2.9.18pre9\
bin\mrtg line 1668.
WARNING: Expected a number but got ''
Use of uninitialized value in pattern match (m//) at
c:\mrtg-2.9.18pre9\bin\mrtg
 line 1667.
Use of uninitialized value in concatenation (.) or string at
c:\mrtg-2.9.18pre9\
bin\mrtg line 1668.
WARNING: Expected a number but got ''
WARNING: Skipping Update of datacpu, inlast is not defined
WARNING: Skipping Update of datacpu, outlast is not defined

Thanks & looking forward of your early reply.

Parvez

2. Question: How do i copy a directory with files in it into a the apple menu?

3. monitoring cpu load w/mrtg

4. Problem with ActiveSync

5. MRTG ARN router CPU monitoring?

6. A600 System Schematics FS

7. Nortel Networks VPN Contivity CPU & Remote Access User connection MRTG Monitoring

8. Printing to local printer from console

9. CPU Monitoring on OpenBSD with MRTG.

10. ### monitor router's cpu with MRTG

11. MRTG monitor Cisco 4006 CPU load

12. Monitoring dual CPU on Win2K using MRTG

13. How do I Monitor CPU Temperature using MRTG?