[mrtg] Re: Variables in cfg files

Jason Humes jhumes at acs.on.ca
Thu Mar 6 22:34:28 MET 2003


Ummm, I'm very sorry...I still don't fully understand.  I read part of the
manual which talks about preappend and append, but I don't understand.
Please help clairfy.  Thanks.



-----Original Message-----
You can use the prepend and append functions to accomplish something like
this.

For example, I have this line in my global config which is included in every
individual device config:

NoSpaceChar: ~

I use the following at the top of a lot of my config files for individual
devices:

Target[$]: community at host~

Then I'll have a target like:

Target[PERC1]:
.1.3.6.1.4.1.232.11.2.4.1.1.5.2&.1.3.6.1.4.1.232.11.2.4.1.1.5.3:

If the community name or the host name or address changes, I make the change
in one place. To make a copy of a config for a new device, I change this
line, maybe a directory line, and I'm done.

If you do this, be sure to have a line like this at the end when you use the
variable so it doesn't get added to other targets. This is especially
important if you are using include files:

Target[$]:

I actually use a few additional "variables" like this in many of my configs.
For example,

Title[$]: HOSTNAME
PageTop[^]: <H1>
PageTop[$]: HOSTNAME</H1>

Then for an individual target, I have something like:

Title[PERC1]: Disk Space Percent Used for M: and T: on
PageTop[PERC1]: Disk Space Percent Used for M: and T: on

Again, if you use this, clear out the variables when you done using them.

Target[^]:
Target[$]:
Title[^]:
Title[$]:
PageTop[^]:
PageTop[$]:

Hope this helps.

Jerry

-----Original Message-----
From: Jason Humes [mailto:jhumes at acs.on.ca <mailto:jhumes at acs.on.ca> ] 
Sent: Thursday, March 06, 2003 1:39 PM
To: 'mrtg at list.ee.ethz.ch'
Subject: [mrtg] Variables in cfg files


Is it possible to define variables/constants within the cfg file?  For
example, say that wherever in the cfg file you see the variable/constant
$host, use the predefined value given to that variable/constant.  

Any ideas???  Thanks very much.

Jason D. Humes

Applied Computer Solutions
3020 St. Etienne Blvd.
Windsor, Ont.
Phone : (519) 944-4300
Fax     : (519) 944-4247
Email : jhumes at acs.on.ca



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