Hello,
I want to put in Cacti some devices but I don't know how to use values from a SNMP data query in a second snmpget.
Shortly, the process must be like that:
step1: snmp querry <ip address> with community "public" oid1 and get some values
step2: snmp querry the same <ip address> with a new community (obtained from values obtained in step1 - with a script or something) oid 2..n and obtain value that must be loaded to RRD
It's like the process used by Cisco Router template but with different values for snmp community between querry and graph actions.
Can anybody point me in the right direction?
recursive use of values in templates/scripts
Moderators: Developers, Moderators
- gandalf
- Developer
- Posts: 22383
- Joined: Thu Dec 02, 2004 2:46 am
- Location: Muenster, Germany
- Contact:
No plain SNMP solution available, but http://docs.cacti.net/manual:087:3a_adv ... ut_methods will do
Reinhard
Reinhard
Hi and thanks for the answer. As you suggested, I made :
1. SNMP data query, in order to list the first values
2. Added a data input method, based on a script. The script is supposed to get its inputs passed by data input method as hostname (ip) and by previous declared SNMP data query output.
3. Added a data template based on the values from the previous script.
4. Also added graph templates based on data templates and host templates based on graph templates.
Now questions:
a) is this how it's supposed to work?
b) can I pass the arguments between snmp data querry to the data input's method script?
1. SNMP data query, in order to list the first values
2. Added a data input method, based on a script. The script is supposed to get its inputs passed by data input method as hostname (ip) and by previous declared SNMP data query output.
3. Added a data template based on the values from the previous script.
4. Also added graph templates based on data templates and host templates based on graph templates.
Now questions:
a) is this how it's supposed to work?
b) can I pass the arguments between snmp data querry to the data input's method script?
So far, I tried to debug the arguments passing.
Shortly, from the SNMP data querry, I got the expected results:
XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.12394.1.2.5.1.1.3'
+ Index found at OID: '1.3.6.1.4.1.12394.1.2.5.1.1.3.0.16.231.66.230.38' value: '256'
+ Located input field 'ifMAC' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.12394.1.2.5.1.1.2'
+ Found item [ifMAC='HEX-:00:10:E7:42:E6:26'] index: 38 [from value]
+ Located input field 'ifIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.12394.1.2.5.1.1.3'
+ Found item [ifIndex='256'] index: 38 [from value]
+ Located input field 'ifDescr' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.12394.1.2.5.1.1.7'
....
From this output I want to pass ifMAC value to the script of data input method as input string: bash <path_cacti>/scripts/second_get <query_ifMAC>
Is this possible? Because the script is not getting the supposed value (the mac address). I tried with ifMAC declared both as input and output in the XML file, with no difference visible.
Thank you,
Shortly, from the SNMP data querry, I got the expected results:
XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.12394.1.2.5.1.1.3'
+ Index found at OID: '1.3.6.1.4.1.12394.1.2.5.1.1.3.0.16.231.66.230.38' value: '256'
+ Located input field 'ifMAC' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.12394.1.2.5.1.1.2'
+ Found item [ifMAC='HEX-:00:10:E7:42:E6:26'] index: 38 [from value]
+ Located input field 'ifIndex' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.12394.1.2.5.1.1.3'
+ Found item [ifIndex='256'] index: 38 [from value]
+ Located input field 'ifDescr' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.12394.1.2.5.1.1.7'
....
From this output I want to pass ifMAC value to the script of data input method as input string: bash <path_cacti>/scripts/second_get <query_ifMAC>
Is this possible? Because the script is not getting the supposed value (the mac address). I tried with ifMAC declared both as input and output in the XML file, with no difference visible.
Thank you,
Who is online
Users browsing this forum: No registered users and 0 guests