I _think_ this is where Jason is headed. I'd also like to be able to do something like the following:
test.cfg ======== host1=10.10.10.1; host2=10.10.10.2; PageTop[$host1]: Stats for $host1; PageTop[$host2]: Stats for $host2; However, the doc does not indicate a way to use local variables. Am I missing something? Thanks in advance. Dallas LaRose Senior Network Engineer S2 Systems, Inc. -----Original Message----- From: Jason Humes [mailto:[EMAIL PROTECTED] Sent: Thursday, March 06, 2003 3:34 PM To: '[EMAIL PROTECTED]' Subject: [mrtg] Re: Variables in cfg files 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[$]: [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] <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. 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 -- 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