When I test the "index" and "query" commands, I get an additional line of output that simply has the capital letter U. Within Cacti, though, it doesn't seem to affect the verbose query
Code: Select all
administrator@grunt-11:/usr/share/cacti$ php ./script_server.php
PHP Script Server has Started - Parent is cmd
./scripts/ss_cisco_enh_mempool.php ss_cisco_enh_mempool 13.10.253.11 public 2 161 500 "" "" index
module_2.1
CPU_of_Switching_Processor_5.1
CPU_of_Switching_Processor_5.2
CPU_of_Routing_Processor_5.1
CPU_of_Routing_Processor_5.2
CPU_of_Switching_Processor_6.1
CPU_of_Switching_Processor_6.2
CPU_of_Routing_Processor_6.1
CPU_of_Routing_Processor_6.2
U <== this line here
Code: Select all
+ Running data query [17].
+ Found type = '6 '[script query].
+ Found data query XML file at '/usr/share/cacti/resource/script_server/ss_cisco_enh_mempool.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/php -q /usr/share/cacti/scripts/ss_cisco_enh_mempool.php 13.10.253.11 public 2 161 500 "" "" index'
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/ss_cisco_enh_mempool.php 13.10.253.11 public 2 161 500 "" "" query index'
+ Found item [scriptIndex='module_2.1'] index: module_2.1
+ Found item [scriptIndex='CPU_of_Switching_Processor_5.1'] index: CPU_of_Switching_Processor_5.1
+ Found item [scriptIndex='CPU_of_Switching_Processor_5.2'] index: CPU_of_Switching_Processor_5.2
+ Found item [scriptIndex='CPU_of_Routing_Processor_5.1'] index: CPU_of_Routing_Processor_5.1
+ Found item [scriptIndex='CPU_of_Routing_Processor_5.2'] index: CPU_of_Routing_Processor_5.2
+ Found item [scriptIndex='CPU_of_Switching_Processor_6.1'] index: CPU_of_Switching_Processor_6.1
+ Found item [scriptIndex='CPU_of_Switching_Processor_6.2'] index: CPU_of_Switching_Processor_6.2
+ Found item [scriptIndex='CPU_of_Routing_Processor_6.1'] index: CPU_of_Routing_Processor_6.1
+ Found item [scriptIndex='CPU_of_Routing_Processor_6.2'] index: CPU_of_Routing_Processor_6.2
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/ss_cisco_enh_mempool.php 13.10.253.11 public 2 161 500 "" "" query cpuName'
+ Found item [cpuName='module_2'] index: module_2.1
+ Found item [cpuName='CPU_of_Switching_Processor_5'] index: CPU_of_Switching_Processor_5.1
+ Found item [cpuName='CPU_of_Switching_Processor_5'] index: CPU_of_Switching_Processor_5.2
+ Found item [cpuName='CPU_of_Routing_Processor_5'] index: CPU_of_Routing_Processor_5.1
+ Found item [cpuName='CPU_of_Routing_Processor_5'] index: CPU_of_Routing_Processor_5.2
+ Found item [cpuName='CPU_of_Switching_Processor_6'] index: CPU_of_Switching_Processor_6.1
+ Found item [cpuName='CPU_of_Switching_Processor_6'] index: CPU_of_Switching_Processor_6.2
+ Found item [cpuName='CPU_of_Routing_Processor_6'] index: CPU_of_Routing_Processor_6.1
+ Found item [cpuName='CPU_of_Routing_Processor_6'] index: CPU_of_Routing_Processor_6.2
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/ss_cisco_enh_mempool.php 13.10.253.11 public 2 161 500 "" "" query memName'
+ Found item [memName='Processor'] index: module_2.1
+ Found item [memName='Processor'] index: CPU_of_Switching_Processor_5.1
+ Found item [memName='I/O'] index: CPU_of_Switching_Processor_5.2
+ Found item [memName='Processor'] index: CPU_of_Routing_Processor_5.1
+ Found item [memName='I/O'] index: CPU_of_Routing_Processor_5.2
+ Found item [memName='Processor'] index: CPU_of_Switching_Processor_6.1
+ Found item [memName='I/O'] index: CPU_of_Switching_Processor_6.2
+ Found item [memName='Processor'] index: CPU_of_Routing_Processor_6.1
+ Found item [memName='I/O'] index: CPU_of_Routing_Processor_6.2
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/ss_cisco_enh_mempool.php 13.10.253.11 public 2 161 500 "" "" query memType'
+ Found item [memType='2'] index: module_2.1
+ Found item [memType='2'] index: CPU_of_Switching_Processor_5.1
+ Found item [memType='3'] index: CPU_of_Switching_Processor_5.2
+ Found item [memType='2'] index: CPU_of_Routing_Processor_5.1
+ Found item [memType='3'] index: CPU_of_Routing_Processor_5.2
+ Found item [memType='2'] index: CPU_of_Switching_Processor_6.1
+ Found item [memType='3'] index: CPU_of_Switching_Processor_6.2
+ Found item [memType='2'] index: CPU_of_Routing_Processor_6.1
+ Found item [memType='3'] index: CPU_of_Routing_Processor_6.2
+ Executing script query '/usr/bin/php -q /usr/share/cacti/scripts/ss_cisco_enh_mempool.php 13.10.253.11 public 2 161 500 "" "" query physIndex'
+ Found item [physIndex='1000'] index: module_2.1
+ Found item [physIndex='2001'] index: CPU_of_Switching_Processor_5.1
+ Found item [physIndex='2001'] index: CPU_of_Switching_Processor_5.2
+ Found item [physIndex='2017'] index: CPU_of_Routing_Processor_5.1
+ Found item [physIndex='2017'] index: CPU_of_Routing_Processor_5.2
+ Found item [physIndex='3001'] index: CPU_of_Switching_Processor_6.1
+ Found item [physIndex='3001'] index: CPU_of_Switching_Processor_6.2
+ Found item [physIndex='3017'] index: CPU_of_Routing_Processor_6.1
+ Found item [physIndex='3017'] index: CPU_of_Routing_Processor_6.2
+ Found data query XML file at '/usr/share/cacti/resource/script_server/ss_cisco_enh_mempool.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_server/ss_cisco_enh_mempool.xml'
+ Found data query XML file at '/usr/share/cacti/resource/script_server/ss_cisco_enh_mempool.xml'
Code: Select all
administrator@grunt-11:/usr/share/cacti$ php ./script_server.php
PHP Script Server has Started - Parent is cmd
./scripts/ss_cisco_enh_mempool.php ss_cisco_enh_mempool 13.10.253.11 public 2 161 500 "" "" get memUsed CPU_of_Switching_Processor_5.2
11743136
./scripts/ss_cisco_enh_mempool.php ss_cisco_enh_mempool 13.10.253.11 public 2 161 500 "" "" get memFree CPU_of_Switching_Processor_5.2
55365728
./scripts/ss_cisco_enh_mempool.php ss_cisco_enh_mempool 13.10.253.11 public 2 161 500 "" "" get memLargestFree CPU_of_Switching_Processor_5.2
55365692
./scripts/ss_cisco_enh_mempool.php ss_cisco_enh_mempool 13.10.253.11 public 2 161 500 "" "" get memLowestFree CPU_of_Switching_Processor_5.2
55169120
Code: Select all
5. The last step is to change the function call that could have traditionally returned the value to the Cacti poller using the PRINT function. You must change that line or lines in your code to utilize the RETURN function instead. However, this does not apply to PRINT statements that are not called from the Poller.
Anyhow, back on topic - should I just ignore the additional U output I get with the index and query commands?