Ad blocker detected: Our website is made possible by displaying online advertisements to our visitors. Please consider supporting us by disabling your ad blocker on our website.
I am trying to make my script work and I am having problems. I have followed the docs and I have the script executing as it should. Here are some of the results:
[root@localhost scripts]# ./multiple_index_resolve_test2.pl 192.168.1.250 public query ifSpeed
1:10000000
65539:1000000000
[root@localhost scripts]# ./multiple_index_resolve_test2.pl 192.168.1.250 public query ifInOctets
1:299098223
65539:4268454900
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Notice: Undefined index: output_delimeter in /var/www/html/lib/data_query.php on line 116
Warning: Cannot modify header information - headers already sent by (output started at /var/www/html/lib/data_query.php:116) in /var/www/html/host.php on line 77
When I execute the script from the command line, it works fine. When I set it up as a device in Cacti, I get this from the Cacti screen.
Please give me direction.
Thanks,
Stephen
Attachments
Cacti Screen
cacti-sdq-issue1.JPG (31.33 KiB) Viewed 3209 times
Last edited by shull on Tue Sep 04, 2007 3:04 pm, edited 1 time in total.
I did not find any obvious error in there. I recommend reading http://docs.cacti.net/node/284. Please try to build a second Script/XML step-by-step as given in this HowTo. This should help you tracking down the error
Reinhard
I did follow that. That is what the script and XML are based on.
If someone could tell me what the error means, I could take it from there. What is Cacti looking for, exactly?
The documentation is good at explaining the "what you do" but there is not any "why you do this" or "here are the reasons this works this way". That, to me, is critical in trying to figure out why something isn't working.
If you have any more knowledge on this, please let me know. How can I see more from the debug logs? Can I log more information? The docs are fine, but they aren't good enough for this issue.
[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]
+ Running data query [11].
+ Found type = '4 '[script query].
+ Found data query XML file at '/var/www/html/resource/script_queries/xmlmultiresolvetest1.xml'
+ XML file parsed ok.
+ Executing script for list of indexes '/usr/bin/perl /var/www/html/scripts/multiple_index_resolve_test2.pl 192.168.1.152 public index'
+ Executing script query '/usr/bin/perl /var/www/html/scripts/multiple_index_resolve_test2.pl 192.168.1.152 public query ifIndex'
+ Found item [ifIndex=''] index: 1:1
+ Found item [ifIndex=''] index: 2:2
+ Found item [ifIndex=''] index: 3:3
+ Found item [ifIndex=''] index: 4:4
+ Found item [ifIndex=''] index: 5:5
+ Found item [ifIndex=''] index: 6:6
+ Found item [ifIndex=''] index: 7:7
+ Found item [ifIndex=''] index: 8:8
+ Found item [ifIndex=''] index: 9:9
+ Found item [ifIndex=''] index: 10:10
+ Found item [ifIndex=''] index: 11:11
+ Found item [ifIndex=''] index: 12:12
+ Found item [ifIndex=''] index: 13:13
+ Found item [ifIndex=''] index: 14:14
+ Executing script query '/usr/bin/perl /var/www/html/scripts/multiple_index_resolve_test2.pl 192.168.1.152 public query ifStatus'
+ Found item [ifStatus=''] index: 1:2
+ Found item [ifStatus=''] index: 2:1
+ Found item [ifStatus=''] index: 3:2
+ Found item [ifStatus=''] index: 4:2
+ Found item [ifStatus=''] index: 5:2
+ Found item [ifStatus=''] index: 6:2
+ Found item [ifStatus=''] index: 7:1
+ Found item [ifStatus=''] index: 8:2
+ Found item [ifStatus=''] index: 9:2
+ Found item [ifStatus=''] index: 10:1
+ Found item [ifStatus=''] index: 11:2
+ Found item [ifStatus=''] index: 12:1
+ Found item [ifStatus=''] index: 13:1
+ Found item [ifStatus=''] index: 14:1
+ Executing script query '/usr/bin/perl /var/www/html/scripts/multiple_index_resolve_test2.pl 192.168.1.152 public query ifDescr'
+ Found item [ifDescr=''] index: 1:FastEthernet0/1
+ Found item [ifDescr=''] index: 2:FastEthernet0/2
+ Found item [ifDescr=''] index: 3:FastEthernet0/3
+ Found item [ifDescr=''] index: 4:FastEthernet0/4
+ Found item [ifDescr=''] index: 5:FastEthernet0/5
+ Found item [ifDescr=''] index: 6:FastEthernet0/6
+ Found item [ifDescr=''] index: 7:FastEthernet0/7
+ Found item [ifDescr=''] index: 8:FastEthernet0/8
+ Found item [ifDescr=''] index: 9:FastEthernet0/9
+ Found item [ifDescr=''] index: 10:FastEthernet0/10
+ Found item [ifDescr=''] index: 11:FastEthernet0/11
+ Found item [ifDescr=''] index: 12:FastEthernet0/12
+ Found item [ifDescr=''] index: 13:Null0
+ Found item [ifDescr=''] index: 14:Vlan1
+ Executing script query '/usr/bin/perl /var/www/html/scripts/multiple_index_resolve_test2.pl 192.168.1.152 public query ifName'
+ Executing script query '/usr/bin/perl /var/www/html/scripts/multiple_index_resolve_test2.pl 192.168.1.152 public query ifAlias'
+ Executing script query '/usr/bin/perl /var/www/html/scripts/multiple_index_resolve_test2.pl 192.168.1.152 public query ifType'
+ Found item [ifType=''] index: 1:6
+ Found item [ifType=''] index: 2:6
+ Found item [ifType=''] index: 3:6
+ Found item [ifType=''] index: 4:6
+ Found item [ifType=''] index: 5:6
+ Found item [ifType=''] index: 6:6
+ Found item [ifType=''] index: 7:6
+ Found item [ifType=''] index: 8:6
+ Found item [ifType=''] index: 9:6
+ Found item [ifType=''] index: 10:6
+ Found item [ifType=''] index: 11:6
+ Found item [ifType=''] index: 12:6
+ Found item [ifType=''] index: 13:1
+ Found item [ifType=''] index: 14:53
+ Executing script query '/usr/bin/perl /var/www/html/scripts/multiple_index_resolve_test2.pl 192.168.1.152 public query ifSpeed'
+ Found item [ifSpeed=''] index: 1:100000000
+ Found item [ifSpeed=''] index: 2:100000000
+ Found item [ifSpeed=''] index: 3:10000000
+ Found item [ifSpeed=''] index: 4:10000000
+ Found item [ifSpeed=''] index: 5:10000000
+ Found item [ifSpeed=''] index: 6:10000000
+ Found item [ifSpeed=''] index: 7:100000000
+ Found item [ifSpeed=''] index: 8:10000000
+ Found item [ifSpeed=''] index: 9:10000000
+ Found item [ifSpeed=''] index: 10:100000000
+ Found item [ifSpeed=''] index: 11:10000000
+ Found item [ifSpeed=''] index: 12:100000000
+ Found item [ifSpeed=''] index: 13:4294967295
+ Found item [ifSpeed=''] index: 14:1000000000
+ Executing script query '/usr/bin/perl /var/www/html/scripts/multiple_index_resolve_test2.pl 192.168.1.152 public query ifPhysAddress'
+ Found item [ifPhysAddress=''] index: 1:0x000c852890c1
+ Found item [ifPhysAddress=''] index: 2:0x000c852890c2
+ Found item [ifPhysAddress=''] index: 3:0x000c852890c3
+ Found item [ifPhysAddress=''] index: 4:0x000c852890c4
+ Found item [ifPhysAddress=''] index: 5:0x000c852890c5
+ Found item [ifPhysAddress=''] index: 6:0x000c852890c6
+ Found item [ifPhysAddress=''] index: 7:0x000c852890c7
+ Found item [ifPhysAddress=''] index: 8:0x000c852890c8
+ Found item [ifPhysAddress=''] index: 9:0x000c852890c9
+ Found item [ifPhysAddress=''] index: 10:0x000c852890ca
+ Found item [ifPhysAddress=''] index: 11:0x000c852890cb
+ Found item [ifPhysAddress=''] index: 12:0x000c852890cc
+ Found item [ifPhysAddress=''] index: 13:
+ Found item [ifPhysAddress=''] index: 14:0x000c852890c0
+ Found data query XML file at '/var/www/html/resource/script_queries/xmlmultiresolvetest1.xml'
+ Found data query XML file at '/var/www/html/resource/script_queries/xmlmultiresolvetest1.xml'
+ Found data query XML file at '/var/www/html/resource/script_queries/xmlmultiresolvetest1.xml'
When I run my script fro mthe command line, it outputs data in the form of:
1:2345
2:343433
3:3434
or
1:wewew
2:gdfgdfg
...
This is how the docs said to do it. Is this a problem? That is the only difference I see with the examples in the docs and my script.
I am not sure if this is part of the problem. I am still getting the error when I run a Verbose Query, but it now shows the above information on the Cacti screen.
As per http://docs.cacti.net/node/285, calling your script using the parameter index should return a list of indices, one on each line. Please post the result of your script when using this very parameter.
@Tony: Yes, you're quite right. That's the result of spending only a few seconds for quite complex questions. I apologize
Reinhard
I've managed to debug it and produce reasonable results. Then I withdraw my debugging changes and it worked as well!?!
Now, I suspect re-indexing issues. To clarify, please perform:
- a re-index by pressing the green circle next to your data query
- following sql command
SELECT *
FROM `host_snmp_cache`
WHERE `host_id` =2
AND `snmp_query_id` =10
where "2" is the number of the host you've applied the data query to and "10" is the nuber of that very data query. If you place your mouse above the "Verbose Query" link, you will find both numbers as "host_id" and "id", respectively