in reply to Re: Grabing a Page and Need to Parse it..
in thread Grabing a Page and Need to Parse it..

I found it...
$traffictotals =~ s/<!-- Begin MRTG Block -->(.*?)<!-- End MRTG Block + -->//s;
Works great :)

Replies are listed 'Best First'.
Re: (3) Grab Page and Parse it... (UCD-SNMP or Net::Snmp instead of parsing MRTG)
by ybiC (Prior) on May 07, 2001 at 23:39 UTC
    Looks like you're parsing output from Multi Router Traffic Grapher, a neat SNMP tool that fetches bandwidth utilization info and generates HTML pages from those stats.

    Instead of parsing it's HTML output back into text, you might consider using UCD SNMP to query the device(s) directly.   UCD-SNMP includes snmpwalk and other command-line tools that are pretty slick.

    For a more perlish solution, Net::Snmp would also do the trick.   "(code) mind your snmPs & Qs" shows yet another perlish approach, this time using CPAN module SNMP to query devices for info.

    There are any number of possible reasons why these wouldn't work in your situation, but they seem worth mentioning.
        cheers,
        Don
        striving toward Perl Adept
        (it's pronounced "why-bick")