[mrtg] Re: cfgmaker
Perry, Duane
PerryD at missouri.edu
Tue Aug 28 17:10:35 MEST 2001
I have done massive editing in the past and have learned slowly how to
automate things. I am using Linux so Perl and shell scripts are how I do
most of this stuff. The "--show-op-down" option works to keep the
administratively-up but operationally-down lines from being left out. I
edited the cfgmaker script to remove some things I did not need. I assure
you my scripting skills are minimal, none of this is too tough. A shell
script is just a file with a list of commands in the order you want them.
Shell script example:
/usr/bin/cfgmaker --show-op-down $1@$2 > $3.cfg
grep -v ^# $3.cfg > $3x.cfg
mv $3x.cfg $3.cfg -f
Put those three lines in a file called myconfig.sh for this example.
Enter: chmod 755 myconfig.sh to make it executable,
Then enter: ./myconfig.sh public 128.206.99.100 router1
This will create a file called router1.cfg. You will have to adjust the path
to your cfgmaker and insert your own community name, ip and name. This
example uses the --show-op-down and the grep solution, only one would be
needed but you can add other commands to fine tune the resulting file. The
if-filter option sounds good to me too but I have not had any success with
it yet.
Duane Perry - University of Missouri
-----Original Message-----
From: Daniel R . Kilbourne [mailto:drk at voyager.net]
Sent: Tuesday, August 28, 2001 8:36 AM
To: James Overbeck
Cc: mrtg at list.ee.ethz.ch
Subject: [mrtg] Re: cfgmaker
yeah...that would work
but, I am looking for automation - I would like the lines to be left out
upoin initial creation of the file
I think I will investigate the 'if-filter' option
James Overbeck extolled:
>
> I think I follow... You don't even want the commented-out
interfaces,
> correct?
> Quick and dirty solution is a simple grep that leaves out all
commented
> lines, even the possibly useful ones. But it does make the file smaller.
>
> grep -v ^# mrtg.cfg > new-mrtg.cfg
>
> HTH,
> James
--
--------------------------------
Daniel R. Kilbourne
daniel.kilbourne at corecomm.com
CoreComm Systems Engineering
________________________________
--
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