[mrtg] how to grow right in this script
Zeeshan Ahmed
zeeshan at worldcall.net.pk
Tue Sep 24 19:58:00 MEST 2002
Dear all i am using this script to creat my mrtg graphs for the cable modems.
#!/bin/bash
#This script will create a folder inside the directory /var/www/html/mrtg" which is named
#by the first variable. It will create a cfg file inside the /etc/mrtg folder. It will also add
#a line to the script "/etc/mrtg/all-ip" so that crontab will run this script which in turn will
#run mrtg for each device. The second variable is the IP address of each device to be
#monitored..This script is best run when "all" the workstations connected to it are powered
#up because "cfgmaker" ignores inactive ports when it is run.
# EX:
# Var1 Var2
# | |
# [root at localhost /root]# create-mrtg 10001 10.0.0.1
# Create a "workdir" for this device using the first variable
mkdir -p /var/www/html/mrtg/$1
#create the cfg file for this Ip address using the first variable (assumes community string is "public")
perl /usr/bin/cfgmaker public@$2 --global "workdir: /var/www/html/mrtg/$1" --output /etc/mrtg/$1.cfg
#Create an index.html file for this folder using the first variable
perl /usr/bin/indexmaker /etc/mrtg/$1.cfg > /var/www/html/mrtg/$1/index.html
#create an entry in script "all-ip" to run mrtg for each device.
echo "/usr/bin/mrtg /etc/mrtg/$1.cfg;" >> /etc/mrtg/all-ip
#Uncommenting the line below will create a "master" index.html inside the /var/www/html directory for all devices.
#Note that this line will create a text file called index.html. This should be edited for correct html syntax.
#echo "<br><a href=$1/index.html> Traffic on ports of Device $1 </a>" >> /var/www/html/mrtg/index.html
The question is that how can i put the line {Options[_]:unknaszero,bits,growright} because when i put this in the script i get the following error. please help in this regard.
Error:
can't resolve "Options[_]" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPGET Problem for public at Options[_]:growright,
at /usr/bin/cfgmaker line 657
--base: Vendor Id:
--base: Populating confcache
--snpo: Skipping ifName scanning because public at Options[_]:growright, does not s
eem to support it
--snpo: Skipping ifDescr scanning because public at Options[_]:growright, does not
seem to support it
--snpo: Skipping ipAdEntIfIndex scanning because public at Options[_]:growright, do
es not seem to support it
--snpo: Skipping ifType scanning because public at Options[_]:growright, does not s
eem to support it
--snpo: Skipping ifPhysAddress scanning because public at Options[_]:growright, doe
s not seem to support it
--base: Get Interface Info
--base: Walking ifIndex
Error:
can't resolve "Options[_]" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPWALK Problem for public at Options[_]:growright,
at /usr/bin/cfgmaker line 107
--base: Walking ifType
Error:
can't resolve "Options[_]" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPWALK Problem for public at Options[_]:growright,
at /usr/bin/cfgmaker line 107
--base: Walking ifSpeed
Error:
can't resolve "Options[_]" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPWALK Problem for public at Options[_]:growright,
at /usr/bin/cfgmaker line 107
--base: Walking ifAdminStatus
Error:
can't resolve "Options[_]" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPWALK Problem for public at Options[_]:growright,
at /usr/bin/cfgmaker line 107
--base: Walking ifOperStatus
Error:
can't resolve "Options[_]" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPWALK Problem for public at Options[_]:growright,
at /usr/bin/cfgmaker line 107
--base: Get Device Info on public at bits:
Error:
can't resolve "bits" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPGET Problem for public at bits:
at /usr/bin/cfgmaker line 657
--base: Vendor Id:
--base: Populating confcache
--snpo: Skipping ifName scanning because public at bits: does not seem to support i
t
--snpo: Skipping ifDescr scanning because public at bits: does not seem to support
it
--snpo: Skipping ipAdEntIfIndex scanning because public at bits: does not seem to s
upport it
--snpo: Skipping ifType scanning because public at bits: does not seem to support i
t
--snpo: Skipping ifPhysAddress scanning because public at bits: does not seem to su
pport it
--base: Get Interface Info
--base: Walking ifIndex
Error:
can't resolve "bits" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPWALK Problem for public at bits:
at /usr/bin/cfgmaker line 107
--base: Walking ifType
Error:
can't resolve "bits" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPWALK Problem for public at bits:
at /usr/bin/cfgmaker line 107
--base: Walking ifSpeed
Error:
can't resolve "bits" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPWALK Problem for public at bits:
at /usr/bin/cfgmaker line 107
--base: Walking ifAdminStatus
Error:
can't resolve "bits" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPWALK Problem for public at bits:
at /usr/bin/cfgmaker line 107
--base: Walking ifOperStatus
Error:
can't resolve "bits" to IP address
at /usr/bin/../lib/mrtg2/SNMP_util.pm line 392
SNMPWALK Problem for public at bits:
at /usr/bin/cfgmaker line 107
--base: Writing /etc/mrtg/0030ebbc026f.cfg
ERROR: Line 119 (--global) in CFG file (/etc/mrtg/0030ebbc026f.cfg) does not ma
ke sense
--
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