Custom Script / Data Query

Post support questions that directly relate to Linux/Unix operating systems.

Moderators: Developers, Moderators

Post Reply
voltsz
Posts: 13
Joined: Thu Dec 31, 2009 2:01 am

Custom Script / Data Query

Post by voltsz »

Hy,

I follow the guide on http://docs.cacti.net/manual:087:3a_adv ... alkthrough and build a custom XML file and custom IOD request, but when I run the "Verbose Query" I receive "No SNMP data returned".

And I googled and searched on this forum without result... And I'm asking to yours a solution...

The remote SNMP host is cofigured as follow:

Code: Select all

pass .1.3.6.1.4.1 /usr/bin/perl /opt/3pp/bin/snmp/MD.pl
The XML is:

Code: Select all

<interface>
        <name>Get Information</name>
        <description>Get SNMP based</description>
        <index_order_type>numeric</index_order_type>
        <oid_index>.1.3.6.1.4.1.1</oid_index>

        <fields>
                <Index>
                        <name>Index</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.1</oid>
                </Index>
        </fields>
</interface>
The CLI snmpwalk from CACTI server is:

Code: Select all

snmpwalk  -v 2c -On -c public X..X.X.X .1.3.6.1.4.1
.1.3.6.1.4.1.1.1 = INTEGER: 1
.1.3.6.1.4.1.1.2 = INTEGER: 2
.1.3.6.1.4.1.1.3 = INTEGER: 3
.1.3.6.1.4.1.2.1 = STRING: "ID1"
.1.3.6.1.4.1.2.2 = STRING: "ID2"
.1.3.6.1.4.1.2.3 = ""
.1.3.6.1.4.1.3.1 = STRING: "6"
.1.3.6.1.4.1.3.2 = STRING: "6"
.1.3.6.1.4.1.3.3 = ""
Timeout: No Response from X..X.X.X
And under "Data Query Debug Information" I have:

Code: Select all

+ Running data query [18].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.1'
+ No SNMP data returned
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
I appreciated any help.

Thanks
Cesare
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Re: Custom Script / Data Query

Post by rony »

You are missing an output field definition.
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
voltsz
Posts: 13
Joined: Thu Dec 31, 2009 2:01 am

Re: Custom Script / Data Query

Post by voltsz »

rony wrote:You are missing an output field definition.
Thanks. But I'm lost. I following the instruction on manual, I wrote a XML definition as depicted on the help, payed attention on index OID.

Sorry but I did not found what I'm missing.

Thanks
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Re: Custom Script / Data Query

Post by rony »

When I'm writing data queries, I always look at the interface data query and resource file as a reference. Maybe this will help?
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
voltsz
Posts: 13
Joined: Thu Dec 31, 2009 2:01 am

Re: Custom Script / Data Query

Post by voltsz »

Hy Rony,

no. Maybe it's better to crash my brain on the wall. But I don't understand.

I followed the manual but I did not understand. Sorry
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Re: Custom Script / Data Query

Post by rony »

Try the following XML:

Code: Select all

<interface>
        <name>Get Information</name>
        <description>Get SNMP based</description>
        <index_order_type>numeric</index_order_type>
        <oid_index>.1.3.6.1.4.1.1</oid_index>

        <fields>
                <snmpIndex>
                        <name>Index</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.1</oid>
                </snmpIndex>
                <snmpName>
                        <name>Name/name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>input</direction>
                        <oid>.1.3.6.1.4.1.2</oid>
                </snmpName>
                <snmpValue>
                        <name>Value</name>
                        <method>walk</method>
                        <source>value</source>
                        <direction>output</direction>
                        <oid>.1.3.6.1.4.1.3</oid>
                </snmpValue>
        </fields>
</interface>
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
voltsz
Posts: 13
Joined: Thu Dec 31, 2009 2:01 am

Re: Custom Script / Data Query

Post by voltsz »

Thanks for the hint, but didn't work:

Code: Select all

Data Query Debug Information 
 
+ Running data query [18].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.1'
+ No SNMP data returned
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
User avatar
rony
Developer/Forum Admin
Posts: 6022
Joined: Mon Nov 17, 2003 6:35 pm
Location: Michigan, USA
Contact:

Re: Custom Script / Data Query

Post by rony »

I'm concerned with why there is "No SNMP data returned".
[size=117][i][b]Tony Roman[/b][/i][/size]
[size=84][i]Experience is what causes a person to make new mistakes instead of old ones.[/i][/size]
[size=84][i]There are only 3 way to complete a project: Good, Fast or Cheap, pick two.[/i][/size]
[size=84][i]With age comes wisdom, what you choose to do with it determines whether or not you are wise.[/i][/size]
voltsz
Posts: 13
Joined: Thu Dec 31, 2009 2:01 am

Re: Custom Script / Data Query

Post by voltsz »

Hy rony,
rony wrote:I'm concerned with why there is "No SNMP data returned".
mee too. That's happe because at the end of the SNMP query there is a timeout? On the CLI the SNMP-walk return this

Code: Select all

snmpwalk  -v 2c -On -c public X..X.X.X .1.3.6.1.4.1
.1.3.6.1.4.1.1.1 = INTEGER: 1
.1.3.6.1.4.1.1.2 = INTEGER: 2
.1.3.6.1.4.1.1.3 = INTEGER: 3
.1.3.6.1.4.1.2.1 = STRING: "ID1"
.1.3.6.1.4.1.2.2 = STRING: "ID2"
.1.3.6.1.4.1.2.3 = ""
.1.3.6.1.4.1.3.1 = STRING: "6"
.1.3.6.1.4.1.3.2 = STRING: "6"
.1.3.6.1.4.1.3.3 = ""
Timeout: No Response from X..X.X.X
That's the problem?
voltsz
Posts: 13
Joined: Thu Dec 31, 2009 2:01 am

Re: Custom Script / Data Query

Post by voltsz »

I have found where was the problem!

The OID I used ( .1.3.6.1.4.1.1 ) was occupied by superior OID. If a search for ".1.3.6.1.4.1" under ~cacti/resource/snmp_queries I found several XML file where this OID was used, for example:

f5_bigip_ifStat.xml
f5_bigip_pm.xml
f5_bigip_pool.xml
f5_bigip_vs.xml
f5_gtm_poolStat.xml
f5_gtm_wip.xml
kbridge.xml
net-snmp_disk.xml
netware_cpu.xml
netware_disk.xml

When I changed the OID used under XML and GUI (I used for example ".1.3.6.1.4.1.9900.1") I have positive match:

Code: Select all

+ Running data query [18].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.9900.1.1'
+ Index found at OID: '.1.3.6.1.4.1.9900.1.1.1' value: '1'
+ Index found at OID: '.1.3.6.1.4.1.9900.1.1.2' value: '2'
+ Located input field 'snmpIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.9900.1.1'
+ Found item [snmpIndex='1'] index: 1 [from value]
+ Found item [snmpIndex='2'] index: 2 [from value]
+ Located input field 'snmpName' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.9900.1.2'
+ Found item [snmpName='ID_005_1'] index: 1 [from value]
+ Found item [snmpName='ID_015_1'] index: 2 [from value]
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
+ Found data query XML file at '/usr/local/cacti-0.8.7e/resource/snmp_queries/MD.xml'
Maybe the OID used at beginning make confusion in CACTI when walk throught name and value.

What do you think?

However, thanks for helping!
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests