[solved] custom snmp query Showing value 0

Post general support questions here that do not specifically fall into the Linux or Windows categories.

Moderators: Developers, Moderators

Post Reply
superdust
Cacti User
Posts: 71
Joined: Fri Oct 20, 2006 3:58 pm

[solved] custom snmp query Showing value 0

Post by superdust »

Hi

I have made an indexed query that seems to work, but when graphing I just get value 0.
Other graphs are working fine on the same instance of cacti.

Hope someone can take a look at my settings and help me along.

Code: Select all

<interface>
        <name>Get Zyxel IES CPU Util</name>
        <description>Get Zyxel IES CPU Util</description>
        <index_order>cpuIndex</index_order>
        <index_order_type>alphabetic</index_order_type>
        <oid_index>.1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1</oid_index>
        <oid_index_parse>OID/REGEXP:^.{38}(.*)</oid_index_parse>

        <fields>
                <cpuIndex>
                        <name>Index</name>
                        <source>index</source>
                        <direction>input</direction>
                </cpuIndex>
                <cpuDescr>
                        <name>Description</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.5</oid>
                </cpuDescr>

                <cpuCurValue>
                        <name>CPU Util</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.2</oid>
                </cpuCurValue>
        </fields>
</interface>
Attachments
cacti1.png
cacti1.png (49.19 KiB) Viewed 1239 times
cacti2.png
cacti2.png (54.21 KiB) Viewed 1239 times
cacti3.png
cacti3.png (22.32 KiB) Viewed 1239 times
cacti4.png
cacti4.png (22.14 KiB) Viewed 1239 times
cacti5.png
cacti5.png (15.18 KiB) Viewed 1239 times
superdust
Cacti User
Posts: 71
Joined: Fri Oct 20, 2006 3:58 pm

Re: Showing value 0

Post by superdust »

Some more screens:
Attachments
cacti6.png
cacti6.png (17.05 KiB) Viewed 1239 times
cacti7.png
cacti7.png (31.41 KiB) Viewed 1239 times
cacti8.png
cacti8.png (42.53 KiB) Viewed 1239 times
superdust
Cacti User
Posts: 71
Joined: Fri Oct 20, 2006 3:58 pm

Re: Showing value 0

Post by superdust »

Also worth mentioning, if I edit xml file to :

Code: Select all

<interface>
        <name>Get Zyxel IES CPU Util</name>
        <description>Get Zyxel IES CPU Util</description>
        <index_order>cpuIndex</index_order>
        <index_order_type>alphabetic</index_order_type>
        <oid_index>.1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1</oid_index>
        <oid_index_parse>OID/REGEXP:^.{38}(.*)</oid_index_parse>

        <fields>
                <cpuIndex>
                        <name>Index</name>
                        <source>index</source>
                        <direction>input</direction>
                </cpuIndex>
                <cpuDescr>
                        <name>Description</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.5</oid>
                </cpuDescr>

                <cpuCurValue>
                        <name>CPU Util</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.2</oid>
                </cpuCurValue>
        </fields>
</interface>
Verbose query output is:

Code: Select all

+ Running data query [15].
+ Found type = '3' [SNMP Query].
+ Found data query XML file at '/var/www/cacti/resource/snmp_queries/Zyxel_IES_CPU.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.890.1.5.13.5.11.3.4.1.1' Index Count: 9
+ Index found at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.1.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.2.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.3.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.4.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.5.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.6.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.7.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.8.1' value: '1'
+ Index found at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.10.1' value: '1'
+ index_parse at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.1.1' results: '1.1'
+ index_parse at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.2.1' results: '2.1'
+ index_parse at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.3.1' results: '3.1'
+ index_parse at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.4.1' results: '4.1'
+ index_parse at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.5.1' results: '5.1'
+ index_parse at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.6.1' results: '6.1'
+ index_parse at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.7.1' results: '7.1'
+ index_parse at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.8.1' results: '8.1'
+ index_parse at OID: '1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.1.0.10.1' results: '10.1'
+ Inserting index data for field 'cpuIndex' [value='1.1']
+ Inserting index data for field 'cpuIndex' [value='2.1']
+ Inserting index data for field 'cpuIndex' [value='3.1']
+ Inserting index data for field 'cpuIndex' [value='4.1']
+ Inserting index data for field 'cpuIndex' [value='5.1']
+ Inserting index data for field 'cpuIndex' [value='6.1']
+ Inserting index data for field 'cpuIndex' [value='7.1']
+ Inserting index data for field 'cpuIndex' [value='8.1']
+ Inserting index data for field 'cpuIndex' [value='10.1']
+ Located input field 'cpuDescr' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.5'
+ Found item [cpuDescr='CPU1'] index: 1.1 [from value]
+ Found item [cpuDescr='CPU1'] index: 2.1 [from value]
+ Found item [cpuDescr='CPU1'] index: 3.1 [from value]
+ Found item [cpuDescr='CPU1'] index: 4.1 [from value]
+ Found item [cpuDescr='CPU1'] index: 5.1 [from value]
+ Found item [cpuDescr='CPU1'] index: 6.1 [from value]
+ Found item [cpuDescr='CPU1'] index: 7.1 [from value]
+ Found item [cpuDescr='CPU1'] index: 8.1 [from value]
+ Found item [cpuDescr='CPU1'] index: 10.1 [from value]
+ Located input field 'cpuCurValue' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.890.1.5.13.5.11.3.4.1.2'
+ Found item [cpuCurValue='5'] index: 1.1 [from value]
+ Found item [cpuCurValue='5'] index: 2.1 [from value]
+ Found item [cpuCurValue='4'] index: 3.1 [from value]
+ Found item [cpuCurValue='5'] index: 4.1 [from value]
+ Found item [cpuCurValue='4'] index: 5.1 [from value]
+ Found item [cpuCurValue='5'] index: 6.1 [from value]
+ Found item [cpuCurValue='18'] index: 7.1 [from value]
+ Found item [cpuCurValue='51'] index: 8.1 [from value]
+ Found item [cpuCurValue='12'] index: 10.1 [from value]
Here cpuCurValue for each row is correct, not 0

