[mrtg] Monitoring MS SQL databases

Grant Ringham (WB) gringham at intrawest.com
Tue Jun 4 02:20:23 MEST 2002


Hello, 
I have been searching for info on monitoring Microsoft SQL databases though
mrtg for some time. Please excuse my poor use of SNMP and MRTG terminology
(I'm new to it) but...
It seems that the MS SQL snmp MIBs/OIDs don't respond to the snmpget
command, but do respond to the snmpgetnext command (I found an obscure
reference to this by a Microsoft tech on one of their newsgroups, and
another in this lists archives). In order to get mrtg to work "normally" it
would necessitate a re-write of the mrtg perl script to use snmpgetnext
rather than snmpget. I fooled with this a bit but really it's beyond me at
this point so what I did was to use a separate script to gather the data as
described below...

To gather database size(mssqlDbInfoSize) I used the target line:

Target[servername.sql.1]: `sqlscript hostname community
1.3.6.1.4.1.311.1.4.1.1.6.1.5.3`

where the sqlscript file is:

snmpgetnext -O v $1 $2 .$3
snmpgetnext -O v $1 $2 .$3
snmpgetnext -O v $1 $2 .system.sysUpTime
snmpgetnext -O v $1 $2 .system.sysName

My Mrtg box is Redhat and my test server is win2000 with sql 7. This is just
a preliminary test it but it works just fine. The only confusing thing is
that in the target line the last OID number (3 in this case) actually
returns the next consecutive value due to using the snmpgetNEXT command. (I
will modify this script to parse the correct values later.) My questions
are:

Does anyone else have a slicker way of doing this (that doesn't require an
intimate knowledge of perl)? 
Is this inefficient?

Grant

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



More information about the mrtg mailing list