How to deal with multi-index values in cacti?

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

Moderators: Developers, Moderators

Post Reply
wuwentao
Posts: 3
Joined: Mon Jun 03, 2013 2:59 am

How to deal with multi-index values in cacti?

Post by wuwentao »

Hi,
I'm trying to add a new Data Queries in cacti for Juniper SRX Device,but i found juniper device have multi-index values,the details are as follows:
root@slt14-bamboo> show snmp mib walk 1.3.6.1.4.1.2636.3.1.13.1.1
jnxOperatingContentsIndex.1.1.0.0 = 1
jnxOperatingContentsIndex.1.2.0.0 = 1
jnxOperatingContentsIndex.2.1.0.0 = 2
jnxOperatingContentsIndex.2.2.0.0 = 2
jnxOperatingContentsIndex.2.5.0.0 = 2
jnxOperatingContentsIndex.2.6.0.0 = 2
jnxOperatingContentsIndex.4.1.0.0 = 4
jnxOperatingContentsIndex.4.1.1.0 = 4
jnxOperatingContentsIndex.4.1.2.0 = 4
jnxOperatingContentsIndex.4.1.3.0 = 4
jnxOperatingContentsIndex.4.1.4.0 = 4
jnxOperatingContentsIndex.4.1.5.0 = 4
jnxOperatingContentsIndex.4.1.6.0 = 4
jnxOperatingContentsIndex.4.1.7.0 = 4
jnxOperatingContentsIndex.4.1.8.0 = 4
jnxOperatingContentsIndex.4.1.9.0 = 4
jnxOperatingContentsIndex.4.1.10.0 = 4
jnxOperatingContentsIndex.4.2.0.0 = 4
jnxOperatingContentsIndex.4.2.1.0 = 4
jnxOperatingContentsIndex.4.2.2.0 = 4
jnxOperatingContentsIndex.4.2.3.0 = 4
jnxOperatingContentsIndex.4.2.4.0 = 4
jnxOperatingContentsIndex.4.2.5.0 = 4
jnxOperatingContentsIndex.4.2.6.0 = 4
jnxOperatingContentsIndex.4.2.7.0 = 4
jnxOperatingContentsIndex.4.2.8.0 = 4
jnxOperatingContentsIndex.4.2.9.0 = 4
jnxOperatingContentsIndex.4.2.10.0 = 4
jnxOperatingContentsIndex.7.1.0.0 = 7
jnxOperatingContentsIndex.7.2.0.0 = 7
jnxOperatingContentsIndex.7.8.0.0 = 7
jnxOperatingContentsIndex.7.9.0.0 = 7
jnxOperatingContentsIndex.7.11.0.0 = 7
jnxOperatingContentsIndex.7.12.0.0 = 7
jnxOperatingContentsIndex.7.14.0.0 = 7
jnxOperatingContentsIndex.7.15.0.0 = 7
jnxOperatingContentsIndex.7.21.0.0 = 7
jnxOperatingContentsIndex.7.22.0.0 = 7
jnxOperatingContentsIndex.7.24.0.0 = 7
jnxOperatingContentsIndex.7.25.0.0 = 7
jnxOperatingContentsIndex.8.1.1.0 = 8
jnxOperatingContentsIndex.8.2.1.0 = 8
jnxOperatingContentsIndex.8.8.1.0 = 8
jnxOperatingContentsIndex.8.9.1.0 = 8
jnxOperatingContentsIndex.8.11.1.0 = 8
jnxOperatingContentsIndex.8.12.1.0 = 8
jnxOperatingContentsIndex.8.14.1.0 = 8
jnxOperatingContentsIndex.8.15.1.0 = 8
jnxOperatingContentsIndex.8.21.1.0 = 8
jnxOperatingContentsIndex.8.22.1.0 = 8
jnxOperatingContentsIndex.8.24.1.0 = 8
jnxOperatingContentsIndex.8.25.1.0 = 8
jnxOperatingContentsIndex.9.1.0.0 = 9
jnxOperatingContentsIndex.9.3.0.0 = 9
jnxOperatingContentsIndex.10.1.1.0 = 10
jnxOperatingContentsIndex.10.2.1.0 = 10
jnxOperatingContentsIndex.12.1.0.0 = 12
jnxOperatingContentsIndex.12.3.0.0 = 12

{primary:node0}
root@slt14-bamboo> show snmp mib walk 1.3.6.1.4.1.2636.3.1.13.1.2
jnxOperatingL1Index.1.1.0.0 = 1
jnxOperatingL1Index.1.2.0.0 = 2
jnxOperatingL1Index.2.1.0.0 = 1
jnxOperatingL1Index.2.2.0.0 = 2
jnxOperatingL1Index.2.5.0.0 = 5
jnxOperatingL1Index.2.6.0.0 = 6
jnxOperatingL1Index.4.1.0.0 = 1
jnxOperatingL1Index.4.1.1.0 = 1
jnxOperatingL1Index.4.1.2.0 = 1
jnxOperatingL1Index.4.1.3.0 = 1
jnxOperatingL1Index.4.1.4.0 = 1
jnxOperatingL1Index.4.1.5.0 = 1
jnxOperatingL1Index.4.1.6.0 = 1
jnxOperatingL1Index.4.1.7.0 = 1
jnxOperatingL1Index.4.1.8.0 = 1
jnxOperatingL1Index.4.1.9.0 = 1
jnxOperatingL1Index.4.1.10.0 = 1
jnxOperatingL1Index.4.2.0.0 = 2
jnxOperatingL1Index.4.2.1.0 = 2
jnxOperatingL1Index.4.2.2.0 = 2
jnxOperatingL1Index.4.2.3.0 = 2
jnxOperatingL1Index.4.2.4.0 = 2
jnxOperatingL1Index.4.2.5.0 = 2
jnxOperatingL1Index.4.2.6.0 = 2
jnxOperatingL1Index.4.2.7.0 = 2
jnxOperatingL1Index.4.2.8.0 = 2
jnxOperatingL1Index.4.2.9.0 = 2
jnxOperatingL1Index.4.2.10.0 = 2
jnxOperatingL1Index.7.1.0.0 = 1
jnxOperatingL1Index.7.2.0.0 = 2
jnxOperatingL1Index.7.8.0.0 = 8
jnxOperatingL1Index.7.9.0.0 = 9
jnxOperatingL1Index.7.11.0.0 = 11
jnxOperatingL1Index.7.12.0.0 = 12
jnxOperatingL1Index.7.14.0.0 = 14
jnxOperatingL1Index.7.15.0.0 = 15
jnxOperatingL1Index.7.21.0.0 = 21
jnxOperatingL1Index.7.22.0.0 = 22
jnxOperatingL1Index.7.24.0.0 = 24
jnxOperatingL1Index.7.25.0.0 = 25
jnxOperatingL1Index.8.1.1.0 = 1
jnxOperatingL1Index.8.2.1.0 = 2
jnxOperatingL1Index.8.8.1.0 = 8
jnxOperatingL1Index.8.9.1.0 = 9
jnxOperatingL1Index.8.11.1.0 = 11
jnxOperatingL1Index.8.12.1.0 = 12
jnxOperatingL1Index.8.14.1.0 = 14
jnxOperatingL1Index.8.15.1.0 = 15
jnxOperatingL1Index.8.21.1.0 = 21
jnxOperatingL1Index.8.22.1.0 = 22
jnxOperatingL1Index.8.24.1.0 = 24
jnxOperatingL1Index.8.25.1.0 = 25
jnxOperatingL1Index.9.1.0.0 = 1
jnxOperatingL1Index.9.3.0.0 = 3
jnxOperatingL1Index.10.1.1.0 = 1
jnxOperatingL1Index.10.2.1.0 = 2
jnxOperatingL1Index.12.1.0.0 = 1
jnxOperatingL1Index.12.3.0.0 = 3

