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[$]: [EMAIL PROTECTED]

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:[EMAIL PROTECTED] 
Sent: Thursday, March 06, 2003 1:39 PM
To: '[EMAIL PROTECTED]'
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.


$host=192.168.1.10
Target[$host]: [EMAIL PROTECTED]:::::2

Jason D. Humes

Applied Computer Solutions
3020 St. Etienne Blvd.
Windsor, Ont.
Phone : (519) 944-4300
Fax     : (519) 944-4247
Email : [EMAIL PROTECTED]



--
Unsubscribe mailto:[EMAIL PROTECTED]
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


Confidentiality Notice: This e-mail message, including any attachments, is 
for the sole use of the intended recipient(s) and may contain confidential 
and privileged information.  Any unauthorized review, use, disclosure or 
distribution is prohibited.  If you are not the intended recipient, please 
contact the sender by reply e-mail and destroy all copies of the original 
message.


--
Unsubscribe mailto:[EMAIL PROTECTED]
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

Reply via email to