From OpenNMS
Contents |
HOWTO: Monitoring Scientific Atlanta Cablemodem using OpenNMS
We have in Germany provider called Unitymedia. It´s used for broadband internet connectivity via cable TV infrastructure. It´s possible to get a view only access to the modem. In my case a Scientific Atlanta EPC2203. After a few outages of internet connectivity I have configured my OpenNMS to monitor the cable modem status and the link quality with capsd/pollerd and the HTTP datacollection. Let´s start with monitoring the cable modem status.
Monitoring online status with Capsd/Pollerd
First we detect the service "HTTP-Cable-Modem-Status" with Capsd, you can also use manual provisioning or LoopPlugin. The file is located
$OPENNMS_HOME/etc/capsd-configuration.xml
<protocol-plugin protocol="HTTP-Cable-Modem-Status" class-name="org.opennms.netmgt.capsd.plugins.HttpPlugin" scan="on">
<property key="port" value="80" />
<property key="timeout" value="3000" />
<property key="retry" value="1" />
<property key="url" value="/system.asp" />
</protocol-plugin>
The next step is to create a HTTP-Monitor and tell HTTP-Monitor to watch for "Cable Modem Status: Operational". Go to
$OPENNMS_HOME/etc/poller-configuration.xml
<service name="HTTP-Cable-Modem-Status" interval="300000" user-defined="false" status="on">
<parameter key="retry" value="5"/>
<parameter key="timeout" value="5950"/>
<parameter key="port" value="80"/>
<parameter key="url" value="/system.asp"/>
<parameter key="response-text" value="Operational"/>
</service>
Don´t forget to add the monitor at the end of the file
<monitor service="HTTP-Cable-Modem-Status" class-name="org.opennms.netmgt.poller.monitors.HttpMonitor"/>
If your modem isn´t in state "Operational" services goes down and you can get notified.
HTTP Datacollection - Collectd
We´re starting in
$OPENNMS_HOME/etc/collectd-configuration.xml
and create a new collection package. To identify the nodes for datacollection, I´ve created a "Cisco-Cablemodem-Stats" service.
<package name="default">
<filter>IPADDR != '0.0.0.0'</filter>
<include-range begin="1.1.1.1" end="254.254.254.254"/>
<service name="SNMP" interval="300000" user-defined="false" status="on">
<parameter key="collection" value="default"/>
</service>
<service name="Cisco-Cablemodem-Stats" interval="300000" user-defined="false" status="on">
<parameter key="collection" value="unitymedia-cisco-cablemodem"/>
</service>
</package>
. . .
<collector service="Cisco-Cablemodem-Stats" class-name="org.opennms.netmgt.collectd.HttpCollector"/>
We use a http-datacollection package called "unitymedia-cisco-cablemodem".
Capsd
Next we create a service "Cisco-Cablemodem-Stats in
$OPENNMS_HOME/etc/capsd-configuration.xml
<protocol-plugin protocol="Cisco-Cablemodem-Stats" class-name="org.opennms.netmgt.capsd.plugins.HttpPlugin" scan="off">
<property key="port" value="80" />
<property key="timeout" value="3000" />
<property key="retry" value="1" />
</protocol-plugin>
I decided set scan="off", because I prefer the service assigned with Provisioning-Groups.
Datacollection
Now it comes the tricky part. We create a http-datacollection for our cable modem:
$OPENNMS_HOME/etc/http-datacollection-config.xml
<http-collection name="unitymedia-cisco-cablemodem">
<rrd step="300">
<rra>RRA:AVERAGE:0.5:1:8928</rra>
<rra>RRA:AVERAGE:0.5:12:8784</rra>
<rra>RRA:MIN:0.5:12:8784</rra>
<rra>RRA:MAX:0.5:12:8784</rra>
</rrd>
<uris>
<uri name="cisco-cablemodem">
<url path="/system.asp"
user-agent="OpenNMS datacollection"
matches="(?s).*Receive Power Level.*nbsp.-([0-9]+).*\.([0-9]).*Transmit Power Level.* \
.([0-9]+).([0-9]).dBmV.*Signal to Noise Ratio.*nbsp.([0-9]+).*([0-9]).dB.*" \
response-range="100-399">
</url>
<attributes>
<attrib alias="receivePwrLvl" match-group="1" type="integer"/>
<attrib alias="receivePwrLvlTenth" match-group="2" type="integer"/>
<attrib alias="transmitPwrLvl" match-group="3" type="integer"/>
<attrib alias="transmitPwrLvlTenth" match-group="4" type="integer"/>
<attrib alias="s2nRatio" match-group="5" type="integer"/>
<attrib alias="s2nRatioTenth" match-group="6" type="integer"/>
</attributes>
</uri>
</uris>
</http-collection>
TODO: Is there a better way to handle negative values? This setup assumes the Receive Power Level is always negative ;)
Graphing
Ok until this point a lot of work but you will see nothing. To see the collected values in the WebUI you´ve to define graphs in
$OPENNMS_HOME/etc/snmp-graph.properties
report.cisco.cablemodem.receive.name=Receive Power Level
report.cisco.cablemodem.receive.columns=receivePwrLvl, receivePwrLvlTenth
report.cisco.cablemodem.receive.type=nodeSnmp
report.cisco.cablemodem.receive.command=--title="Receive Power Level" \
--vertical-label="dBmV" \
DEF:avgPwrLvl={rrd1}:receivePwrLvl:AVERAGE \
DEF:minPwrLvl={rrd1}:receivePwrLvl:MIN \
DEF:maxPwrLvl={rrd1}:receivePwrLvl:MAX \
DEF:avgPwrLvlTen={rrd2}:receivePwrLvlTenth:AVERAGE \
DEF:minPwrLvlTen={rrd2}:receivePwrLvlTenth:MIN \
DEF:maxPwrLvlTen={rrd2}:receivePwrLvlTenth:MAX \
CDEF:avgPwrTen=avgPwrLvlTen,10,/ \
CDEF:minPwrTen=minPwrLvlTen,10,/ \
CDEF:maxPwrTen=maxPwrLvlTen,10,/ \
CDEF:avgDrPwrLvl=avgPwrLvl,avgPwrTen,+ \
CDEF:minDrPwrLvl=minPwrLvl,minPwrTen,+ \
CDEF:maxDrPwrLvl=maxPwrLvl,maxPwrTen,+ \
CDEF:avgNegDrPwrLvl=0,avgDrPwrLvl,- \
CDEF:minNegDrPwrLvl=0,minDrPwrLvl,- \
CDEF:maxNegDrPwrLvl=0,maxDrPwrLvl,- \
AREA:avgNegDrPwrLvl#00ff00:"Receive Power Level " \
GPRINT:avgNegDrPwrLvl:AVERAGE:"Avg \\: %8.2lf %s" \
GPRINT:minNegDrPwrLvl:MIN:"Min \\: %8.2lf %s" \
GPRINT:maxNegDrPwrLvl:MAX:"Max \\: %8.2lf %s\\n"
report.cisco.cablemodem.transmit.name=Transmit Power Level
report.cisco.cablemodem.transmit.columns=transmitPwrLvl, transmitPwrLvlTenth
report.cisco.cablemodem.transmit.type=nodeSnmp
report.cisco.cablemodem.transmit.command=--title="Transmit Power Level" \
--vertical-label="dBmV" \
DEF:avgPwrLvl={rrd1}:transmitPwrLvl:AVERAGE \
DEF:minPwrLvl={rrd1}:transmitPwrLvl:MIN \
DEF:maxPwrLvl={rrd1}:transmitPwrLvl:MAX \
DEF:avgPwrLvlTen={rrd2}:transmitPwrLvlTenth:AVERAGE \
DEF:minPwrLvlTen={rrd2}:transmitPwrLvlTenth:MIN \
DEF:maxPwrLvlTen={rrd2}:transmitPwrLvlTenth:MAX \
CDEF:avgPwrTen=avgPwrLvlTen,10,/ \
CDEF:minPwrTen=minPwrLvlTen,10,/ \
CDEF:maxPwrTen=maxPwrLvlTen,10,/ \
CDEF:avgDrPwrLvl=avgPwrLvl,avgPwrTen,+ \
CDEF:minDrPwrLvl=minPwrLvl,minPwrTen,+ \
CDEF:maxDrPwrLvl=maxPwrLvl,maxPwrTen,+ \
AREA:avgDrPwrLvl#0000FF:"Transmit Power Level " \
GPRINT:avgDrPwrLvl:AVERAGE:"Avg \\: %8.2lf %s" \
GPRINT:minDrPwrLvl:MIN:"Min \\: %8.2lf %s" \
GPRINT:maxDrPwrLvl:MAX:"Max \\: %8.2lf %s\\n"
report.cisco.cablemodem.s2n.name=Signal to Noise Ratio
report.cisco.cablemodem.s2n.columns=s2nRatio, s2nRatioTenth
report.cisco.cablemodem.s2n.type=nodeSnmp
report.cisco.cablemodem.s2n.command=--title="Signal to Noise Ratio" \
--vertical-label="dB" \
DEF:avgPwrLvl={rrd1}:s2nRatio:AVERAGE \
DEF:minPwrLvl={rrd1}:s2nRatio:MIN \
DEF:maxPwrLvl={rrd1}:s2nRatio:MAX \
DEF:avgPwrLvlTen={rrd2}:s2nRatioTenth:AVERAGE \
DEF:minPwrLvlTen={rrd2}:s2nRatioTenth:MIN \
DEF:maxPwrLvlTen={rrd2}:s2nRatioTenth:MAX \
CDEF:avgPwrTen=avgPwrLvlTen,10,/ \
CDEF:minPwrTen=minPwrLvlTen,10,/ \
CDEF:maxPwrTen=maxPwrLvlTen,10,/ \
CDEF:avgDrPwrLvl=avgPwrLvl,avgPwrTen,+ \
CDEF:minDrPwrLvl=minPwrLvl,minPwrTen,+ \
CDEF:maxDrPwrLvl=maxPwrLvl,maxPwrTen,+ \
AREA:avgDrPwrLvl#FF0000:"Signal to Noise " \
GPRINT:avgDrPwrLvl:AVERAGE:"Avg \\: %8.2lf %s" \
GPRINT:minDrPwrLvl:MIN:"Min \\: %8.2lf %s" \
GPRINT:maxDrPwrLvl:MAX:"Max \\: %8.2lf %s\\n"
Pictures of result
This picture shows the read only webpage for the connection state and link quality
The next image shows the datacollection in OpenNMS
Version: 1.0
Original Author: indigo
Created: 09.02.2010








