[mrtg] Re: Generating Broadcast graphs for all interfaces

Michael Grice grice at binc.net
Mon May 17 16:39:12 MEST 2004


* Andrew Werbowy <Andrew_Werbowy at cbc.ca> [040517 08:30] wrote:
> Hi All,
>  
> I want to generate broadcast stats on my catalysts switches
> and I was wondering if anybody did something already like this.
>  
> Well here is what I am using and gettingthe error in executing the
> script:
>  /usr/local/mrtg-2/bin/cfgmaker --host-template=broadcast.template
> public at 10.10.10.10
>  
>  
> "Global symbol "$if_ok" requires explicit package name at (eval 4) line
> 27, <IF_TEMPLATE> line 68.
> Global symbol "$target_name" requires explicit package name at (eval 4)
> line 29, <IF_TEMPLATE> line 68.
> "
> And here is the script,  ohh and I do not know Perl:

Can I recommend Schwartz and Phoenix's Learning Perl? :)

Basically, the  big issue here is that neither the $if_ok or
$target_name variables are available when running this template as a
host template. I was about to tell you to run it as an interface
template, until I noticed that you don't get one response per interface
for this variable (at least on my Cisco's).

So drop this line:

> if ($if_ok) {

The variable $router_name should be available when this is run as a host
template. Change the following to something like:

my $target_name = $router_name . ".drop";

> my $target_name = $target_name . ".drop";
> my $directory_name = $directory_name . "";
>  
> $head_lines .= <<ECHO;
> #  Input Queue drops  for $target_name
> #---------------------------------------------------------------------
> ECHO
> $target_lines .= <<ECHO;
>  
> #
> -----------------------------------------------------------------------
> # Inbound / Outbound Unicast Packet Count

Do the next two lines appear as one line in the template? They should be
one (but it might be a mail client issue). Also, you might want to use
$router_connect instead--you need the SNMP community string in the
Target line. (And I'm not sure if that space should be there, either).

> Target[$target_name]:
> 1.3.6.1.2.1.31.1.1.1.3.0&1.3.6.1.2.1.31.1.1.1.5.0: $router_name:::::2

[Deletions...]

Finally, drop the '}' at the end, since you've dropped the corresponding
'{' at the top.
--Michael

--
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