[mrtg] Re: --no-down
Perry, Duane
PerryD at missouri.edu
Fri Feb 1 16:04:00 MET 2002
This is similar to a one line perl command I use a great deal in
manipulating my MRTG config files. This command will find and replace
strings in as many files as you want. Of course this power can do
horribly destructive things as well as good things, be careful. The
-i.bak creates a backup of the original file in case you mess up.
Perl -e 's/string to match/replacement or blank/gi' -p -i.bak
filename.ext
Duane Perry
University of Missouri
-----Original Message-----
From: David Gabler [mailto:dgabler at TRUELINK.com]
Sent: Thursday, January 31, 2002 5:44 PM
To: 'Leonard Miller'; mrtg at list.ee.ethz.ch
Subject: [mrtg] Re: --no-down
You can also do a simple command to remove the #'s from the files.
e.g. EXAMPLE ONLY DONT USE WITH OUT TESTING FIRST NOT SURE IF EVEN
LOGICALLY
CORRECT
perl -pi -e 's/^#([A-Z].+\[.+\]:.+)/$1/' `ls -1 *.config`
I dont know if this darned thing works but it is just an example.... of
living with what you get and making the best of the circumstances.
or better known as when life gives you lemons make lemonade.
David
> -----Original Message-----
> From: Leonard Miller [mailto:Leonard_Miller at udlp.com]
> Sent: Thursday, January 31, 2002 6:20 AM
> To: mrtg at list.ee.ethz.ch
> Subject: [mrtg] --no-down
>
>
> <snip>
> I don't want to have to go into each config file and manually remove
> the #'s. I want this to monitor
> the interfaces even if nothing is connected so that when something is
> connected or disconnected,
> <snip>
> Thanks
>
> Leonard W. Miller, CCNA
>
--
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