Any ideas?
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Showing value 0

Post by BSOD2600 »

should've continued your original post...

you follow the steps in http://docs.cacti.net/manual:088:4_help ... #debugging yet?
superdust
Cacti User
Posts: 71
Joined: Fri Oct 20, 2006 3:58 pm

Re: Showing value 0

Post by superdust »

Yes, you are probably right, I thought I would start a new thread as the other problem was solved.

I have read the debugging part, but all seems to work.
You can even see Cacti pull the right values when using <direction>input</direction> for that OID.
Also other graphs on same host is working fine.
So I guess I have made a mistake somewhere that I can not find.

Graph source:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=1371672365 \
--end=1371758765 \
--title='MSX IP DSLAM1 - CPU Util - 1.1 CPU1' \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit='0' \
COMMENT:"From 2013/06/19 22\:06\:05 To 2013/06/20 22\:06\:05\c" \
COMMENT:"  \n" \
--vertical-label='percent' \
--slope-mode \
--font TITLE:10: \
--font AXIS:7: \
--font LEGEND:8: \
--font UNIT:7: \
DEF:a="/var/www/cacti/rra/msx_ip_dslam1_cpucurvalue_736.rrd":'cpuCurValue':AVERAGE \
LINE2:a#F51D30FF:"CPU Util"  \
GPRINT:a:LAST:"Current\:%8.2lf %s"  \
GPRINT:a:MAX:"Max\:%8.2lf %s"  \
GPRINT:a:MIN:"Min\:%8.2lf %s" 
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Showing value 0

Post by BSOD2600 »

So in your debugging steps, you validated the script is spitting out data in cacti.log for these OIDs?
superdust
Cacti User
Posts: 71
Joined: Fri Oct 20, 2006 3:58 pm

Re: Showing value 0

Post by superdust »

Sorry, I have used Cacti for some time, but I`m new to making these kinds of query's.
How do I validated the script is spitting out data in cacti.log for these OIDs?
I get these warnings in log file, but they do not tell me much.

Code: Select all

06/20/2013 02:25:03 AM - CMDPHP: Poller[0] Host[3] DS[109] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:04 AM - CMDPHP: Poller[0] Host[4] DS[616] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:04 AM - CMDPHP: Poller[0] Host[4] DS[616] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:21 AM - CMDPHP: Poller[0] Host[5] DS[736] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:21 AM - CMDPHP: Poller[0] Host[5] DS[737] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:21 AM - CMDPHP: Poller[0] Host[5] DS[738] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:21 AM - CMDPHP: Poller[0] Host[5] DS[739] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:21 AM - CMDPHP: Poller[0] Host[5] DS[740] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:21 AM - CMDPHP: Poller[0] Host[5] DS[741] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:21 AM - CMDPHP: Poller[0] Host[5] DS[742] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:21 AM - CMDPHP: Poller[0] Host[5] DS[743] WARNING: Result from SNMP not valid.  Partial Result: U
06/20/2013 02:25:21 AM - CMDPHP: Poller[0] Host[5] DS[744] WARNING: Result from SNMP not valid.  Partial Result: U
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Showing value 0

Post by BSOD2600 »

increase the logging level detail to medium or higher to view the errors.
Does the poller cache contain the correct OIDs for that device?
superdust
Cacti User
Posts: 71
Joined: Fri Oct 20, 2006 3:58 pm

Re: Showing value 0

Post by superdust »

Thanks!

When looking at poller cache I noticed that a value was missing from OID (third last number).
Guess this happened with using <oid_index_parse>OID/REGEXP:^.{38}(.*)</oid_index_parse>
Fixed it now, and its finally working :)
User avatar
BSOD2600
Cacti Moderator
Posts: 12171
Joined: Sat May 08, 2004 12:44 pm
Location: USA

Re: Showing value 0

Post by BSOD2600 »

The Poller Cache should've also showed this info... for future troubleshooting.
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest