[mrtg] Re: Windows MRTG/SNMP

Volk,Gregory B greg.volk at edwardjones.com
Sun Sep 3 00:11:41 MEST 2006

> We currently monitor our linux machines with SNMP, but we 
> haven't found a windows snmp daemon that gives much useful 
> information about the computer.
> We would like to get more than just in/out traffic. Things 
> like CPU usage, memory usage, drive usage.
> Any suggestions?

Along these same lines, I have been working on writing some MRTG
customizations & templates that call an external perl script to get WMI
statistics out of a windows box, store them locally, in RRD files, and
generate graphs using 14all.cgi when a browser connects to a web server
running on a high port on the local system. So far I have managed to get
things work pretty well. The 'package' if you want to call it that
(we're talking about a bunch of files and a batch file to "install"
things) contains the following software so far:

PERL - A stripped down perl installation with the necessary MRTG related
modules - I had to do this because the installation of perl that is on
all my workstations here at work is inconsisitant at best, and broken or
completely missing at worst. This 'mini' perl install ends up under
c:\progra~1\mrtg\perl so it won't touch any existing perl intall.

A slightly modified version of 14all.cgi - the mods aren't anything
special, just paths and such.

A modifed MRTG 2.14.2 - again no special mods.

SHTTPd (a small mem foot print web server - shttpd.sourceforge.net)

GETWMI.pl (a program to access the win32 wmi counters via perl)

Threshold.pl (a program to send snmp traps when thresholds are crossed,
not currently working)

I decided that it would be best to do all the data collection and graph
generation locally because external WMI calls have a lot of network
overhead (AD authenticaton, etc) and this way with each system polling
itself a dedicated poller system is not needed. Try as I might, I was
not able to find a windows SNMP daemon that makes _all_ of the WMI
counters remotely available via SNMP. That's why I went with native WMI
calls. The MRTG daemon runs as the 'local system' user because a
privilged account is the only type of user that has access to the WMI
counters (as far as I can tell). The SHTTPd web server runs under a
local account named 'mrtg' which is a generic user with no special
priviledges. Yes, I reailze this brings up significant security
concerns, some of which I have thought of, but many I have not - I'm
still in the early testing phase of this whole thing.

Anyway, if others are interested in trying out what I have put together,
I can make the 'package' available on my web site provided my
distribution of the software is okay with each program's author - don't
expect this to be made availble overnight, it will take some time for me
to at least contact the authors. Every component is GPL'd open source,
but I want to at least notify each author as a common courtesy. I also
have to write some documentation around the mods I have made so this
will take a little while depending on what other work fires flare up. If
you're interested in trying this out, mail me, and put MRTGWMI in the
title somewhere.

So far I have the following variables graphed and the data looks pretty
reasonable on a Windows XP system. It will probably work for a Win2k3
system but I haven't done any testing on that at all. Each one of the
lines below shows up as a single graph:

    Win32_PerfRawData_PerfOS_Processor PercentUserTime
    Win32_PerfRawData_PerfOS_Objects processes
    Win32_PerfRawData_PerfOS_Memory AvailableBytes,AvailableBytes
    Win32_PerfRawData_PerfOS_Memory PagesInputPerSec,PagesOutputPerSec
    Win32_PerfFormattedData_PerfDisk_LogicalDisk PercentFreeSpace
DiskReadBytesPerSec,DiskWriteBytesPerSec _Total
    Win32_PerfFormattedData_PerfOS_PagingFile PercentUsage _Total
    Win32_PerfRawData_PerfOS_Memory PageReadsPersec,PageWritesPersec
    Win32_OperatingSystem NumberOfUsers,NumberOfUsers
PercentUserTime,PercentPrivilegedTime _Total
PercentProcessorTime,PercentProcessorTime _Total
PercentUserTime,PercentPrivilegedTime _Total
    Win32_PerfRawData_PerfOS_Processor DPCsQueuedPerSec,DPCsQueuedPerSec
    Win32_PerfRawData_PerfOS_Processor InterruptsPerSec,InterruptsPerSec
    Win32_PerfRawData_PerfOS_Cache CopyReadHitsPercent,FastReadsPersec
    Win32_PerfRawData_PerfOS_Cache DataFlushesPersec
    Win32_PerfRawData_PerfOS_Cache DataMapHitsPercent,DataMapPinsPersec
    Win32_PerfRawData_PerfOS_Objects mutexes,sections
    Win32_PerfRawData_PerfOS_Objects Semaphores,Threads

Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive     http://lists.ee.ethz.ch/mrtg
FAQ         http://faq.mrtg.org    Homepage     http://www.mrtg.org
WebAdmin    http://lists.ee.ethz.ch/lsg2.cgi

More information about the mrtg mailing list