[mrtg] MRTG for specific Interfaces on Cisco Device
Thiel, Mark
MThiel at Limitedbrands.com
Thu Jun 4 16:40:55 CEST 2009
One more question if I may... Can I apply different filters to different devices like:
I want gi5/1 & gi5/2 for device 10.128.128.1
and gi6/3 & gi7/4 for device 10.0.0.164
cfgmaker --global "WorkDir: /www/mrtg" \
--global "Options[_]: growright,bits" \
--ifref=descr \
--ifdesc=alias \
--community=xxxxxxxx \
--if-template=/usr/bin/filtertemplate.cfg \
--if-filter='($if_snmp_descr =~ "GigabitEthernet5/1") or ($if_snmp_descr =~ "GigabitEthernet5/2")' \
10.128.128.1 \
--if-filter='($if_snmp_descr =~ "GigabitEthernet6/3") or ($if_snmp_descr =~ "GigabitEthernet7/4")' \
10.0.0.164 \
--output=/www/mrtg/test.cfg
Mark Thiel
-----Original Message-----
From: mrtg-bounces at lists.oetiker.ch [mailto:mrtg-bounces at lists.oetiker.ch] On Behalf Of Thiel, Mark
Sent: Thursday, June 04, 2009 10:30 AM
To: 'McDonald, Dan'; mrtg at lists.oetiker.ch
Cc: mrtg at lists.oetiker.ch
Subject: Re: [mrtg] MRTG for specific Interfaces on Cisco Device
Thanks Dan. Works Beautifully...
Mark Thiel
-----Original Message-----
From: mrtg-bounces at lists.oetiker.ch [mailto:mrtg-bounces at lists.oetiker.ch] On Behalf Of McDonald, Dan
Sent: Thursday, June 04, 2009 10:21 AM
To: mrtg at lists.oetiker.ch
Cc: mrtg at lists.oetiker.ch
Subject: Re: [mrtg] MRTG for specific Interfaces on Cisco Device
On Thu, 2009-06-04 at 10:04 -0400, Thiel, Mark wrote:
> Thanks Dan.
>
> I am trying the following and receiving an if-filter error... Any ideas...??? Sorry for so many questions...
Doesn't it need quotes? Otherwise, you are trying to divide the undefined function GigabitEthernet5 by 1...
Isn't == a numeric comparison in perl?
remember, filters are just snippets of perl code that get spliced into cfgmaker.
maybe something like:
--if-filter='($if_snmp_descr =~ m#5/[12]$#)'
>
> netsrvtool:/usr/bin # cfgmaker --global "WorkDir: /www/mrtg" \
> > --global "Options[_]: growright,bits" \
> > --ifref=descr \
> > --ifdesc=alias \
> > --community=get-info \
> > --if-filter='($if_snmp_descr==GigabitEthernet5/1)' \
> > 10.128.128.1 \
> > --output=/www/mrtg/test.cfg
>
> ERROR: with if-filter ($if_snmp_descr==GigabitEthernet5/1): Bareword "GigabitEthernet5" not allowed while "strict subs" in use at (eval 796) line 1.
> netsrvtool:/usr/bin #
>
> Mark Thiel
>
> -----Original Message-----
> From: mrtg-bounces at lists.oetiker.ch
> [mailto:mrtg-bounces at lists.oetiker.ch] On Behalf Of McDonald, Dan
> Sent: Thursday, June 04, 2009 9:51 AM
> To: mrtg at lists.oetiker.ch
> Subject: Re: [mrtg] MRTG for specific Interfaces on Cisco Device
>
> On Thu, 2009-06-04 at 09:41 -0400, Thiel, Mark wrote:
> > Thanks Dan.
> >
> > I have been looking over that in detail and am unable to find a variable for a specific name of an interface.
>
> either $if_snmp_name or $if_snmp_alias.
>
> >
> > I can see that:
> >
> > '--if-filter=$if_type=6'
> >
> > would grab ethernet interfaces, but I only need 2 of them from a particular switch.
> >
> > Is there a variable (possibly not documented), where I could do something like this:
>
> All variables available in templates can also be used in filters.
>
> --
> Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX
> www.austinenergy.com
>
> Notice: This communication may contain privileged and/or confidential information. If you are not the intended recipient, please notify the sender by email, and immediately delete the message and any attachments without copying or disclosing them. LBI may, for any reason, intercept, access, use, and disclose any information that is communicated by or through, or which is stored on, its networks, applications, services, and devices.
--
Daniel J McDonald, CCIE # 2495, CISSP # 78281, CNX www.austinenergy.com
Notice: This communication may contain privileged and/or confidential information. If you are not the intended recipient, please notify the sender by email, and immediately delete the message and any attachments without copying or disclosing them. LBI may, for any reason, intercept, access, use, and disclose any information that is communicated by or through, or which is stored on, its networks, applications, services, and devices.
_______________________________________________
mrtg mailing list
mrtg at lists.oetiker.ch
https://lists.oetiker.ch/cgi-bin/listinfo/mrtg
Notice: This communication may contain privileged and/or confidential information. If you are not the intended recipient, please notify the sender by email, and immediately delete the message and any attachments without copying or disclosing them. LBI may, for any reason, intercept, access, use, and disclose any information that is communicated by or through, or which is stored on, its networks, applications, services, and devices.
More information about the mrtg
mailing list