{primary:node0}
root@slt14-bamboo> show snmp mib walk 1.3.6.1.4.1.2636.3.1.13.1.3
jnxOperatingL2Index.1.1.0.0 = 0
jnxOperatingL2Index.1.2.0.0 = 0
jnxOperatingL2Index.2.1.0.0 = 0
jnxOperatingL2Index.2.2.0.0 = 0
jnxOperatingL2Index.2.5.0.0 = 0
jnxOperatingL2Index.2.6.0.0 = 0
jnxOperatingL2Index.4.1.0.0 = 0
jnxOperatingL2Index.4.1.1.0 = 1
jnxOperatingL2Index.4.1.2.0 = 2
jnxOperatingL2Index.4.1.3.0 = 3
jnxOperatingL2Index.4.1.4.0 = 4
jnxOperatingL2Index.4.1.5.0 = 5
jnxOperatingL2Index.4.1.6.0 = 6
jnxOperatingL2Index.4.1.7.0 = 7
jnxOperatingL2Index.4.1.8.0 = 8
jnxOperatingL2Index.4.1.9.0 = 9
jnxOperatingL2Index.4.1.10.0 = 10
jnxOperatingL2Index.4.2.0.0 = 0
jnxOperatingL2Index.4.2.1.0 = 1
jnxOperatingL2Index.4.2.2.0 = 2
jnxOperatingL2Index.4.2.3.0 = 3
jnxOperatingL2Index.4.2.4.0 = 4
jnxOperatingL2Index.4.2.5.0 = 5
jnxOperatingL2Index.4.2.6.0 = 6
jnxOperatingL2Index.4.2.7.0 = 7
jnxOperatingL2Index.4.2.8.0 = 8
jnxOperatingL2Index.4.2.9.0 = 9
jnxOperatingL2Index.4.2.10.0 = 10
jnxOperatingL2Index.7.1.0.0 = 0
jnxOperatingL2Index.7.2.0.0 = 0
jnxOperatingL2Index.7.8.0.0 = 0
jnxOperatingL2Index.7.9.0.0 = 0
jnxOperatingL2Index.7.11.0.0 = 0
jnxOperatingL2Index.7.12.0.0 = 0
jnxOperatingL2Index.7.14.0.0 = 0
jnxOperatingL2Index.7.15.0.0 = 0
jnxOperatingL2Index.7.21.0.0 = 0
jnxOperatingL2Index.7.22.0.0 = 0
jnxOperatingL2Index.7.24.0.0 = 0
jnxOperatingL2Index.7.25.0.0 = 0
jnxOperatingL2Index.8.1.1.0 = 1
jnxOperatingL2Index.8.2.1.0 = 1
jnxOperatingL2Index.8.8.1.0 = 1
jnxOperatingL2Index.8.9.1.0 = 1
jnxOperatingL2Index.8.11.1.0 = 1
jnxOperatingL2Index.8.12.1.0 = 1
jnxOperatingL2Index.8.14.1.0 = 1
jnxOperatingL2Index.8.15.1.0 = 1
jnxOperatingL2Index.8.21.1.0 = 1
jnxOperatingL2Index.8.22.1.0 = 1
jnxOperatingL2Index.8.24.1.0 = 1
jnxOperatingL2Index.8.25.1.0 = 1
jnxOperatingL2Index.9.1.0.0 = 0
jnxOperatingL2Index.9.3.0.0 = 0
jnxOperatingL2Index.10.1.1.0 = 1
jnxOperatingL2Index.10.2.1.0 = 1
jnxOperatingL2Index.12.1.0.0 = 0
jnxOperatingL2Index.12.3.0.0 = 0

{primary:node0}
root@slt14-bamboo> show snmp mib walk 1.3.6.1.4.1.2636.3.1.13.1.4
jnxOperatingL3Index.1.1.0.0 = 0
jnxOperatingL3Index.1.2.0.0 = 0
jnxOperatingL3Index.2.1.0.0 = 0
jnxOperatingL3Index.2.2.0.0 = 0
jnxOperatingL3Index.2.5.0.0 = 0
jnxOperatingL3Index.2.6.0.0 = 0
jnxOperatingL3Index.4.1.0.0 = 0
jnxOperatingL3Index.4.1.1.0 = 0
jnxOperatingL3Index.4.1.2.0 = 0
jnxOperatingL3Index.4.1.3.0 = 0
jnxOperatingL3Index.4.1.4.0 = 0
jnxOperatingL3Index.4.1.5.0 = 0
jnxOperatingL3Index.4.1.6.0 = 0
jnxOperatingL3Index.4.1.7.0 = 0
jnxOperatingL3Index.4.1.8.0 = 0
jnxOperatingL3Index.4.1.9.0 = 0
jnxOperatingL3Index.4.1.10.0 = 0
jnxOperatingL3Index.4.2.0.0 = 0
jnxOperatingL3Index.4.2.1.0 = 0
jnxOperatingL3Index.4.2.2.0 = 0
jnxOperatingL3Index.4.2.3.0 = 0
jnxOperatingL3Index.4.2.4.0 = 0
jnxOperatingL3Index.4.2.5.0 = 0
jnxOperatingL3Index.4.2.6.0 = 0
jnxOperatingL3Index.4.2.7.0 = 0
jnxOperatingL3Index.4.2.8.0 = 0
jnxOperatingL3Index.4.2.9.0 = 0
jnxOperatingL3Index.4.2.10.0 = 0
jnxOperatingL3Index.7.1.0.0 = 0
jnxOperatingL3Index.7.2.0.0 = 0
jnxOperatingL3Index.7.8.0.0 = 0
jnxOperatingL3Index.7.9.0.0 = 0
jnxOperatingL3Index.7.11.0.0 = 0
jnxOperatingL3Index.7.12.0.0 = 0
jnxOperatingL3Index.7.14.0.0 = 0
jnxOperatingL3Index.7.15.0.0 = 0
jnxOperatingL3Index.7.21.0.0 = 0
jnxOperatingL3Index.7.22.0.0 = 0
jnxOperatingL3Index.7.24.0.0 = 0
jnxOperatingL3Index.7.25.0.0 = 0
jnxOperatingL3Index.8.1.1.0 = 0
jnxOperatingL3Index.8.2.1.0 = 0
jnxOperatingL3Index.8.8.1.0 = 0
jnxOperatingL3Index.8.9.1.0 = 0
jnxOperatingL3Index.8.11.1.0 = 0
jnxOperatingL3Index.8.12.1.0 = 0
jnxOperatingL3Index.8.14.1.0 = 0
jnxOperatingL3Index.8.15.1.0 = 0
jnxOperatingL3Index.8.21.1.0 = 0
jnxOperatingL3Index.8.22.1.0 = 0
jnxOperatingL3Index.8.24.1.0 = 0
jnxOperatingL3Index.8.25.1.0 = 0
jnxOperatingL3Index.9.1.0.0 = 0
jnxOperatingL3Index.9.3.0.0 = 0
jnxOperatingL3Index.10.1.1.0 = 0
jnxOperatingL3Index.10.2.1.0 = 0
jnxOperatingL3Index.12.1.0.0 = 0
jnxOperatingL3Index.12.3.0.0 = 0

