[mrtg] MRTG using scripts instead of SNMP

Laurent Mesurÿffffffffffe9 zargos_lord1 at yahoo.fr
Wed Mar 16 17:33:16 MET 2005


HI,

i'm using MRTG as a tool to help for auditing systems.
However, i may not be able to modify those system, and
thus, cannot have SNMP installed on them.

Then i can use scripts to fetch my data. MRTG
documentation tells that the results must be like
this:

Line 1: data in
Line 2: data out
Line 3: uptime
Line 4: name

i configured my mrtg with:

Target[targetname]: `<path to script> [arguments]`
...[other optioins needed by mrtg]...


But i have an error each time mrtg runs:

First it take a lot of time, the i have the following
errors with the option: --logging and --debut with all
arguments:

Use of uninitialized value in concatenation (.) or
string at /usr/bin/mrtg line 543
Use of uninitialized value in concatenation (.) or
string at /usr/bin/mrtg line 543
Use of uninitialized value in concatenation (.) or
string at /usr/bin/mrtg line 543
Error:
  can't resolve "@" to IPv6 address
 at
/usr/lib/perl5/vendor_perl/5.8.5/i386-linux-thread-multi/SNMP_util.pm
line 426
SNMPGET Problem for @

base: get current values: in:1147400, out:2717512,
up:12900.66; name:undef, time:1110990633

here is the script:

#!/bin/bash
montage=$1
target=$2
uptime=`cat /proc/uptime | awk '{ print $1 }'`
ligne=`df -Pk $montage | grep -i $montage`
montage=`echo $ligne | awk '{ print $1 }'`
occupe=`echo $ligne | awk '{ print $3 }'`
disponible=`echo $ligne | awk '{ print $4 }'`
echo $occupe
echo $disponible
echo $uptime
echo "$target"

This script gave used space and free space for a disk
device (i.e.: /dev/hda5)

The results given are correct as per the
documentation:

1147400
2717512
12900.66
server01

But, it never takes the name, it takes undef instead,
but all other data are correct.

Can someone tells me what happened?

Laurent


	

	
		
Découvrez nos promotions exclusives "destination de la Tunisie, du Maroc, des Baléares et la Rép. Dominicaine sur Yahoo! Voyages :
http://fr.travel.yahoo.com/promotions/mar14.html

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