[mrtg] Fwd: apollo_uptime.html
Rodolfo J. Paiz
rpaiz at simpaticus.com
Sat Oct 18 08:46:10 MEST 2003
Leandro,
When I create the target in mrtg.cfg using these parameters (the minimum it
will accept):
### Interface 4 >> Get the uptime text for a separate file.
#
#Target[apollo_uptime]: 1:apollo-snmp at apollo.paiz.org:
#Suppress[apollo_uptime]: ymwd
#Title[apollo_uptime]:
#PageTop[apollo_uptime]:
#MaxBytes[apollo_uptime]: 10
then what I get is the complete webpage below:
>
>----------
>The statistics were last updated Friday, 17 October 2003 at 18:13,
>at which time 'apollo.paiz.org' had been up for 1 day, 7:27:05.
>
>----------
>
>GREEN ### Incoming Traffic in Bits per Second
>BLUE ### Outgoing Traffic in Bits per Second
>
>
>----------
>
><http://people.ee.ethz.ch/~oetiker/webtools/mrtg/>
>MRTG
> <http://people.ee.ethz.ch/~oetiker/webtools/mrtg/>
>[]
> <http://people.ee.ethz.ch/~oetiker/webtools/mrtg/>
>Multi Router Traffic Grapher
>
>version 2.9.17 <http://people.ee.ethz.ch/~oetiker/>Tobias Oetiker
><mailto:oetiker at ee.ethz.ch><oetiker at ee.ethz.ch>
>and <http://www.bungi.com/>Dave Rand <mailto:dlr at bungi.com><dlr at bungi.com>
Can you think of a way to eliminate this and keep just the text about the
update time and uptime?
I have found that the code to generate this is here in /usr/bin/mrtg:
[rpaiz at apollo rpaiz]$ grep -C 15 "statistics were last updated" /usr/bin/mrtg
print HTML <<"TEXT";
$$rcfg{'addhead'}{$router}
</HEAD>
$$rcfg{bodytag}{$router}
$$rcfg{'pagetop'}{$router}<BR>
<HR>
TEXT
if (defined $$rcfg{'timezone'}{$router}){
print HTML
&$LOC("The statistics were last updated <B>$Today
$$rcfg{'timezone'}{$router}</B>");
} else {
print HTML
&$LOC("The statistics were last updated <B>$Today</B>");
}
if ($uptime && ! $$rcfg{options}{noinfo}{$router}) {
print HTML
",<BR>\n".
&$LOC("at which time $namestring had been up for <B>$uptime</B>.").
"\n<!-- End Head -->";
}
Is there a way I can add a piece of simple code which will open (and
overwrite if it previously existed) $WORKDIR/apollo_uptime.html and just
add the statistics/uptime text, then close it? I am afraid my perl
abilities _were_ born yesterday, and I can barely understand pieces of this
let alone modify it.
--
Rodolfo J. Paiz
rpaiz at simpaticus.com
--
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