MRTG setup for WISP network elements.
All examples use "public" as placeholder for corresponding SMNP community string.
# RRD data archiver #55 23 * * * /usr/local/bin/rrd-archive.pl >/dev/null 2>&1 # MRTG data collection routines */5 * * * * /usr/bin/perl /usr/local/mrtg-2/bin/mrtg /Library/WebServer/mrtg/cfg/wisp.cfg --logging /var/log/mrtg.log >/dev/null 2>&1
############################################################################### # System: NMS # Description: WISP Broadband MRTG master config file # Contact: Nigel Bruin # Location: ############################################################################### ############################################################################### # # Global Defaults # HtmlDir: /Library/WebServer/mrtg/logs ImageDir: /Library/WebServer/mrtg/images IconDir: /mrtg/images/ LogDir: /Library/WebServer/mrtg/logs LogFormat: rrdtool RRDRowCount[_]: 5000 PathAdd: /usr/local/rrdtool-1.2.12/bin/ ConversionCode: /usr/local/mrtg-2/bin/MyConversions.pl #timeout => $default_timeout, #retries => $default_retries, #backoff => $default_backoff, #default_max_repetitions => $max_repetitions, #use_16bit_request_ids => 1, #lenient_source_port_matching => 0, #lenient_source_address_matching => 1 SnmpOptions: timeout => 2, retries => 1 Options[_]: bits, growright Kilo[_]: 1024 XSize[_]: 600 NoMib2: Yes #SingleRequest: Yes Include: Cisco.cfg Include: Cyclone.cfg Include: Baystack.cfg Include: Gemini.cfg Include: Trango.cfg Include: WRN1WRM2.cfg Include: AP-WRN1.cfg Include: AP-WRN2.cfg Include: AP-WRM1.cfg Include: AP-WRM2.cfg Include: AP-ICK1.cfg Include: AP-ICK2.cfg Include: NMS.cfg Include: UPS1.cfg Include: UPS2.cfg Include: UPS3.cfg Include: UPS4.cfg Include: UPS5.cfg Include: SB.cfg # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#########################################################################
#
# WISP mrtg SNMP conversions routines
#
# Nigel Bruin, 2006
#
#########################################################################
#
# Convert APC UPS RunTime (Timeticks) to INTEGER in minutes
#
# Input string is of the form "1:02:00.00" or "1:02:00"
# i.e. hh:mm:ss.nn
#
sub Runtime2Int {
my $value = shift;
if (defined($value))
{
$value =~ s/(\d*):(\d*):\d*.\d*/int(($1 * 60)+$2)/e;
$value =~ s/(\d*):(\d*):\d*/int(($1 * 60)+$2)/e;
};
return $value;
}
#########################################################################
#
# Scale Trango RSSI (add 100)
#
# Trango returns powers as negative dBm in teh range -99 to -40 or so.
# Add 100 to shift scale into the positive.
#
sub TrangoScaleRSSI {
my $value = shift;
if (defined($value)) { $value += 100 };
return $value;
}
#########################################################################
#
# Scale APC UPS voltage (subtract 180)
#
sub APCscaleVolts {
my $value = shift;
if (defined($value)) { $value -= 180 };
return $value;
}
#########################################################################
#
# Scale APC UPS frequency (subtract 45)
#
sub APCscaleHertz {
my $value = shift;
if (defined($value)) { $value -= 45 };
return $value;
}
#########################################################################
#
# Scale APC UPS Output load (percentage -> Watts) for 1000kVA rating
#
sub APCscaleLoad1000 {
my $value = shift;
if (defined($value)) { $value *= 10 };
return $value;
}
#########################################################################
#
# Scale APC UPS Output load (percentage -> Watts) for 1400kVA rating
#
sub APCscaleLoad1400 {
my $value = shift;
if (defined($value)) { $value *= 14 };
return $value;
}
#########################################################################
Setup is straight-forward, e.g. key changes in routers2.conf:
dbpath = /Library/WebServer/mrtg/logs graphpath = /Library/WebServer/mrtg/stats graphurl = /mrtg/stats confpath = /Library/WebServer/mrtg/cfg cfgfiles = *.cfg iconurl = /mrtg/rrdicons/ defaulttarget = interface graphstyle = big usebigk = no sorder = t n n2 l l2 x x2 archive = yes showfindbox = yes
############################################################################################ # # APC UPS # Directory[_]: Directory[_]: ups # ############################################################################################ # apc.products.hardware.ups.upsInput.upsAdvInput.upsAdvInputLineVoltage # apc.products.hardware.ups.upsOutput.upsAdvOutput.upsAdvOutputVoltage Target[UPS-InOutV]: .1.3.6.1.4.1.318.1.1.1.3.2.1.0&.1.3.6.1.4.1.318.1.1.1.4.2.1.0:public@10.0.0.42|APCscaleVolts Directory[UPS-InOutV]: ups Options[UPS-InOutV]: growright,gauge,nopercent Unscaled[UPS-InOutV]: ymwd MaxBytes[UPS-InOutV]: 100 Title[UPS-InOutV]: 180V - 280V YSize[UPS-InOutV]: 200 YTics[UPS-InOutV]: 10 ShortLegend[UPS-InOutV]: V YLegend[UPS-InOutV]: Input & Output: 180V - 280V LegendI[UPS-InOutV]: Input LegendO[UPS-InOutV]: Output PageTop[UPS-InOutV]: <H1>UPS: Input & Output Voltages (V)</H1> # apc.products.hardware.ups.upsBattery.upsAdvBattery.upsAdvBatteryCapacity Target[UPS-BCap]: .1.3.6.1.4.1.318.1.1.1.2.2.1.0&.1.3.6.1.4.1.318.1.1.1.2.2.1.0:public@10.0.0.42 Directory[UPS-BCap]: ups Options[UPS-BCap]: growright,gauge,nopercent Unscaled[UPS-BCap]: ymwd MaxBytes[UPS-BCap]: 100 Title[UPS-BCap]: Battery (%) ShortLegend[UPS-BCap]: % YLegend[UPS-BCap]: Battery (%) LegendI[UPS-BCap]: Charge LegendO[UPS-BCap]: PageTop[UPS-BCap]: <H1>UPS: Battery Capacity (%)</H1> # apc.products.hardware.ups.upsBattery.upsAdvBattery.upsAdvBatteryRunTimeRemaining Target[UPS-RTime]: .1.3.6.1.4.1.318.1.1.1.2.2.3.0&.1.3.6.1.4.1.318.1.1.1.2.2.3.0:public@10.0.0.42|Runtime2Int Directory[UPS-RTime]: ups Options[UPS-RTime]: growright,gauge,nopercent Unscaled[UPS-RTime]: ymwd MaxBytes[UPS-RTime]: 300 Title[UPS-RTime]: Runtime (mins) YSize[UPS-RTime]: 150 ShortLegend[UPS-RTime]: Mins YTics[UPS-RTime]: 4 YLegend[UPS-RTime]: Batt. Runtime (Mins) LegendI[UPS-RTime]: Runtime LegendO[UPS-RTime]: PageTop[UPS-RTime]: <H1>UPS: Predicted Battery Runtime (Mins): C2610, Cyclone, Gemini</H1> # apc.products.hardware.ups.upsBattery.upsAdvBattery.upsAdvBatteryTemperature Target[UPS-BTemp]: .1.3.6.1.4.1.318.1.1.1.2.2.2.0&.1.3.6.1.4.1.318.1.1.1.2.2.2.0:public@10.0.0.42 Directory[UPS-BTemp]: ups Options[UPS-BTemp]: growright,gauge,nopercent Unscaled[UPS-BTemp]: ymwd MaxBytes[UPS-BTemp]: 50 AbsMax[UPS-BTemp]: 100 Title[UPS-BTemp]: TempM(deg C) ShortLegend[UPS-BTemp]: Deg C WithPeak[UPS-BTemp]: ymwd YTics[UPS-BTemp]: 5 YLegend[UPS-BTemp]: Temp (deg C) LegendI[UPS-BTemp]: Battery Temp LegendO[UPS-BTemp]: PageTop[UPS-BTemp]: <H1>UPS: Battery Temperature (Deg C)</H1> # apc.products.hardware.ups.upsConfig.upsAdvConfig.upsAdvConfigLowTransferVolt # apc.products.hardware.ups.upsInput.upsAdvInput.upsAdvInputLineVoltage Target[UPS-InputV]: .1.3.6.1.4.1.318.1.1.1.5.2.3.0&.1.3.6.1.4.1.318.1.1.1.3.2.1.0:public@10.0.0.42|APCscaleVolts Directory[UPS-InputV]: ups Options[UPS-InputV]: growright,gauge,nopercent Unscaled[UPS-InputV]: ymwd MaxBytes[UPS-InputV]: 100 Title[UPS-InputV]: 180V - 280V ShortLegend[UPS-InputV]: Volts YLegend[UPS-InputV]: 180V - 280V LegendI[UPS-InputV]: Treshold LegendO[UPS-InputV]: Input PageTop[UPS-InputV]: <H1>UPS: Mains Input Voltage & Threshold (V)</H1> # apc.products.hardware.ups.upsInput.upsAdvInput.upsAdvInputMinLineVoltage # apc.products.hardware.ups.upsInput.upsAdvInput.upsAdvInputMaxLineVoltage Target[UPS-InputMMV]: .1.3.6.1.4.1.318.1.1.1.3.2.3.0&.1.3.6.1.4.1.318.1.1.1.3.2.2.0:public@10.0.0.42|APCscaleVolts Directory[UPS-InputMMV]: ups Options[UPS-InputMMV]: growright,gauge,nopercent Unscaled[UPS-InputMMV]: ymwd MaxBytes[UPS-InputMMV]: 100 Title[UPS-InputMMV]: 180V - 280V YSize[UPS-InputMMV]: 200 YTics[UPS-InputMMV]: 10 ShortLegend[UPS-InputMMV]: Volts YLegend[UPS-InputMMV]: MIn & Max: 180V - 280V LegendI[UPS-InputMMV]: Min Input LegendO[UPS-InputMMV]: Max Input PageTop[UPS-InputMMV]: <H1>UPS: Mains Input Min & Max Voltage (V)</H1> # apc.products.hardware.ups.upsInput.upsAdvInput.upsAdvInputFrequency Target[UPS-InputHz]: .1.3.6.1.4.1.318.1.1.1.3.2.4.0&.1.3.6.1.4.1.318.1.1.1.3.2.4.0:public@10.0.0.42|APCscaleHertz Directory[UPS-InputHz]: ups Options[UPS-InputHz]: growright,gauge,nopercent Unscaled[UPS-InputHz]: ymwd MaxBytes[UPS-InputHz]: 10 Title[UPS-InputHz]: 45Hz - 55Hz ShortLegend[UPS-InputHz]: Hertz YTics[UPS-InputHz]: 10 YLegend[UPS-InputHz]: 45Hz - 55Hz LegendI[UPS-InputHz]: Input Freq LegendO[UPS-InputHz]: PageTop[UPS-InputHz]: <H1>UPS: Mains Input Freq (Hz)</H1> # apc.products.hardware.ups.upsConfig.upsAdvConfig.upsAdvConfigRatedOutputVoltage # apc.products.hardware.ups.upsOutput.upsAdvOutput.upsAdvOutputVoltage Target[UPS-OutputV]: .1.3.6.1.4.1.318.1.1.1.5.2.1.0&.1.3.6.1.4.1.318.1.1.1.4.2.1.0:public@10.0.0.42|APCscaleVolts Directory[UPS-OutputV]: ups Options[UPS-OutputV]: growright,gauge,nopercent Unscaled[UPS-OutputV]: ymwd MaxBytes[UPS-OutputV]: 100 Title[UPS-OutputV]: 180V - 280V ShortLegend[UPS-OutputV]: Volts YLegend[UPS-OutputV]: 180V - 280V LegendI[UPS-OutputV]: Rating LegendO[UPS-OutputV]: Output PageTop[UPS-OutputV]: <H1>UPS: Rated & Actual Output Voltage (V)</H1> # apc.products.hardware.ups.upsOutput.upsAdvOutput.upsAdvOutputLoad # Expressed as percentage of unit capacity. Assume 1KVA unit hence x10 for watts. Target[UPS-OutputW]: .1.3.6.1.4.1.318.1.1.1.4.2.3.0&.1.3.6.1.4.1.318.1.1.1.4.2.3.0:public@10.0.0.42|APCscaleLoad1000 Directory[UPS-OutputW]: ups Options[UPS-OutputW]: growright,gauge,nopercent Unscaled[UPS-OutputW]: ymwd MaxBytes[UPS-OutputW]: 1000 WithPeak[UPS-OutputW]: ymwd Title[UPS-OutputW]: Watts YSize[UPS-OutputW]: 200 ShortLegend[UPS-OutputW]: Watts YTics[UPS-OutputW]: 10 YLegend[UPS-OutputW]: Load (Watts) LegendI[UPS-OutputW]: Load LegendO[UPS-OutputW]: PageTop[UPS-OutputW]: <H1>UPS: Output Load (W)</H1> ############################################################################################
############################################################################### # # Avaya Access Point # Directory[_]: Directory[_]: ap # ############################################################################### Target[AP-Eth]: ifInOctets.1&ifOutOctets.1:public@10.0.0.13 Options[AP-Eth]: growright, noinfo, nopercent Title[AP-Eth]: Traffic Analysis (Ethernet) MaxBytes[AP-Eth]: 1600000 XSize[AP-Eth]: 600 YLegend[AP-Eth]: Bytes (in, out) PageTop[AP-Eth]: <H1>Traffic: AP-Ethernet</H1> Target[AP-WireA]: ifInOctets.3&ifOutOctets.3:public@10.0.0.13 Options[AP-WireA]: growright, noinfo, nopercent Title[AP-WireA]: Traffic Analysis (Wireless-A) MaxBytes[AP-WireA]: 1600000 XSize[AP-WireA]: 600 YLegend[AP-WireA]: Bytes (in, out) PageTop[AP-WireA]: <H1>Traffic: AP-Wireless-A</H1> Target[AP-WireB]: ifInOctets.4&ifOutOctets.4:public@10.0.0.13 Options[AP-WireB]: growright, noinfo, nopercent Title[AP-WireB]: Traffic Analysis (Wireless-B) MaxBytes[AP-WireB]: 1600000 XSize[AP-WireB]: 600 YLegend[AP-WireB]: Bytes (in, out) PageTop[AP-WireB]: <H1>Traffic: AP-Wireless-B</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
############################################################################### # # BayStack Intelligent 24port Ethernet Switch # Directory[_]: Directory[_]: baystack # ############################################################################### Target[Baystack-P1]: ifInOctets.1&ifOutOctets.1:public@10.0.0.3 Title[Baystack-P1]: Traffic: Baystack Port 1 MaxBytes[Baystack-P1]: 16000000 XSize[Baystack-P1]: 600 YLegend[Baystack-P1]: Bytes (in, out) PageTop[Baystack-P1]: <H1>Traffic: Baystack Port 1</H1> Target[Baystack-P2]: ifInOctets.2&ifOutOctets.2:public@10.0.0.3 Title[Baystack-P2]: Traffic: Baystack Port 2 MaxBytes[Baystack-P2]: 16000000 XSize[Baystack-P2]: 600 YLegend[Baystack-P2]: Bytes (in, out) PageTop[Baystack-P2]: <H1>Traffic: Baystack Port 2</H1> Target[Baystack-P3]: ifInOctets.3&ifOutOctets.3:public@10.0.0.3 Title[Baystack-P3]: Traffic: Baystack Port 3 MaxBytes[Baystack-P3]: 16000000 XSize[Baystack-P3]: 600 YLegend[Baystack-P3]: Bytes (in, out) PageTop[Baystack-P3]: <H1>Traffic: Baystack Port 3</H1> Target[Baystack-P4]: ifInOctets.4&ifOutOctets.4:public@10.0.0.3 Title[Baystack-P4]: Traffic: Baystack Port 4 MaxBytes[Baystack-P4]: 16000000 XSize[Baystack-P4]: 600 YLegend[Baystack-P4]: Bytes (in, out) PageTop[Baystack-P4]: <H1>Traffic: Baystack Port 4</H1> Target[Baystack-P5]: ifInOctets.5&ifOutOctets.5:public@10.0.0.3 Title[Baystack-P5]: Traffic: Baystack Port 5 MaxBytes[Baystack-P5]: 16000000 XSize[Baystack-P5]: 600 YLegend[Baystack-P5]: Bytes (in, out) PageTop[Baystack-P5]: <H1>Traffic: Baystack Port 5</H1> Target[Baystack-P6]: ifInOctets.6&ifOutOctets.6:public@10.0.0.3 Title[Baystack-P6]: Traffic: Baystack Port 6 MaxBytes[Baystack-P6]: 16000000 XSize[Baystack-P6]: 600 YLegend[Baystack-P6]: Bytes (in, out) PageTop[Baystack-P6]: <H1>Traffic: Baystack Port 6</H1> Target[Baystack-P7]: ifInOctets.7&ifOutOctets.7:public@10.0.0.3 Title[Baystack-P7]: Traffic: Baystack Port 7 MaxBytes[Baystack-P7]: 16000000 XSize[Baystack-P7]: 600 YLegend[Baystack-P7]: Bytes (in, out) PageTop[Baystack-P7]: <H1>Traffic: Baystack Port 7</H1> Target[Baystack-P8]: ifInOctets.8&ifOutOctets.8:public@10.0.0.3 Title[Baystack-P8]: Traffic: Baystack Port 8 MaxBytes[Baystack-P8]: 16000000 XSize[Baystack-P8]: 600 YLegend[Baystack-P8]: Bytes (in, out) PageTop[Baystack-P8]: <H1>Traffic: Baystack Port 8</H1> Target[Baystack-P9]: ifInOctets.9&ifOutOctets.9:public@10.0.0.3 Title[Baystack-P9]: Traffic: Baystack Port 9 MaxBytes[Baystack-P9]: 16000000 XSize[Baystack-P9]: 600 YLegend[Baystack-P9]: Bytes (in, out) PageTop[Baystack-P9]: <H1>Traffic: Baystack Port 9</H1> Target[Baystack-P10]: ifInOctets.10&ifOutOctets.10:public@10.0.0.3 Title[Baystack-P10]: Traffic: Baystack Port 10 MaxBytes[Baystack-P10]: 16000000 XSize[Baystack-P10]: 600 YLegend[Baystack-P10]: Bytes (in, out) PageTop[Baystack-P10]: <H1>Traffic: Baystack Port 10</H1> Target[Baystack-P11]: ifInOctets.11&ifOutOctets.11:public@10.0.0.3 Title[Baystack-P11]: Traffic: Baystack Port 11 MaxBytes[Baystack-P11]: 16000000 XSize[Baystack-P11]: 600 YLegend[Baystack-P11]: Bytes (in, out) PageTop[Baystack-P11]: <H1>Traffic: Baystack Port 11</H1> Target[Baystack-P12]: ifInOctets.12&ifOutOctets.12:public@10.0.0.3 Title[Baystack-P12]: Traffic: Baystack Port 12 MaxBytes[Baystack-P12]: 16000000 XSize[Baystack-P12]: 600 YLegend[Baystack-P12]: Bytes (in, out) PageTop[Baystack-P12]: <H1>Traffic: Baystack Port 12</H1> Target[Baystack-P13]: ifInOctets.13&ifOutOctets.13:public@10.0.0.3 Title[Baystack-P13]: Traffic: Baystack Port 13 MaxBytes[Baystack-P13]: 16000000 XSize[Baystack-P13]: 600 YLegend[Baystack-P13]: Bytes (in, out) PageTop[Baystack-P13]: <H1>Traffic: Baystack Port 13</H1> Target[Baystack-P14]: ifInOctets.14&ifOutOctets.14:public@10.0.0.3 Title[Baystack-P14]: Traffic: Baystack Port 14 MaxBytes[Baystack-P14]: 16000000 XSize[Baystack-P14]: 600 YLegend[Baystack-P14]: Bytes (in, out) PageTop[Baystack-P14]: <H1>Traffic: Baystack Port 14</H1> Target[Baystack-P15]: ifInOctets.15&ifOutOctets.15:public@10.0.0.3 Title[Baystack-P15]: Traffic: Baystack Port 15 MaxBytes[Baystack-P15]: 16000000 XSize[Baystack-P15]: 600 YLegend[Baystack-P15]: Bytes (in, out) PageTop[Baystack-P15]: <H1>Traffic: Baystack Port 15</H1> Target[Baystack-P16]: ifInOctets.16&ifOutOctets.16:public@10.0.0.3 Title[Baystack-P16]: Traffic: Baystack Port 16 MaxBytes[Baystack-P16]: 16000000 XSize[Baystack-P16]: 600 YLegend[Baystack-P16]: Bytes (in, out) PageTop[Baystack-P16]: <H1>Traffic: Baystack Port 16</H1> Target[Baystack-P17]: ifInOctets.17&ifOutOctets.17:public@10.0.0.3 Title[Baystack-P17]: Traffic: Baystack Port 17 MaxBytes[Baystack-P17]: 16000000 XSize[Baystack-P17]: 600 YLegend[Baystack-P17]: Bytes (in, out) PageTop[Baystack-P17]: <H1>Traffic: Baystack Port 17</H1> Target[Baystack-P18]: ifInOctets.18&ifOutOctets.18:public@10.0.0.3 Title[Baystack-P18]: Traffic: Baystack Port 18 MaxBytes[Baystack-P18]: 16000000 XSize[Baystack-P18]: 600 YLegend[Baystack-P18]: Bytes (in, out) PageTop[Baystack-P18]: <H1>Traffic: Baystack Port 18</H1> Target[Baystack-P19]: ifInOctets.19&ifOutOctets.19:public@10.0.0.3 Title[Baystack-P19]: Traffic: Baystack Port 19 MaxBytes[Baystack-P19]: 16000000 XSize[Baystack-P19]: 600 YLegend[Baystack-P19]: Bytes (in, out) PageTop[Baystack-P19]: <H1>Traffic: Baystack Port 19</H1> Target[Baystack-P20]: ifInOctets.20&ifOutOctets.20:public@10.0.0.3 Title[Baystack-P20]: Traffic: Baystack Port 20 MaxBytes[Baystack-P20]: 16000000 XSize[Baystack-P20]: 600 YLegend[Baystack-P20]: Bytes (in, out) PageTop[Baystack-P20]: <H1>Traffic: Baystack Port 20</H1> Target[Baystack-P21]: ifInOctets.21&ifOutOctets.21:public@10.0.0.3 Title[Baystack-P21]: Traffic: Baystack Port 21 MaxBytes[Baystack-P21]: 16000000 XSize[Baystack-P21]: 600 YLegend[Baystack-P21]: Bytes (in, out) PageTop[Baystack-P21]: <H1>Traffic: Baystack Port 21</H1> Target[Baystack-P22]: ifInOctets.22&ifOutOctets.22:public@10.0.0.3 Title[Baystack-P22]: Traffic: Baystack Port 22 MaxBytes[Baystack-P22]: 16000000 XSize[Baystack-P22]: 600 YLegend[Baystack-P22]: Bytes (in, out) PageTop[Baystack-P22]: <H1>Traffic: Baystack Port 22</H1> Target[Baystack-P23]: ifInOctets.23&ifOutOctets.23:public@10.0.0.3 Title[Baystack-P23]: Traffic: Baystack Port 23 MaxBytes[Baystack-P23]: 16000000 XSize[Baystack-P23]: 600 YLegend[Baystack-P23]: Bytes (in, out) PageTop[Baystack-P23]: <H1>Traffic: Baystack Port 23</H1> Target[Baystack-P24]: ifInOctets.24&ifOutOctets.24:public@10.0.0.3 Title[Baystack-P24]: Traffic: Baystack Port 24 MaxBytes[Baystack-P24]: 16000000 XSize[Baystack-P24]: 600 YLegend[Baystack-P24]: Bytes (in, out) PageTop[Baystack-P24]: <H1>Traffic: Baystack Port 24</H1>
MRTG setup for a Cisco 2610 modular router with 3 ADSL WIC cards.
Uses and SNMP and a custom perl script which accesses the data via the HTTP interface (requires WGET).
mrtg config file:
############################################################################### # # Cisco 2610 Modular Router # Directory[_]: Directory[_]: cisco # ############################################################################### # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Traffic # ATM 0/0, index 1 Target[C2610-ADSL1]: ifInOctets.1&ifOutOctets.1:public@84.12.108.98 Directory[C2610-ADSL1]: cisco Title[C2610-ADSL1]: Traffic: C2610 (ATM 0/0, ADSL-1) MaxBytes1[C2610-ADSL1]: 250000 MaxBytes2[C2610-ADSL1]: 30000 AbsMax[C2610-ADSL1]: 1000000 WithPeak[C2610-ADSL1]: ymwd XSize[C2610-ADSL1]: 600 YLegend[C2610-ADSL1]: Bytes (in, out) PageTop[C2610-ADSL1]: <H1>Traffic: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1, index 3 Target[C2610-ADSL2]: ifInOctets.3&ifOutOctets.3:public@84.12.108.98 Directory[C2610-ADSL2]: cisco Title[C2610-ADSL2]: Traffic: C2610 (ATM 0/1, ADSL-2) MaxBytes1[C2610-ADSL2]: 250000 MaxBytes2[C2610-ADSL2]: 30000 AbsMax[C2610-ADSL2]: 1000000 WithPeak[C2610-ADSL2]: ymwd XSize[C2610-ADSL2]: 600 YLegend[C2610-ADSL2]: Bytes (in, out) PageTop[C2610-ADSL2]: <H1>Traffic: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0, index 4 Target[C2610-ADSL3]: ifInOctets.4&ifOutOctets.4:public@84.12.108.98 Directory[C2610-ADSL3]: cisco Title[C2610-ADSL3]: Traffic: C2610 (ATM 1/0, ADSL-3) MaxBytes1[C2610-ADSL3]: 250000 MaxBytes2[C2610-ADSL3]: 30000 AbsMax[C2610-ADSL3]: 1000000 WithPeak[C2610-ADSL3]: ymwd XSize[C2610-ADSL3]: 600 YLegend[C2610-ADSL3]: Bytes (in, out) PageTop[C2610-ADSL3]: <H1>Traffic: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Line Speeds # ATM 0/0 Target[C2610-speed1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m speed -a 0 -b 0` Directory[C2610-speed1]: cisco Title[C2610-speed1]: Line Speed: C2610 (ATM 0/0, ADSL-1) Options[C2610-speed1]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-speed1]: 8192 AbsMax[C2610-speed1]: 10000 Unscaled[C2610-speed1]: ymwd WithPeak[C2610-speed1]: ymwd XSize[C2610-speed1]: 600 YLegend[C2610-speed1]: kbps (in, out) PageTop[C2610-speed1]: <H1>Line Speed: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-speed2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m speed -a 0 -b 1` Directory[C2610-speed2]: cisco Title[C2610-speed2]: Line Speed: C2610 (ATM 0/1, ADSL-2) Options[C2610-speed2]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-speed2]: 8192 AbsMax[C2610-speed2]: 10000 Unscaled[C2610-speed2]: ymwd WithPeak[C2610-speed2]: ymwd XSize[C2610-speed2]: 600 YLegend[C2610-speed2]: kbps (in, out) PageTop[C2610-speed2]: <H1>Line Speed: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-speed3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m speed -a 1 -b 0` Directory[C2610-speed3]: cisco Title[C2610-speed3]: Line Speed: C2610 (ATM 1/0, ADSL-3) Options[C2610-speed3]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-speed3]: 8192 AbsMax[C2610-speed3]: 10000 Unscaled[C2610-speed3]: ymwd WithPeak[C2610-speed3]: ymwd XSize[C2610-speed3]: 600 YLegend[C2610-speed3]: kbps (in, out) PageTop[C2610-speed3]: <H1>Line Speed: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Capacity Used # ATM 0/0 Target[C2610-capacity1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m capacity -a 0 -b 0` Directory[C2610-capacity1]: cisco Title[C2610-capacity1]: Capacity Used: C2610 (ATM 0/0, ADSL-1) Options[C2610-capacity1]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-capacity1]: 100 AbsMax[C2610-capacity1]: 100 Unscaled[C2610-capacity1]: ymwd WithPeak[C2610-capacity1]: ymwd XSize[C2610-capacity1]: 600 YLegend[C2610-capacity1]: % PageTop[C2610-capacity1]: <H1>Capacity Used: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-capacity2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m capacity -a 0 -b 1` Directory[C2610-capacity2]: cisco Title[C2610-capacity2]: Capacity Used: C2610 (ATM 0/1, ADSL-2) Options[C2610-capacity2]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-capacity2]: 100 AbsMax[C2610-capacity2]: 100 Unscaled[C2610-capacity2]: ymwd WithPeak[C2610-capacity2]: ymwd XSize[C2610-capacity2]: 600 YLegend[C2610-capacity2]: % PageTop[C2610-capacity2]: <H1>Capacity Used: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-capacity3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m capacity -a 1 -b 0` Directory[C2610-capacity3]: cisco Title[C2610-capacity3]: Capacity Used: C2610 (ATM 1/0, ADSL-3) Options[C2610-capacity3]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-capacity3]: 100 AbsMax[C2610-capacity3]: 100 Unscaled[C2610-capacity3]: ymwd WithPeak[C2610-capacity3]: ymwd XSize[C2610-capacity3]: 600 YLegend[C2610-capacity3]: % PageTop[C2610-capacity3]: <H1>Capacity Used: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Activations # ATM 0/0 Target[C2610-starts1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m starts -a 0 -b 0` Directory[C2610-starts1]: cisco Title[C2610-starts1]: Interface Starts: C2610 (ATM 0/0, ADSL-1) Options[C2610-starts1]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-starts1]: 1000 AbsMax[C2610-starts1]: 1000 #Unscaled[C2610-starts1]: ymwd WithPeak[C2610-starts1]: ymwd XSize[C2610-starts1]: 600 YLegend[C2610-starts1]: # PageTop[C2610-starts1]: <H1>Interface Starts: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-starts2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m starts -a 0 -b 1` Directory[C2610-starts2]: cisco Title[C2610-starts2]: Interface Starts: C2610 (ATM 0/1, ADSL-2) Options[C2610-starts2]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-starts2]: 1000 AbsMax[C2610-starts2]: 1000 #Unscaled[C2610-starts2]: ymwd WithPeak[C2610-starts2]: ymwd XSize[C2610-starts2]: 600 YLegend[C2610-starts2]: # PageTop[C2610-starts2]: <H1>Interface Starts: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-starts3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m starts -a 1 -b 0` Directory[C2610-starts3]: cisco Title[C2610-starts3]: Interface Starts: C2610 (ATM 1/0, ADSL-3) Options[C2610-starts3]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-starts3]: 1000 AbsMax[C2610-starts3]: 1000 #Unscaled[C2610-starts3]: ymwd WithPeak[C2610-starts3]: ymwd XSize[C2610-starts3]: 600 YLegend[C2610-starts3]: # PageTop[C2610-starts3]: <H1>Interface Starts: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Reed-Solomon EC Rate # ATM 0/0 Target[C2610-ecg1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 0 -b 0` Directory[C2610-ecg1]: cisco Title[C2610-ecg1]: EC Rate: C2610 (ATM 0/0, ADSL-1) Options[C2610-ecg1]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecg1]: 100000 AbsMax[C2610-ecg1]: 100000 #Unscaled[C2610-ecg1]: ymwd WithPeak[C2610-ecg1]: ymwd XSize[C2610-ecg1]: 600 YLegend[C2610-ecg1]: EC Rate PageTop[C2610-ecg1]: <H1>EC Rate: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-ecg2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 0 -b 1` Directory[C2610-ecg2]: cisco Title[C2610-ecg2]: EC rate: C2610 (ATM 0/1, ADSL-2) Options[C2610-ecg2]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecg2]: 100000 AbsMax[C2610-ecg2]: 100000 #Unscaled[C2610-ecg2]: ymwd WithPeak[C2610-ecg2]: ymwd XSize[C2610-ecg2]: 600 YLegend[C2610-ecg2]: EC Rate PageTop[C2610-ecg2]: <H1>EC Rate: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-ecg3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 1 -b 0` Directory[C2610-ecg3]: cisco Title[C2610-ecg3]: EC Rate: C2610 (ATM 1/0, ADSL-3) Options[C2610-ecg3]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecg3]: 100000 AbsMax[C2610-ecg3]: 100000 #Unscaled[C2610-ecg3]: ymwd WithPeak[C2610-ecg3]: ymwd XSize[C2610-ecg3]: 600 YLegend[C2610-ecg3]: EC Rate PageTop[C2610-ecg3]: <H1>EC Rate: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Reed-Solomon EC Counters # ATM 0/0 Target[C2610-ecc1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 0 -b 0` Directory[C2610-ecc1]: cisco Title[C2610-ecc1]: EC Counter: C2610 (ATM 0/0, ADSL-1) Options[C2610-ecc1]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecc1]: 1000000 AbsMax[C2610-ecc1]: 100000000 #Unscaled[C2610-ecc1]: ymwd WithPeak[C2610-ecc1]: ymwd XSize[C2610-ecc1]: 600 YLegend[C2610-ecc1]: Error Counter PageTop[C2610-ecc1]: <H1>EC Counter: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-ecc2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 0 -b 1` Directory[C2610-ecc2]: cisco Title[C2610-ecc2]: EC Counter: C2610 (ATM 0/1, ADSL-2) Options[C2610-ecc2]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecc2]: 1000000 AbsMax[C2610-ecc2]: 100000000 #Unscaled[C2610-ecc2]: ymwd WithPeak[C2610-ecc2]: ymwd XSize[C2610-ecc2]: 600 YLegend[C2610-ecc2]: Error Counter PageTop[C2610-ecc2]: <H1>EC Counter: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-ecc3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m ec -a 1 -b 0` Directory[C2610-ecc3]: cisco Title[C2610-ecc3]: EC Counter: C2610 (ATM 1/0, ADSL-3) Options[C2610-ecc3]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-ecc3]: 1000000 AbsMax[C2610-ecc3]: 100000000 #Unscaled[C2610-ecc3]: ymwd WithPeak[C2610-ecc3]: ymwd XSize[C2610-ecc3]: 600 YLegend[C2610-ecc3]: Error Counter PageTop[C2610-ecc3]: <H1>EC Counter: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL CRC Errors # ATM 0/0 Target[C2610-crc1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m crc -a 0 -b 0` Directory[C2610-crc1]: cisco Title[C2610-crc1]: CRC Errors: C2610 (ATM 0/0, ADSL-1) Options[C2610-crc1]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-crc1]: 1000 AbsMax[C2610-crc1]: 1000 #Unscaled[C2610-crc1]: ymwd WithPeak[C2610-crc1]: ymwd XSize[C2610-crc1]: 600 YLegend[C2610-crc1]: Error Count PageTop[C2610-crc1]: <H1>CRC Errors: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-crc2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m crc -a 0 -b 1` Directory[C2610-crc2]: cisco Title[C2610-crc2]: CRC Errors: C2610 (ATM 0/1, ADSL-2) Options[C2610-crc2]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-crc2]: 1000 AbsMax[C2610-crc2]: 1000 #Unscaled[C2610-crc2]: ymwd WithPeak[C2610-crc2]: ymwd XSize[C2610-crc2]: 600 YLegend[C2610-crc2]: Error Count PageTop[C2610-crc2]: <H1>CRC Errors: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-crc3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m crc -a 1 -b 0` Directory[C2610-crc3]: cisco Title[C2610-crc3]: CRC Errors: C2610 (ATM 1/0, ADSL-3) Options[C2610-crc3]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-crc3]: 1000 AbsMax[C2610-crc3]: 1000 #Unscaled[C2610-crc3]: ymwd WithPeak[C2610-crc3]: ymwd XSize[C2610-crc3]: 600 YLegend[C2610-crc3]: Error Count PageTop[C2610-crc3]: <H1>CRC Errors: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL Header Errors # ATM 0/0 Target[C2610-header1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m header -a 0 -b 0` Directory[C2610-header1]: cisco Title[C2610-header1]: Header Errors: C2610 (ATM 0/0, ADSL-1) Options[C2610-header1]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-header1]: 1000 AbsMax[C2610-header1]: 1000 #Unscaled[C2610-header1]: ymwd WithPeak[C2610-header1]: ymwd XSize[C2610-header1]: 600 YLegend[C2610-header1]: Error Count PageTop[C2610-header1]: <H1>Header Errors: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-header2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m header -a 0 -b 1` Directory[C2610-header2]: cisco Title[C2610-header2]: Header Errors: C2610 (ATM 0/1, ADSL-2) Options[C2610-header2]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-header2]: 1000 AbsMax[C2610-header2]: 1000 #Unscaled[C2610-header2]: ymwd WithPeak[C2610-header2]: ymwd XSize[C2610-header2]: 600 YLegend[C2610-header2]: Error Count PageTop[C2610-header2]: <H1>Header Errors: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-header3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m header -a 1 -b 0` Directory[C2610-header3]: cisco Title[C2610-header3]: Header Errors: C2610 (ATM 1/0, ADSL-3) Options[C2610-header3]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-header3]: 1000 AbsMax[C2610-header3]: 1000 #Unscaled[C2610-header3]: ymwd WithPeak[C2610-header3]: ymwd XSize[C2610-header3]: 600 YLegend[C2610-header3]: Error Count PageTop[C2610-header3]: <H1>Header Errors: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # ADSL SNR # ATM 0/0 Target[C2610-snr1]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m snr -a 0 -b 0` Directory[C2610-snr1]: cisco Title[C2610-snr1]: SNR: C2610 (ATM 0/0, ADSL-1) Options[C2610-snr1]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-snr1]: 100 AbsMax[C2610-snr1]: 100 #Unscaled[C2610-snr1]: ymwd WithPeak[C2610-snr1]: ymwd XSize[C2610-snr1]: 600 YLegend[C2610-snr1]: SNR PageTop[C2610-snr1]: <H1>SNR: C2610 Modular Router (ATM 0/0, ADSL-1)</H1> # ATM 0/1 Target[C2610-snr2]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m snr -a 0 -b 1` Directory[C2610-snr2]: cisco Title[C2610-snr2]: SNR: C2610 (ATM 0/1, ADSL-2) Options[C2610-snr2]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-snr2]: 100 AbsMax[C2610-snr2]: 100 #Unscaled[C2610-snr2]: ymwd WithPeak[C2610-snr2]: ymwd XSize[C2610-snr2]: 600 YLegend[C2610-snr2]: SNR PageTop[C2610-snr2]: <H1>SNR: C2610 Modular Router (ATM 0/1, ADSL-2)</H1> # ATM 1/0 Target[C2610-snr3]: `adsl-mrtg.pl -H 84.12.108.98 -p public -m snr -a 1 -b 0` Directory[C2610-snr3]: cisco Title[C2610-snr3]: SNR: C2610 (ATM 1/0, ADSL-3) Options[C2610-snr3]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[C2610-snr3]: 100 AbsMax[C2610-snr3]: 100 #Unscaled[C2610-snr3]: ymwd WithPeak[C2610-snr3]: ymwd XSize[C2610-snr3]: 600 YLegend[C2610-snr3]: SNR PageTop[C2610-snr3]: <H1>SNR: C2610 Modular Router (ATM 1/0, ADSL-3)</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # Ethernet Traffic Target[C2610-Eth]: ifInOctets.2&ifOutOctets.2:public@84.12.108.98 Directory[C2610-Eth]: cisco Title[C2610-Eth]: Traffic: C2610 Ethernet MaxBytes1[C2610-Eth]: 100000 MaxBytes2[C2610-Eth]: 1000000 AbsMax[C2610-Eth]: 4000000 #Unscaled[C2610-Eth]: ymwd WithPeak[C2610-Eth]: ymwd XSize[C2610-Eth]: 600 YSize[C2610-Eth]: 200 YLegend[C2610-Eth]: Bytes (in, out) PageTop[C2610-Eth]: <H1>Traffic: C2610 Modular Router - Ethernet</H1> # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
Perl code (/usr/bin/adsl-mrtg.pl):
#!/usr/bin/perl -w
use strict;
use Getopt::Long;
use Pod::Usage;
=head1 NAME
adsl-mrtg.pl - Cisco WIC-1 ADSL MRTG plug-in
=head1 SYNOPSIS
adsl-mrtg.pl -H host [-u user] [-p password] [-m measure] -a interfaceA -b interfaceB
host: IP address of the router
user: Web user (default admin)
password: Web password (default public)
measure: speed* | capacity | snr | ec | crc | header | attenuation | starts
interfaceA: Interface number A
interfaceB: Interface number B
e.g., to graph ATM0/1:
adsl-mrtg.pl -H 10.0.0.10 -p password -m traffic -a 0 -b 1
=head1 DESCRIPTION
Uses the web interface on a Cisco router to query the status of an ADSL
link on a WIC-1 card and return the specified parameter MRTG-compatible
format.
=head1 AUTHOR
Nigel Bruin 2006
=cut
###############################################################################
#
# Constants
# Path to WGET
my $PATHTOWGET = "/usr/bin/wget";
# Measure parameter values
my $measureSpeed = 'speed';
my $measureCapacity = 'capacity';
my $measureSNR = 'snr';
my $measureEC = 'ec';
my $measureCRC = 'crc';
my $measureHeader = 'header';
my $measureAtt = 'attentuation';
my $measureStarts = 'starts';
###############################################################################
#
# Global variables
my ( $host, $user, $password, $measure, $ifA, $ifB, $output );
###############################################################################
#
# Main routine
GetOptions("H=s" => \$host,
"u=s" => \$user,
"p=s" => \$password,
"m=s" => \$measure,
"a=s" => \$ifA,
"b=s" => \$ifB
);
# Enforce parameter defaults
if(!$user ) { $user = 'admin' };
if(!$password) { $password = 'public' };
if(!$measure ) { $measure = $measureSpeed };
if(!$ifA ) { $ifA = '0' };
if(!$ifB ) { $ifB = '0' };
# Command line options checking
if ( !$host )
{ pod2usage("Not enough arguments.\n"); exit 1 };
# WIC-1 ADSL query - use WGET to query the web interface and get a
# "/level/15/exec/-/show/dsl/interface/ATM/1//0/CR" command.
# Issue "show dsl interface" command to Cisco
my $adsl = `$PATHTOWGET -q -T 3 -t 1 -w 3 --http-user $user --http-passwd $password -O - http://$host/level/15/exec/-/show/dsl/interface/ATM/$ifA//$ifB/CR`;
$adsl =~ s/\n/ /g; # Convert newlines
$adsl =~ s/\t/ /g; # Convert tabs
$adsl =~ s/\r/ /g; # Convert returns
# Sanity check output for key expected strings
if ((index($adsl, 'command completed.' ) == -1) ||
(index($adsl, 'Line not activated:' ) != -1) ||
(index($adsl, 'show dsl interface ATM') == -1))
{ $output = "0\n0\n--" }
else
{
if ($measure eq $measureSpeed)
{
# Speed (kbps): 0 6848 0 832
$output = substr($adsl, index($adsl, 'Speed (kbps):'));
my @speedwords = split /\s+/, $output, 7;
my $dnlink = int($speedwords[2]) + int($speedwords[3]);
my $uplink = int($speedwords[4]) + int($speedwords[5]);
$output = "$uplink\n$dnlink\n--";
}
elsif ($measure eq $measureCapacity)
{
# Capacity Used: 100% 89%
$output = substr($adsl, index($adsl, 'Capacity Used:'));
$output =~ s/Capacity Used:\s*(\S*)%\s*(\S*)%(.*)/$2\n$1\n--/;
if (length($output) > 30) { $output = "0\n0\n--" }
}
elsif ($measure eq $measureSNR)
{
# Noise Margin: -44.5 dB 10.0 dB
$output = substr($adsl, index($adsl, 'Noise Margin:'));
$output =~ s/Noise Margin:\s*(\S*)\s*dB\s*(\S*)\s*dB(.*)/$2\n$1\n--/;
if (length($output) > 30) { $output = "0\n0\n--" }
}
elsif ($measure eq $measureEC)
{
# Reed-Solomon EC: 12285 0 34 0
$output = substr($adsl, index($adsl, 'Reed-Solomon EC:'));
my @ecwords = split /\s+/, $output, 7;
my $dnec = int($ecwords[2]) + int($ecwords[3]);
my $upec = int($ecwords[4]) + int($ecwords[5]);
$output = "$upec\n$dnec\n--";
}
elsif ($measure eq $measureCRC)
{
# CRC Errors: 0 56282 11262 10504
$output = substr($adsl, index($adsl, 'CRC Errors:'));
#$output =~ s/CRC Errors:\s*(\S*)\s*(\S*)\s*(\S*)\s*(\S*)(.*)/$4\n$2\n--/;
#if (length($output) > 30) { $output = "0\n0\n--" }
my @crcwords = split /\s+/, $output, 7;
my $dncrc = int($crcwords[2]) + int($crcwords[3]);
my $upcrc = int($crcwords[4]) + int($crcwords[5]);
$output = "$upcrc\n$dncrc\n--";
}
elsif ($measure eq $measureHeader)
{
# Header Errors: 0 51202 11212 10840
$output = substr($adsl, index($adsl, 'Header Errors:'));
#$output =~ s/Header Errors:\s*(\S*)\s*(\S*)\s*(\S*)\s*(\S*)(.*)/$4\n$2\n--/;
#if (length($output) > 30) { $output = "0\n0\n--" }
my @hdrwords = split /\s+/, $output, 7;
my $dnhdr = int($hdrwords[2]) + int($hdrwords[3]);
my $uphdr = int($hdrwords[4]) + int($hdrwords[5]);
$output = "$uphdr\n$dnhdr\n--";
}
elsif ($measure eq $measureAtt)
{
# Attenuation: 38.0 dB 24.0 dB
$output = substr($adsl, index($adsl, 'Attenuation:'));
$output =~ s/Attenuation:\s*(\S*)\s*dB\s*(\S*)\s*dB(.*)/$2\n$1\n--/;
if (length($output) > 30) { $output = "0\n0\n--" }
}
elsif ($measure eq $measureStarts)
{
# Activations: 49
$output = substr($adsl, index($adsl, 'Activations:'));
$output =~ s/Activations:\s*(\S*)\s*(.*)/0\n$1\n--/;
if (length($output) > 30) { $output = "0\n0\n--" }
}
else
{ $output = "0\n0\n--" };
};
# Print 4 lines of output for MRTG, e.g
# 832
# 7645
# --
# ATM0/1
print "$output\nATM".$ifA.'/'.$ifB."\n";
exit;
############################################################################### # # NMS # Directory[_]: Directory[_]: nms # ############################################################################### #Target[NMS-Eth]: ifInOctets.1&ifOutOctets.1:public@10.0.0.3 #Options[NMS-Eth]: growright #Title[NMS-Eth]: NMS: Traffic Analysis #MaxBytes[NMS-Eth]: 10000000000 #WithPeak[NMS-Eth]: ymwd #XSize[NMS-Eth]: 600 #YLegend[NMS-Eth]: Bytes (in, out) #PageTop[NMS-Eth]: <H1>NMS: Ethernet Traffic</H1> # enterprises.ucdavis.memory.memTotalReal.0 # enterprises.ucdavis.memory.memTotalFree.0 #Target[NMS-Mem]: 1.3.6.1.4.1.2021.4.5.0&1.3.6.1.4.1.2021.4.11.0:public@10.0.0.2 #Options[NMS-Mem]: gauge, growright, noinfo, nopercent, nolegend #Title[NMS-Mem]: NMS: Memory (Total, Used) #MaxBytes[NMS-Mem]: 12000000 #WithPeak[NMS-Mem]: ymwd #XSize[NMS-Mem]: 600 #YLegend[NMS-Mem]: Total / Used #LegendO[NMS-Mem]: #LegendI[NMS-Mem]: #PageTop[NMS-Mem]: <H1>NMS: Memory Resources (Total, Used)</H1> # enterprises.ucdavis.laTable.laEntry.laLoad.2 (5 min) # enterprises.ucdavis.laTable.laEntry.laLoad.3 (15 min) Target[NMS-Load]: 1.3.6.1.4.1.2021.10.1.3.2&1.3.6.1.4.1.2021.10.1.3.3:public@10.0.0.2 * 100 Options[NMS-Load]: gauge, growright, noinfo, nopercent Unscaled[NMS-Load]: ymwd Title[NMS-Load]: NMS: CPU Loading (x100) MaxBytes[NMS-Load]: 100 AbsMax[NMS-Load]: 1000 WithPeak[NMS-Load]: ymwd XSize[NMS-Load]: 600 YLegend[NMS-Load]: Load (5min, 15min) x100 LegendO[NMS-Load]: LegendI[NMS-Load]: PageTop[NMS-Load]: <H1>NMS: Processor Loading, 5min, 15min x100</H1> # LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt # Target[NMS-Disk1]:hrStorageUsed.1&hrStorageSize.1:gWiHAjcqlA@10.0.0.2 #Target[NMS-Disk1]: .1.3.6.1.2.1.25.2.3.1.6.1&.1.3.6.1.2.1.25.2.3.1.5.1:public@10.0.0.2 #Options[NMS-Disk1]: growright,gauge,nopercent #Unscaled[NMS-Disk1]: ymwd #MaxBytes[NMS-Disk1]: 20000000 #AbsMax[NMS-Disk1]: 100000000 #Title[NMS-Disk1]: NMS: / (Used, Tot) #kMG[NMS-Disk1]: k,M,G,T,P #YLegend[NMS-Disk1]: / (Used, Tot) #LegendI[NMS-Disk1]: Size #LegendO[NMS-Disk1]: Usage #PageTop[NMS-Disk1]: <H1>NMS: Disk Space: / (Used, Tot)</H1> # LoadMIBs: /usr/share/snmp/mibs/HOST-RESOURCES-MIB.txt # Target[NMS-Disk1]:hrStorageUsed.3&hrStorageSize.1:gWiHAjcqlA@10.0.0.3 #Target[NMS-Disk2]: .1.3.6.1.2.1.25.2.3.1.6.2&.1.3.6.1.2.1.25.2.3.1.5.2:public@10.0.0.2 #Options[NMS-Disk2]: growright,gauge,nopercent #Unscaled[NMS-Disk2]: ymwd #MaxBytes[NMS-Disk2]: 110000 #AbsMax[NMS-Disk2]: 1000000 #Title[NMS-Disk2]: NMS: /boot (Used, Tot) #kMG[NMS-Disk2]: k,M,G,T,P #YLegend[NMS-Disk2]: /boot (Used,Tot) #LegendI[NMS-Disk2]: Size #LegendO[NMS-Disk2]: Usage #PageTop[NMS-Disk2]: <H1>NMS: Disk Space: /boot (Used, Tot)</H1>
############################################################################### # # NetEyes Cyclone-1000 Load Balancing Router # Directory[_]: Directory[_]: cyclone # ############################################################################### Target[Cyclone-Eth]: ifInOctets.1&ifOutOctets.1:public@10.0.0.1 Directory[Cyclone-Eth]: cyclone Title[Cyclone-Eth]: Traffic: Cyclone Ethernet (LAN) MaxBytes1[Cyclone-Eth]: 65536 MaxBytes2[Cyclone-Eth]: 524288 Unscaled[Cyclone-Eth]: ymwd WithPeak[Cyclone-Eth]: ymwd XSize[Cyclone-Eth]: 600 YSize[Cyclone-Eth]: 200 YLegend[Cyclone-Eth]: Bytes (in, out) PageTop[Cyclone-Eth]: <H1>Traffic: Cyclone Ethernet (LAN)</H1> Target[Cyclone-WAN1]: ifInOctets.2&ifOutOctets.2:public@10.0.0.1 Directory[Cyclone-WAN1]: cyclone Title[Cyclone-WAN1]: Traffic: Cyclone Ethernet (WAN1) MaxBytes1[Cyclone-WAN1]: 524288 MaxBytes2[Cyclone-WAN1]: 65536 Unscaled[Cyclone-WAN1]: ymwd WithPeak[Cyclone-WAN1]: ymwd XSize[Cyclone-WAN1]: 600 YLegend[Cyclone-WAN1]: Bytes (in, out) PageTop[Cyclone-WAN1]: <H1>Traffic: Cyclone Ethernet (WAN1)</H1> Target[Cyclone-WAN2]: ifInOctets.3&ifOutOctets.3:public@10.0.0.1 Directory[Cyclone-WAN2]: cyclone Title[Cyclone-WAN2]: Traffic: Cyclone Ethernet (WAN2) MaxBytes1[Cyclone-WAN2]: 524288 MaxBytes2[Cyclone-WAN2]: 65536 Unscaled[Cyclone-WAN2]: ymwd WithPeak[Cyclone-WAN2]: ymwd XSize[Cyclone-WAN2]: 600 YLegend[Cyclone-WAN2]: Bytes (in, out) PageTop[Cyclone-WAN2]: <H1>Traffic: Cyclone Ethernet (WAN2)</H1> Target[Cyclone-WAN3]: ifInOctets.4&ifOutOctets.4:public@10.0.0.1 Directory[Cyclone-WAN3]: cyclone Title[Cyclone-WAN3]: Traffic: Cyclone Ethernet (WAN3) MaxBytes1[Cyclone-WAN3]: 524288 MaxBytes2[Cyclone-WAN3]: 65536 Unscaled[Cyclone-WAN3]: ymwd WithPeak[Cyclone-WAN3]: ymwd XSize[Cyclone-WAN3]: 600 YLegend[Cyclone-WAN3]: Bytes (in, out) PageTop[Cyclone-WAN3]: <H1>Traffic: Cyclone Ethernet (WAN3)</H1> # 1.3.6.1.4.1.ucdavis.memory.memTotalReal.0 # 1.3.6.1.4.1.ucdavis.memory.memAvailReal.0 Target[CycloneRAM]: 1.3.6.1.4.1.2021.4.5.0&1.3.6.1.4.1.2021.4.6.0:public@10.0.0.1: Directory[CycloneRAM]: cyclone Options[CycloneRAM]: gauge, growright, noinfo, nopercent Unscaled[CycloneRAM]: ymwd Suppress[CycloneRAM]: y MaxBytes[CycloneRAM]: 256000 XSize[CycloneRAM]: 600 YLegend[CycloneRAM]: Bytes (Tot, Avail) LegendO[CycloneRAM]: LegendI[CycloneRAM]: Title[CycloneRAM]: Cyclone RAM (Bytes: Tot, Avail) PageTop[CycloneRAM]: <H1>Cyclone RAM (Bytes: Tot, Avail)</H1> # UCD-SNMP-MIB::laLoad.1, laLoad.2 Target[CycloneLoad]: 1.3.6.1.4.1.2021.10.1.3.1&1.3.6.1.4.1.2021.10.1.3.2:public@10.0.0.1 * 100 Directory[CycloneLoad]: cyclone Options[CycloneLoad]: gauge, growright, noinfo, nopercent #Unscaled[CycloneLoad]: ymwd Title[CycloneLoad]: Cyclone CPU Loading (x100) MaxBytes[CycloneLoad]: 50 AbsMax[CycloneLoad]: 200 WithPeak[CycloneLoad]: ymwd XSize[CycloneLoad]: 600 YTics[CycloneLoad]: 5 YLegend[CycloneLoad]: Load (1min, 5min) x100 LegendO[CycloneLoad]: LegendI[CycloneLoad]: PageTop[CycloneLoad]: <H1>Cyclone Processor Loading (x100)</H1> ###############################################################################
Link is a pair of identical hardware, with one labelled and Master and the other Slave. The symmetry of operation means all data may be collected from the nearest unit only.
############################################################################### # # Orthogon Gemini Point-to-Point radio # Directory[_]: Directory[_]: gemini # ############################################################################### Target[Gemini-Eth]: ifInOctets.1&ifOutOctets.1:public@10.0.0.5 Directory[Gemini-Eth]: gemini Options[Gemini-Eth]: growright, noinfo, nopercent Title[Gemini-Eth]: Gemini Traffic Analysis MaxBytes[Gemini-Eth]: 2000000 AbsMax[Gemini-Eth]: 20000000 YLegend[Gemini-Eth]: Bytes (in, out) LegendO[Gemini-Eth]: LegendI[Gemini-Eth]: PageTop[Gemini-Eth]: <H1>Traffic: (Gemini)</H1> # enterprises.gemini.phyStatus.receiveChannel # enterprises.gemini.phyStatus.transmitChannel Target[Gemini-Chnl]: 1.3.6.1.4.1.17713.1.12.6.0&1.3.6.1.4.1.17713.1.12.7.0:public@10.0.0.5 Directory[Gemini-Chnl]: gemini Options[Gemini-Chnl]: gauge, growright, noinfo, nopercent, nolegend Title[Gemini-Chnl]: Gemini Receive / Transmit Channel Unscaled[Gemini-Chnl]: ymwd MaxBytes[Gemini-Chnl]: 20 AbsMax[Gemini-Chnl]: 30 Ytics[Gemini-Chnl]: 10 YLegend[Gemini-Chnl]: Rcv / Xmit LegendO[Gemini-Chnl]: LegendI[Gemini-Chnl]: PageTop[Gemini-Chnl]: <H1>Gemini Receive / Transmit Channel</H1> # enterprises.gemini.phyStatus.transmitPower Target[Gemini-Power]: 1.3.6.1.4.1.17713.1.12.3.0&1.3.6.1.4.1.17713.1.12.3.0:public@10.0.0.5 / 10 Directory[Gemini-Power]: gemini Options[Gemini-Power]: gauge, growright, noinfo, nopercent, nolegend Title[Gemini-Power]: Gemini Xmit Power (max 25dBm) Unscaled[Gemini-Power]: ymwd WithPeak[Gemini-Power]: ymwd #YTics[Gemini-Power]: 6 MaxBytes[Gemini-Power]: 25 AbsMax[Gemini-Power]: 40 YLegend[Gemini-Power]: Transmit Power LegendO[Gemini-Power]: LegendI[Gemini-Power]: PageTop[Gemini-Power]: <H1>Gemini Xmit Power (max 25dBm)</H1> # enterprises.gemini.phyStatus.receiveModulationMode # enterprises.gemini.phyStatus.transmitModulationMode Target[Gemini-Mod]: 1.3.6.1.4.1.17713.1.12.8.0&1.3.6.1.4.1.17713.1.12.9.0:public@10.0.0.5 Directory[Gemini-Mod]: gemini Options[Gemini-Mod]: gauge, growright, noinfo, nopercent, nolegend Title[Gemini-Mod]: Gemini Modulation Mode Unscaled[Gemini-Mod]: ymwd WithPeak[Gemini-Mod]: ymwd MaxBytes[Gemini-Mod]: 8 AbsMax[Gemini-Mod]: 10 YTics[Gemini-Mod]: 8 YLegend[Gemini-Mod]: Rcv / Xmit LegendO[Gemini-Mod]: LegendI[Gemini-Mod]: PageTop[Gemini-Mod]: <H1>Gemini Modulation Mode</H1> # enterprises.gemini.phyStatus.snr #Target[Gemini-SNR]: 1.3.6.1.4.1.17713.1.12.10.0&1.3.6.1.4.1.17713.1.12.10.0:public@10.0.0.5 / 10 #Directory[Gemini-SNR]: gemini #Options[Gemini-SNR]: gauge, growright, noinfo, nopercent, nolegend #Title[Gemini-SNR]: Gemini SNR dBm ##Unscaled[Gemini-SNR]: ymwd #WithPeak[Gemini-SNR]: ymwd #YSize[Gemini-SNR]: 200 #YTics[Gemini-SNR]: 6 #MaxBytes[Gemini-SNR]: 30 #AbsMax[Gemini-SNR]: 500 #YLegend[Gemini-SNR]: SNR #LegendO[Gemini-SNR]: #LegendI[Gemini-SNR]: #PageTop[Gemini-SNR]: <H1>Gemini SNR dBm</H1> # enterprises.gemini.phyStatus.lnkLoss Target[Gemini-linkloss]: 1.3.6.1.4.1.17713.1.12.5.0&1.3.6.1.4.1.17713.1.12.5.0:public@10.0.0.5 / 10 Directory[Gemini-linkloss]: gemini Options[Gemini-linkloss]: gauge, growright, noinfo, nopercent, nolegend Title[Gemini-linkloss]: Gemini Link Loss #Unscaled[Gemini-linkloss]: ymwd WithPeak[Gemini-linkloss]: ymwd YSize[Gemini-linkloss]: 200 YTics[Gemini-linkloss]: 10 MaxBytes[Gemini-linkloss]: 160 AbsMax[Gemini-linkloss]: 500 YLegend[Gemini-linkloss]: Link Loss dBm LegendO[Gemini-linkloss]: LegendI[Gemini-linkloss]: PageTop[Gemini-linkloss]: <H1>Gemini Link Loss</H1> ###############################################################################
Requires perl script (sb-mrtg.pl) to collect and re-format data from unit. Script was downloaded from SmartBridges support.
############################################################################### # # airBridge Traffic Stats # ############################################################################### # Options[_]: Options[_]: growright, noinfo, nopercent XSize[_]: XSize[_]: 350 YSize[_]: YSize[_]: 100 Directory[_]: Directory[_]: sb # ############################################################################### # Target[ab50l]: `sb-mrtg.pl -i 10.0.0.50 -c public -t l` Title[ab50l]: airBridge Radio Link: 10.0.0.50 Options[ab50l]: gauge, growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[ab50l]: 100 Legend1[ab50l]: RSSI % Legend2[ab50l]: Link Quality % YLegend[ab50l]: RSSI & LQ % Unscaled[ab50l]: ymwd PageTop[ab50l]: <H1>airBridge Radio Link: 10.0.0.50 on ICK1</H1> Target[ab50w]: `sb-mrtg.pl -i 10.0.0.50 -c public -t w` Title[ab50w]: airBridge Air Interface Activity: 10.0.0.50 (Packets) Options[ab50w]: growright, integer, nolegend, nobanner, noinfo, perminute MaxBytes[ab50w]: 30000 AbsMax[ab50w]: 100000 YTics[ab50w]: 6 #Unscaled[ab50w]: ymwd WithPeak[ab50w]: ymwd Legend1[ab50w]: Packets In Legend2[ab50w]: Packets Out YLegend[ab50w]: Pkts (in, out) PageTop[ab50w]: <H1>Air Interface Activity: 10.0.0.50 on ICK1 (Packets)</H1> Target[ab50t]: `sb-mrtg.pl -i 10.0.0.50 -c public -t e` Title[ab50t]: airBridge Ethernet Traffic: 10.0.0.50 (Bytes) Options[ab50t]: growright, integer, nolegend, nobanner, noinfo, nopercent MaxBytes[ab50t]: 100000 AbsMax[ab50t]: 786432 YTics[ab50t]: 5 #Unscaled[ab50t]: ymwd WithPeak[ab50t]: ymwd Legend1[ab50t]: Bytes In Legend2[ab50t]: Bytes Out YLegend[ab50t]: Bytes (in, out) PageTop[ab50t]: <H1>Ethernet Traffic: 10.0.0.50 on ICK1 (Bytes)</H1> ###############################################################################
Link uses a pair of identical hardware but software configured as Master (MU) and Remote (RU) each with a different MIB.
############################################################################### # # TrangoLINK-10 Point-to-Point radio # Directory[_]: Directory[_]: trango # ############################################################################### Target[Trango-MU1]: 1.3.6.1.4.1.5454.1.22.2.5.4.0&1.3.6.1.4.1.5454.1.22.2.1:public@10.0.0.6|TrangoScaleRSSI Options[Trango-MU1]: gauge, growright, noinfo, nopercent, nolegend Unscaled[Trango-MU1]: ymwd WithPeak[Trango-MU1]: ymwd Title[Trango-MU1]: Trango MU RSSI MaxBytes[Trango-MU1]: 40 XSize[Trango-MU1]: 600 YLegend[Trango-MU1]: RSSI + 100 LegendO[Trango-MU1]: LegendI[Trango-MU1]: PageTop[Trango-MU1]: <H1>Trango MU RSSI</H1> Target[Trango-RU1]: 1.3.6.1.4.1.5454.1.24.2.5.4.0&1.3.6.1.4.1.5454.1.24.2.1:public@10.0.0.7|TrangoScaleRSSI Options[Trango-RU1]: gauge, growright, noinfo, nopercent, nolegend Unscaled[Trango-RU1]: ymwd WithPeak[Trango-RU1]: ymwd Title[Trango-RU1]: Trango RU RSSI MaxBytes[Trango-RU1]: 40 XSize[Trango-RU1]: 600 YLegend[Trango-RU1]: RSSI + 100 LegendO[Trango-RU1]: LegendI[Trango-RU1]: PageTop[Trango-RU1]: <H1>Trango RU RSSI</H1> Target[Trango-MU2]: 1.3.6.1.4.1.5454.1.22.1.9.1&1.3.6.1.4.1.5454.1.22.1.9.2:public@10.0.0.6: Options[Trango-MU2]: growright, noinfo, nopercent WithPeak[Trango-MU2]: ymwd Title[Trango-MU2]: Trango Traffic Analysis MaxBytes[Trango-MU2]: 1000000 XSize[Trango-MU2]: 600 YLegend[Trango-MU2]: Bytes (in, out) PageTop[Trango-MU2]: <H1>Traffic (Trango)</H1> Target[Trango-MUTemp]: .1.3.6.1.4.1.5454.1.22.1.10&.1.3.6.1.4.1.5454.1.22.1.10:public@10.0.0.6 Options[Trango-MUTemp]: gauge, growright, noinfo, nopercent, nolegend Unscaled[Trango-MUTemp]: ymwd WithPeak[Trango-MUTemp]: ymwd Title[Trango-MUTemp]: Trango MU Internal Temperature MaxBytes[Trango-MUTemp]: 50 AbsMax[Trango-MUTemp]: 100 XSize[Trango-MUTemp]: 600 Ytics[Trango-MUTemp]: 5 YLegend[Trango-MUTemp]: Deg C LegendO[Trango-MUTemp]: LegendI[Trango-MUTemp]: PageTop[Trango-MUTemp]: <H1>Trango MU Temperature</H1> Target[Trango-RUTemp]: .1.3.6.1.4.1.5454.1.24.1.10&.1.3.6.1.4.1.5454.1.24.1.10:public@10.0.0.7 Options[Trango-RUTemp]: gauge, growright, noinfo, nopercent, nolegend Unscaled[Trango-RUTemp]: ymwd WithPeak[Trango-RUTemp]: ymwd Title[Trango-RUTemp]: Trango RU Internal Temperature MaxBytes[Trango-RUTemp]: 50 AbsMax[Trango-RUTemp]: 100 XSize[Trango-RUTemp]: 600 Ytics[Trango-RUTemp]: 5 YLegend[Trango-RUTemp]: Deg C LegendO[Trango-RUTemp]: LegendI[Trango-RUTemp]: PageTop[Trango-RUTemp]: <H1>Trango RU Temperature</H1> ###############################################################################