{primary:node0}
root@slt14-bamboo> show snmp mib walk 1.3.6.1.4.1.2636.3.1.13.1.5
jnxOperatingDescr.1.1.0.0 = node0 midplane
jnxOperatingDescr.1.2.0.0 = node1 midplane
jnxOperatingDescr.2.1.0.0 = node0 PEM 0
jnxOperatingDescr.2.2.0.0 = node0 PEM 1
jnxOperatingDescr.2.5.0.0 = node1 PEM 0
jnxOperatingDescr.2.6.0.0 = node1 PEM 1
jnxOperatingDescr.4.1.0.0 = node0 Fan Tray
jnxOperatingDescr.4.1.1.0 = node0 Fan 1
jnxOperatingDescr.4.1.2.0 = node0 Fan 2
jnxOperatingDescr.4.1.3.0 = node0 Fan 3
jnxOperatingDescr.4.1.4.0 = node0 Fan 4
jnxOperatingDescr.4.1.5.0 = node0 Fan 5
jnxOperatingDescr.4.1.6.0 = node0 Fan 6
jnxOperatingDescr.4.1.7.0 = node0 Fan 7
jnxOperatingDescr.4.1.8.0 = node0 Fan 8
jnxOperatingDescr.4.1.9.0 = node0 Fan 9
jnxOperatingDescr.4.1.10.0 = node0 Fan 10
jnxOperatingDescr.4.2.0.0 = node1 Fan Tray
jnxOperatingDescr.4.2.1.0 = node1 Fan 1
jnxOperatingDescr.4.2.2.0 = node1 Fan 2
jnxOperatingDescr.4.2.3.0 = node1 Fan 3
jnxOperatingDescr.4.2.4.0 = node1 Fan 4
jnxOperatingDescr.4.2.5.0 = node1 Fan 5
jnxOperatingDescr.4.2.6.0 = node1 Fan 6
jnxOperatingDescr.4.2.7.0 = node1 Fan 7
jnxOperatingDescr.4.2.8.0 = node1 Fan 8
jnxOperatingDescr.4.2.9.0 = node1 Fan 9
jnxOperatingDescr.4.2.10.0 = node1 Fan 10
jnxOperatingDescr.7.1.0.0 = node0 FPC: SRX3k SFB 12GE @ 0/*/*
jnxOperatingDescr.7.2.0.0 = node0 FPC: SRX3k 2x10GE XFP @ 1/*/*
jnxOperatingDescr.7.8.0.0 = node0 FPC: SRX3k SPC @ 7/*/*
jnxOperatingDescr.7.9.0.0 = node0 FPC: SRX3k SPC @ 8/*/*
jnxOperatingDescr.7.11.0.0 = node0 FPC: SRX3k NPC @ 10/*/*
jnxOperatingDescr.7.12.0.0 = node0 FPC: SRX3k NPC @ 11/*/*
jnxOperatingDescr.7.14.0.0 = node1 FPC: SRX3k SFB 12GE @ 0/*/*
jnxOperatingDescr.7.15.0.0 = node1 FPC: SRX3k 2x10GE XFP @ 1/*/*
jnxOperatingDescr.7.21.0.0 = node1 FPC: SRX3k SPC @ 7/*/*
jnxOperatingDescr.7.22.0.0 = node1 FPC: SRX3k SPC @ 8/*/*
jnxOperatingDescr.7.24.0.0 = node1 FPC: SRX3k NPC @ 10/*/*
jnxOperatingDescr.7.25.0.0 = node1 FPC: SRX3k NPC @ 11/*/*
jnxOperatingDescr.8.1.1.0 = node0 PIC: 8x 1GE-TX 4x 1GE-SFP @ 0/0/*
jnxOperatingDescr.8.2.1.0 = node0 PIC: 2x 10GE-XFP @ 1/0/*
jnxOperatingDescr.8.8.1.0 = node0 PIC: SPU Cp-Flow @ 7/0/*
jnxOperatingDescr.8.9.1.0 = node0 PIC: SPU Flow @ 8/0/*
jnxOperatingDescr.8.11.1.0 = node0 PIC: NPC PIC @ 10/0/*
jnxOperatingDescr.8.12.1.0 = node0 PIC: NPC PIC @ 11/0/*
jnxOperatingDescr.8.14.1.0 = node1 PIC: 8x 1GE-TX 4x 1GE-SFP @ 0/0/*
jnxOperatingDescr.8.15.1.0 = node1 PIC: 2x 10GE-XFP @ 1/0/*
jnxOperatingDescr.8.21.1.0 = node1 PIC: SPU Cp-Flow @ 7/0/*
jnxOperatingDescr.8.22.1.0 = node1 PIC: SPU Flow @ 8/0/*
jnxOperatingDescr.8.24.1.0 = node1 PIC: NPC PIC @ 10/0/*
jnxOperatingDescr.8.25.1.0 = node1 PIC: NPC PIC @ 11/0/*
jnxOperatingDescr.9.1.0.0 = node0 Routing Engine 0
jnxOperatingDescr.9.3.0.0 = node1 Routing Engine 0
jnxOperatingDescr.10.1.1.0 = node0 FPM Board
jnxOperatingDescr.10.2.1.0 = node1 FPM Board
jnxOperatingDescr.12.1.0.0 = node0 CB 0
jnxOperatingDescr.12.3.0.0 = node1 CB 0

{primary:node0}
root@slt14-bamboo>

My XML file is :
<juniper_kernel>
<name>Get Juniper Device Kernel Info</name>
<script_path>|path_cacti|/scripts/ss_juniper_kernel.php</script_path>
<script_function>ss_juniper_kernel</script_function>
<script_server>php</script_server>
<arg_prepend>|host_hostname| |host_id| |host_snmp_version|:|host_snmp_port|:|host_snmp_timeout|:|host_ping_retries|:|host_max_oids|:|host_snmp_community|:|host_snmp_username|:|host_snmp_password|:|host_snmp_auth_protocol|:|host_snmp_priv_passphrase|:|host_snmp_priv_protocol|:|host_snmp_context|</arg_prepend>
<arg_index>index</arg_index>
<arg_query>query</arg_query>
<arg_get>get</arg_get>
<arg_num_indexes>num_indexes</arg_num_indexes>
<output_delimeter>!</output_delimeter>
<index_order>jnxOperatingContentsIndex:jnxOperatingL1Index:jnxOperatingL2Index:jnxOperatingL3Index</index_order>
<index_order_type>numeric</index_order_type>
<index_title_format>|chosen_order_field|</index_title_format>
<fields>
<jnxOperatingContentsIndex>
<name>jnxOperatingContentsIndex</name>
<direction>input</direction>
<query_name>jnxOperatingContentsIndex</query_name>
</jnxOperatingContentsIndex>
<jnxOperatingL1Index>
<name>jnxOperatingL1Index</name>
<direction>input</direction>
<query_name>jnxOperatingL1Index</query_name>
</jnxOperatingL1Index>
<jnxOperatingL2Index>
<name>jnxOperatingL2Index</name>
<direction>input</direction>
<query_name>jnxOperatingL2Index</query_name>
</jnxOperatingL2Index>
<jnxOperatingL3Index>
<name>jnxOperatingL3Index</name>
<direction>input</direction>
<query_name>jnxOperatingL3Index</query_name>
</jnxOperatingL3Index>
<jnxOperatingDescr>
<name>jnxOperatingDescr</name>
<direction>input</direction>
<query_name>jnxOperatingDescr</query_name>
</jnxOperatingDescr>
<jnxOperatingTemp>
<name>jnxOperatingTemp</name>
<direction>output</direction>
<query_name>jnxOperatingTemp</query_name>
</jnxOperatingTemp>
<jnxOperatingCPU>
<name>jnxOperatingCPU</name>
<direction>output</direction>
<query_name>jnxOperatingCPU</query_name>
</jnxOperatingCPU>
<jnxOperatingISR>
<name>jnxOperatingISR</name>
<direction>output</direction>
<query_name>jnxOperatingISR</query_name>
</jnxOperatingISR>
<jnxOperatingDRAMSize>
<name>jnxOperatingDRAMSize</name>
<direction>output</direction>
<query_name>jnxOperatingDRAMSize</query_name>
</jnxOperatingDRAMSize>
<jnxOperatingBuffer>
<name>jnxOperatingBuffer</name>
<direction>output</direction>
<query_name>jnxOperatingBuffer</query_name>
</jnxOperatingBuffer>
<jnxOperatingHeap>
<name>jnxOperatingHeap</name>
<direction>output</direction>
<query_name>jnxOperatingHeap</query_name>
</jnxOperatingHeap>
<jnxOperatingUpTime>
<name>jnxOperatingUpTime</name>
<direction>output</direction>
<query_name>jnxOperatingUpTime</query_name>
</jnxOperatingUpTime>
<jnxOperatingLastRestart>
<name>jnxOperatingLastRestart</name>
<direction>output</direction>
<query_name>jnxOperatingLastRestart</query_name>
</jnxOperatingLastRestart>
<jnxOperatingMemory>
<name>jnxOperatingMemory</name>
<direction>output</direction>
<query_name>jnxOperatingMemory</query_name>
</jnxOperatingMemory>
<jnxOperatingStateOrdered>
<name>jnxOperatingStateOrdered</name>
<direction>output</direction>
<query_name>jnxOperatingStateOrdered</query_name>
</jnxOperatingStateOrdered>
<jnxOperatingChassisId>
<name>jnxOperatingChassisId</name>
<direction>input</direction>
<query_name>jnxOperatingChassisId</query_name>
</jnxOperatingChassisId>
<jnxOperatingChassisDescr>
<name>jnxOperatingChassisDescr</name>
<direction>input</direction>
<query_name>jnxOperatingChassisDescr</query_name>
</jnxOperatingChassisDescr>
<jnxOperatingRestartTime>
<name>jnxOperatingRestartTime</name>
<direction>output</direction>
<query_name>jnxOperatingRestartTime</query_name>
</jnxOperatingRestartTime>
<jnxOperating1MinLoadAvg>
<name>jnxOperating1MinLoadAvg</name>
<direction>output</direction>
<query_name>jnxOperating1MinLoadAvg</query_name>
</jnxOperating1MinLoadAvg>
<jnxOperating5MinLoadAvg>
<name>jnxOperating5MinLoadAvg</name>
<direction>output</direction>
<query_name>jnxOperating5MinLoadAvg</query_name>
</jnxOperating5MinLoadAvg>
<jnxOperating15MinLoadAvg>
<name>jnxOperating15MinLoadAvg</name>
<direction>output</direction>
<query_name>jnxOperating15MinLoadAvg</query_name>
</jnxOperating15MinLoadAvg>
</fields>
</juniper_kernel>
I have add a new Data queries in Get Script Server Data (Indexed) for this device,but i can't get any results in rrd file.
the script result :
[root@slt18-centos-dut1 ~]# "/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.131.210 19 2:161:500:1:20:public:::::: query jnxOperatingDescr
1.1.0.0!node0 midplane
1.2.0.0!node1 midplane
2.1.0.0!node0 PEM 0
2.2.0.0!node0 PEM 1
2.5.0.0!node1 PEM 0
2.6.0.0!node1 PEM 1
4.1.0.0!node0 Left Fan Tray
4.1.1.1!node0 Top Rear Fan
4.1.2.2!node0 Bottom Rear Fan
4.1.3.3!node0 Top Middle Fan
4.1.4.4!node0 Bottom Middle Fan
4.1.5.5!node0 Top Front Fan
4.1.6.6!node0 Bottom Front Fan
4.2.0.0!node1 Left Fan Tray
4.2.1.1!node1 Top Rear Fan
4.2.2.2!node1 Bottom Rear Fan
4.2.3.3!node1 Top Middle Fan
4.2.4.4!node1 Bottom Middle Fan
4.2.5.5!node1 Top Front Fan
4.2.6.6!node1 Bottom Front Fan
7.1.0.0!node0 FPC: SRX5k IOC II @ 0/*/*
7.2.0.0!node0 FPC: SRX5k SPC II @ 1/*/*
7.3.0.0!node0 FPC: SRX5k DPC 40x 1GE @ 2/*/*
7.6.0.0!node0 FPC: SRX5k DPC 4X 10GE @ 5/*/*
7.7.0.0!node1 FPC: SRX5k IOC II @ 0/*/*
7.8.0.0!node1 FPC: SRX5k SPC II @ 1/*/*
7.9.0.0!node1 FPC: SRX5k DPC 40x 1GE @ 2/*/*
7.12.0.0!node1 FPC: SRX5k DPC 4X 10GE @ 5/*/*
8.1.1.1!node0 PIC: 10x 10GE SFP+ @ 0/0/*
8.2.1.1!node0 PIC: SPU Cp @ 1/0/*
8.2.2.2!node0 PIC: SPU Flow @ 1/1/*
8.2.3.3!node0 PIC: SPU Flow @ 1/2/*
8.2.4.4!node0 PIC: SPU Flow @ 1/3/*
8.3.1.1!node0 PIC: 10x 1GE RichQ @ 2/0/*
8.3.2.2!node0 PIC: 10x 1GE RichQ @ 2/1/*
8.3.3.3!node0 PIC: 10x 1GE RichQ @ 2/2/*
8.3.4.4!node0 PIC: 10x 1GE RichQ @ 2/3/*
8.6.1.1!node0 PIC: 1x 10GE(LAN/WAN) RichQ @ 5/0/*
8.6.2.2!node0 PIC: 1x 10GE(LAN/WAN) RichQ @ 5/1/*
8.6.3.3!node0 PIC: 1x 10GE(LAN/WAN) RichQ @ 5/2/*
8.6.4.4!node0 PIC: 1x 10GE(LAN/WAN) RichQ @ 5/3/*
8.7.1.1!node1 PIC: 10x 10GE SFP+ @ 0/0/*
8.8.1.1!node1 PIC: SPU Cp @ 1/0/*
8.8.2.2!node1 PIC: SPU Flow @ 1/1/*
8.8.3.3!node1 PIC: SPU Flow @ 1/2/*
8.8.4.4!node1 PIC: SPU Flow @ 1/3/*
8.9.1.1!node1 PIC: 10x 1GE RichQ @ 2/0/*
8.9.2.2!node1 PIC: 10x 1GE RichQ @ 2/1/*
8.9.3.3!node1 PIC: 10x 1GE RichQ @ 2/2/*
8.9.4.4!node1 PIC: 10x 1GE RichQ @ 2/3/*
8.12.1.1!node1 PIC: 1x 10GE(LAN/WAN) RichQ @ 5/0/*
8.12.2.2!node1 PIC: 1x 10GE(LAN/WAN) RichQ @ 5/1/*
8.12.3.3!node1 PIC: 1x 10GE(LAN/WAN) RichQ @ 5/2/*
8.12.4.4!node1 PIC: 1x 10GE(LAN/WAN) RichQ @ 5/3/*
9.1.0.0!node0 Routing Engine 0
9.3.0.0!node1 Routing Engine 0
10.1.1.1!node0 FPM Board
10.2.1.1!node1 FPM Board
12.1.0.0!node0 CB 0
12.3.0.0!node1 CB 0
20.1.1.1!node0 MIC: 10x 10GE SFP+ @ 0/0/*
20.7.1.1!node1 MIC: 10x 10GE SFP+ @ 0/0/*
[root@slt18-centos-dut1 ~]#
[root@slt18-centos-dut1 ~]# "/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.131.210 19 2:161:500:1:20:public:::::: query jnxOperatingMemory
1.1.0.0!0
1.2.0.0!0
2.1.0.0!0
2.2.0.0!0
2.5.0.0!0
2.6.0.0!0
4.1.0.0!0
4.1.1.1!0
4.1.2.2!0
4.1.3.3!0
4.1.4.4!0
4.1.5.5!0
4.1.6.6!0
4.2.0.0!0
4.2.1.1!0
4.2.2.2!0
4.2.3.3!0
4.2.4.4!0
4.2.5.5!0
4.2.6.6!0
7.1.0.0!2048
7.2.0.0!1024
7.3.0.0!1024
7.6.0.0!1024
7.7.0.0!2048
7.8.0.0!1024
7.9.0.0!1024
7.12.0.0!1024
8.1.1.1!0
8.2.1.1!0
8.2.2.2!0
8.2.3.3!0
8.2.4.4!0
8.3.1.1!0
8.3.2.2!0
8.3.3.3!0
8.3.4.4!0
8.6.1.1!0
8.6.2.2!0
8.6.3.3!0
8.6.4.4!0
8.7.1.1!0
8.8.1.1!0
8.8.2.2!0
8.8.3.3!0
8.8.4.4!0
8.9.1.1!0
8.9.2.2!0
8.9.3.3!0
8.9.4.4!0
8.12.1.1!0
8.12.2.2!0
8.12.3.3!0
8.12.4.4!0
9.1.0.0!2048
9.3.0.0!2048
10.1.1.1!0
10.2.1.1!0
12.1.0.0!0
12.3.0.0!0
20.1.1.1!0
20.7.1.1!0
the verbose query in device via the web console:
Data Query Debug Information
+ Running data query [16].
+ Found type = '6' [Script Query - Script Server].
+ Found data query XML file at '/srv/www/cacti/resource/script_server/juniper_kernel.xml'
+ XML file parsed ok.
+ Executing script for num of indexes '"/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.176.21 19 2:161:500:1:20:public:::::: num_indexes'
+ Found number of indexes: 58
+ Executing script for list of indexes '"/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.176.21 19 2:161:500:1:20:public:::::: index' Index Count: 1
+ Found index: sizeof index number :arr0 != arr1 or arr2 != arr3
+ Executing script query '"/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.176.21 19 2:161:500:1:20:public:::::: query jnxOperatingContentsIndex'
+ Found item [jnxOperatingContentsIndex='= arr3'] index: sizeof index number :arr0 != arr1 or arr2
+ Executing script query '"/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.176.21 19 2:161:500:1:20:public:::::: query jnxOperatingL1Index'
+ Found item [jnxOperatingL1Index='1'] index: 1.1.0.0
+ Found item [jnxOperatingL1Index='2'] index: 1.2.0.0
+ Found item [jnxOperatingL1Index='1'] index: 2.1.0.0
+ Found item [jnxOperatingL1Index='2'] index: 2.2.0.0
+ Found item [jnxOperatingL1Index='5'] index: 2.5.0.0
+ Found item [jnxOperatingL1Index='6'] index: 2.6.0.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.0.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.1.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.2.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.3.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.4.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.5.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.6.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.7.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.8.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.9.0
+ Found item [jnxOperatingL1Index='1'] index: 4.1.10.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.0.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.1.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.2.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.3.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.4.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.5.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.6.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.7.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.8.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.9.0
+ Found item [jnxOperatingL1Index='2'] index: 4.2.10.0
+ Found item [jnxOperatingL1Index='1'] index: 7.1.0.0
+ Found item [jnxOperatingL1Index='2'] index: 7.2.0.0
+ Found item [jnxOperatingL1Index='8'] index: 7.8.0.0
+ Found item [jnxOperatingL1Index='9'] index: 7.9.0.0
+ Found item [jnxOperatingL1Index='11'] index: 7.11.0.0
+ Found item [jnxOperatingL1Index='12'] index: 7.12.0.0
+ Found item [jnxOperatingL1Index='14'] index: 7.14.0.0
+ Found item [jnxOperatingL1Index='15'] index: 7.15.0.0
+ Found item [jnxOperatingL1Index='21'] index: 7.21.0.0
+ Found item [jnxOperatingL1Index='22'] index: 7.22.0.0
+ Found item [jnxOperatingL1Index='24'] index: 7.24.0.0
+ Found item [jnxOperatingL1Index='25'] index: 7.25.0.0
+ Found item [jnxOperatingL1Index='1'] index: 8.1.1.0
+ Found item [jnxOperatingL1Index='2'] index: 8.2.1.0
+ Found item [jnxOperatingL1Index='8'] index: 8.8.1.0
+ Found item [jnxOperatingL1Index='9'] index: 8.9.1.0
+ Found item [jnxOperatingL1Index='11'] index: 8.11.1.0
+ Found item [jnxOperatingL1Index='12'] index: 8.12.1.0
+ Found item [jnxOperatingL1Index='14'] index: 8.14.1.0
+ Found item [jnxOperatingL1Index='15'] index: 8.15.1.0
+ Found item [jnxOperatingL1Index='21'] index: 8.21.1.0
+ Found item [jnxOperatingL1Index='22'] index: 8.22.1.0
+ Found item [jnxOperatingL1Index='24'] index: 8.24.1.0
+ Found item [jnxOperatingL1Index='25'] index: 8.25.1.0
+ Found item [jnxOperatingL1Index='1'] index: 9.1.0.0
+ Found item [jnxOperatingL1Index='3'] index: 9.3.0.0
+ Found item [jnxOperatingL1Index='1'] index: 10.1.1.0
+ Found item [jnxOperatingL1Index='2'] index: 10.2.1.0
+ Found item [jnxOperatingL1Index='1'] index: 12.1.0.0
+ Found item [jnxOperatingL1Index='3'] index: 12.3.0.0
+ Executing script query '"/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.176.21 19 2:161:500:1:20:public:::::: query jnxOperatingL2Index'
+ Found item [jnxOperatingL2Index='0'] index: 1.1.0.0
+ Found item [jnxOperatingL2Index='0'] index: 1.2.0.0
+ Found item [jnxOperatingL2Index='0'] index: 2.1.0.0
+ Found item [jnxOperatingL2Index='0'] index: 2.2.0.0
+ Found item [jnxOperatingL2Index='0'] index: 2.5.0.0
+ Found item [jnxOperatingL2Index='0'] index: 2.6.0.0
+ Found item [jnxOperatingL2Index='0'] index: 4.1.0.0
+ Found item [jnxOperatingL2Index='1'] index: 4.1.1.0
+ Found item [jnxOperatingL2Index='2'] index: 4.1.2.0
+ Found item [jnxOperatingL2Index='3'] index: 4.1.3.0
+ Found item [jnxOperatingL2Index='4'] index: 4.1.4.0
+ Found item [jnxOperatingL2Index='5'] index: 4.1.5.0
+ Found item [jnxOperatingL2Index='6'] index: 4.1.6.0
+ Found item [jnxOperatingL2Index='7'] index: 4.1.7.0
+ Found item [jnxOperatingL2Index='8'] index: 4.1.8.0
+ Found item [jnxOperatingL2Index='9'] index: 4.1.9.0
+ Found item [jnxOperatingL2Index='10'] index: 4.1.10.0
+ Found item [jnxOperatingL2Index='0'] index: 4.2.0.0
+ Found item [jnxOperatingL2Index='1'] index: 4.2.1.0
+ Found item [jnxOperatingL2Index='2'] index: 4.2.2.0
+ Found item [jnxOperatingL2Index='3'] index: 4.2.3.0
+ Found item [jnxOperatingL2Index='4'] index: 4.2.4.0
+ Found item [jnxOperatingL2Index='5'] index: 4.2.5.0
+ Found item [jnxOperatingL2Index='6'] index: 4.2.6.0
+ Found item [jnxOperatingL2Index='7'] index: 4.2.7.0
+ Found item [jnxOperatingL2Index='8'] index: 4.2.8.0
+ Found item [jnxOperatingL2Index='9'] index: 4.2.9.0
+ Found item [jnxOperatingL2Index='10'] index: 4.2.10.0
+ Found item [jnxOperatingL2Index='0'] index: 7.1.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.2.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.8.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.9.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.11.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.12.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.14.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.15.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.21.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.22.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.24.0.0
+ Found item [jnxOperatingL2Index='0'] index: 7.25.0.0
+ Found item [jnxOperatingL2Index='1'] index: 8.1.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.2.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.8.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.9.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.11.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.12.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.14.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.15.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.21.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.22.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.24.1.0
+ Found item [jnxOperatingL2Index='1'] index: 8.25.1.0
+ Found item [jnxOperatingL2Index='0'] index: 9.1.0.0
+ Found item [jnxOperatingL2Index='0'] index: 9.3.0.0
+ Found item [jnxOperatingL2Index='1'] index: 10.1.1.0
+ Found item [jnxOperatingL2Index='1'] index: 10.2.1.0
+ Found item [jnxOperatingL2Index='0'] index: 12.1.0.0
+ Found item [jnxOperatingL2Index='0'] index: 12.3.0.0
+ Executing script query '"/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.176.21 19 2:161:500:1:20:public:::::: query jnxOperatingL3Index'
+ Found item [jnxOperatingL3Index='= arr3'] index: sizeof index number :arr0 != arr1 or arr2
+ Executing script query '"/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.176.21 19 2:161:500:1:20:public:::::: query jnxOperatingDescr'
+ Found item [jnxOperatingDescr='node0 midplane'] index: 1.1.0.0
+ Found item [jnxOperatingDescr='node1 midplane'] index: 1.2.0.0
+ Found item [jnxOperatingDescr='node0 PEM 0'] index: 2.1.0.0
+ Found item [jnxOperatingDescr='node0 PEM 1'] index: 2.2.0.0
+ Found item [jnxOperatingDescr='node1 PEM 0'] index: 2.5.0.0
+ Found item [jnxOperatingDescr='node1 PEM 1'] index: 2.6.0.0
+ Found item [jnxOperatingDescr='node0 Fan Tray'] index: 4.1.0.0
+ Found item [jnxOperatingDescr='node0 Fan 1'] index: 4.1.1.0
+ Found item [jnxOperatingDescr='node0 Fan 2'] index: 4.1.2.0
+ Found item [jnxOperatingDescr='node0 Fan 3'] index: 4.1.3.0
+ Found item [jnxOperatingDescr='node0 Fan 4'] index: 4.1.4.0
+ Found item [jnxOperatingDescr='node0 Fan 5'] index: 4.1.5.0
+ Found item [jnxOperatingDescr='node0 Fan 6'] index: 4.1.6.0
+ Found item [jnxOperatingDescr='node0 Fan 7'] index: 4.1.7.0
+ Found item [jnxOperatingDescr='node0 Fan 8'] index: 4.1.8.0
+ Found item [jnxOperatingDescr='node0 Fan 9'] index: 4.1.9.0
+ Found item [jnxOperatingDescr='node0 Fan 10'] index: 4.1.10.0
+ Found item [jnxOperatingDescr='node1 Fan Tray'] index: 4.2.0.0
+ Found item [jnxOperatingDescr='node1 Fan 1'] index: 4.2.1.0
+ Found item [jnxOperatingDescr='node1 Fan 2'] index: 4.2.2.0
+ Found item [jnxOperatingDescr='node1 Fan 3'] index: 4.2.3.0
+ Found item [jnxOperatingDescr='node1 Fan 4'] index: 4.2.4.0
+ Found item [jnxOperatingDescr='node1 Fan 5'] index: 4.2.5.0
+ Found item [jnxOperatingDescr='node1 Fan 6'] index: 4.2.6.0
+ Found item [jnxOperatingDescr='node1 Fan 7'] index: 4.2.7.0
+ Found item [jnxOperatingDescr='node1 Fan 8'] index: 4.2.8.0
+ Found item [jnxOperatingDescr='node1 Fan 9'] index: 4.2.9.0
+ Found item [jnxOperatingDescr='node1 Fan 10'] index: 4.2.10.0
+ Found item [jnxOperatingDescr='node0 FPC: SRX3k SFB 12GE @ 0/*/*'] index: 7.1.0.0
+ Found item [jnxOperatingDescr='node0 FPC: SRX3k 2x10GE XFP @ 1/*/*'] index: 7.2.0.0
+ Found item [jnxOperatingDescr='node0 FPC: SRX3k SPC @ 7/*/*'] index: 7.8.0.0
+ Found item [jnxOperatingDescr='node0 FPC: SRX3k SPC @ 8/*/*'] index: 7.9.0.0
+ Found item [jnxOperatingDescr='node0 FPC: SRX3k NPC @ 10/*/*'] index: 7.11.0.0
+ Found item [jnxOperatingDescr='node0 FPC: SRX3k NPC @ 11/*/*'] index: 7.12.0.0
+ Found item [jnxOperatingDescr='node1 FPC: SRX3k SFB 12GE @ 0/*/*'] index: 7.14.0.0
+ Found item [jnxOperatingDescr='node1 FPC: SRX3k 2x10GE XFP @ 1/*/*'] index: 7.15.0.0
+ Found item [jnxOperatingDescr='node1 FPC: SRX3k SPC @ 7/*/*'] index: 7.21.0.0
+ Found item [jnxOperatingDescr='node1 FPC: SRX3k SPC @ 8/*/*'] index: 7.22.0.0
+ Found item [jnxOperatingDescr='node1 FPC: SRX3k NPC @ 10/*/*'] index: 7.24.0.0
+ Found item [jnxOperatingDescr='node1 FPC: SRX3k NPC @ 11/*/*'] index: 7.25.0.0
+ Found item [jnxOperatingDescr=''] index: 8.1.1.0
+ Found item [jnxOperatingDescr=''] index: 8.2.1.0
+ Found item [jnxOperatingDescr=''] index: 8.8.1.0
+ Found item [jnxOperatingDescr=''] index: 8.9.1.0
+ Found item [jnxOperatingDescr=''] index: 8.11.1.0
+ Found item [jnxOperatingDescr=''] index: 8.12.1.0
+ Found item [jnxOperatingDescr=''] index: 8.14.1.0
+ Found item [jnxOperatingDescr=''] index: 8.15.1.0
+ Found item [jnxOperatingDescr=''] index: 8.21.1.0
+ Found item [jnxOperatingDescr=''] index: 8.22.1.0
+ Found item [jnxOperatingDescr=''] index: 8.24.1.0
+ Found item [jnxOperatingDescr=''] index: 8.25.1.0
+ Found item [jnxOperatingDescr=''] index: 9.1.0.0
+ Found item [jnxOperatingDescr=''] index: 9.3.0.0
+ Found item [jnxOperatingDescr=''] index: 10.1.1.0
+ Found item [jnxOperatingDescr=''] index: 10.2.1.0
+ Found item [jnxOperatingDescr=''] index: 12.1.0.0
+ Found item [jnxOperatingDescr=''] index: 12.3.0.0
+ Executing script query '"/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.176.21 19 2:161:500:1:20:public:::::: query jnxOperatingChassisId'
+ Found item [jnxOperatingChassisId='12'] index: 1.1.0.0
+ Found item [jnxOperatingChassisId='13'] index: 1.2.0.0
+ Found item [jnxOperatingChassisId='12'] index: 2.1.0.0
+ Found item [jnxOperatingChassisId='12'] index: 2.2.0.0
+ Found item [jnxOperatingChassisId='13'] index: 2.5.0.0
+ Found item [jnxOperatingChassisId='13'] index: 2.6.0.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.0.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.1.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.2.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.3.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.4.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.5.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.6.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.7.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.8.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.9.0
+ Found item [jnxOperatingChassisId='12'] index: 4.1.10.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.0.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.1.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.2.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.3.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.4.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.5.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.6.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.7.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.8.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.9.0
+ Found item [jnxOperatingChassisId='13'] index: 4.2.10.0
+ Found item [jnxOperatingChassisId='12'] index: 7.1.0.0
+ Found item [jnxOperatingChassisId='12'] index: 7.2.0.0
+ Found item [jnxOperatingChassisId='12'] index: 7.8.0.0
+ Found item [jnxOperatingChassisId='12'] index: 7.9.0.0
+ Found item [jnxOperatingChassisId='12'] index: 7.11.0.0
+ Found item [jnxOperatingChassisId='12'] index: 7.12.0.0
+ Found item [jnxOperatingChassisId='13'] index: 7.14.0.0
+ Found item [jnxOperatingChassisId='13'] index: 7.15.0.0
+ Found item [jnxOperatingChassisId='13'] index: 7.21.0.0
+ Found item [jnxOperatingChassisId='13'] index: 7.22.0.0
+ Found item [jnxOperatingChassisId='13'] index: 7.24.0.0
+ Found item [jnxOperatingChassisId='13'] index: 7.25.0.0
+ Found item [jnxOperatingChassisId='12'] index: 8.1.1.0
+ Found item [jnxOperatingChassisId='12'] index: 8.2.1.0
+ Found item [jnxOperatingChassisId='12'] index: 8.8.1.0
+ Found item [jnxOperatingChassisId='12'] index: 8.9.1.0
+ Found item [jnxOperatingChassisId='12'] index: 8.11.1.0
+ Found item [jnxOperatingChassisId='12'] index: 8.12.1.0
+ Found item [jnxOperatingChassisId='13'] index: 8.14.1.0
+ Found item [jnxOperatingChassisId='13'] index: 8.15.1.0
+ Found item [jnxOperatingChassisId='13'] index: 8.21.1.0
+ Found item [jnxOperatingChassisId='13'] index: 8.22.1.0
+ Found item [jnxOperatingChassisId='13'] index: 8.24.1.0
+ Found item [jnxOperatingChassisId='13'] index: 8.25.1.0
+ Found item [jnxOperatingChassisId='12'] index: 9.1.0.0
+ Found item [jnxOperatingChassisId='13'] index: 9.3.0.0
+ Found item [jnxOperatingChassisId='12'] index: 10.1.1.0
+ Found item [jnxOperatingChassisId='13'] index: 10.2.1.0
+ Found item [jnxOperatingChassisId='12'] index: 12.1.0.0
+ Found item [jnxOperatingChassisId='13'] index: 12.3.0.0
+ Executing script query '"/usr/local/php/bin/php" -q /srv/www/cacti/scripts/ss_juniper_kernel.php 10.208.176.21 19 2:161:500:1:20:public:::::: query jnxOperatingChassisDescr'
+ Found item [jnxOperatingChassisDescr='node0'] index: 1.1.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 1.2.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 2.1.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 2.2.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 2.5.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 2.6.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.1.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.2.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.3.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.4.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.5.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.6.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.7.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.8.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.9.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 4.1.10.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.1.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.2.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.3.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.4.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.5.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.6.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.7.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.8.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.9.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 4.2.10.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 7.1.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 7.2.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 7.8.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 7.9.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 7.11.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 7.12.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 7.14.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 7.15.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 7.21.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 7.22.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 7.24.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 7.25.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 8.1.1.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 8.2.1.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 8.8.1.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 8.9.1.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 8.11.1.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 8.12.1.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 8.14.1.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 8.15.1.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 8.21.1.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 8.22.1.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 8.24.1.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 8.25.1.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 9.1.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 9.3.0.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 10.1.1.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 10.2.1.0
+ Found item [jnxOperatingChassisDescr='node0'] index: 12.1.0.0
+ Found item [jnxOperatingChassisDescr='node1'] index: 12.3.0.0
but i can't get the result in rra file,I want to know the detail process about how to deal with the script result ?and how to store it into rra file ?
sorry,i'm a newbie in cacti,the document file is not very well for me to understand the working process.
In addition, i also add a xml file for Get SNMP Data (Indexed),but it's also not work well.
wuwentao
Posts: 3
Joined: Mon Jun 03, 2013 2:59 am

