You can subscribe to this list here.
| 2007 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(1) |
|---|---|---|---|---|---|---|---|---|---|---|---|---|
| 2008 |
Jan
(34) |
Feb
(22) |
Mar
(2) |
Apr
(4) |
May
|
Jun
(2) |
Jul
(2) |
Aug
|
Sep
(2) |
Oct
(4) |
Nov
(2) |
Dec
(22) |
| 2009 |
Jan
(20) |
Feb
(7) |
Mar
(5) |
Apr
(7) |
May
(10) |
Jun
|
Jul
(2) |
Aug
|
Sep
(21) |
Oct
(6) |
Nov
(10) |
Dec
(6) |
| 2010 |
Jan
(1) |
Feb
(4) |
Mar
(14) |
Apr
(1) |
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
(1) |
Nov
(5) |
Dec
(3) |
| 2011 |
Jan
(35) |
Feb
(1) |
Mar
(12) |
Apr
(9) |
May
(2) |
Jun
|
Jul
(2) |
Aug
(3) |
Sep
|
Oct
(1) |
Nov
|
Dec
|
| 2012 |
Jan
(2) |
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
(2) |
Sep
|
Oct
|
Nov
|
Dec
(3) |
| 2013 |
Jan
(3) |
Feb
|
Mar
(2) |
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2014 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
(3) |
Dec
|
| 2015 |
Jan
|
Feb
|
Mar
(1) |
Apr
|
May
|
Jun
(4) |
Jul
|
Aug
|
Sep
(1) |
Oct
|
Nov
|
Dec
|
| 2016 |
Jan
(1) |
Feb
|
Mar
(2) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
|
From: <buc...@us...> - 2016-05-26 14:22:14
|
Revision: 256
http://sourceforge.net/p/devmon/code/256
Author: buchanmilne
Date: 2016-05-26 14:22:12 +0000 (Thu, 26 May 2016)
Log Message:
-----------
Initial template for Cisco NX-OS n6000 (aka Cisco Nexus 5000, possibly others)
Added Paths:
-----------
trunk/templates/cisco-n6000/
trunk/templates/cisco-n6000/cpu/
trunk/templates/cisco-n6000/cpu/exceptions
trunk/templates/cisco-n6000/cpu/message
trunk/templates/cisco-n6000/cpu/oids
trunk/templates/cisco-n6000/cpu/thresholds
trunk/templates/cisco-n6000/cpu/transforms
trunk/templates/cisco-n6000/fans/
trunk/templates/cisco-n6000/fans/exceptions
trunk/templates/cisco-n6000/fans/message
trunk/templates/cisco-n6000/fans/oids
trunk/templates/cisco-n6000/fans/thresholds
trunk/templates/cisco-n6000/fans/transforms
trunk/templates/cisco-n6000/if_dsc/
trunk/templates/cisco-n6000/if_dsc/exceptions
trunk/templates/cisco-n6000/if_dsc/message
trunk/templates/cisco-n6000/if_dsc/oids
trunk/templates/cisco-n6000/if_dsc/thresholds
trunk/templates/cisco-n6000/if_dsc/transforms
trunk/templates/cisco-n6000/if_err/
trunk/templates/cisco-n6000/if_err/exceptions
trunk/templates/cisco-n6000/if_err/message
trunk/templates/cisco-n6000/if_err/oids
trunk/templates/cisco-n6000/if_err/thresholds
trunk/templates/cisco-n6000/if_err/transforms
trunk/templates/cisco-n6000/if_load/
trunk/templates/cisco-n6000/if_load/exceptions
trunk/templates/cisco-n6000/if_load/message
trunk/templates/cisco-n6000/if_load/oids
trunk/templates/cisco-n6000/if_load/thresholds
trunk/templates/cisco-n6000/if_load/transforms
trunk/templates/cisco-n6000/if_stat/
trunk/templates/cisco-n6000/if_stat/exceptions
trunk/templates/cisco-n6000/if_stat/message
trunk/templates/cisco-n6000/if_stat/oids
trunk/templates/cisco-n6000/if_stat/thresholds
trunk/templates/cisco-n6000/if_stat/transforms
trunk/templates/cisco-n6000/memory/
trunk/templates/cisco-n6000/memory/exceptions
trunk/templates/cisco-n6000/memory/message
trunk/templates/cisco-n6000/memory/oids
trunk/templates/cisco-n6000/memory/thresholds
trunk/templates/cisco-n6000/memory/transforms
trunk/templates/cisco-n6000/power/
trunk/templates/cisco-n6000/power/exceptions
trunk/templates/cisco-n6000/power/message
trunk/templates/cisco-n6000/power/oids
trunk/templates/cisco-n6000/power/thresholds
trunk/templates/cisco-n6000/power/transforms
trunk/templates/cisco-n6000/serial/
trunk/templates/cisco-n6000/serial/exceptions
trunk/templates/cisco-n6000/serial/message
trunk/templates/cisco-n6000/serial/oids
trunk/templates/cisco-n6000/serial/thresholds
trunk/templates/cisco-n6000/serial/transforms
trunk/templates/cisco-n6000/specs
Added: trunk/templates/cisco-n6000/cpu/exceptions
===================================================================
Added: trunk/templates/cisco-n6000/cpu/message
===================================================================
--- trunk/templates/cisco-n6000/cpu/message (rev 0)
+++ trunk/templates/cisco-n6000/cpu/message 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,10 @@
+
+{sysUpTimeSecs.color}: Up for {UpTimeTxt}
+{sysUpTimeSecs.color}: Last reboot due to {sysReloadReason}
+{CPUTotal5Min.color}: CPU usage: {CPUTotal5Min}%
+
+System description:
+{sysDescr}
+<!--
+<br>CPU 5 min average: {CPUTotal5Min}
+-->
Added: trunk/templates/cisco-n6000/cpu/oids
===================================================================
--- trunk/templates/cisco-n6000/cpu/oids (rev 0)
+++ trunk/templates/cisco-n6000/cpu/oids 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,5 @@
+
+sysDescr : .1.3.6.1.2.1.1.1.0 : leaf
+sysReloadReason : .1.3.6.1.4.1.9.2.1.2.0 : leaf
+sysUpTime : .1.3.6.1.2.1.1.3.0 : leaf
+CPUTotal5Min : .1.3.6.1.4.1.9.9.109.1.1.1.1.8.1 : leaf
Added: trunk/templates/cisco-n6000/cpu/thresholds
===================================================================
--- trunk/templates/cisco-n6000/cpu/thresholds (rev 0)
+++ trunk/templates/cisco-n6000/cpu/thresholds 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,8 @@
+
+CPUTotal5Min : red : >70 : CPU utilization is very high: {CPUTotal5Min}%
+CPUTotal5Min : yellow : >30 : CPU utilization is high: {CPUTotal5Min}%
+CPUTotal5Min : green : : CPU utilization is nominal: {CPUTotal5Min}%
+
+sysUpTimeSecs : red : <600 : Device rebooted recently. System uptime: {UpTimeTxt}
+sysUpTimeSecs : yellow : <5000 : Device rebooted recently. System uptime: {UpTimeTxt}
+sysUpTimeSecs : green : : System uptime: {UpTimeTxt}
Added: trunk/templates/cisco-n6000/cpu/transforms
===================================================================
--- trunk/templates/cisco-n6000/cpu/transforms (rev 0)
+++ trunk/templates/cisco-n6000/cpu/transforms 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,2 @@
+sysUpTimeSecs : MATH : {sysUpTime} / 100
+UpTimeTxt : ELAPSED : {sysUpTimeSecs}
Added: trunk/templates/cisco-n6000/fans/exceptions
===================================================================
Added: trunk/templates/cisco-n6000/fans/message
===================================================================
--- trunk/templates/cisco-n6000/fans/message (rev 0)
+++ trunk/templates/cisco-n6000/fans/message 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,3 @@
+TABLE:
+Name|Model|Serial|Class|Status
+{cefcFanTrayentPhysicalName}|{cefcFanTrayentPhysicalModelName}|{cefcFanTrayentPhysicalSerialNum}|{cefcFanTrayentPhysicalClassTxt}|{cefcFanTrayOperStatusTxt.color}{cefcFanTrayOperStatusTxt} {cefcFanTrayOperStatusTxt.errors}
Added: trunk/templates/cisco-n6000/fans/oids
===================================================================
--- trunk/templates/cisco-n6000/fans/oids (rev 0)
+++ trunk/templates/cisco-n6000/fans/oids 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,6 @@
+cefcFanTrayOperStatus : .1.3.6.1.4.1.9.9.117.1.4.1.1.1 : branch
+
+entPhysicalName : .1.3.6.1.2.1.47.1.1.1.1.7 : branch
+entPhysicalModelName : .1.3.6.1.2.1.47.1.1.1.1.13 : branch
+entPhysicalSerialNum : .1.3.6.1.2.1.47.1.1.1.1.11 : branch
+entPhysicalClass : .1.3.6.1.2.1.47.1.1.1.1.5 : branch
Added: trunk/templates/cisco-n6000/fans/thresholds
===================================================================
--- trunk/templates/cisco-n6000/fans/thresholds (rev 0)
+++ trunk/templates/cisco-n6000/fans/thresholds 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,3 @@
+cefcFanTrayOperStatusTxt : green : up
+cefcFanTrayOperStatusTxt : yellow : unknown|warning : {cefcFanTrayentPhysicalName} is {cefcFanTrayOperStatusTxt}
+cefcFanTrayOperStatusTxt : red : down : {cefcFanTrayentPhysicalName} is {cefcFanTrayOperStatusTxt}
Added: trunk/templates/cisco-n6000/fans/transforms
===================================================================
--- trunk/templates/cisco-n6000/fans/transforms (rev 0)
+++ trunk/templates/cisco-n6000/fans/transforms 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,10 @@
+cefcFanTrayOperStatusTxt : SWITCH : {cefcFanTrayOperStatus} 1=unknown,2=up,3=down,4=warning
+cefcFanTrayIndex : INDEX : {cefcFanTrayOperStatus}
+
+
+entPhysicalClassTxt : SWITCH : {entPhysicalClass} 1=other,2=unknown,3=chassis,4=backplane,5=container,6=powerSupply,7=fan,8=sensor,9=module,10=port,11=stack,12=cpu
+
+cefcFanTrayentPhysicalName : CHAIN : {cefcFanTrayIndex} {entPhysicalName}
+cefcFanTrayentPhysicalModelName : CHAIN : {cefcFanTrayIndex} {entPhysicalModelName}
+cefcFanTrayentPhysicalSerialNum : CHAIN : {cefcFanTrayIndex} {entPhysicalSerialNum}
+cefcFanTrayentPhysicalClassTxt : CHAIN : {cefcFanTrayIndex} {entPhysicalClassTxt}
Added: trunk/templates/cisco-n6000/if_dsc/exceptions
===================================================================
--- trunk/templates/cisco-n6000/if_dsc/exceptions (rev 0)
+++ trunk/templates/cisco-n6000/if_dsc/exceptions 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,2 @@
+ifName : alarm : .+
+ifName : ignore : Nu.+|Vl.+|VLAN.+
Added: trunk/templates/cisco-n6000/if_dsc/message
===================================================================
--- trunk/templates/cisco-n6000/if_dsc/message (rev 0)
+++ trunk/templates/cisco-n6000/if_dsc/message 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,8 @@
+<b>Discards:</b>
+TABLE:
+Ifc name|Discards in|Discard rate in|Discard load in|Discards out|Discard rate out|Discard load out
+{ifName}{ifAliasBox}|{ifInDiscards}|{ifInDps}|{ifInDscPct.color}{ifInDscPct}%{ifInDscPct.errors}|{ifOutDiscards}|{ifOutDps}|{ifOutDscPct.color}{ifOutDscPct}%{ifOutDscPct.errors}
+
+Note:
+Error rates are per second.
+Load percentages are based on error/bit ratio.
Added: trunk/templates/cisco-n6000/if_dsc/oids
===================================================================
--- trunk/templates/cisco-n6000/if_dsc/oids (rev 0)
+++ trunk/templates/cisco-n6000/if_dsc/oids 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,6 @@
+ifName : .1.3.6.1.2.1.31.1.1.1.1 : branch
+ifAlias : .1.3.6.1.2.1.31.1.1.1.18 : branch
+ifInOctets : .1.3.6.1.2.1.2.2.1.10 : branch
+ifInDiscards : .1.3.6.1.2.1.2.2.1.13 : branch
+ifOutOctets : .1.3.6.1.2.1.2.2.1.16 : branch
+ifOutDiscards : .1.3.6.1.2.1.2.2.1.19 : branch
Added: trunk/templates/cisco-n6000/if_dsc/thresholds
===================================================================
--- trunk/templates/cisco-n6000/if_dsc/thresholds (rev 0)
+++ trunk/templates/cisco-n6000/if_dsc/thresholds 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,6 @@
+# Create thresholds for all the error rate counters
+# oid name : color : limit : Error message
+ifInDscPct : yellow : 5 : {ifName}{ifAliasBox} - High input discard rate. ({ifInDscPct}%)
+ifInDscPct : red : 10 : {ifName}{ifAliasBox} - Very high input discard rate. ({ifInDscPct}%)
+ifOutDscPct : yellow : 5 : {ifName}{ifAliasBox} - High output discard rate ({ifOutDscPct}%)
+ifOutDscPct : red : 10 : {ifName}{ifAliasBox} - Very high output discard rate ({ifOutDscPct}%)
Added: trunk/templates/cisco-n6000/if_dsc/transforms
===================================================================
--- trunk/templates/cisco-n6000/if_dsc/transforms (rev 0)
+++ trunk/templates/cisco-n6000/if_dsc/transforms 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,14 @@
+# Get bit speed delta (so we dont have to provide custom delta limit)
+ifInOps : DELTA : {ifInOctets}
+ifOutOps : DELTA : {ifOutOctets}
+# Convert our octets delta into bits per second
+ifInBps : MATH : {ifInOps} x 8
+ifOutBps : MATH : {ifOutOps} x 8
+# Do delta transform on all error counters
+ifInDps : DELTA : {ifInDiscards}
+ifOutDps : DELTA : {ifOutDiscards}
+# Perform error to traffic percentage calculations
+ifInDscPct : MATH : ({ifInDps} / {ifInBps}) x 100
+ifOutDscPct : MATH : ({ifOutDps} / {ifOutBps}) x 100
+# Create an alias in a bracketed box, or nothing if alias is blank
+ifAliasBox : REGSUB : {ifAlias} /(\S+.*)/ [$1]/
Added: trunk/templates/cisco-n6000/if_err/exceptions
===================================================================
--- trunk/templates/cisco-n6000/if_err/exceptions (rev 0)
+++ trunk/templates/cisco-n6000/if_err/exceptions 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,2 @@
+ifName : alarm : .+
+ifName : ignore : Nu.+|Vl.+|VLAN.+
Added: trunk/templates/cisco-n6000/if_err/message
===================================================================
--- trunk/templates/cisco-n6000/if_err/message (rev 0)
+++ trunk/templates/cisco-n6000/if_err/message 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,11 @@
+<b>Errors:</b>
+Input errors: yellow={ifInErrPct.thresh:yellow}%, red={ifInErrPct.thresh:red}%
+Output errors: yellow={ifOutErrPct.thresh:yellow}%, red={ifOutErrPct.thresh:red}%
+
+TABLE:
+Ifc name|Errors in|Error rate in|Error load in|Errors out|Error rate out|Error load out
+{ifName}{ifAliasBox}|{ifInErrors}|{ifInEps}|{ifInErrPct.color}{ifInErrPct}%{ifInErrPct.errors}|{ifOutErrors}|{ifOutEps}|{ifOutErrPct.color}{ifOutErrPct}%{ifOutErrPct.errors}
+
+Note:
+Error rates are per second, averaged over a 60 second interval.
+Load percentages are based on error/bit ratio.
Added: trunk/templates/cisco-n6000/if_err/oids
===================================================================
--- trunk/templates/cisco-n6000/if_err/oids (rev 0)
+++ trunk/templates/cisco-n6000/if_err/oids 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,12 @@
+ifName : .1.3.6.1.2.1.31.1.1.1.1 : branch
+ifAlias : .1.3.6.1.2.1.31.1.1.1.18 : branch
+ifSpeed : .1.3.6.1.2.1.2.2.1.5 : branch
+ifInErrors : .1.3.6.1.2.1.2.2.1.14 : branch
+ifOutErrors : .1.3.6.1.2.1.2.2.1.20 : branch
+
+ifHCInUcastPkts : .1.3.6.1.2.1.31.1.1.1.7 : branch
+ifHCInMulticastPkts : 1.3.6.1.2.1.31.1.1.1.8 : branch
+ifHCInBroadcastPkts : .1.3.6.1.2.1.31.1.1.1.9 : branch
+ifHCOutUcastPkts : 1.3.6.1.2.1.31.1.1.1.11 : branch
+ifHCOutMulticastPkts : 1.3.6.1.2.1.31.1.1.1.12 : branch
+ifHCOutBroadcastPkts : 1.3.6.1.2.1.31.1.1.1.13 : branch
Added: trunk/templates/cisco-n6000/if_err/thresholds
===================================================================
--- trunk/templates/cisco-n6000/if_err/thresholds (rev 0)
+++ trunk/templates/cisco-n6000/if_err/thresholds 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,7 @@
+# Create thresholds for all the error rate counters
+# oid name : color : limit : Error message
+
+ifInErrPct : yellow : 1 : {ifName}{ifAliasBox} - High input error rate ({ifInErrPct}%)
+ifInErrPct : red : 5 : {ifName}{ifAliasBox} - Very high input error rate ({ifInErrPct}%)
+ifOutErrPct : yellow : 1 : {ifName}{ifAliasBox} - High output error rate ({ifOutErrPct}%)
+ifOutErrPct : red : 5 : {ifName}{ifAliasBox} - Very high output error rate ({ifOutErrPct}%)
Added: trunk/templates/cisco-n6000/if_err/transforms
===================================================================
--- trunk/templates/cisco-n6000/if_err/transforms (rev 0)
+++ trunk/templates/cisco-n6000/if_err/transforms 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,13 @@
+ifHCInPkts : MATH : {ifHCInUcastPkts} + {ifHCInMulticastPkts} + {ifHCInBroadcastPkts}
+ifHCOutPkts : MATH : {ifHCOutUcastPkts} + {ifHCOutMulticastPkts} + {ifHCOutBroadcastPkts}
+ifInPps : DELTA : {ifHCInPkts}
+ifOutPps : DELTA : {ifHCOutPkts}
+# Do delta transform on all error counters
+ifInEps : DELTA : {ifInErrors}
+ifOutEps : DELTA : {ifOutErrors}
+# Perform error to traffic percentage calculations
+ifInErrPct : MATH : ({ifInEps} / {ifInPps}) x 100
+ifOutErrPct : MATH : ({ifOutEps} / {ifOutPps}) x 100
+# Create an alias in a bracketed box, or nothing if alias is blank
+ifAliasBox : REGSUB : {ifAlias} /(\S+.*)/ [$1]/
+
Added: trunk/templates/cisco-n6000/if_load/exceptions
===================================================================
--- trunk/templates/cisco-n6000/if_load/exceptions (rev 0)
+++ trunk/templates/cisco-n6000/if_load/exceptions 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,2 @@
+#ifName : alarm : .+
+ifName : ignore : Nu.+|Vl.+|VLAN.+
Added: trunk/templates/cisco-n6000/if_load/message
===================================================================
--- trunk/templates/cisco-n6000/if_load/message (rev 0)
+++ trunk/templates/cisco-n6000/if_load/message 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,7 @@
+
+<b>Interface error rates:</b>
+Input load: yellow={ifInLoad.thresh:yellow}%, red={ifInLoad.thresh:red}%
+Output load: yellow={ifOutLoad.thresh:yellow}%, red={ifOutLoad.thresh:red}%
+TABLE:rrd(DS:ds0:ifHCInOctets:COUNTER; DS:ds1:ifHCOutOctets:COUNTER)
+Ifc name|Ifc Speed|Rate in (load %)|Rate out (load %)|Delta in|Delta out
+{ifName}{ifAliasBox}|{ifSpeedDisplay}|{ifInLoad.color}{ifInSpeed} ({ifInLoad}%){ifInLoad.errors}|{ifOutLoad.color}{ifOutSpeed} ({ifOutLoad}%){ifOutLoad.errors}|{ifInOps}|{ifOutOps}
Added: trunk/templates/cisco-n6000/if_load/oids
===================================================================
--- trunk/templates/cisco-n6000/if_load/oids (rev 0)
+++ trunk/templates/cisco-n6000/if_load/oids 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,5 @@
+ifNameNative : .1.3.6.1.2.1.31.1.1.1.1 : branch
+ifAlias : .1.3.6.1.2.1.31.1.1.1.18 : branch
+ifHighSpeed : .1.3.6.1.2.1.31.1.1.1.15 : branch
+ifHCInOctets : 1.3.6.1.2.1.31.1.1.1.6 : branch
+ifHCOutOctets : 1.3.6.1.2.1.31.1.1.1.10 : branch
Added: trunk/templates/cisco-n6000/if_load/thresholds
===================================================================
--- trunk/templates/cisco-n6000/if_load/thresholds (rev 0)
+++ trunk/templates/cisco-n6000/if_load/thresholds 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,4 @@
+ifInLoad : yellow : 75 : {ifName}{ifAliasBox} load is high ({ifInLoad}%)
+ifInLoad : red : 95 : {ifName}{ifAliasBox} load is very high ({ifInLoad}%)
+ifOutLoad : yellow : 75 : {ifName}{ifAliasBox} load is high ({ifOutLoad}%)
+ifOutLoad : red : 95 : {ifName}{ifAliasBox} load is very high ({ifOutLoad}%)
Added: trunk/templates/cisco-n6000/if_load/transforms
===================================================================
--- trunk/templates/cisco-n6000/if_load/transforms (rev 0)
+++ trunk/templates/cisco-n6000/if_load/transforms 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,18 @@
+# Create a human-readable ifc speed
+ifSpeedAcc : MATH : {ifHighSpeed} x 1000000 : 0
+ifSpeedDisplay : SPEED : {ifSpeedAcc}
+# Get bit speed delta (so we dont have to provide custom delta limit)
+ifInOps : DELTA : {ifHCInOctets}
+ifOutOps : DELTA : {ifHCOutOctets}
+# Convert our octets delta into bits per second
+ifInBps : MATH : {ifInOps} x 8
+ifOutBps : MATH : {ifOutOps} x 8
+# Make some easily readable speed variables
+ifInSpeed : SPEED : {ifInBps}
+ifOutSpeed : SPEED : {ifOutBps}
+# Now determine our percentage load, based on traffic and ifc speed
+ifInLoad : MATH : ({ifInBps} / {ifSpeedAcc}) x 100
+ifOutLoad : MATH : ({ifOutBps} / {ifSpeedAcc}) x 100
+# Create an alias in a bracketed box, or nothing if alias is blank
+ifAliasBox : REGSUB : {ifAlias} /(\S+.*)/ [$1]/
+ifName : REGSUB : {ifNameNative} /(\S+)(\s*)?(\S+)$/$1$3/
Added: trunk/templates/cisco-n6000/if_stat/exceptions
===================================================================
--- trunk/templates/cisco-n6000/if_stat/exceptions (rev 0)
+++ trunk/templates/cisco-n6000/if_stat/exceptions 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,2 @@
+ifName : alarm : .+
+ifName : ignore : Nu.+|Vl.+|VLAN.+
Added: trunk/templates/cisco-n6000/if_stat/message
===================================================================
--- trunk/templates/cisco-n6000/if_stat/message (rev 0)
+++ trunk/templates/cisco-n6000/if_stat/message 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,3 @@
+TABLE:
+Ifc name|Ifc speed|Ifc status
+{ifName}{ifAliasBox}|{ifSpeedH}|{ifStat.color}{ifStat}{ifStat.errors}
Added: trunk/templates/cisco-n6000/if_stat/oids
===================================================================
--- trunk/templates/cisco-n6000/if_stat/oids (rev 0)
+++ trunk/templates/cisco-n6000/if_stat/oids 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,6 @@
+ifName : .1.3.6.1.2.1.31.1.1.1.1 : branch
+ifAlias : .1.3.6.1.2.1.31.1.1.1.18 : branch
+ifBps : .1.3.6.1.2.1.2.2.1.5 : branch
+ifHighSpeed : .1.3.6.1.2.1.31.1.1.1.15 : branch
+ifAdminStatNum : .1.3.6.1.2.1.2.2.1.7 : branch
+ifOperStatNum : .1.3.6.1.2.1.2.2.1.8 : branch
Added: trunk/templates/cisco-n6000/if_stat/thresholds
===================================================================
--- trunk/templates/cisco-n6000/if_stat/thresholds (rev 0)
+++ trunk/templates/cisco-n6000/if_stat/thresholds 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,6 @@
+ifAdminStatTxt : green : admin down : Interface {ifName}{ifAliasBox} is {ifAdminStatTxt}
+ifAdminStatTxt : yellow : testing : Interface {ifName}{ifAliasBox} is {ifAdminStatTxt}
+ifAdminStatTxt : red : up : Interface {ifName}{ifAliasBox} is {ifAdminStatTxt}
+ifOperStatTxt : green : up : Interface {ifName}{ifAliasBox} is {ifOperStatTxt}
+ifOperStatTxt : yellow : dormant|testing|yellow|not present|layer down : Interface {ifName}{ifAliasBox} is {ifOperStatTxt}
+ifOperStatTxt : red : down : Interface {ifName}{ifAliasBox} is {ifOperStatTxt}
Added: trunk/templates/cisco-n6000/if_stat/transforms
===================================================================
--- trunk/templates/cisco-n6000/if_stat/transforms (rev 0)
+++ trunk/templates/cisco-n6000/if_stat/transforms 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,7 @@
+ifAdminStatTxt : SWITCH : {ifAdminStatNum} 1=up,2=admin down,3=testing
+ifOperStatTxt : SWITCH : {ifOperStatNum} 1=up,2=down,3=testing,4=unknown,5=dormant,6=not present,7=lower layer down
+ifStat : BEST : {ifAdminStatTxt},{ifOperStatTxt}
+ifSpeedAcc : MATH : {ifHighSpeed} x 1000000
+ifSpeed : SPEED : {ifBps}
+ifSpeedH : SPEED : {ifSpeedAcc}
+ifAliasBox : REGSUB : {ifAlias} /(\S+.*)/ [$1]/
Added: trunk/templates/cisco-n6000/memory/exceptions
===================================================================
Added: trunk/templates/cisco-n6000/memory/message
===================================================================
--- trunk/templates/cisco-n6000/memory/message (rev 0)
+++ trunk/templates/cisco-n6000/memory/message 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,7 @@
+Free memory: {mem_free} bytes ({mem_free_per}%)
+Used memory: {mem_used} bytes ({mem_used_per}%)
+------------- ----------------
+Total memory: {mem_total} bytes (100%)
+
+<!-- DEVMON to RRD Physical {mem_used_per}%
+-->
Added: trunk/templates/cisco-n6000/memory/oids
===================================================================
--- trunk/templates/cisco-n6000/memory/oids (rev 0)
+++ trunk/templates/cisco-n6000/memory/oids 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,3 @@
+mem_used : .1.3.6.1.4.1.9.9.109.1.1.1.1.12.1 : leaf
+mem_free : .1.3.6.1.4.1.9.9.109.1.1.1.1.13.1 : leaf
+
Added: trunk/templates/cisco-n6000/memory/thresholds
===================================================================
--- trunk/templates/cisco-n6000/memory/thresholds (rev 0)
+++ trunk/templates/cisco-n6000/memory/thresholds 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,2 @@
+mem_used_per : yellow : 75 : Memory load is high
+mem_used_per : red : 95 : Memory load is very high
Added: trunk/templates/cisco-n6000/memory/transforms
===================================================================
--- trunk/templates/cisco-n6000/memory/transforms (rev 0)
+++ trunk/templates/cisco-n6000/memory/transforms 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,3 @@
+mem_total : MATH : {mem_used} + {mem_free}
+mem_used_per : MATH : ({mem_used} x 100) / {mem_total} : 0
+mem_free_per : MATH : ({mem_free} x 100) / {mem_total} : 0
Added: trunk/templates/cisco-n6000/power/exceptions
===================================================================
--- trunk/templates/cisco-n6000/power/exceptions (rev 0)
+++ trunk/templates/cisco-n6000/power/exceptions 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,2 @@
+cefcFRUentPhysicalClassTxt : only : powerSupply
+cefcFRUentPhysicalClassTxt : alarm : powerSupply
Added: trunk/templates/cisco-n6000/power/message
===================================================================
--- trunk/templates/cisco-n6000/power/message (rev 0)
+++ trunk/templates/cisco-n6000/power/message 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,3 @@
+TABLE:
+Name|Model|Serial|cefcFRUPowerAdminStatus|cefcFRUPowerOperStatus|cefcFRUCurrent
+{cefcFRUentPhysicalName}|<!--{cefcFRUentPhysicalClassTxt}--> {cefcFRUentPhysicalModelName}|{cefcFRUentPhysicalSerialNum}|{cefcFRUPowerStatus.color}{cefcFRUPowerStatus}{cefcFRUPowerStatus.errors} ({cefcFRUPowerAdminStatusTxt})|{cefcFRUPowerOperStatusTxt} ({cefcFRUPowerOperStatus})|{cefcFRUCurrent}
Added: trunk/templates/cisco-n6000/power/oids
===================================================================
--- trunk/templates/cisco-n6000/power/oids (rev 0)
+++ trunk/templates/cisco-n6000/power/oids 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,11 @@
+cefcFRUPowerAdminStatus : .1.3.6.1.4.1.9.9.117.1.1.2.1.1 : branch
+cefcFRUPowerOperStatus : .1.3.6.1.4.1.9.9.117.1.1.2.1.2 : branch
+cefcFRUCurrent : .1.3.6.1.4.1.9.9.117.1.1.2.1.3 : branch
+
+
+entPhysicalName : .1.3.6.1.2.1.47.1.1.1.1.7 : branch
+entPhysicalModelName : .1.3.6.1.2.1.47.1.1.1.1.13 : branch
+entPhysicalSerialNum : .1.3.6.1.2.1.47.1.1.1.1.11 : branch
+entPhysicalClass : .1.3.6.1.2.1.47.1.1.1.1.5 : branch
+
+
Added: trunk/templates/cisco-n6000/power/thresholds
===================================================================
--- trunk/templates/cisco-n6000/power/thresholds (rev 0)
+++ trunk/templates/cisco-n6000/power/thresholds 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,8 @@
+cefcFRUPowerAdminStatusTxt : red : on|inlineAuto|inlineOn : {cefcFRUentPhysicalName} has status {cefcFRUPowerAdminStatusTxt}
+cefcFRUPowerAdminStatusTxt : yellow : powerCycle : {cefcFRUentPhysicalName} has status {cefcFRUPowerAdminStatusTxt}
+cefcFRUPowerAdminStatusTxt : green : admin off : {cefcFRUentPhysicalName} has status {cefcFRUPowerAdminStatusTxt}
+
+cefcFRUPowerOperStatusTxt : green : on|inlineAuto|inlineOn : {cefcFRUentPhysicalName} has status {cefcFRUPowerOperStatusTxt}
+cefcFRUPowerOperStatusTxt : yellow : powerCycle|onButFanFail : {cefcFRUentPhysicalName} has status {cefcFRUPowerOperStatusTxt}
+cefcFRUPowerOperStatusTxt : red : off.*|failed|onButInlinePowerFail : {cefcFRUentPhysicalName} has status {cefcFRUPowerOperStatusTxt}
+
Added: trunk/templates/cisco-n6000/power/transforms
===================================================================
--- trunk/templates/cisco-n6000/power/transforms (rev 0)
+++ trunk/templates/cisco-n6000/power/transforms 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,11 @@
+cefcFRUPowerIndex : INDEX : {cefcFRUPowerAdminStatus}
+cefcFRUPowerAdminStatusTxt : SWITCH : {cefcFRUPowerAdminStatus} 1=on,2=admin off,3=inlineAuto,4=inlineOn,5=powerCycle
+cefcFRUPowerOperStatusTxt : SWITCH : {cefcFRUPowerOperStatus} 1=offEnvOther,2=on,3=offAdmin,4=offDenied,5=offEnvPower,6=offEnvTemp,7=offEnvFan,8=failed,9=onButFanFail,10=offCooling,11=offConnectorRating,12=onButInlinePowerFail
+cefcFRUPowerStatus : BEST : {cefcFRUPowerAdminStatusTxt},{cefcFRUPowerOperStatusTxt}
+
+entPhysicalClassTxt : SWITCH : {entPhysicalClass} 1=other,2=unknown,3=chassis,4=backplane,5=container,6=powerSupply,7=fan,8=sensor,9=module,10=port,11=stack,12=cpu
+
+cefcFRUentPhysicalName : CHAIN : {cefcFRUPowerIndex} {entPhysicalName}
+cefcFRUentPhysicalModelName : CHAIN : {cefcFRUPowerIndex} {entPhysicalModelName}
+cefcFRUentPhysicalSerialNum : CHAIN : {cefcFRUPowerIndex} {entPhysicalSerialNum}
+cefcFRUentPhysicalClassTxt : CHAIN : {cefcFRUPowerIndex} {entPhysicalClassTxt}
Added: trunk/templates/cisco-n6000/serial/exceptions
===================================================================
--- trunk/templates/cisco-n6000/serial/exceptions (rev 0)
+++ trunk/templates/cisco-n6000/serial/exceptions 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,3 @@
+entPhysicalClassTxt : only : chassis|module|stack
+#entPhysicalIsFRUTxt : only : true
+#entPhysicalClass
Added: trunk/templates/cisco-n6000/serial/message
===================================================================
--- trunk/templates/cisco-n6000/serial/message (rev 0)
+++ trunk/templates/cisco-n6000/serial/message 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,3 @@
+TABLE:noalarmsmsg
+Model|Description|Hardware Rev|Software Rev|Serial Number
+<!--{entPhysicalClassTxt}-->{entPhysicalModelName}|{entPhysicalDescr}|{entPhysicalHardwareRev}|{entPhysicalSoftwareRev}|{entPhysicalSerialNum}
Added: trunk/templates/cisco-n6000/serial/oids
===================================================================
--- trunk/templates/cisco-n6000/serial/oids (rev 0)
+++ trunk/templates/cisco-n6000/serial/oids 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,15 @@
+entPhysicalDescr : .1.3.6.1.2.1.47.1.1.1.1.2 : branch
+#entPhysicalVendorType : .1.3.6.1.2.1.47.1.1.1.1.3 : branch
+entPhysicalContainedIn : .1.3.6.1.2.1.47.1.1.1.1.4 : branch
+entPhysicalClass : .1.3.6.1.2.1.47.1.1.1.1.5 : branch
+entPhysicalParentRelPos : .1.3.6.1.2.1.47.1.1.1.1.6 : branch
+entPhysicalName : .1.3.6.1.2.1.47.1.1.1.1.7 : branch
+entPhysicalHardwareRev : .1.3.6.1.2.1.47.1.1.1.1.8 : branch
+entPhysicalFirmwareRev : .1.3.6.1.2.1.47.1.1.1.1.9 : branch
+entPhysicalSoftwareRev : .1.3.6.1.2.1.47.1.1.1.1.10 : branch
+entPhysicalSerialNum : .1.3.6.1.2.1.47.1.1.1.1.11 : branch
+entPhysicalMfgName : .1.3.6.1.2.1.47.1.1.1.1.12 : branch
+entPhysicalModelName : .1.3.6.1.2.1.47.1.1.1.1.13 : branch
+entPhysicalAlias : .1.3.6.1.2.1.47.1.1.1.1.14 : branch
+entPhysicalAssetID : .1.3.6.1.2.1.47.1.1.1.1.15 : branch
+entPhysicalIsFRU : .1.3.6.1.2.1.47.1.1.1.1.16 : branch
Added: trunk/templates/cisco-n6000/serial/thresholds
===================================================================
Added: trunk/templates/cisco-n6000/serial/transforms
===================================================================
--- trunk/templates/cisco-n6000/serial/transforms (rev 0)
+++ trunk/templates/cisco-n6000/serial/transforms 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,5 @@
+entPhysicalClassTxt : SWITCH : {entPhysicalClass} 1=other,2=unknown,3=chassis,4=backplane,5=container,6=powerSupply,7=fan,8=sensor,9=module,10=port,11=stack,12=cpu
+
+entPhysicalIsFRUTxt : SWITCH : {entPhysicalIsFRU} 1=true,2=false
+
+entPhysicalIndex : INDEX : {entPhysicalContainedIn}
Added: trunk/templates/cisco-n6000/specs
===================================================================
--- trunk/templates/cisco-n6000/specs (rev 0)
+++ trunk/templates/cisco-n6000/specs 2016-05-26 14:22:12 UTC (rev 256)
@@ -0,0 +1,6 @@
+vendor : cisco
+model : n6000
+snmpver : 2
+sysdesc : Cisco NX-OS.*n6000.*
+#Cisco NX-OS(tm) n6000, Software (n6000-uk9), Version 7.0(5)N1(1), RELEASE SOFTWARE Copyright (c) 2002-2012 by Cisco Systems, Inc. Device Manager Version 6.0(2)N1(1), Compiled 10/29/2014 22:00:00
+#SNMPv2-MIB::sysObjectID.0 = OID: SNMPv2-SMI::enterprises.9.12.3.1.3.1410
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2016-03-11 11:47:04
|
Revision: 255
http://sourceforge.net/p/devmon/code/255
Author: buchanmilne
Date: 2016-03-11 11:47:02 +0000 (Fri, 11 Mar 2016)
Log Message:
-----------
Fix displaying of descriptions for sub-interfaces, and shorten by removing parenthesis
Modified Paths:
--------------
trunk/extras/devmongraphtitle.pl
Modified: trunk/extras/devmongraphtitle.pl
===================================================================
--- trunk/extras/devmongraphtitle.pl 2016-03-11 11:45:44 UTC (rev 254)
+++ trunk/extras/devmongraphtitle.pl 2016-03-11 11:47:02 UTC (rev 255)
@@ -22,7 +22,12 @@
print "Network Traffic $period\n";
exit 0
}
-my ($testname,$intname) = split(/\./,$files[0],3);
+my $rrd = $files[0];
+my ($testname,$intname);
+if ($rrd =~ /^([^\.]+)\.(.*)\.rrd$/) {
+ ($testname,$intname) = ($1,$2);
+}
+#my ($testname,$intname) = split(/\./,$files[0],3);
$intname =~ s/_/\//g if ($intname);
print "Looking for $intname\n" if $ENV{'DEBUG'};
@@ -73,11 +78,11 @@
$title = "$int ($descr) $period";
return $title if (length($title) <= $maxdesclen);
- $title = "$int ($descr)";
+ $title = "$int $descr";
if ( length($title) > $maxdesclen ) {
substr($descr,length($descr) - length($title) + $maxdesclen - 3,length($title) - $maxdesclen +3,"..");
#$title = "$int ($descr) $period";
- $title = "$int ($descr)";
+ $title = "$int $descr";
}
return $title;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2016-03-11 11:45:46
|
Revision: 254
http://sourceforge.net/p/devmon/code/254
Author: buchanmilne
Date: 2016-03-11 11:45:44 +0000 (Fri, 11 Mar 2016)
Log Message:
-----------
Support Xymon 4.3 by default without requiring compat variables
Modified Paths:
--------------
trunk/extras/devmon.initd.redhat
trunk/modules/dm_config.pm
Modified: trunk/extras/devmon.initd.redhat
===================================================================
--- trunk/extras/devmon.initd.redhat 2016-01-08 10:18:59 UTC (rev 253)
+++ trunk/extras/devmon.initd.redhat 2016-03-11 11:45:44 UTC (rev 254)
@@ -26,7 +26,11 @@
[ -e /etc/sysconfig/devmon ] && . /etc/sysconfig/devmon
prog="/usr/local/devmon/devmon"
-if [ -e ~hobbit/client/bin/bbcmd ]
+if [ -e ~xymon/server/bin/xymoncmd ]
+then prog="~xymon/server/bin/xymoncmd $prog"
+elif [ -e ~xymon/client/bin/xymoncmd ]
+then prog="~xymon/client/bin/xymoncmd $prog"
+elif [ -e ~hobbit/client/bin/bbcmd ]
then prog="~hobbit/client/bin/bbcmd $prog"
elif [ -e ~xymon/client/bin/bbcmd ]
then prog="~xymon/client/bin/bbcmd $prog"
Modified: trunk/modules/dm_config.pm
===================================================================
--- trunk/modules/dm_config.pm 2016-01-08 10:18:59 UTC (rev 253)
+++ trunk/modules/dm_config.pm 2016-03-11 11:45:44 UTC (rev 254)
@@ -122,11 +122,11 @@
'regex' => 'yes|no',
'set' => 0,
'case' => 0 },
- 'bbhosts' => { 'default' => (defined $ENV{'BBHOSTS'} and $ENV{'BBHOSTS'} ne '') ? $ENV{'BBHOSTS'} : '/home/hobbit/server/etc/bb-hosts',
+ 'bbhosts' => { 'default' => (defined $ENV{'HOSTSCFG'} and $ENV{'HOSTSCFG'} ne '') ? $ENV{'HOSTSCFG'} :(defined $ENV{'BBHOSTS'} and $ENV{'BBHOSTS'} ne '') ? $ENV{'BBHOSTS'} : '/home/hobbit/server/etc/bb-hosts',
'regex' => '.+',
'set' => 0,
'case' => 1 },
- 'bblocation' => { 'default' => (defined $ENV{'BBLOCATION'} and $ENV{'BBLOCATION'} ne '') ? $ENV{'BBLOCATION'} : '',
+ 'bblocation' => { 'default' => (defined $ENV{'XYMONNETWORK'} and $ENV{'XYMONNETWORK'} ne '') ? $ENV{'XYMONNETWORK'} : (defined $ENV{'BBLOCATION'} and $ENV{'BBLOCATION'} ne '') ? $ENV{'BBLOCATION'} : '',
'regex' => '\w+',
'set' => 0,
'case' => 1 },
@@ -174,15 +174,15 @@
'regex' => 'bb|hobbit|xymon',
'set' => 0,
'case' => 0 },
- 'dispserv' => { 'default' => (defined $ENV{'BBDISP'} and $ENV{BBDISP} ne '') ? $ENV{'BBDISP'} : 'localhost',
+ 'dispserv' => { 'default' => (defined $ENV{'XYMSRV'} and $ENV{'XYMSRV'} ne '' ) ? $ENV{'XYMSRV'} : (defined $ENV{'BBDISP'} and $ENV{BBDISP} ne '') ? $ENV{'BBDISP'} : 'localhost',
'regex' => '\S+',
'set' => 0,
'case' => 0 },
- 'dispport' => { 'default' => (defined $ENV{'BBPORT'} and $ENV{'BBPORT'} ne '') ? $ENV{'BBPORT'} : 1984,
+ 'dispport' => { 'default' => (defined $ENV{'XYMONDPORT'} and $ENV{'XYMONDPORT'} ne '') ? $ENV{'XYMONDPORT'} : (defined $ENV{'BBPORT'} and $ENV{'BBPORT'} ne '') ? $ENV{'BBPORT'} : 1984,
'regex' => '\d+',
'set' => 0,
'case' => 0 },
- 'bbdateformat' => { 'default' => (defined $ENV{'BBDATEFORMAT'} and $ENV{'BBDATEFORMAT'} ne '') ? $ENV{'BBDATEFORMAT'} : '',
+ 'bbdateformat' => { 'default' => (defined $ENV{'XYMONDATEFORMAT'} and $ENV{'XYMONDATEFORMAT'} ne '') ? $ENV{'XYMONDATEFORMAT'} : (defined $ENV{'BBDATEFORMAT'} and $ENV{'BBDATEFORMAT'} ne '') ? $ENV{'BBDATEFORMAT'} : '',
'regex' => '.+',
'set' => 0,
'case' => 1 },
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2016-01-08 10:19:02
|
Revision: 253
http://sourceforge.net/p/devmon/code/253
Author: buchanmilne
Date: 2016-01-08 10:18:59 +0000 (Fri, 08 Jan 2016)
Log Message:
-----------
Enforcing a maximum title length (82 chars), and do various changes to
accommodate as much of the description as possible if the title is too long
Modified Paths:
--------------
trunk/extras/devmongraphtitle.pl
Modified: trunk/extras/devmongraphtitle.pl
===================================================================
--- trunk/extras/devmongraphtitle.pl 2015-09-15 15:18:07 UTC (rev 252)
+++ trunk/extras/devmongraphtitle.pl 2016-01-08 10:18:59 UTC (rev 253)
@@ -12,6 +12,9 @@
my $graphinstance = shift || "";
my $period = shift||"";
my @files = @ARGV;
+my $maxdesclen = 82;
+my $longheader = "Network traffic on";
+my $shortheader = "Traffic on";
my $intdesc;
@@ -39,7 +42,7 @@
print if $ENV{'DEBUG'};
if (m(^<tr><td>$intname ([^<]+)?<\/td><td>)) {
$intdesc = $1;
- print "Network Traffic on $intname ($intdesc) $period\n";
+ print generate_title($intname,$intdesc), "\n";
exit 0;
}
}
@@ -48,8 +51,34 @@
print if $ENV{'DEBUG'};
if (m(^<tr><td>$intname ([^<]+)?<\/td><td>)) {
$intdesc = $1;
- print "Network Traffic on $intname ($intdesc) $period\n";
+ print generate_title($intname,$intdesc), "\n";
exit 0;
}
}
print "Network Traffic on $intname $period\n";
+
+sub generate_title {
+ my ($int,$descr) = @_;
+ my $title;
+ $title = "$longheader $int ($descr) $period";
+ return $title if (length($title) <= $maxdesclen);
+
+ if (length($title) > $maxdesclen + length($longheader) - length($shortheader) ) {
+ $period =~ s/ Hours/h/;
+ $period =~ s/ Days/d/;
+ }
+ $title = "$shortheader $int ($descr) $period";
+ return $title if (length($title) <= $maxdesclen);
+
+ $title = "$int ($descr) $period";
+ return $title if (length($title) <= $maxdesclen);
+
+ $title = "$int ($descr)";
+ if ( length($title) > $maxdesclen ) {
+ substr($descr,length($descr) - length($title) + $maxdesclen - 3,length($title) - $maxdesclen +3,"..");
+ #$title = "$int ($descr) $period";
+ $title = "$int ($descr)";
+ }
+ return $title;
+}
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2015-09-15 15:18:10
|
Revision: 252
http://sourceforge.net/p/devmon/code/252
Author: buchanmilne
Date: 2015-09-15 15:18:07 +0000 (Tue, 15 Sep 2015)
Log Message:
-----------
Use high-speed counters/rates for Cisco ASR1000
Modified Paths:
--------------
trunk/templates/cisco-asr1000/if_dsc/oids
trunk/templates/cisco-asr1000/if_dsc/thresholds
trunk/templates/cisco-asr1000/if_dsc/transforms
trunk/templates/cisco-asr1000/if_err/oids
trunk/templates/cisco-asr1000/if_err/thresholds
trunk/templates/cisco-asr1000/if_err/transforms
trunk/templates/cisco-asr1000/if_load/message
trunk/templates/cisco-asr1000/if_load/oids
trunk/templates/cisco-asr1000/if_load/thresholds
trunk/templates/cisco-asr1000/if_load/transforms
trunk/templates/cisco-asr1000/if_stat/message
trunk/templates/cisco-asr1000/if_stat/oids
trunk/templates/cisco-asr1000/if_stat/transforms
Modified: trunk/templates/cisco-asr1000/if_dsc/oids
===================================================================
--- trunk/templates/cisco-asr1000/if_dsc/oids 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_dsc/oids 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,6 +1,10 @@
ifName : .1.3.6.1.2.1.31.1.1.1.1 : branch
ifAlias : .1.3.6.1.2.1.31.1.1.1.18 : branch
-ifInOctets : .1.3.6.1.2.1.2.2.1.10 : branch
ifInDiscards : .1.3.6.1.2.1.2.2.1.13 : branch
-ifOutOctets : .1.3.6.1.2.1.2.2.1.16 : branch
ifOutDiscards : .1.3.6.1.2.1.2.2.1.19 : branch
+ifHCInUcastPkts : .1.3.6.1.2.1.31.1.1.1.7 : branch
+ifHCInMulticastPkts : 1.3.6.1.2.1.31.1.1.1.8 : branch
+ifHCInBroadcastPkts : .1.3.6.1.2.1.31.1.1.1.9 : branch
+ifHCOutUcastPkts : 1.3.6.1.2.1.31.1.1.1.11 : branch
+ifHCOutMulticastPkts : 1.3.6.1.2.1.31.1.1.1.12 : branch
+ifHCOutBroadcastPkts : 1.3.6.1.2.1.31.1.1.1.13 : branch
Modified: trunk/templates/cisco-asr1000/if_dsc/thresholds
===================================================================
--- trunk/templates/cisco-asr1000/if_dsc/thresholds 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_dsc/thresholds 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,6 +1,6 @@
# Create thresholds for all the error rate counters
# oid name : color : limit : Error message
-ifInDscPct : yellow : 5 : {ifName}{ifAliasBox} - High input discard rate. ({ifInDscPct}%)
-ifInDscPct : red : 10 : {ifName}{ifAliasBox} - Very high input discard rate. ({ifInDscPct}%)
-ifOutDscPct : yellow : 5 : {ifName}{ifAliasBox} - High output discard rate ({ifOutDscPct}%)
-ifOutDscPct : red : 10 : {ifName}{ifAliasBox} - Very high output discard rate ({ifOutDscPct}%)
+ifInDscPct : yellow : 1 : {ifName}{ifAliasBox} - High input discard rate. ({ifInDscPct}%)
+ifInDscPct : red : 5 : {ifName}{ifAliasBox} - Very high input discard rate. ({ifInDscPct}%)
+ifOutDscPct : yellow : 1 : {ifName}{ifAliasBox} - High output discard rate ({ifOutDscPct}%)
+ifOutDscPct : red : 5 : {ifName}{ifAliasBox} - Very high output discard rate ({ifOutDscPct}%)
Modified: trunk/templates/cisco-asr1000/if_dsc/transforms
===================================================================
--- trunk/templates/cisco-asr1000/if_dsc/transforms 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_dsc/transforms 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,14 +1,12 @@
-# Get bit speed delta (so we dont have to provide custom delta limit)
-ifInOps : DELTA : {ifInOctets}
-ifOutOps : DELTA : {ifOutOctets}
-# Convert our octets delta into bits per second
-ifInBps : MATH : {ifInOps} x 8
-ifOutBps : MATH : {ifOutOps} x 8
+ifHCInPkts : MATH : {ifHCInUcastPkts} + {ifHCInMulticastPkts} + {ifHCInBroadcastPkts}
+ifHCOutPkts : MATH : {ifHCOutUcastPkts} + {ifHCOutMulticastPkts} + {ifHCOutBroadcastPkts}
# Do delta transform on all error counters
+ifInPps : DELTA : {ifHCInPkts}
+ifOutPps : DELTA : {ifHCOutPkts}
ifInDps : DELTA : {ifInDiscards}
ifOutDps : DELTA : {ifOutDiscards}
# Perform error to traffic percentage calculations
-ifInDscPct : MATH : ({ifInDps} / {ifInBps}) x 100
-ifOutDscPct : MATH : ({ifOutDps} / {ifOutBps}) x 100
+ifInDscPct : MATH : ({ifInDps} / {ifInPps}) x 100
+ifOutDscPct : MATH : ({ifOutDps} / {ifOutPps}) x 100
# Create an alias in a bracketed box, or nothing if alias is blank
ifAliasBox : REGSUB : {ifAlias} /(\S+.*)/ [$1]/
Modified: trunk/templates/cisco-asr1000/if_err/oids
===================================================================
--- trunk/templates/cisco-asr1000/if_err/oids 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_err/oids 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,7 +1,12 @@
ifName : .1.3.6.1.2.1.31.1.1.1.1 : branch
ifAlias : .1.3.6.1.2.1.31.1.1.1.18 : branch
ifSpeed : .1.3.6.1.2.1.2.2.1.5 : branch
-ifInOctets : .1.3.6.1.2.1.2.2.1.10 : branch
ifInErrors : .1.3.6.1.2.1.2.2.1.14 : branch
-ifOutOctets : .1.3.6.1.2.1.2.2.1.16 : branch
ifOutErrors : .1.3.6.1.2.1.2.2.1.20 : branch
+
+ifHCInUcastPkts : .1.3.6.1.2.1.31.1.1.1.7 : branch
+ifHCInMulticastPkts : 1.3.6.1.2.1.31.1.1.1.8 : branch
+ifHCInBroadcastPkts : .1.3.6.1.2.1.31.1.1.1.9 : branch
+ifHCOutUcastPkts : 1.3.6.1.2.1.31.1.1.1.11 : branch
+ifHCOutMulticastPkts : 1.3.6.1.2.1.31.1.1.1.12 : branch
+ifHCOutBroadcastPkts : 1.3.6.1.2.1.31.1.1.1.13 : branch
Modified: trunk/templates/cisco-asr1000/if_err/thresholds
===================================================================
--- trunk/templates/cisco-asr1000/if_err/thresholds 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_err/thresholds 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,7 +1,7 @@
# Create thresholds for all the error rate counters
# oid name : color : limit : Error message
-ifInErrPct : yellow : 5 : {ifName}{ifAliasBox} - High input error rate ({ifInErrPct}%)
-ifInErrPct : red : 10 : {ifName}{ifAliasBox} - Very high input error rate ({ifInErrPct}%)
-ifOutErrPct : yellow : 5 : {ifName}{ifAliasBox} - High output error rate ({ifOutErrPct}%)
-ifOutErrPct : red : 10 : {ifName}{ifAliasBox} - Very high output error rate ({ifOutErrPct}%)
+ifInErrPct : yellow : 1 : {ifName}{ifAliasBox} - High input error rate ({ifInErrPct}%)
+ifInErrPct : red : 5 : {ifName}{ifAliasBox} - Very high input error rate ({ifInErrPct}%)
+ifOutErrPct : yellow : 1 : {ifName}{ifAliasBox} - High output error rate ({ifOutErrPct}%)
+ifOutErrPct : red : 5 : {ifName}{ifAliasBox} - Very high output error rate ({ifOutErrPct}%)
Modified: trunk/templates/cisco-asr1000/if_err/transforms
===================================================================
--- trunk/templates/cisco-asr1000/if_err/transforms 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_err/transforms 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,15 +1,13 @@
-# Get bit speed delta (so we dont have to provide custom delta limit)
-ifInOps : DELTA : {ifInOctets}
-ifOutOps : DELTA : {ifOutOctets}
-# Convert our octets delta into bits per second
-ifInBps : MATH : {ifInOps} x 8
-ifOutBps : MATH : {ifOutOps} x 8
+ifHCInPkts : MATH : {ifHCInUcastPkts} + {ifHCInMulticastPkts} + {ifHCInBroadcastPkts}
+ifHCOutPkts : MATH : {ifHCOutUcastPkts} + {ifHCOutMulticastPkts} + {ifHCOutBroadcastPkts}
+ifInPps : DELTA : {ifHCInPkts}
+ifOutPps : DELTA : {ifHCOutPkts}
# Do delta transform on all error counters
ifInEps : DELTA : {ifInErrors}
ifOutEps : DELTA : {ifOutErrors}
# Perform error to traffic percentage calculations
-ifInErrPct : MATH : ({ifInEps} / {ifInBps}) x 100
-ifOutErrPct : MATH : ({ifOutEps} / {ifOutBps}) x 100
+ifInErrPct : MATH : ({ifInEps} / {ifInPps}) x 100
+ifOutErrPct : MATH : ({ifOutEps} / {ifOutPps}) x 100
# Create an alias in a bracketed box, or nothing if alias is blank
ifAliasBox : REGSUB : {ifAlias} /(\S+.*)/ [$1]/
Modified: trunk/templates/cisco-asr1000/if_load/message
===================================================================
--- trunk/templates/cisco-asr1000/if_load/message 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_load/message 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,7 +1,7 @@
-<b>Interface error rates:</b>
+<b>Interface rates:</b>
Input load: yellow={ifInLoad.thresh:yellow}%, red={ifInLoad.thresh:red}%
Output load: yellow={ifOutLoad.thresh:yellow}%, red={ifOutLoad.thresh:red}%
-TABLE:rrd(DS:ds0:ifInOctets:COUNTER; DS:ds1:ifOutOctets:COUNTER)
-Ifc name|Ifc Speed|Rate in (load %)|Rate out (load %)
-{ifName}{ifAliasBox}|{ifSpeed}|{ifInLoad.color}{ifInSpeed} ({ifInLoad}%){ifInLoad.errors}|{ifOutLoad.color}{ifOutSpeed} ({ifOutLoad}%){ifOutLoad.errors}
+TABLE:rrd(DS:ds0:ifHCInOctets:COUNTER; DS:ds1:ifHCOutOctets:COUNTER)
+Ifc name|Ifc Speed|Rate in (load %)|Rate out (load %)|Delta in|Delta out
+{ifName}{ifAliasBox}|{ifSpeedDisplay}|{ifInLoad.color}{ifInSpeed} ({ifInLoad}%){ifInLoad.errors}|{ifOutLoad.color}{ifOutSpeed} ({ifOutLoad}%){ifOutLoad.errors}|{ifInOps}|{ifOutOps}
Modified: trunk/templates/cisco-asr1000/if_load/oids
===================================================================
--- trunk/templates/cisco-asr1000/if_load/oids 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_load/oids 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,5 +1,5 @@
-ifName : .1.3.6.1.2.1.31.1.1.1.1 : branch
+ifNameNative : .1.3.6.1.2.1.31.1.1.1.1 : branch
ifAlias : .1.3.6.1.2.1.31.1.1.1.18 : branch
-ifBps : .1.3.6.1.2.1.2.2.1.5 : branch
-ifInOctets : .1.3.6.1.2.1.2.2.1.10 : branch
-ifOutOctets : .1.3.6.1.2.1.2.2.1.16 : branch
+ifHighSpeed : .1.3.6.1.2.1.31.1.1.1.15 : branch
+ifHCInOctets : 1.3.6.1.2.1.31.1.1.1.6 : branch
+ifHCOutOctets : 1.3.6.1.2.1.31.1.1.1.10 : branch
Modified: trunk/templates/cisco-asr1000/if_load/thresholds
===================================================================
--- trunk/templates/cisco-asr1000/if_load/thresholds 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_load/thresholds 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,4 +1,4 @@
-ifInLoad : yellow : 75 : {ifName}{ifAliasBox} load is high
-ifInLoad : red : 95 : {ifName}{ifAliasBox} load is very high
-ifOutLoad : yellow : 75 : {ifName}{ifAliasBox} load is high
-ifOutLoad : red : 95 : {ifName}{ifAliasBox} load is very high
+ifInLoad : yellow : 75 : {ifName}{ifAliasBox} load is high ({ifInLoad}%)
+ifInLoad : red : 95 : {ifName}{ifAliasBox} load is very high ({ifInLoad}%)
+ifOutLoad : yellow : 75 : {ifName}{ifAliasBox} load is high ({ifOutLoad}%)
+ifOutLoad : red : 95 : {ifName}{ifAliasBox} load is very high ({ifOutLoad}%)
Modified: trunk/templates/cisco-asr1000/if_load/transforms
===================================================================
--- trunk/templates/cisco-asr1000/if_load/transforms 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_load/transforms 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,8 +1,9 @@
# Create a human-readable ifc speed
-ifSpeed : SPEED : {ifBps}
+ifSpeedAcc : MATH : {ifHighSpeed} x 1000000 : 0
+ifSpeedDisplay : SPEED : {ifSpeedAcc}
# Get bit speed delta (so we dont have to provide custom delta limit)
-ifInOps : DELTA : {ifInOctets}
-ifOutOps : DELTA : {ifOutOctets}
+ifInOps : DELTA : {ifHCInOctets}
+ifOutOps : DELTA : {ifHCOutOctets}
# Convert our octets delta into bits per second
ifInBps : MATH : {ifInOps} x 8
ifOutBps : MATH : {ifOutOps} x 8
@@ -10,7 +11,8 @@
ifInSpeed : SPEED : {ifInBps}
ifOutSpeed : SPEED : {ifOutBps}
# Now determine our percentage load, based on traffic and ifc speed
-ifInLoad : MATH : ({ifInBps} / {ifBps}) x 100
-ifOutLoad : MATH : ({ifOutBps} / {ifBps}) x 100
+ifInLoad : MATH : ({ifInBps} / {ifSpeedAcc}) x 100
+ifOutLoad : MATH : ({ifOutBps} / {ifSpeedAcc}) x 100
# Create an alias in a bracketed box, or nothing if alias is blank
ifAliasBox : REGSUB : {ifAlias} /(\S+.*)/ [$1]/
+ifName : REGSUB : {ifNameNative} /(\S+)(\s*)?(\S+)$/$1$3/
Modified: trunk/templates/cisco-asr1000/if_stat/message
===================================================================
--- trunk/templates/cisco-asr1000/if_stat/message 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_stat/message 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,3 +1,3 @@
TABLE:
Ifc name|Ifc speed|Ifc status
-{ifName}{ifAliasBox}|{ifSpeed}|{ifStat.color}{ifStat}{ifStat.errors}
+{ifName}{ifAliasBox}|{ifSpeedH}|{ifStat.color}{ifStat}{ifStat.errors}
Modified: trunk/templates/cisco-asr1000/if_stat/oids
===================================================================
--- trunk/templates/cisco-asr1000/if_stat/oids 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_stat/oids 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,5 +1,6 @@
ifName : .1.3.6.1.2.1.31.1.1.1.1 : branch
ifAlias : .1.3.6.1.2.1.31.1.1.1.18 : branch
ifBps : .1.3.6.1.2.1.2.2.1.5 : branch
+ifHighSpeed : .1.3.6.1.2.1.31.1.1.1.15 : branch
ifAdminStatNum : .1.3.6.1.2.1.2.2.1.7 : branch
ifOperStatNum : .1.3.6.1.2.1.2.2.1.8 : branch
Modified: trunk/templates/cisco-asr1000/if_stat/transforms
===================================================================
--- trunk/templates/cisco-asr1000/if_stat/transforms 2015-06-02 15:28:36 UTC (rev 251)
+++ trunk/templates/cisco-asr1000/if_stat/transforms 2015-09-15 15:18:07 UTC (rev 252)
@@ -1,5 +1,7 @@
ifAdminStatTxt : SWITCH : {ifAdminStatNum} 1=up,2=admin down,3=testing
ifOperStatTxt : SWITCH : {ifOperStatNum} 1=up,2=down,3=testing,4=unknown,5=dormant,6=not present,7=lower layer down
ifStat : BEST : {ifAdminStatTxt},{ifOperStatTxt}
+ifSpeedAcc : MATH : {ifHighSpeed} x 1000000
ifSpeed : SPEED : {ifBps}
+ifSpeedH : SPEED : {ifSpeedAcc}
ifAliasBox : REGSUB : {ifAlias} /(\S+.*)/ [$1]/
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2015-06-02 15:28:38
|
Revision: 251
http://sourceforge.net/p/devmon/code/251
Author: buchanmilne
Date: 2015-06-02 15:28:36 +0000 (Tue, 02 Jun 2015)
Log Message:
-----------
Dont add ignored repeaters to the 'Alarming on' message
Modified Paths:
--------------
trunk/modules/dm_tests.pm
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2015-06-02 15:13:49 UTC (rev 250)
+++ trunk/modules/dm_tests.pm 2015-06-02 15:28:36 UTC (rev 251)
@@ -1983,6 +1983,7 @@
T_LEAF: for my $leaf (@table_leaves) {
my $row_data = $line;
+ my $alarm_int;
# Do some alarm logic
my $pri_val = $oids->{$pri}{'val'}{$leaf};
@@ -2047,12 +2048,10 @@
}
# If this is our primary oid, and we are have an alarm
- # variable defined, add this to our alarm header if we are
- # alarming on it; Wrap our header at 60 chars
- if(!defined $t_opts{'noalarmsmsg'} and $alarm) {
- $alarm_ints =~ s/(.{60,}),$/$1)\nAlarming on (/;
- $alarm_ints .= "$val,";
- }
+ # variable defined, save it so we can add it later
+ $alarm_int = $val;
+ #
+ #
}
# See if we have a valid flag, if so, replace the
@@ -2122,6 +2121,12 @@
}
}
+ # add the primary repeater to our alarm header if we are
+ # alarming on it; Wrap our header at 60 chars
+ if(!defined $t_opts{'noalarmsmsg'} and $alarm) {
+ $alarm_ints =~ s/(.{60,}),$/$1)\nAlarming on (/;
+ $alarm_ints .= "$alarm_int,";
+ }
# Finished with this row (signified by the primary leaf id)
if(defined $t_opts{'nonhtml'} || defined $t_opts{'plain'}) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2015-06-02 15:13:51
|
Revision: 250
http://sourceforge.net/p/devmon/code/250
Author: buchanmilne
Date: 2015-06-02 15:13:49 +0000 (Tue, 02 Jun 2015)
Log Message:
-----------
Keep sending RRD data for rows that don't alarm, if you don't want RRDs, ignore the row
Modified Paths:
--------------
trunk/modules/dm_tests.pm
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2015-06-02 14:59:22 UTC (rev 249)
+++ trunk/modules/dm_tests.pm 2015-06-02 15:13:49 UTC (rev 250)
@@ -2037,10 +2037,13 @@
for my $name (keys %rrd) {
$rrd{$name}{'pri'} = $oid if $rrd{$name}{'pri'} eq 'pri';
- if ($rrd{$name}{'all'} or $alarm) {
+ # This condition looks incorrect. We should not remove rrds if alerting
+ # is disabled for this leaf. If the user doesnt want a graph, they probably
+ # dont want this leaf in the table, they should set 'ignore' instead of 'noalarm'
+ #if ($rrd{$name}{'all'} or $alarm) {
# add to list, but check we're not pushing multiple times
push @{$rrd{$name}{'leaves'}}, $leaf unless grep {$_ eq $leaf} @{$rrd{$name}{'leaves'}};
- }
+ #}
}
# If this is our primary oid, and we are have an alarm
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2015-06-02 14:59:23
|
Revision: 249
http://sourceforge.net/p/devmon/code/249
Author: buchanmilne
Date: 2015-06-02 14:59:22 +0000 (Tue, 02 Jun 2015)
Log Message:
-----------
Merge patch from Wim Nelis (ticket #18)
Modified Paths:
--------------
trunk/modules/dm_tests.pm
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2015-06-02 14:46:00 UTC (rev 248)
+++ trunk/modules/dm_tests.pm 2015-06-02 14:59:22 UTC (rev 249)
@@ -1990,12 +1990,12 @@
my $a_val = $dev->{'except'}{$test}{$pri}{'alarm'} ||
$dev->{'except'}{'all'}{$pri}{'alarm'} ||
$tmpl->{'oids'}{$pri}{'except'}{'alarm'};
- $alarm = ($pri_val =~ /^($a_val)$/) ? 1 : 0 if defined $a_val;
+ $alarm = ($pri_val =~ /^(?:$a_val)$/) ? 1 : 0 if defined $a_val;
my $na_val = $dev->{'except'}{$test}{$pri}{'noalarm'} ||
$dev->{'except'}{'all'}{$pri}{'noalarm'} ||
$tmpl->{'oids'}{$pri}{'except'}{'noalarm'};
- $alarm = 0 if defined $na_val and $pri_val =~ /^($na_val)$/;
+ $alarm = 0 if defined $na_val and $pri_val =~ /^(?:$na_val)$/;
# Now go through all the oids in our table row and replace them
for my $root ($row_data =~ /\{(.+?)\}/g) {
@@ -2023,8 +2023,8 @@
my $only = $dev->{'except'}{$test}{$oid}{'only'} ||
$dev->{'except'}{'all'}{$oid}{'only'} ||
$tmpl->{'oids'}{$oid}{'except'}{'only'};
- next T_LEAF if defined $ignore and $val =~ /^($ignore)$/;
- next T_LEAF if defined $only and $val !~ /^($only)$/;
+ next T_LEAF if defined $ignore and $val =~ /^(?:$ignore)$/;
+ next T_LEAF if defined $only and $val !~ /^(?:$only)$/;
# If we arent alarming on a value, its green by default
@@ -2347,28 +2347,28 @@
if(defined $dev->{'except'}{$test}{$oid}{'noalarm'}) {
my $match = $dev->{'except'}{$test}{$oid}{'noalarm'};
- return 1 if $val =~ /^($match)$/;
+ return 1 if $val =~ /^(?:$match)$/;
}
elsif(defined $dev->{'except'}{'all'}{$oid}{'noalarm'}) {
my $match = $dev->{'except'}{'all'}{$oid}{'noalarm'};
- return 1 if $val =~ /^($match)$/;
+ return 1 if $val =~ /^(?:$match)$/;
}
elsif(defined $tmpl->{'oids'}{$oid}{'except'}{'noalarm'}) {
my $match = $tmpl->{'oids'}{$oid}{'except'}{'noalarm'};
- return 1 if $val =~ /^($match)$/;
+ return 1 if $val =~ /^(?:$match)$/;
}
if(defined $dev->{'except'}{$test}{$oid}{'alarm'}) {
my $match = $dev->{'except'}{$test}{$oid}{'alarm'};
- return 1 if $val !~ /^($match)$/;
+ return 1 if $val !~ /^(?:$match)$/;
}
elsif(defined $dev->{'except'}{'all'}{$oid}{'alarm'}) {
my $match = $dev->{'except'}{'all'}{$oid}{'alarm'};
- return 1 if $val !~ /^($match)$/;
+ return 1 if $val !~ /^(?:$match)$/;
}
elsif(defined $tmpl->{'oids'}{$oid}{'except'}{'alarm'}) {
my $match = $tmpl->{'oids'}{$oid}{'except'}{'alarm'};
- return 1 if $val !~ /^($match)$/;
+ return 1 if $val !~ /^(?:$match)$/;
}
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2015-06-02 14:46:01
|
Revision: 248
http://sourceforge.net/p/devmon/code/248
Author: buchanmilne
Date: 2015-06-02 14:46:00 +0000 (Tue, 02 Jun 2015)
Log Message:
-----------
Some fixes for MATCH operator
Modified Paths:
--------------
trunk/modules/dm_tests.pm
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2015-03-13 16:50:33 UTC (rev 247)
+++ trunk/modules/dm_tests.pm 2015-06-02 14:46:00 UTC (rev 248)
@@ -1766,17 +1766,17 @@
$oid_h->{'error'}{$leaf} = 1;
next;
}
- do_log("$val matched $expr, assigning new $idx from old row $leaf",0) if $g{'debug'} and $res;
+ do_log("$val matched $expr, assigning new row $idx from old row $leaf",0) if $g{'debug'} and $res;
next unless $res;
# Our oid sub leaf
# my $oid_idx = $src_h->{'val'}{$leaf};
if(!defined $leaf) {
- $oid_h->{'val'}{$leaf} = 'Target val missing - index';
- $oid_h->{'time'}{$leaf} = time;
- $oid_h->{'color'}{$leaf} = 'yellow';
- $oid_h->{'error'}{$leaf} = 1;
+ $oid_h->{'val'}{$idx} = 'Target val missing - index';
+ $oid_h->{'time'}{$idx} = time;
+ $oid_h->{'color'}{$idx} = 'yellow';
+ $oid_h->{'error'}{$idx} = 1;
next;
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2015-03-13 16:50:40
|
Revision: 247
http://sourceforge.net/p/devmon/code/247
Author: buchanmilne
Date: 2015-03-13 16:50:33 +0000 (Fri, 13 Mar 2015)
Log Message:
-----------
Improvements to the bgp test for cisco-asr1000
Modified Paths:
--------------
trunk/templates/cisco-asr1000/bgp/message
trunk/templates/cisco-asr1000/bgp/thresholds
trunk/templates/cisco-asr1000/bgp/transforms
Modified: trunk/templates/cisco-asr1000/bgp/message
===================================================================
--- trunk/templates/cisco-asr1000/bgp/message 2014-11-27 13:19:01 UTC (rev 246)
+++ trunk/templates/cisco-asr1000/bgp/message 2015-03-13 16:50:33 UTC (rev 247)
@@ -1,7 +1,5 @@
BGP Local AS: {bgpLocalAs}
-{bgpPeerStateTxt.errors}
-{bgpPeerAdminStatusTxt.errors}
TABLE:
-Identifier|Peer IP|Remote AS|Peer State|Peer Admin Status|Negotiated Version
-{bgpPeerIdentifier}|{bgpPeerPeerRemoteAddr}|{bgpPeerPeerRemoteAS}|{bgpPeerStateTxt.color} {bgpPeerStateTxt}|{bgpPeerAdminStatusTxt.color} {bgpPeerAdminStatusTxt}|{bgpPeerNegotiatedVersion}
+Peer IP|Identifier|Remote AS|Peer Status|Negotiated Version
+{bgpPeerPeerRemoteAddr}|{bgpPeerIdentifier}|{bgpPeerPeerRemoteAS}|{bgpPeerStatus.color} {bgpPeerStatus}{bgpPeerStatus.errors}|{bgpPeerNegotiatedVersion}
Modified: trunk/templates/cisco-asr1000/bgp/thresholds
===================================================================
--- trunk/templates/cisco-asr1000/bgp/thresholds 2014-11-27 13:19:01 UTC (rev 246)
+++ trunk/templates/cisco-asr1000/bgp/thresholds 2015-03-13 16:50:33 UTC (rev 247)
@@ -1,3 +1,6 @@
bgpPeerStateTxt : green : established : BGP Session established
bgpPeerStateTxt : yellow :
-bgpPeerStateTxt: red : idle|connect|active|opensent|openconfirm : BGP Session not established
+bgpPeerStateTxt: red : idle|connect|active|opensent|openconfirm : BGP Session to {bgpPeerPeerRemoteAddr} AS {bgpPeerPeerRemoteAS} not established
+
+bgpPeerAdminStatusTxt : green : stop : BGP Peering disabled
+bgpPeerAdminStatusTxt : red : start : BGP Peering to {bgpPeerPeerRemoteAddr} AS {bgpPeerPeerRemoteAS} enabled but not established
Modified: trunk/templates/cisco-asr1000/bgp/transforms
===================================================================
--- trunk/templates/cisco-asr1000/bgp/transforms 2014-11-27 13:19:01 UTC (rev 246)
+++ trunk/templates/cisco-asr1000/bgp/transforms 2015-03-13 16:50:33 UTC (rev 247)
@@ -1,2 +1,3 @@
bgpPeerStateTxt : SWITCH : {bgpPeerState} 1=idle,2=connect,3=active,4=opensent,5=openconfirm,6=established
bgpPeerAdminStatusTxt : SWITCH : {bgpPeerAdminStatus} 1=stop,2=start
+bgpPeerStatus : BEST : {bgpPeerStateTxt},{bgpPeerAdminStatusTxt}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2014-11-27 13:19:10
|
Revision: 246
http://sourceforge.net/p/devmon/code/246
Author: buchanmilne
Date: 2014-11-27 13:19:01 +0000 (Thu, 27 Nov 2014)
Log Message:
-----------
Add a new 'PACK' transform, which does exactly the inverse of the UNPACK transform
Modified Paths:
--------------
trunk/docs/TEMPLATES
trunk/modules/dm_templates.pm
trunk/modules/dm_tests.pm
Modified: trunk/docs/TEMPLATES
===================================================================
--- trunk/docs/TEMPLATES 2014-11-27 12:53:57 UTC (rev 245)
+++ trunk/docs/TEMPLATES 2014-11-27 13:19:01 UTC (rev 246)
@@ -522,7 +522,11 @@
(i.e. 300549.3420). The default value is 2 precision characters.
To remove the decimal characters alltogether, specify a value of 0.
+ 'UNPACK' transform:
+ The inverse of the 'PACK' transform.
+ Introduced in 0.3.1
+
'REGSUB' transform:
One of the most powerful and complicated transforms, the regsub
Modified: trunk/modules/dm_templates.pm
===================================================================
--- trunk/modules/dm_templates.pm 2014-11-27 12:53:57 UTC (rev 245)
+++ trunk/modules/dm_templates.pm 2014-11-27 13:19:01 UTC (rev 246)
@@ -560,6 +560,26 @@
last CASE;
};
+ $func_type eq 'pack' and do {
+ $temp =~ s/^\s*\{\s*\S+?\s*\}\s+(\S+)(\s+.+)?//;
+ my $type = $1;
+ my $validChars = 'aAbBcCdDfFhHiIjJlLnNsSvVuUwxZ';
+ do_log("PACK transform uses only a single oid,an encode type, " .
+ "and an optional seperator at $trans_file, line $l_num", 0)
+ and next LINE if $temp ne '';
+ do_log("No encode type at $trans_file, line $l_num", 0)
+ and next LINE if !defined $type;
+ while($type =~ s/\((.+?)\)(\d+|\*)?//) {
+ my $bit = $1;
+ do_log("Bad encode type ($bit) at $trans_file, line $l_num", 0)
+ and next LINE if $bit !~ /^([$validChars](\d+|\*)?)+$/i;
+ }
+ do_log("Bad encode type ($type) at $trans_file, line $l_num", 0)
+ and next LINE if $type ne '' and
+ $type !~ /^([$validChars](\d+|\*)?)+$/i;
+ last CASE;
+ };
+
$func_type eq 'regsub' and do {
$temp =~ s/^\{\s*\S+?\s*\}\s*\/.+\/.*\/\s*$//g;
do_log("REGSUB transform should be a perl regex substitution at " .
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2014-11-27 12:53:57 UTC (rev 245)
+++ trunk/modules/dm_tests.pm 2014-11-27 13:19:01 UTC (rev 246)
@@ -773,8 +773,55 @@
}
+ sub trans_pack {
+ my ($device, $oids, $oid, $thr) = @_;
+ my $oid_h = \%{$oids->{$oid}};
+ my ($dep_oid, $type, $seperator) = ($1, $2, $3 || '')
+ if $oid_h->{'trans_data'} =~ /\{(.+)\}\s+(\S+)(?:\s+"(.+)")?/;
+ my $dep_oid_h = \%{$oids->{$dep_oid}};
+ # Validate our dependencies
+ validate_deps($device, $oids, $oid, [$dep_oid]) or return;
+
+ # See if we are a repeating variable type datum
+ # (such as that generated by snmpwalking a table)
+ if($oid_h->{'repeat'}) {
+
+ # Unpack ze data
+ for my $leaf (keys %{$dep_oid_h->{'val'}}) {
+ # Skip if we got a dependency error for this leaf
+ next if $oid_h->{'error'}{$leaf};
+
+ my @packed = split $seperator, $dep_oid_h->{'val'}{$leaf};
+ my $val = pack $type, @packed;
+
+ do_log("Transformed $dep_oid_h->{'val'}{$leaf}, first val $packed[0], to $val via pack transform type $type, seperator $seperator ",0) if $g{'debug'};
+
+ $oid_h->{'val'}{$leaf} = $val;
+ $oid_h->{'time'}{$leaf} = time;
+ }
+
+ # Apply thresholds
+ apply_thresh_rep($oids, $thr, $oid);
+ }
+
+ # Otherwise we are a single entry datum
+ else {
+ my $packed = $dep_oid_h->{'val'};
+ my @vars = pack $type, $packed;
+
+ $oid_h->{'val'} = join $seperator, @vars;
+ $oid_h->{'time'} = time;
+
+ # Apply thresholds
+ apply_thresh($oids, $thr, $oid);
+ }
+
+ }
+
+
+
# Translate hex or octal data into decimal ##################################
sub trans_unpack {
my ($device, $oids, $oid, $thr) = @_;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2014-11-27 12:54:01
|
Revision: 245
http://sourceforge.net/p/devmon/code/245
Author: buchanmilne
Date: 2014-11-27 12:53:57 +0000 (Thu, 27 Nov 2014)
Log Message:
-----------
Improve logging:
- Move some logging only required for dev purposes to debug level 5
- Include the device name in "Missing repeater data" logs
Modified Paths:
--------------
trunk/modules/dm_config.pm
trunk/modules/dm_tests.pm
Modified: trunk/modules/dm_config.pm
===================================================================
--- trunk/modules/dm_config.pm 2013-09-02 12:30:23 UTC (rev 244)
+++ trunk/modules/dm_config.pm 2014-11-27 12:53:57 UTC (rev 245)
@@ -1323,7 +1323,7 @@
my ($ip, $host, $bbopts) = ($1, $2, $3);
# Skip if the NET tag does not match this site
- do_log("Checking if $bbopts matches NET:" . $g{'bblocation'} . ".",4) if $g{'debug'};
+ do_log("Checking if $bbopts matches NET:" . $g{'bblocation'} . ".",5) if $g{'debug'};
if ($g{'bblocation'} ne '') {
if ($bbopts !~ / NET:$g{'bblocation'}/) {
do_log("The NET for $host is not $g{'bblocation'}. Skipping.",3);
@@ -1508,7 +1508,7 @@
# Skip if this host doesnt match the regex
if ($sysdesc !~ /$regex/) {
- do_log("$host did not match $vendor : $model : $regex", 0)
+ do_log("$host did not match $vendor : $model : $regex", 4)
if $g{'debug'};
next OLDMODEL;
}
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2013-09-02 12:30:23 UTC (rev 244)
+++ trunk/modules/dm_tests.pm 2014-11-27 12:53:57 UTC (rev 245)
@@ -1235,7 +1235,7 @@
}
else {$then_oid_val = $oids->{$then_oid}{'val'}}
if(!defined $then_oid_val) {
- do_log("Missing repeater data for trans_switch on $oid", 0);
+ do_log("Missing repeater data for trans_switch on $oid on $device", 0);
$then_oid_val = 'Undefined';
}
$then =~ s/\{$then_oid\}/$then_oid_val/g;
@@ -1285,7 +1285,7 @@
}
else {$then_oid_val = $oids->{$then_oid}{'val'}}
if(!defined $then_oid_val) {
- do_log("Missing repeater data for trans_switch on $oid", 0);
+ do_log("Missing repeater data for trans_switch on $oid on $device", 0);
$then_oid_val = 'Undefined';
}
$then =~ s/\{$then_oid\}/$then_oid_val/g;
@@ -1358,7 +1358,7 @@
}
else {$then_oid_val = $oid_h->{'val'}}
if(!defined $then_oid_val) {
- do_log("Missing repeater data for trans_tswitch on $oid", 0);
+ do_log("Missing repeater data for trans_tswitch on $oid on $device", 0);
$then_oid_val = 'Undefined';
if(!defined $oid_h->{'color'}{$leaf}) {
$oid_h->{'color'}{$leaf} = $oids->{$then_oid}{'color'};
@@ -1418,7 +1418,7 @@
}
if(!defined $then_oid_val) {
- do_log("Missing repeater data for trans_tswitch on $oid", 0);
+ do_log("Missing repeater data for trans_tswitch on $oid on $device", 0);
$then_oid_val = 'Undefined';
}
$then =~ s/\{$then_oid\}/$then_oid_val/g;
@@ -1905,7 +1905,7 @@
# Make sure we have leaf data for our primary oid
if(!defined $oids->{$pri}{'val'}) {
- do_log("Missing repeater data for $pri for $test msg", 0);
+ do_log("Missing repeater data for $pri for $test msg on $device", 0);
$msg .= "&clear Missing repeater data for primary OID $pri\n";
$worst_color = 'clear';
next;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: Fosiul a. <exp...@gm...> - 2014-11-20 14:48:57
|
Hi
I am very new to devmon, and trying to do bellow and need some help to
understand
Basically,
Device-A
snmpwalk -c xxxx-v 2c Device-A .1.3.6.1.4.1.2620.1.5.6
SNMPv2-SMI::enterprises.2620.1.5.6.0 = STRING: "active"
Device-B
snmpwalk -c xxxxx -v 2c Device-B .1.3.6.1.4.1.2620.1.5.6
SNMPv2-SMI::enterprises.2620.1.5.6.0 = STRING: "standby"
Template directory :-
messages :
THIS MEMBER IS {FailoverStatus}
oids :-
FailoverStatus : .1.3.6.1.4.1.2620.1.5.6.0 : leaf
What I want to do is :
if Device-A become Standby , i want to make it RED ,
same
if Device-B become Active, i want to make it RED
the issues, its its same oid for both devices and it string, it does
not give any integer output.
how can i transforms it to get my expected output ?
Thanks for your help.
Really appreciated
|
|
From: Ben Y. <ben...@ju...> - 2014-07-02 16:36:02
|
Can you point me in the direction of the xymon client that is referenced in
the devmongraphtitles.pl script please? The only client I can find on the
net doesn't support the method hobbitdlog.
use Xymon::Client;
.
my $result = $bb->hobbitdlog("$hostname.$testname");
Regards
|
|
From: <buc...@us...> - 2013-09-02 12:30:27
|
Revision: 244
http://sourceforge.net/p/devmon/code/244
Author: buchanmilne
Date: 2013-09-02 12:30:23 +0000 (Mon, 02 Sep 2013)
Log Message:
-----------
Improve some sysdescs to match more accurately (vmware-esx4; cisco-6509, cisco-6506 to not match cisco-7600)
Modified Paths:
--------------
trunk/templates/cisco-6506/specs
trunk/templates/cisco-6509/specs
trunk/templates/vmware-esx4/specs
Modified: trunk/templates/cisco-6506/specs
===================================================================
--- trunk/templates/cisco-6506/specs 2013-03-02 09:20:30 UTC (rev 243)
+++ trunk/templates/cisco-6506/specs 2013-09-02 12:30:23 UTC (rev 244)
@@ -1,4 +1,4 @@
vendor : cisco
model : 6506
snmpver : 2
-sysdesc : c6sup|s72033_rp|s222_rp|C6506
+sysdesc : c6sup|\ss72033_rp|s222_rp|C6506
Modified: trunk/templates/cisco-6509/specs
===================================================================
--- trunk/templates/cisco-6509/specs 2013-03-02 09:20:30 UTC (rev 243)
+++ trunk/templates/cisco-6509/specs 2013-09-02 12:30:23 UTC (rev 244)
@@ -1,4 +1,4 @@
vendor : cisco
model : 6509
snmpver : 2
-sysdesc : c6sup|s72033_rp|s222_rp
+sysdesc : c6sup|\ss72033_rp|s222_rp
Modified: trunk/templates/vmware-esx4/specs
===================================================================
--- trunk/templates/vmware-esx4/specs 2013-03-02 09:20:30 UTC (rev 243)
+++ trunk/templates/vmware-esx4/specs 2013-09-02 12:30:23 UTC (rev 244)
@@ -1,4 +1,4 @@
vendor : vmware
model : esx4
snmpver : 2
-sysdesc : VmwareESX4
+sysdesc : VMware ESX 4
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2013-03-02 09:20:38
|
Revision: 243
http://devmon.svn.sourceforge.net/devmon/?rev=243&view=rev
Author: buchanmilne
Date: 2013-03-02 09:20:30 +0000 (Sat, 02 Mar 2013)
Log Message:
-----------
Add a script with sudo rules and a hobbitlaunch config file
to restart devmon if it is purple
Added Paths:
-----------
trunk/extras/restart-devmon-if-purple
trunk/extras/restart-devmon-if-purple.cfg
trunk/extras/xymon-control-devmon.sudoers
Added: trunk/extras/restart-devmon-if-purple
===================================================================
--- trunk/extras/restart-devmon-if-purple (rev 0)
+++ trunk/extras/restart-devmon-if-purple 2013-03-02 09:20:30 UTC (rev 243)
@@ -0,0 +1,47 @@
+#!/bin/bash
+if [ "$BB" == "" ]
+then
+ echo "This script must be run under a Hobbit or Xymon environment" >&2
+ echo "e.g. by: bbcmd $0" >&2
+ exit 1
+fi
+if [ "$BBDISPLAYS" != "" ]
+then
+ BBDISP=${BBDISPLAYS#,*}
+fi
+COLOR=$($BB $BBDISP "hobbitdboard host=$HOSTNAME test=dm" | cut -d'|' -f3)
+
+if [ "`id -u`" -eq 0 ]
+then
+ DEVMON="/etc/init.d/devmon"
+ PKILL="pkill"
+else
+ DEVMON="sudo /etc/init.d/devmon"
+ PKILL="sudo pkill"
+fi
+
+if [ "$COLOR" == "purple" ]
+then
+ LOGSAVE=/var/log/devmon/failures/devmon-failure-`date +%Y-%m-%d-%H:%M:%S`.log
+ echo "Devmon is purple, saving last 200 lines of log to $LOGSAVE"
+ tail -n200 /var/log/devmon/devmon.log > $LOGSAVE
+ $DEVMON stop
+ NUM=$(pgrep -u devmon|wc -l)
+ if [ "$NUM" -ne 0 ]
+ then
+ echo "Devmon failed to stop cleanly, terminating manually"
+ $PKILL -u devmon
+ sleep 5
+ fi
+ NUM=$(pgrep -u devmon|wc -l)
+ if [ "$NUM" -ne 0 ]
+ then
+ echo "Devmon failed to terminate cleanly, killing manually"
+ $PKILL -9 -u devmon
+ fi
+ $DEVMON start
+else
+ [ "$DEBUG" == 1 ] && echo "Devmon isn't purple, it is $COLOR"
+ exit 0
+fi
+
Property changes on: trunk/extras/restart-devmon-if-purple
___________________________________________________________________
Added: svn:executable
+ *
Added: trunk/extras/restart-devmon-if-purple.cfg
===================================================================
--- trunk/extras/restart-devmon-if-purple.cfg (rev 0)
+++ trunk/extras/restart-devmon-if-purple.cfg 2013-03-02 09:20:30 UTC (rev 243)
@@ -0,0 +1,6 @@
+[devmonr]
+ ENVFILE /usr/lib64/xymon/server/etc/hobbitserver.cfg
+ CMD /usr/local/bin/restart-devmon-if-purple
+ INTERVAL 1m
+ LOGFILE /var/log/xymon/devmon-restart.log
+
Added: trunk/extras/xymon-control-devmon.sudoers
===================================================================
--- trunk/extras/xymon-control-devmon.sudoers (rev 0)
+++ trunk/extras/xymon-control-devmon.sudoers 2013-03-02 09:20:30 UTC (rev 243)
@@ -0,0 +1 @@
+xymon ALL=NOPASSWD: /usr/bin/pkill *-u devmon,/etc/init.d/devmon *
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2013-03-02 09:10:14
|
Revision: 242
http://devmon.svn.sourceforge.net/devmon/?rev=242&view=rev
Author: buchanmilne
Date: 2013-03-02 09:10:06 +0000 (Sat, 02 Mar 2013)
Log Message:
-----------
Improve templatebuilder.pl:
-Dont add branches and leaves to oids file
-Imprve threshold generation
-Create a table in message for repeaters, or oid: value lines for leaves
-Write the template files if they dont exist in the current directory
Modified Paths:
--------------
trunk/extras/templatebuilder.pl
Modified: trunk/extras/templatebuilder.pl
===================================================================
--- trunk/extras/templatebuilder.pl 2013-01-03 14:44:41 UTC (rev 241)
+++ trunk/extras/templatebuilder.pl 2013-03-02 09:10:06 UTC (rev 242)
@@ -15,6 +15,7 @@
my %trans = ();
my %enum = ();
my @walkproc= ();
+my $debug = 1;
sub OIDNumLookup {
my ($mib,$var,$tail) = @_;
@@ -32,13 +33,15 @@
my $c = -1;
foreach my $l (@walk) {
if(my ($mib,$var,$tail) = ($l =~ /^([^:]+)::([^.]+)(.*) = /)) {
+ push @walkproc,($l);
+ $c++;
+ next if $trans{"${mib}::$var"};
$trans{"${mib}::$var"} = "";
# $trans{"${mib}::$var$tail"} = "";
- if($l =~ /= INTEGER: .*\(\d+\)$/) {
+ if($l =~ /= INTEGER: .*(\d+)$/) {
+ print "Adding ${mib}::$var to integers to map\n" if $debug;
$enum{"${mib}::$var"} = "";
}
- push @walkproc,($l);
- $c++;
} else {
$walkproc[$c] .= "\n$l";
}
@@ -54,46 +57,111 @@
}
my @enumlist = keys %enum;
$transcmd = "snmptranslate -Tp ".join " ",@enumlist;
-@translist = grep / (EnumVal|Values:) /,`$transcmd`;
+#@translist = grep / (EnumVal|Values:) /,`$transcmd`;
chomp @translist;
-for(my $i=0;$i<=$#enumlist;$i++) {
- $enum{$enumlist[$i]} = $translist[1+2*$i];
- $enum{$enumlist[$i]} =~ s/^\s+//;
+foreach (keys %enum) {
+ my $snmpcmd = "snmptranslate -Tp $_|grep Values:";
+ print "Trying to translate $_ using $snmpcmd\n" if $debug;
+ my @snmpvals = `$snmpcmd`;
+ print "Received from snmptranslate: ",join "\n",@snmpvals;
+ #my $transform = grep /Values:/,@snmpvals;
+ my $transform = $snmpvals[0];
+ #$transform =~ s/\s+//g;
+ print "Transform for $_: $transform\n" if $debug;
+ $enum{$_} = $transform;
}
+print Dumper(\%enum) if $debug;
+#for(my $i=0;$i<=$#enumlist;$i++) {
+# $enum{$enumlist[$i]} = $translist[1+2*$i];
+# $enum{$enumlist[$i]} =~ s/^\s+//;
+#}
my %varprint;
my %enumprint;
my @oidprint = ();
my @transformprint = ();
my @threshprint = ();
+my %thresh;
+my @messageprint = ();
+my @branches;
+my @leaves;
foreach my $l (@walkproc) {
+ print "Assessing $l\n" if $debug;
my ($mib,$var,$tail,$rest) = ($l =~ /^([^:]+)::([^.]+)(.*)( = .*)$/s);
$tail ||= "";
- #printf ("mib: %s var: %s tail: %s rest: $rest\n",$mib,$var,$tail,$rest);
+ printf ("mib: %s var: %s tail: %s rest: $rest\n",$mib,$var,$tail,$rest) if $debug;
unless( defined $varprint{"${mib}::$var"} ) {
- print "$var\t: ".$trans{"${mib}::$var"}."\t: branch\n";
- print "$var\t: ".$trans{"${mib}::$var"}.".0\t: leaf\n" if $tail eq ".0";
- push @oidprint,("$var\t: ".$trans{"${mib}::$var"}."\t: branch\n");
- push @oidprint,("$var\t: ".$trans{"${mib}::$var"}.".0\t: leaf\n") if $tail eq ".0";
+ if ($tail eq '.0') {
+ print "$var\t: ".$trans{"${mib}::$var"}.".0\t: leaf\n";
+ push @oidprint,("$var\t: ".$trans{"${mib}::$var"}.".0\t: leaf\n");
+ push @leaves,$var;
+ } else {
+ print "$var\t: ".$trans{"${mib}::$var"}."\t: branch\n";
+ push @oidprint,("$var\t: ".$trans{"${mib}::$var"}."\t: branch\n");
+ push @branches,$var;
+ }
}
$varprint{"${mib}::$var"} = 1;
- if($l =~ /= INTEGER: .*\(\d+\)$/) {
+ if($l =~ /= INTEGER: (\d+)/) {
unless( $enumprint{"${mib}::$var"} ) {
- printf " ## %s\n",$enum{"${mib}::$var"};
+ print "Checking if I can interpret values for $var from the MIB\n" if $debug;
+ printf " ##ENUM %s\n",$enum{"${mib}::$var"};
my $el = $enum{"${mib}::$var"};
$el =~ s/^\s*Values:\s*//;
my @elv = map {s/^(.*)\((\-?\d+)\)/$2=$1/; $_;} split /,\s*/,$el;
- my @thv = map {s/^(.*)\(\-?\d+\)/$1/; $_;} split /,\s*/,$el;
- #@elv =~ s/^(.*)\((\d+)\)/$2=$1/;
- printf "${var}Txt\t: SWITCH\t: {$var} %s\n",join ",",@elv;
- push @transformprint, (sprintf "${var}Txt\t: SWITCH\t: {$var} %s\n",join ",",@elv);
- push @threshprint, (sprintf "${var}Txt\t: green : %s\t:\n",join "|",grep /(ok|good|online|closed|locked)/i,@thv);
- push @threshprint, (sprintf "${var}Txt\t: yellow : %s\t:\n",join "|",grep !/(ok|good|online|closed|locked|fail|degrade|offline)/i,@thv);
- push @threshprint, (sprintf "${var}Txt\t: red : %s\t:\n",join "|",grep /(fail|degrade|offline)/i,@thv);
+ if ( my @thv = map {s/^(.*)\(\-?\d+\)/$1/; $_;} split /,\s*/,$el) {
+ #@elv =~ s/^(.*)\((\d+)\)/$2=$1/;
+ printf "${var}Txt\t: SWITCH\t: {$var} %s\n",join ",",@elv;
+ push @transformprint, (sprintf "${var}Txt\t: SWITCH\t: {$var} %s\n",join ",",@elv);
+ push @threshprint, (sprintf "${var}Txt\t: green : %s\t:\n",join "|",grep /(ok|good|online|closed|locked|green)/i,@thv);
+ push @threshprint, (sprintf "${var}Txt\t: yellow : %s\t:\n",join "|",grep !/(ok|good|online|closed|locked||green|fail|degrade|offline|alarm|red|off)/i,@thv);
+ push @threshprint, (sprintf "${var}Txt\t: red : %s\t:\n",join "|",grep /(fail|degrade|offline|alarm|red|off)/i,@thv);
+ $thresh{$var} = 1;
+ }
}
$enumprint{"${mib}::$var"} = 1;
}
- print "${mib}::$var$tail (".OIDNumLookup($mib,$var,$tail).")$rest\n";
+ print "${mib}::$var$tail (".OIDNumLookup($mib,$var,$tail).")$rest\n" if $debug;
}
-print "\noids file::\n",@oidprint;
-print "\ntransforms file::\n",@transformprint;
-print "\nthresholds file::\n",@threshprint;
+if (@leaves gt 1 ) {
+ foreach my $leaf (@leaves) {
+ print @messageprint,"{${leaf}.errors}\n" if $thresh{$leaf};
+ }
+ foreach my $leaf (@leaves) {
+ push @messageprint,"$leaf: {$leaf}\n";
+ }
+}
+if (@branches gt 1) {
+ push @messageprint,(sprintf "TABLE:\n");
+ push @messageprint, join('|',@branches), "\n";
+ foreach my $branch (@branches) {
+ if ( $thresh{$branch} ) {
+ push @messageprint, "{${branch}Txt.color}{${branch}Txt}{${branch}Txt.errors}"
+ } else {
+ push @messageprint, "{$branch}";
+ }
+ push @messageprint, '|';
+ }
+ pop @messageprint;
+ push @messageprint,"\n";
+}
+write_file("oids",\@oidprint);
+write_file("transforms",\@transformprint);
+write_file("thresholds",\@threshprint);
+write_file("exceptions",[]);
+write_file("message",\@messageprint);
+
+sub write_file {
+ my ($file,$contents) = @_;
+ print Dumper($contents) if $debug;
+ if ( -e "$file" ) {
+ print STDERR "#$file file exists, not overwriting it\n";
+ print "===== start $file =====\n",@{$contents},"====== end $file ======\n";
+ } else {
+ open TMPL,">$file" or warn "Could not open file: $!" and return 0;
+ print TMPL @{$contents};
+ close TMPL;
+ }
+ return 1;
+}
+
+
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: SourceForge.net <no...@so...> - 2013-01-03 15:38:37
|
Bugs item #3463155, was opened at 2011-12-20 19:56 Message generated for change (Comment added) made by buchanmilne You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=816977&aid=3463155&group_id=160720 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: Templates Group: None Status: Open >Resolution: Later Priority: 5 Private: No Submitted By: Richard Finegold (goldfndr) Assigned to: Nobody/Anonymous (nobody) Summary: Cisco-6509 wrong oids for serial Initial Comment: On a Cisco 6509 here, the serial number oids don't have readable values; I was getting "Missing repeater data for primary OID entPhysicalDescr". The oid given for entPhysicalDescr (and duplicated as entPhysicalModelName) should actually be moduleModel; within the OID, I think only moduleStatus has the MIB-derived name. While searching the snmpwalk output, I did find better output at "ciscoMgmt.92", but that's deprecated. I later found good output at .47 (from the entity MIB) so I copied the cisco-2811 template's serial subdirectory. The output is good now (status=green instead of clear). ---------------------------------------------------------------------- >Comment By: Buchan Milne (buchanmilne) Date: 2013-01-03 07:38 Message: On our 6509s (7) and 7613s (2) we get results from both the OIDs in the existing 6509 template and from ENTITY-MIB. However, results from ENTITY-MIB contain rows for each port, temperature sensor, voltage sensor etc., whereas the current test only contains a row per module. In the case of a 6500 or 7600 with a few dense blades, it results in a few hundred rows (361 for one 6509, 358 for another, 406 for one 7600). While it may be information that will be useful on (rare) occasion, I don't know if it makes sense. Our 6500s are running 12.2(18)SXD7b, our 7600s are running 12.2(33)SRC2. It may be more worthwhile at some stage to allow more flexible association of MIBs to devices than the current method. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=816977&aid=3463155&group_id=160720 |
|
From: <buc...@us...> - 2013-01-03 14:44:47
|
Revision: 241
http://devmon.svn.sourceforge.net/devmon/?rev=241&view=rev
Author: buchanmilne
Date: 2013-01-03 14:44:41 +0000 (Thu, 03 Jan 2013)
Log Message:
-----------
Fix parsing of option=value table options (reported by Wim Nelis)
Use first value for border,pad options, instead of the arry (Wim Nelis)
Modified Paths:
--------------
trunk/modules/dm_tests.pm
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2013-01-02 15:55:32 UTC (rev 240)
+++ trunk/modules/dm_tests.pm 2013-01-03 14:44:41 UTC (rev 241)
@@ -1802,6 +1802,7 @@
if(defined $opts) {
for my $optval (split /\s*,\s*/, $opts) {
my ($opt,$val) = ($1,$2) if $optval =~ /(\w+)(?:\((.+)\))?/;
+ ($opt,$val) = ($1,$2) if $optval =~ /^(\w+)=(\d+)$/;
$val = 1 if !defined $val;
push @{$t_opts{$opt}}, $val;
@@ -1813,8 +1814,8 @@
$table = '';
}
else {
- my $border = (defined $t_opts{'border'}) ? $t_opts{'border'} : 1;
- my $pad = (defined $t_opts{'pad'}) ? $t_opts{'pad'} : 5;
+ my $border = (defined $t_opts{'border'}) ? $t_opts{'border'}[0] : 1;
+ my $pad = (defined $t_opts{'pad'}) ? $t_opts{'pad'}[0] : 5;
$table = "<table border=$border cellpadding=$pad>\n";
}
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2013-01-02 15:55:38
|
Revision: 240
http://devmon.svn.sourceforge.net/devmon/?rev=240&view=rev
Author: buchanmilne
Date: 2013-01-02 15:55:32 +0000 (Wed, 02 Jan 2013)
Log Message:
-----------
Revert unintended changes to trans_index in r238 (thanks to Wim Nelis for spotting them)
Revision Links:
--------------
http://devmon.svn.sourceforge.net/devmon/?rev=238&view=rev
Modified Paths:
--------------
trunk/modules/dm_tests.pm
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2012-12-27 18:01:12 UTC (rev 239)
+++ trunk/modules/dm_tests.pm 2013-01-02 15:55:32 UTC (rev 240)
@@ -1621,9 +1621,6 @@
my $oid_h = \%{$oids->{$oid}};
# Extract our parent oids from the expression, first
my ($src_oid) = $oid_h->{'trans_data'} =~ /\{(.+?)\}/g;
- my ($oidregex) = $oid_h->{'trans_data'} =~ s/\{(.+?)\}//g;
- $oidregex =~ s/^\s*//;
- $oidregex =~ s/\s*$//;
validate_deps($device, $oids, $oid, [$src_oid], '.+') ;
# Validate our dependencies, have to do them seperately
@@ -1648,24 +1645,6 @@
# Skip if our source oid is freaky-deaky
next if $oid_h->{'error'}{$leaf};
- # If we had a regex, skip this index if the value doesnt match
- if ( $oidregex ne '' ) {
- my $res;
- my $val = $src_h->{'val'}{$leaf};
- do_log("Testing value $val from against $oidregex",0) if $g{'debug'};
- my $result = eval "\$res = \$val =~ m$oidregex";
- if($@) {
- do_log("Failed eval for REGSUB transform on leaf $leaf of " .
- "$oid on $device ($@)", 0);
- $oid_h->{'val'}{$leaf} = 'Failed eval';
- $oid_h->{'time'}{$leaf} = time;
- $oid_h->{'color'}{$leaf} = 'yellow';
- $oid_h->{'error'}{$leaf} = 1;
- next;
- }
- next if $res;
- }
-
# Our oid sub leaf
# my $oid_idx = $src_h->{'val'}{$leaf};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2012-12-27 18:01:19
|
Revision: 239
http://devmon.svn.sourceforge.net/devmon/?rev=239&view=rev
Author: buchanmilne
Date: 2012-12-27 18:01:12 +0000 (Thu, 27 Dec 2012)
Log Message:
-----------
Overloading of the trans_data element of a SWITCH or TSWITCH transform
was preventing transform ordering according to dependencies from working.
Use a new element (trans_edata) to hold the SWITCH-specific template data instead.
Modified Paths:
--------------
trunk/modules/dm_templates.pm
trunk/modules/dm_tests.pm
Modified: trunk/modules/dm_templates.pm
===================================================================
--- trunk/modules/dm_templates.pm 2012-12-21 08:55:17 UTC (rev 238)
+++ trunk/modules/dm_templates.pm 2012-12-27 18:01:12 UTC (rev 239)
@@ -261,8 +261,8 @@
$oid_h->{'trans_data'} =~ /\{(.+?)}\s*(.+)/;
next if !defined $dep_oid;
- $oid_h->{'trans_data'} = {};
- my $trans_data = \%{$oid_h->{'trans_data'}};
+ $oid_h->{'trans_edata'} = {};
+ my $trans_data = \%{$oid_h->{'trans_edata'}};
my $cases = \%{$trans_data->{'cases'}};
my $case_num = 0;
my $default;
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2012-12-21 08:55:17 UTC (rev 238)
+++ trunk/modules/dm_tests.pm 2012-12-27 18:01:12 UTC (rev 239)
@@ -102,8 +102,8 @@
next if !$oids->{$oid}{'transform'} or
defined $oids->{$oid}{'val'};
# Only transform if we have dependent value, otherwise push onto end of queue (not a perfect solution, but better than before)
- if(ref $oids->{$oid}{trans_data} eq "HASH" && ! defined $oids->{$oids->{$oid}{trans_data}{dep_oid}}{val}) {
- do_log("Skipping oid $oid until ".$oids->{$oid}{trans_data}{dep_oid}." defined for $device") if $g{debug};
+ if(ref $oids->{$oid}{trans_edata} eq "HASH" && ! defined $oids->{$oids->{$oid}{trans_edata}{dep_oid}}{val}) {
+ do_log("Skipping oid $oid until ".$oids->{$oid}{trans_edata}{dep_oid}." defined for $device") if $g{debug};
push @translist,($oid) unless $skiplist{$oid}++;
} else {
transform($device, $oids, $oid, $thr);
@@ -168,6 +168,7 @@
$oids->{$oid}{'transform'} = 1;
$oids->{$oid}{'trans_type'} = $tmpl->{'oids'}{$oid}{'trans_type'};
$oids->{$oid}{'trans_data'} = $tmpl->{'oids'}{$oid}{'trans_data'};
+ $oids->{$oid}{'trans_edata'} = $tmpl->{'oids'}{$oid}{'trans_edata'};
next;
}
@@ -1185,7 +1186,8 @@
my ($device, $oids, $oid, $thr) = @_;
my $oid_h = \%{$oids->{$oid}};
- my $trans_data = \%{$oid_h->{'trans_data'}};
+ my $trans_data = \%{$oid_h->{'trans_edata'}};
+ #my $trans_odata = \%{$oid_h->{'trans_data'}};
my $dep_oid = $trans_data->{'dep_oid'};
my $dep_oid_h = \%{$oids->{$dep_oid}};
my $cases = \%{$trans_data->{'cases'}};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2012-12-21 08:55:26
|
Revision: 238
http://devmon.svn.sourceforge.net/devmon/?rev=238&view=rev
Author: buchanmilne
Date: 2012-12-21 08:55:17 +0000 (Fri, 21 Dec 2012)
Log Message:
-----------
Add new MATCH transform
Modified Paths:
--------------
trunk/docs/TEMPLATES
trunk/modules/dm_templates.pm
trunk/modules/dm_tests.pm
Modified: trunk/docs/TEMPLATES
===================================================================
--- trunk/docs/TEMPLATES 2012-12-21 06:45:18 UTC (rev 237)
+++ trunk/docs/TEMPLATES 2012-12-21 08:55:17 UTC (rev 238)
@@ -423,7 +423,53 @@
do on the index value should be possible with existing
transforms.
+ 'MATCH' transform:
+ In some badly designed MIBs multiple types of information are
+ presented in a single table with two columns (branches), often
+ in just a name, value format. This transform makes it possible
+ to split such a combined table out into separate tables, or to
+ reformat the table so that it has multiple columns.
+
+ For example, the MIB for the TRIDIUM building management system
+ has a table with outputName and outputValue, data returned looks
+ as follows:
+
+ TRIDIUM-MIB::outputName.1 = STRING: "I_Inc4_Freq"
+ TRIDIUM-MIB::outputName.2 = STRING: "I_Inc4_VaN"
+ TRIDIUM-MIB::outputName.3 = STRING: "I_Inc4_VbN"
+ TRIDIUM-MIB::outputName.4 = STRING: "I_Inc4_VcN"
+ ...
+ TRIDIUM-MIB::outputValue.1 = STRING: "50.06"
+ TRIDIUM-MIB::outputValue.2 = STRING: "232.91"
+ TRIDIUM-MIB::outputValue.3 = STRING: "233.39"
+ TRIDIUM-MIB::outputValue.4 = STRING: "233.98"
+
+ To split the frequences out as a separate repeater, use:
+ outputFreqRow : MATCH : {outputName} /.*_Freq$/
+ outputVaRow : MATCH : {outputName} /.*_VaN$/
+ ...
+
+ outputFreqRow will now contain the indexes of outputName that matched
+ the regular expression, e.g. 1,5,9 etc. , outputVaRow will contain
+ 2,6,10. To construct a table, use the chain transform to create
+ repeaters using the matched indexes:
+ outputFreq : CHAIN : {outputFreqRow} {outputValue}
+ outputVa : CHAIN : {outputVaRow} {outputValue}
+ ...
+
+ To create the primary repeater for a table, we do the same on outputName:
+ IncomerRowName : CHAIN : {outputFreqRow} {outputName}
+
+ In this case, it is preferable to clean up the outputFreq for display:
+ IncomerName : REGSUB : {IncomerRowName} /(.*)_Freq/$1/
+
+ A table created as follows:
+ Incomer|Frequency (Hz)|Voltage A|Voltage B|Voltage C
+
+ Would now contain in its first row:
+ I_Inc4|50.06|232.91|233.39|233.98
+
'MATH' transform:
The MATH transform performs a mathematical expression defined
Modified: trunk/modules/dm_templates.pm
===================================================================
--- trunk/modules/dm_templates.pm 2012-12-21 06:45:18 UTC (rev 237)
+++ trunk/modules/dm_templates.pm 2012-12-21 08:55:17 UTC (rev 238)
@@ -542,6 +542,14 @@
last CASE;
};
+ $func_type eq 'match' and do {
+ $temp =~ s/^\{\s*\S+?\s*\}\s*\/.+\/\s*$//g;
+ do_log("MATCH transform should be a perl regex match at " .
+ "$trans_file, line $l_num", 0)
+ and next LINE if $temp ne '';
+ last CASE;
+ };
+
$func_type eq 'math' and do {
$temp =~ s/:\s*\d+\s*$//;
$temp =~ s/\{\s*\S+?\s*\}|\s\.\s|\s+x\s+|\*|\+|\/|-|\^|%|\||&|\d+(\.\d*)?|\(|\)//g;
Modified: trunk/modules/dm_tests.pm
===================================================================
--- trunk/modules/dm_tests.pm 2012-12-21 06:45:18 UTC (rev 237)
+++ trunk/modules/dm_tests.pm 2012-12-21 08:55:17 UTC (rev 238)
@@ -1619,6 +1619,9 @@
my $oid_h = \%{$oids->{$oid}};
# Extract our parent oids from the expression, first
my ($src_oid) = $oid_h->{'trans_data'} =~ /\{(.+?)\}/g;
+ my ($oidregex) = $oid_h->{'trans_data'} =~ s/\{(.+?)\}//g;
+ $oidregex =~ s/^\s*//;
+ $oidregex =~ s/\s*$//;
validate_deps($device, $oids, $oid, [$src_oid], '.+') ;
# Validate our dependencies, have to do them seperately
@@ -1643,6 +1646,24 @@
# Skip if our source oid is freaky-deaky
next if $oid_h->{'error'}{$leaf};
+ # If we had a regex, skip this index if the value doesnt match
+ if ( $oidregex ne '' ) {
+ my $res;
+ my $val = $src_h->{'val'}{$leaf};
+ do_log("Testing value $val from against $oidregex",0) if $g{'debug'};
+ my $result = eval "\$res = \$val =~ m$oidregex";
+ if($@) {
+ do_log("Failed eval for REGSUB transform on leaf $leaf of " .
+ "$oid on $device ($@)", 0);
+ $oid_h->{'val'}{$leaf} = 'Failed eval';
+ $oid_h->{'time'}{$leaf} = time;
+ $oid_h->{'color'}{$leaf} = 'yellow';
+ $oid_h->{'error'}{$leaf} = 1;
+ next;
+ }
+ next if $res;
+ }
+
# Our oid sub leaf
# my $oid_idx = $src_h->{'val'}{$leaf};
@@ -1666,7 +1687,85 @@
}
+ # Extract names and values from simple tables #############################
+ # Some MIBs just return a table of names and values, with rows that have
+ # different data, types, meanings, units etc.
+ # This operator allows the creation of new columns for rows where the name
+ # column matches the provided regex
+ sub trans_match {
+ my ($device, $oids, $oid, $thr) = @_;
+ my $oid_h = \%{$oids->{$oid}};
+ # Extract our parent oids from the expression, first
+ my $trans_data = $oid_h->{'trans_data'};
+ my ($src_oid, $expr) = ($1,$2)
+ if $trans_data =~ /^\{\s*(\S+?)\s*\}\s*(\/.+\/)\s*$/;
+ validate_deps($device, $oids, $oid, [$src_oid], '.+') ;
+
+ # Validate our dependencies, have to do them seperately
+ # validate_deps($device, $oids, 'tmp', [$trg_oid]) or return;
+ # validate_deps($device, $oids, $oid, [$src_oid], '^\.?(\d+\.)?\d+$')
+ # or return;
+ do_log("Transforming $src_oid to $oid via match transform matching $expr",0) if $g{'debug'};
+
+ my $src_h = \%{$oids->{$src_oid}};
+
+ # This transform should probably only work for repeater sources
+ if(!$src_h->{'repeat'}) {
+ do_log("Trying to index a non-repeater source on $device ($@)", 0);
+ return;
+ }
+
+ else {
+ # Tag the target as a repeater
+ $oid_h->{'repeat'} = 2;
+ my $idx = 0;
+ for my $leaf (sort { $a<=>$b} keys %{$src_h->{'val'}}) {
+
+ # Skip if our source oid is freaky-deaky
+ next if $oid_h->{'error'}{$leaf};
+
+ my $res;
+ my $val = $src_h->{'val'}{$leaf};
+ #do_log("Testing value $val from against $expr",0) if $g{'debug'};
+ my $result = eval "\$res = \$val =~ m$expr";
+ if($@) {
+ do_log("Failed eval for EXTRACT transform on leaf $leaf of " .
+ "$oid on $device ($@)", 0);
+ $oid_h->{'val'}{$leaf} = 'Failed eval';
+ $oid_h->{'time'}{$leaf} = time;
+ $oid_h->{'color'}{$leaf} = 'yellow';
+ $oid_h->{'error'}{$leaf} = 1;
+ next;
+ }
+ do_log("$val matched $expr, assigning new $idx from old row $leaf",0) if $g{'debug'} and $res;
+ next unless $res;
+
+ # Our oid sub leaf
+ # my $oid_idx = $src_h->{'val'}{$leaf};
+
+ if(!defined $leaf) {
+ $oid_h->{'val'}{$leaf} = 'Target val missing - index';
+ $oid_h->{'time'}{$leaf} = time;
+ $oid_h->{'color'}{$leaf} = 'yellow';
+ $oid_h->{'error'}{$leaf} = 1;
+ next;
+ }
+
+ $oid_h->{'val'}{$idx} = $leaf;
+ $oid_h->{'time'}{$idx} = $src_h->{'time'}{$leaf};
+ $oid_h->{'color'}{$idx} = $src_h->{'color'}{$leaf};
+ $oid_h->{'error'}{$idx} = $src_h->{'error'}{$leaf};
+ $idx++;
+ }
+
+ # Apply thresholds
+ apply_thresh_rep($oids, $thr, $oid);
+ }
+
+ }
+
+
# Create our outbound message ##############################################
sub render_msg {
my ($device, $tmpl, $test, $oids) = @_;
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2012-12-21 06:45:25
|
Revision: 237
http://devmon.svn.sourceforge.net/devmon/?rev=237&view=rev
Author: buchanmilne
Date: 2012-12-21 06:45:18 +0000 (Fri, 21 Dec 2012)
Log Message:
-----------
Fix regex for operator matching in MATH transform, which had broken some templates using x as multiplication
Modified Paths:
--------------
trunk/modules/dm_templates.pm
Modified: trunk/modules/dm_templates.pm
===================================================================
--- trunk/modules/dm_templates.pm 2012-08-03 10:36:23 UTC (rev 236)
+++ trunk/modules/dm_templates.pm 2012-12-21 06:45:18 UTC (rev 237)
@@ -544,9 +544,10 @@
$func_type eq 'math' and do {
$temp =~ s/:\s*\d+\s*$//;
- $temp =~ s/\{\s*\S+?\s*\}|\s\.\s|\sx\s|\*|\+|\/|-|\^|%|\||&|\d+(\.\d*)?|\(|\)\s*//g;
+ $temp =~ s/\{\s*\S+?\s*\}|\s\.\s|\s+x\s+|\*|\+|\/|-|\^|%|\||&|\d+(\.\d*)?|\(|\)//g;
+ $temp =~ s/\s*//;
do_log("MATH transform uses only math/numeric symbols and an " .
- "optional precision number at $trans_file, line $l_num", 0)
+ "optional precision number, $temp did not pass, at $trans_file, line $l_num", 0)
and next LINE if $temp !~ /^\s*$/;
last CASE;
};
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2012-08-03 10:36:34
|
Revision: 236
http://devmon.svn.sourceforge.net/devmon/?rev=236&view=rev
Author: buchanmilne
Date: 2012-08-03 10:36:23 +0000 (Fri, 03 Aug 2012)
Log Message:
-----------
Reduce failed query logging
Modified Paths:
--------------
trunk/modules/dm_snmp.pm
Modified: trunk/modules/dm_snmp.pm
===================================================================
--- trunk/modules/dm_snmp.pm 2012-08-03 10:32:02 UTC (rev 235)
+++ trunk/modules/dm_snmp.pm 2012-08-03 10:36:23 UTC (rev 236)
@@ -718,7 +718,7 @@
$data_out{'maxrep'}{$oid} = $num_reps + 1;
}
- do_log("DEBUG SNMP($fork_num): Failed queries $failed_query",0) if $g{'debug'};
+ do_log("DEBUG SNMP($fork_num): Failed queries $failed_query",0) if ($g{'debug'} and $failed_query gt 0);
# We dont want to do every table if we are failing alot of walks
if($failed_query > 6) {
my $error_str =
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|
|
From: <buc...@us...> - 2012-08-03 10:32:08
|
Revision: 235
http://devmon.svn.sourceforge.net/devmon/?rev=235&view=rev
Author: buchanmilne
Date: 2012-08-03 10:32:02 +0000 (Fri, 03 Aug 2012)
Log Message:
-----------
Add debug logging of messages sent to xymond/bbd
Modified Paths:
--------------
trunk/modules/dm_msg.pm
Modified: trunk/modules/dm_msg.pm
===================================================================
--- trunk/modules/dm_msg.pm 2012-07-24 16:09:10 UTC (rev 234)
+++ trunk/modules/dm_msg.pm 2012-08-03 10:32:02 UTC (rev 235)
@@ -31,9 +31,11 @@
# Send our test results to the BB/Hobbit server
sub send_msgs {
$g{'msgxfrtime'} = time;
+ $g{'sentmsgsize'} = 0;
do_log('DEBUG MSG: running send_msgs()',1) if $g{'debug'};
- do_log('Sending messages to display server',1);
+ my $nummsg = scalar @{$g{'test_results'}};
+ do_log("Sending $nummsg messages to display server",1);
# Determine the address we are connecting to
my $host = $g{'dispserv'};
@@ -53,6 +55,7 @@
return;
}
+ my $msg_sent = 0;
do_log("DEBUG: Looping through messages for this socket",3) if $g{'debug'};
# Run until we are out of messages to send
SOCKLOOP: while(@{$g{'test_results'}}) {
@@ -103,6 +106,7 @@
MSGLOOP: while($msg_size < $g{'msgsize'}
and @{$g{'test_results'}}) {
my $msg = shift @{$g{'test_results'}};
+ $msg_sent++;
# Make sure this is a valid message
if(!defined $msg or $msg eq '') {
do_log("Error: dm_msg trying to send a blank message!",0);
@@ -115,12 +119,12 @@
# Nuts, this is a huge message, bigger than our msg size. Well want
# to send it by itself to minimize how much it gets truncated
if($msg_size == 0) {
- my $thismsgsize = length $msg;
+ $msg_size = length $msg;
# Okay, we are clear, send the message
eval {
local $SIG{ALRM} = sub { die "Printing message timed out\n" };
alarm 10;
- do_log("DEBUG: Printing single combo message size $thismsgsize",3) if $g{'debug'};
+ do_log("DEBUG: Printing single combo message ($msg_sent of $nummsg), size $msg_size",3) if $g{'debug'};
print SOCK "$msg\n";
do_log("DEBUG: Finished printing single combo message",3) if $g{'debug'};
alarm 0;
@@ -135,9 +139,12 @@
# Not an empty combo msg, wait till our new socket is open
else {
unshift @{$g{'test_results'}}, $msg;
+ $msg_sent--;
}
# Either way, open a new socket
+ $g{'sentmsgsize'} += $msg_size;
+ do_log("DEBUG: Closing socket, $msg_size sent",3) if $g{'debug'};
close SOCK;
next SOCKLOOP;
}
@@ -148,13 +155,17 @@
# Whoops, looks like it does; wait for the next socket
unshift @{$g{'test_results'}}, $msg;
+ $msg_sent--;
+ $g{'sentmsgsize'} += $msg_size;
+ do_log("DEBUG: Closing socket, $msg_size sent",3) if $g{'debug'};
close SOCK;
next SOCKLOOP;
}
# Looks good, print the msg
else {
- do_log("DEBUG: Printing combo message with multiple messages",3) if $g{'debug'};
+ my $thismsgsize = length $msg;
+ do_log("DEBUG: Printing message ($msg_sent of $nummsg), size $thismsgsize to existing combo",3) if $g{'debug'};
eval {
local $SIG{ALRM} = sub { die "Printing message timed out\n" };
alarm 10;
@@ -167,11 +178,13 @@
return;
}
$msg_size += length $msg;
- do_log("DEBUG: Finished printing combo message with multiple messages",3) if $g{'debug'};
+ do_log("DEBUG: Finished printing message to existing combo ($msg_size so far)",3) if $g{'debug'};
}
} # End MSGLOOP
+ $g{'sentmsgsize'} += $msg_size;
+ do_log("DEBUG: Closing socket, $msg_size sent",3) if $g{'debug'};
close SOCK;
} # END SOCKLOOP
@@ -180,8 +193,9 @@
# Now send our dm status message!
if(!$g{'print_msg'}) {
- do_log("DEBUG: Connecting and sending dm message",3) if $g{'debug'};
my $dm_msg = dm_stat_msg();
+ my $msgsize = length $dm_msg;
+ do_log("DEBUG: Connecting and sending dm message ($msgsize)",3) if $g{'debug'};
eval {
local $SIG{ALRM} = sub { die "Connecting and sending dm message timed out\n" };
alarm 10;
@@ -234,6 +248,7 @@
"SNMP test time: $g{'snmppolltime'}\n" .
"Test logic time: $g{'testtime'}\n" .
"BB msg xfer time: $g{'msgxfrtime'}\n" .
+ "BB msg xfer size: $g{'sentmsgsize'}\n" .
"This poll period: $this_poll_time\n" .
"\n" .
"Avg poll time: ";
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|