[mrtg] Re: script to run MRTG

Zeeshan Ahmed zeeshan at worldcall.net.pk
Wed Oct 2 18:27:19 MEST 2002


I am using the fowwlowing script to make the MRTG grpahs for cabl emodes now
and it has make my work very easy, but if i add the

"Options[_]: growright, bits" in the following script with --global
Options[_]: growright, bits

it goes at the end of the file. How i can make it at the start of the file

())))))))))))))))))))))))(((((((((((((((((((((((((((((((((((((((((((((((((((
(((((((((((((((((((((((((((((((((((((((((((((

#!/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
 )))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))
))))))))))))))))))))))))))))))))))))))))))



Regards

Zeshan Ahmed

----- Original Message -----
From: "David Raistrick" <keen at wow.atlasta.net>
To: "Zeeshan Ahmed" <zeeshan at worldcall.net.pk>
Cc: "Bishop, Dean" <dean.bishop at tcdsb.org>; <mrtg at list.ee.ethz.ch>
Sent: Wednesday, October 02, 2002 7:44 PM
Subject: [mrtg] Re: script to run MRTG


>
> On Wed, 2 Oct 2002, Zeeshan Ahmed wrote:
>
> >
> > yeah i did try this but there is one interesting thing that if i use
> > "Options[_]: unknaszero, bits, growright" this oprtions in this script
this
> > get puts at the end of the cfg file, but it down not effect the graphs
to
> > grow from right. and bits.
>
> "get puts at the end of the cfg file"
>
> You should put this option further up in your config file. If you want to
> to apply to the entire file, put it near the top.  If you only want it to
> take effect at some point further in the file (for only one graph in the
> file, not all of them, for instance), place it before the definitions
> you'd like it to affect.
>
>
>
> --
>         David Raistrick
> keen at atlasta.net http://www.expita.com/nomime.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
>
>
>


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