Re: How to deal with multi-index values in cacti?

Post by wuwentao »

Hi,
Is anybody can help me for this issue?

I am not familiar with cacti source code,so i add many additional info for debug it.
I found when i was add a data query under a device in <path_cacti>/host.php, it will go to the function form_save(),then trace it :
/* recache snmp data */
run_data_query($_POST["id"], $_POST["snmp_query_id"]);
this function is defined in <path_cacti>/lib/data_query.php ,continue trace it,
/* update the sort cache */
update_data_query_sort_cache($host_id, $snmp_query_id);
this function also have issue when i processed with my script,continue trace:
this function get_ordered_index_type_list() have no result for our xml file

Code: Select all

/* get a list of valid data query types */
        $valid_index_types = get_ordered_index_type_list($host_id, $data_query_id);
trace the get_ordered_index_type_list() in the same file:
the problem in this while operation:
/* list each of the input fields for this snmp query */
while (list($field_name, $field_array) = each($raw_xml["fields"])) {
if ($field_array["direction"] == "input") {
/* create a list of all values for this index */
if (sizeof($data_query_index_array) == 0) {
$field_values = db_fetch_assoc("select field_value from host_snmp_cache where host_id=$host_id and snmp_query_id=$data_query_id and field_name='$field_name'");
}else{
$field_values = db_fetch_assoc("select field_value from host_snmp_cache where host_id=$host_id and snmp_query_id=$data_query_id and field_name='$field_name' and $sql_or");
}

echo "-----01--field-values------------- <br>";
echo '<pre>';//wtwu debug
print_r($field_values);
echo '</pre>';
/* aggregate the above list so there is no duplicates */
$aggregate_field_values = array_rekey($field_values, "field_value", "field_value");

echo "-----02--aggregate_field_values-------------- <br>";
echo '<pre>';//wtwu debug
print_r($aggregate_field_values);
echo '</pre>';
/* fields that contain duplicate or empty values are not suitable to index off of */
if (!((sizeof($aggregate_field_values) < sizeof($field_values)) || (in_array("", $aggregate_field_values) == true) || (sizeof($aggregate_field_values) == 0)) || ($nonunique)) {
array_push($xml_outputs, $field_name);
}
}
}

