[mrtg] Re: Operations ?

Jacek Zabicki jzabicki at equifax.ca
Sat Oct 9 00:25:54 MEST 1999


Hi,
This is another trick you can do if you use unix as MRTG server. Instead of
specifying an OID on Target line, call a unix script from Target line. I
just wrote it and it works. In this script only the second value is
multiplied.

<<<< CUT HERE >>>>>>>
#!/bin/sh

# This script is used by MRTG, it is specified on Target line of .cfg file
# $1 must be IP address of target (Windows NT server)
# $2 must be a community name of target (Windows NT server)
# This script returns four lines
# line 1: memory used on windows NT server in bytes
# line 2: total memory installed in Windows NT server in bytes
# line 3: system up time
# line 4: system name and IP
# For more info consult config.htm

# this script requires that following is installed
# on a target Compaq Windows NT server:
# - Teleserve perfm.bat
# - Compaq Insight Manager client

# BEGIN ============
# Memory used
# This is an OID installed with Teleserve perfm.bat
snmpget $1 $2 .1.3.6.1.4.1.311.1.1.3.1.1.7.2.0 | cut -c35-50

# Total RAM installed in this computer
# Variable returned by Insight Manager OID is in kilobytes,
# it has to by converted to bytes, ie multiplied by 1000
let RAM=`snmpget $1 $2 .1.3.6.1.4.1.232.1.2.3.2.0 | cut -c29-50`*1000
echo $RAM

snmpget $1 $2 system.sysUpTime.0 | cut -c22-70
echo -n `snmpget $1 $2 system.sysName.0 | cut -c20-45 `; echo -n " "; echo
$1
# END ==============
<<<< CUT HERE >>>>>>>

-------------------
Jacek Zabicki
zabicki at i.am
http://zabicki.i.am
-------------------


-----Original Message-----
From: mrtg-bounce at list.ee.ethz.ch [mailto:mrtg-bounce at list.ee.ethz.ch]On
Behalf Of Lionel Billiet
Sent: 06 October, 1999 10:58
To: mrtg
Subject: [mrtg] Operations ?


> Target[total2924]: 1:public at swtichIP + 2:public at swtichIP +
>                        3:public at swtichIP + 4:public at swtichIP +
>                        5:public at swtichIP + 6:public at swtichIP +
>                        7:public at swtichIP + 8:public at swtichIP +
>                        9:public at swtichIP + 10:public at swtichIP +

Is it possible to make other operations than additions?

Some 1:public at swtichIP / 2:public at swtichIP * 1234 for example?



--
* 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