What I'm actually trying to do use utilize the template option of cfgmaker. One of the parameters that you can use with cfgmaker is host-template and if-template, these point to files that have config params that you would see in the .cfg file. Cfgmaker imports those and uses that as the template for creating the .cfg for the respective hosts. Here is a copy of my host-template file:
# # Memory Usage # my $target_name = $router_name . ".memory"; $target_lines .= <<ECHO; #Target[$target_name]: 1.3.6.1.4.1.311.1.1.3.1.1.1.3.0&1.3.6.1.2.1.25.2.2.0:$router_connect PageTop[$target_name]: <table width="600" align="center" bgcolor="black" cellspacing=1 cellpadding=0> <tr><td> <table bgcolor="white" align="center" width="100%" cellspacing=0 cellpadding=0> <tr><td bgcolor="navy" align="center" style="color: gold; font-family: Verdana, Arial; font-size: 18pt; font-weight: bold; border-bottom: thin solid Black;"> Server CPU load </tr></td><tr><td> <TABLE width="100%" align="left" style="color: black; font-family: Verdana, Arial; font-size: 10pt; font-weight: bold; border-bottom: thin solid Black;"> <TR><TD>System:</TD><TD>$router_name in $html_syslocation</TD></TR> <TR><TD>Maintainer:</TD><TD>$html_syscontact</TD></TR> <TR><TD>Description:</TD><TD>Memory Usage</TD></TR> <TR><TD>Resource:</TD><TD>CPU.</TD></TR> </TABLE> PageFoot[$target_name]: </td></tr></table></td></tr></table> #SetEnv[$target_name]: MRTG_INT_DESCR="$target_name" Unscaled[$target_name]: dwmy Background[$target_name]: #c0c0c0 MaxBytes[$target_name]: 1048048000 kMG[$target_name]: ,,M,, Options[$target_name]: gauge, absolute, unknaszero YLegend[$target_name]: Memory in Use ShortLegend[$target_name]: WithPeak[$target_name]: wmy Colours[$target_name]: GREEN#00eb0c,BLUE#0000ff,GRAY#AAAAAA,VIOLET#ff00ff Legend1[$target_name]: Allocated Memory in Use Legend2[$target_name]: . Legend3[$target_name]: . Legend4[$target_name]: Peak Allocated Memory in Use LegendI[$target_name]: Mem LegendO[$target_name]: Mem Title[$target_name]: $router_name As you can see I have to enter a number for the MaxBytes. So every machine is going to base its usage off of 1GB or RAM even though some servers have more. My question is how can I vary that number using the cfgmaker templates option? I know I could write a script that could modify the .cfg files after the creation but I thought for sure that mrtg would have run into this problem and would have a solution... Britt Tabor I.T. Infrastructure Engineer -----Original Message----- From: DANIEL MAGNUSZEWSKI [mailto:[EMAIL PROTECTED] Sent: Tuesday, July 06, 2004 11:20 AM To: [EMAIL PROTECTED]; [EMAIL PROTECTED] Subject: [mrtg] Re: MaxBytes changing??? Britt, I'm not sure if I'm understanding you correctly, but it seems to me that you are looking for a way to make SNMP queries from your html? If so, you should check out this Perl module: http://search.cpan.org/~rigbyc/Apache-WebSNMP-0.11/lib/Apache/WebSNMP.pm Otherwise, I'd say to write a script that used SNMP to gather the data and have the script create the output using a template and filling in the variables. That way you can run the script against a few different hosts and have it create output custom for each host's SNMP info. Hopefully this is what you're looking for. Daniel Magnuszewski CCNA M & T Bank [EMAIL PROTECTED] >>> "Britt Tabor" <[EMAIL PROTECTED]> 7/6/2004 10:35:34 AM >>> I am trying to use templates to make some html changes on my pages. That all works great no problems but I am running into a small problem with MaxBytes. I am monitoring memory usage on some servers and the RAM size is different in each one. MaxBytes in the template file has to be a number it can't be a reference to an OID or at least it gives me an error when I try. So how can I vary MaxBytes or define it or better yet reference the OID on each server and use that? Britt Tabor I.T. Infrastructure Engineer -- 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 -- 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