$return_array = array();

/* the xml file contains an ordered list of "indexable" fields */
if (isset($raw_xml["index_order"])) {
$index_order_array = explode(":", $raw_xml["index_order"]);

for ($i=0; $i<count($index_order_array); $i++) {
if (in_array($index_order_array[$i], $xml_outputs)) {
$return_array[] = $index_order_array[$i];
echo "<br>!!!!!!!!! oh !!!!!,it's working well now!<br>";
}
echo "<br>--04---hello world!<br>";
}
/* the xml file does not contain a field list, ignore the order */
}else{
for ($i=0; $i<count($xml_outputs); $i++) {
$return_array[] = $xml_outputs[$i];
}
}
echo "<br>-------------05---------<br>";
echo "field_values=$field_values <br>";
echo "host-id=$host_id <br>";
echo "data_query_id=$data_query_id <br>";
echo "======index_order_array======<br>";
echo '<pre>';//wtwu debug
print_r($index_order_array);
echo '</pre>';
echo "======xml_outputs======<br>";
echo '<pre>';//wtwu debug
print_r($xml_outputs);
echo '</pre>';
echo "==========00112233==<br>";
echo '<pre>';//wtwu debug
print_r($raw_xml);
echo '</pre>';

return $return_array;
}
so the $xml_outputs only have 1 result ,the next function will have some error,my debug info as follows:
-----01--field-values-------------
Array
(
[0] => Array
(
[field_value] => 1
)

[1] => Array
(
[field_value] => 2
)

[2] => Array
(
[field_value] => 7
)

[3] => Array
(
[field_value] => 8
)

[4] => Array
(
[field_value] => 9
)

[5] => Array
(
[field_value] => 9
)

[6] => Array
(
[field_value] => 9
)

)
-----02--aggregate_field_values--------------
Array
(
[1] => 1
[2] => 2
[7] => 7
[8] => 8
[9] => 9
)
-----01--field-values-------------
Array
(
[0] => Array
(
[field_value] => 1
)

[1] => Array
(
[field_value] => 1
)

[2] => Array
(
[field_value] => 1
)

[3] => Array
(
[field_value] => 1
)

[4] => Array
(
[field_value] => 1
)

[5] => Array
(
[field_value] => 1
)

[6] => Array
(
[field_value] => 1
)

)
-----02--aggregate_field_values--------------
Array
(
[1] => 1
)
-----01--field-values-------------
Array
(
[0] => Array
(
[field_value] => 0
)

[1] => Array
(
[field_value] => 0
)

[2] => Array
(
[field_value] => 0
)

[3] => Array
(
[field_value] => 1
)

[4] => Array
(
[field_value] => 0
)

[5] => Array
(
[field_value] => 1
)

[6] => Array
(
[field_value] => 2
)

)
-----02--aggregate_field_values--------------
Array
(
[0] => 0
[1] => 1
[2] => 2
)
-----01--field-values-------------
Array
(
[0] => Array
(
[field_value] => 0
)

[1] => Array
(
[field_value] => 0
)

[2] => Array
(
[field_value] => 0
)

[3] => Array
(
[field_value] => 0
)

[4] => Array
(
[field_value] => 0
)

[5] => Array
(
[field_value] => 0
)

[6] => Array
(
[field_value] => 0
)

)
-----02--aggregate_field_values--------------
Array
(
[0] => 0
)
-----01--field-values-------------
Array
(
[0] => Array
(
[field_value] => midplane
)

[1] => Array
(
[field_value] => PEM 0
)

[2] => Array
(
[field_value] => FPC: Virtual FPC @ 0/*/*
)

[3] => Array
(
[field_value] => PIC: Virtual GE @ 0/0/*
)

[4] => Array
(
[field_value] => Routing Engine
)

[5] => Array
(
[field_value] => USB Hub
)

[6] => Array
(
[field_value] => Removable Compact Flash
)

)
-----02--aggregate_field_values--------------
Array
(
[midplane] => midplane
[PEM 0] => PEM 0
[FPC: Virtual FPC @ 0/*/*] => FPC: Virtual FPC @ 0/*/*
[PIC: Virtual GE @ 0/0/*] => PIC: Virtual GE @ 0/0/*
[Routing Engine] => Routing Engine
[USB Hub] => USB Hub
[Removable Compact Flash] => Removable Compact Flash
)
-----01--field-values-------------
Array
(
[0] => Array
(
[field_value] => 2
)

[1] => Array
(
[field_value] => 2
)

[2] => Array
(
[field_value] => 2
)

[3] => Array
(
[field_value] => 2
)

[4] => Array
(
[field_value] => 2
)

[5] => Array
(
[field_value] => 2
)

[6] => Array
(
[field_value] => 2
)

)
-----02--aggregate_field_values--------------
Array
(
[2] => 2
)
-----01--field-values-------------
Array
(
[0] => Array
(
[field_value] => Single Chassis
)

[1] => Array
(
[field_value] => Single Chassis
)

[2] => Array
(
[field_value] => Single Chassis
)

[3] => Array
(
[field_value] => Single Chassis
)

[4] => Array
(
[field_value] => Single Chassis
)

[5] => Array
(
[field_value] => Single Chassis
)

[6] => Array
(
[field_value] => Single Chassis
)

)
-----02--aggregate_field_values--------------
Array
(
[Single Chassis] => Single Chassis
)

--04---hello world!

--04---hello world!

--04---hello world!

--04---hello world!

-------------05---------
field_values=Array
host-id=4
data_query_id=10
======index_order_array======
Array
(
[0] => jnxContentsIndex
[1] => jnxL1Index
[2] => jnxL2Index
[3] => jnxL3Index
)
======xml_outputs======
Array
(
[0] => jnxDescr
)
==========00112233==
Array
(
[name] => Get Juniper Device Kernel Info
[script_path] => |path_cacti|/scripts/ss_juniper_kernel.php
[script_function] => ss_juniper_kernel
[script_server] => php
[arg_prepend] => |host_hostname| |host_id| |host_snmp_version|:|host_snmp_port|:|host_snmp_timeout|:|host_ping_retries|:|host_max_oids|:|host_snmp_community|:|host_snmp_username|:|host_snmp_password|:|host_snmp_auth_protocol|:|host_snmp_priv_passphrase|:|host_snmp_priv_protocol|:|host_snmp_context|
[arg_index] => index
[arg_query] => query
[arg_get] => get
[arg_num_indexes] => num_indexes
[output_delimeter] => !
[index_order] => jnxContentsIndex:jnxL1Index:jnxL2Index:jnxL3Index
[index_order_type] => numeric
[index_title_format] => |chosen_order_field|
[fields] => Array
(
[jnxContentsIndex] => Array
(
[name] => ContentsIndex
[direction] => input
[query_name] => ContentsIndex
)

[jnxL1Index] => Array
(
[name] => L1Index
[direction] => input
[query_name] => L1Index
)

[jnxL2Index] => Array
(
[name] => L2Index
[direction] => input
[query_name] => L2Index
)

[jnxL3Index] => Array
(
[name] => L3Index
[direction] => input
[query_name] => L3Index
)

[jnxDescr] => Array
(
[name] => Descr
[direction] => input
[query_name] => Descr
)

[jnxTemp] => Array
(
[name] => Temp
[direction] => output
[query_name] => Temp
)

[jnxCPU] => Array
(
[name] => CPU
[direction] => output
[query_name] => CPU
)

[jnxISR] => Array
(
[name] => ISR
[direction] => output
[query_name] => ISR
)

[jnxDRAMSize] => Array
(
[name] => DRAMSize
[direction] => output
[query_name] => DRAMSize
)

[jnxBuffer] => Array
(
[name] => Buffer
[direction] => output
[query_name] => Buffer
)

[jnxHeap] => Array
(
[name] => Heap
[direction] => output
[query_name] => Heap
)

[jnxUpTime] => Array
(
[name] => UpTime
[direction] => output
[query_name] => UpTime
)

[jnxLastRestart] => Array
(
[name] => LastRestart
[direction] => output
[query_name] => LastRestart
)

[jnxMemory] => Array
(
[name] => Memory
[direction] => output
[query_name] => Memory
)

[jnxStateOrdered] => Array
(
[name] => StateOrdered
[direction] => output
[query_name] => StateOrdered
)

[jnxChassisId] => Array
(
[name] => ChassisId
[direction] => input
[query_name] => ChassisId
)

[jnxChassisDescr] => Array
(
[name] => ChassisDescr
[direction] => input
[query_name] => ChassisDescr
)

[jnxRestartTime] => Array
(
[name] => RestartTime
[direction] => output
[query_name] => RestartTime
)

[jnx1MinLoadAvg] => Array
(
[name] => 1MinLoadAvg
[direction] => output
[query_name] => 1MinLoadAvg
)

[jnx5MinLoadAvg] => Array
(
[name] => 5MinLoadAvg
[direction] => output
[query_name] => 5MinLoadAvg
)

[jnx15MinLoadAvg] => Array
(
[name] => 15MinLoadAvg
[direction] => output
[query_name] => 15MinLoadAvg
)

)

)

-------no result!!!!
Array
(
)
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest