Cacti (home)ForumsDocumentation

Differences

This shows you the differences between two versions of the page.

manual:087:3a_advanced_topics.3d_script_data_query_walkthrough [2010/02/22 14:24]
gandalf
manual:087:3a_advanced_topics.3d_script_data_query_walkthrough [2011/12/29 11:20] (current)
gandalf more code checks
Line 288: Line 288:
 #      interface indices along with the description of the interface #      interface indices along with the description of the interface
 # ------------------------------------------------------------------------- # -------------------------------------------------------------------------
-}elseif ($cmd == "query") {+}elseif ($cmd == "query" && isset($query_field)) {
         $arr_index = reindex(cacti_snmp_walk($hostname, $snmp_community,         $arr_index = reindex(cacti_snmp_walk($hostname, $snmp_community,
         $oids["index"], $snmp_version, $snmp_auth_username,         $oids["index"], $snmp_version, $snmp_auth_username,
Line 320: Line 320:
 #      the description of the interface for interface #1 #      the description of the interface for interface #1
 # ------------------------------------------------------------------------- # -------------------------------------------------------------------------
-}elseif ($cmd == "get") {+}elseif ($cmd == "get" $$ isset($query_field) && isset($query_index)) {
         print (cacti_snmp_get($hostname, $snmp_community,         print (cacti_snmp_get($hostname, $snmp_community,
         $oids[$query_field] . ".$query_index", $snmp_version, $snmp_auth_username,         $oids[$query_field] . ".$query_index", $snmp_version, $snmp_auth_username,





Personal Tools