I try to make a script to graph the MOS Value of a One Access Device.
I'm polling the follwing SNMP fields:
Code: Select all
.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.3.0
.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.4.0
.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.5.0
Code: Select all
.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.3.0 = STRING: 3.98
.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.4.0 = STRING: 3.91
.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.5.0 = STRING: 4.30
This is my XML File:
Code: Select all
<interface>
<name>Get MOS Statistics from One Access</name>
<description>Queries a host for a list of xDSL interfaces</description>
<oid_index>1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.1.0</oid_index>
<index_order>MosAVGDisp:MosMINDisp:MosMAXDisp</index_order>
<fields>
<MosAVGDisp>
<name>MOS Average</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.3.0</oid>
</MosAVGDisp>
<MosMINDisp>
<name>MOS Minimum</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.4.0</oid>
</MosMINDisp>
<MosMAXDisp>
<name>MOS Maximum</name>
<method>walk</method>
<source>value</source>
<direction>input</direction>
<oid>.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.5.0</oid>
</MosMAXDisp>
<MosAVG>
<name>Mos Average</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.3.0</oid>
</MosAVG>
<MosMIN>
<name>Mos Minimum</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.4.0</oid>
</MosMIN>
<MosMAX>
<name>Mos Maximum</name>
<method>walk</method>
<source>value</source>
<direction>output</direction>
<oid>.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.5.0</oid>
</MosMAX>
</fields>
</interface>
Code: Select all
/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1389787381 \
--end=1389801781 \
--title='xxxxxxxxxxxxxxxxxxxx - Mos Statistics' \
--base=1000 \
--height=120 \
--width=600 \
--alt-autoscale-max \
--lower-limit='0' \
COMMENT:"From 15/01/2014 13\:03\:01 To 15/01/2014 17\:03\:01\c" \
COMMENT:" \n" \
--vertical-label='' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a="/srv/www/htdocs/cacti/rra/xxxxxxxxxxxxxxxxxxxx_mosstatsavg_12110.rrd":'MosStatsAvg':AVERAGE \
DEF:b="/srv/www/htdocs/cacti/rra/xxxxxxxxxxxxxxxxxxxx_mosstatsavg_12110.rrd":'MosStatsMax':AVERAGE \
DEF:c="/srv/www/htdocs/cacti/rra/xxxxxxxxxxxxxxxxxxxx_mosstatsavg_12110.rrd":'MosStatsMin':AVERAGE \
LINE1:a#F51D30FF:"Mos Average" \
LINE1:b#888888FF:"Mos Maximum" \
LINE1:c#00BD27FF:"Mos Minimum"
Code: Select all
+ Running data query [47].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at 'xxxxxxxxxxxxxxxxxxxxxxxxxxxx/cacti/resource/snmp_queries/oneAccessMOS.xml'
+ XML file parsed ok.
+ <oid_num_indexes> missing in XML file, 'Index Count Changed' emulated by counting oid_index entries
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.1.0' Index Count: 1
+ Index found at OID: '.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.1.0' value: '0'
+ Located input field 'MosAVGDisp' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.3.0'
+ Found item [MosAVGDisp='3.92'] index: 0 [from value]
+ Located input field 'MosMINDisp' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.4.0'
+ Found item [MosMINDisp='3.92'] index: 0 [from value]
+ Located input field 'MosMAXDisp' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.13191.10.3.5.2.1.4.1.1.5.0'
+ Found item [MosMAXDisp='3.92'] index: 0 [from value]