data query and graph creation problem

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

Moderators: Developers, Moderators

Post Reply
gripp
Posts: 9
Joined: Tue Jan 29, 2008 1:05 pm
Location: Brasil

data query and graph creation problem

Post by gripp »

Hi,

I'm with a little strange problem in cacti and haven't found nothing about it here in the forums.
I have got some scripts and templates here on this forum to collect some QoS data on cisco routers, but they didn't worked properly. I started changing things a bit to make them work. I thought I had done it but not.

THE PROBLEM: the data query works for one cisco device and not for other.

The perl script and the xml are attached.

Script execution outputs for the working device (cacti on a linux box):
root@<host> cacti# perl /opt/cacti/scripts/cbwfq.pl
usage:

/opt/cacti/scripts/cbwfq.pl IP SNMP_community SNMP_version index
/opt/cacti/scripts/cbwfq.pl IP SNMP_community SNMP_version query {class|bytes|drops}
/opt/cacti/scripts/cbwfq.pl IP SNMP_community SNMP_version get {class|bytes|drops} index_oid
root@<host> cacti# perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 index
1089.1091
1089.1097
1089.1107
root@<host> cacti# perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 query class
1089.1091!<class name1>
1089.1097!<class name2>
1089.1107!<class name3>
root@<host> cacti# perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 query bytes
1089.1091!0
1089.1097!3639476156
1089.1107!2603127710
root@<host> cacti#
Script execution outputs for the not working device:
root@<host> cacti# perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 index
1083.1085
1083.1093
1083.1099
1117.1121
1117.1133
1117.1143
1117.1149
1195.1197
1195.1205
1195.1211
1229.1233
1229.1245
1229.1255
1229.1261
root@<host> cacti# perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 query class
1083.1085!<class name1>
1083.1093!<class name2>
1083.1099!<class name3>
1117.1121!<class name4>
1117.1133!<class name5>
1117.1143!<class name6>
1117.1149!<class name7>
1195.1197!<class name8>
1195.1205!<class name9>
1195.1211!<class name10>
1229.1233!<class name11>
1229.1245!<class name12>
1229.1255!<class name13>
1229.1261!<class name14>
root@<host> cacti# perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 query bytes
1083.1085!101373200
1083.1093!347365295
1083.1099!310175705
1117.1121!374433754
1117.1133!1484071717
1117.1143!3521803237
1117.1149!1085342123
1195.1197!102478013
1195.1205!353077392
1195.1211!322493502
1229.1233!376106516
1229.1245!1485573975
1229.1255!3536948125
1229.1261!1103662306
root@<host> cacti#
As can be verified on the output the script is working properly for the 2 devices. (of course I removed some sensitive information)

Now, creating the graphics.

On working device:
Data Query Debug Information
+ Running data query [14].
+ Found type = '4 '[script query].
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 index'
+ Executing script query 'perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 query class'
+ Found item [class='class name1'] index: 1089.1091
+ Found item [class='class name2'] index: 1089.1097
+ Found item [class='class name3'] index: 1089.1107
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'

======================================

+ Created graph: <ip> - Class Throughput - <class name1>
+ Created graph: <ip> - Class Throughput - <class name2>
+ Created graph: <ip> - Class Throughput - <class name3>
And on non working device:
Data Query Debug Information
+ Running data query [14].
+ Found type = '4 '[script query].
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ XML file parsed ok.
+ Executing script for list of indexes 'perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 index'
+ Executing script query 'perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 query class'
+ Found item [class='class name1'] index: 1083.1085
+ Found item [class='class name2'] index: 1083.1093
+ Found item [class='class name3'] index: 1083.1099
+ Found item [class='class name4'] index: 1117.1121
+ Found item [class='class name5'] index: 1117.1133
+ Found item [class='class name6'] index: 1117.1143
+ Found item [class='class name7'] index: 1117.1149
+ Found item [class='class name8'] index: 1195.1197
+ Found item [class='class name9'] index: 1195.1205
+ Found item [class='class name10'] index: 1195.1211
+ Found item [class='class name11'] index: 1229.1233
+ Found item [class='class name12'] index: 1229.1245
+ Found item [class='class name13'] index: 1229.1255
+ Found item [class='class name14'] index: 1229.1261
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'
+ Found data query XML file at '/opt/cacti/resource/script_queries/cbwfq.xml'

======================================

+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
+ Created graph: <ip> - Class Throughput - |query_class|
As can by viewed the creation of the graphics fail in the second case, as if the "query class" option on the script doesn't worked...
I have tried change the class name reducing it's size or/and removing all non letter/number/space character.

Any ideas?

Last, sorry by my English, I have learned by myself...

Thanks for any help,

Regards,

Gripp.
Attachments
cbwfq.zip
script and xml files
(2.41 KiB) Downloaded 119 times
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please delete failing graphs and data sources first.
Then, please re-index the failing data query by pressing the green circle next to it for that very device. Now, please try to create graphs again. Post results, then.
If again |query_*| stuff is not resolved, we should try to investigate why those data is not cached by cacti as it should.
BTB: Which SNMP timeout/retries are set? Does the script pay attention to those settings?
Reinhard
gripp
Posts: 9
Joined: Tue Jan 29, 2008 1:05 pm
Location: Brasil

Post by gripp »

Hi gandalf, thanks for the quick answer...

I have tried that a lot of times... I have deleted all the graphs and data sources of this type, including the one on the working device, and tried to recreate, same problem... I had try the re-index too, no change....

I forgot to mention, my cacti is version 0.8.6j. I'm out of time to update :(, but if that could solve the problem....

About the SNMP timeout/retries the script don't pay attention to then, but I'm a bit confused about that. The script always work for the problem device when ran in the linux shell. Is there a time out for the script when the graph is created? And beside this, in the verbose query the data always come, as can be viewed in the previews post.
Normal execution time of the script:

root@<host> root# date; perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 index; date
Wed Jan 30 14:34:32 BRST 2008
1083.1085
1083.1093
1083.1099
1117.1121
1117.1133
1117.1143
1117.1149
1195.1197
1195.1205
1195.1211
1229.1233
1229.1245
1229.1255
1229.1261
Wed Jan 30 14:34:39 BRST 2008
root@<host> root# date; perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 query class; date
Wed Jan 30 14:34:48 BRST 2008
1083.1085!<class name1>
1083.1093!<class name2>
1083.1099!<class name3>
1117.1121!<class name4>
1117.1133!<class name5>
1117.1143!<class name6>
1117.1149!<class name7>
1195.1197!<class name8>
1195.1205!<class name9>
1195.1211!<class name10>
1229.1233!<class name11>
1229.1245!<class name12>
1229.1255!<class name13>
1229.1261!<class name14>
Wed Jan 30 14:34:55 BRST 2008
root@<host> root#
I don't know what more information I can send to help searching the problem/solution. Please tell me what you need.

Thanks,

Regards,

Gripp.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Whoo, it takes about 7 seconds to complete. And default timeout is 500 ms! Please incraese the timeout to at least 10000 ms (and well, that's insane). Though cacti not always performs a "query" type request. In most cases it will be a "get" type request. You may consider debugging as given by second link of my signature. You will want to skip most items, as they do not aplly here. But it will show you how to use debug and how to understand the output
Reinhard
gripp
Posts: 9
Joined: Tue Jan 29, 2008 1:05 pm
Location: Brasil

Post by gripp »

thanks again, gandalf.

but I'm not understanding how to change the time out of the script execution when I'm creating the graphs. To tell the truth, I'm not understanding how to change the time out when the source is a script. The timeout on the host and on the settings are for SNMP queries, or not?

I'm a bit lost on how to solve this problem, now that you have found it... the device that works really answers instantly...

Very thanks,

regards,

gripp
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

When editing the Host, there's an SNMP timeout value that defaults to 500. Change it to 10000.
If the script is way faster on the other host, you may want to determine why it's so slow on the other one.
Reinhard
gripp
Posts: 9
Joined: Tue Jan 29, 2008 1:05 pm
Location: Brasil

Post by gripp »

The problem is that one device is local (the faster one), and the other is in another country (the one with nedds about 7 seconds).... but I'm collecting CPU, memory and interface statistics for all of them with out a problem... the problem is that the script needs to do a lot of snmpwalks to answer the query command, I'm thinking about a way to improve it's speed....

Anyway, about the timeout, I have changed the SNMP Timeout to 30000 and still the problem continue. Is there any timeout on the apache server or in the php configuration that can affect this?

the configuration of apache and php are:

apache
#
# Timeout: The number of seconds before receives and sends time out.
#
Timeout 300

php
max_execution_time = 30 ; Maximum execution time of each script, in seconds

Thanks again,

gripp
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

I'm not that used to those settings. The php one is quite clear and should not interfere. The apache one: I don't know.
Reinhard
gripp
Posts: 9
Joined: Tue Jan 29, 2008 1:05 pm
Location: Brasil

Post by gripp »

OK, I have eliminated the timeout suspect as the cause of the problem. How? I get the final output of a normal execution of the script, put it in a file and changed the script to simple output that file... ;) of course this is a test, but see that time isn't a problem now:
root@<host> scripts# date;perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 index; date
Fri Feb 1 17:38:10 BRST 2008
1083.1085
1083.1093
1083.1099
1117.1121
1117.1133
1117.1143
1117.1149
1195.1197
1195.1205
1195.1211
1229.1233
1229.1245
1229.1255
1229.1261
Fri Feb 1 17:38:10 BRST 2008
root@<host> scripts# date;perl /opt/cacti/scripts/cbwfq.pl <ip> <community> 2 query class; date
Fri Feb 1 17:38:14 BRST 2008
1083.1085!<class name1>
1083.1093!<class name2>
1083.1099!<class name3>
1117.1121!<class name4>
1117.1133!<class name5>
1117.1143!<class name6>
1117.1149!<class name7>
1195.1197!<class name8>
1195.1205!<class name9>
1195.1211!<class name10>
1229.1233!<class name11>
1229.1245!<class name12>
1229.1255!<class name13>
1229.1261!<class name14>
Fri Feb 1 17:38:14 BRST 2008
root@<host> scripts#
And I still have the same problem, the data sources aren't created correctly. Any other ideas?

Thanks,

Gripp.
gripp
Posts: 9
Joined: Tue Jan 29, 2008 1:05 pm
Location: Brasil

Post by gripp »

OK, I got a calm day today, because the beginning of carnival, and upgraded the cacti to 0.8.7a.

Still the same problem.

Thanks.
gripp
Posts: 9
Joined: Tue Jan 29, 2008 1:05 pm
Location: Brasil

Post by gripp »

I'm still with this problem, I upgraded cacti, apache and mysql to the latest version and still the problems occurs.

Can anyone help with this problem? How can I debug it to find where the errors occurs?

Thanks,
User avatar
mpdsville1
Cacti User
Posts: 71
Joined: Wed Mar 16, 2005 12:11 pm
Location: Albany , NY , USA

Re: data query and graph creation problem

Post by mpdsville1 »

I just ran into this exact same problem.. Was there ever any resolution?
Mike Donnelly , Albany , NY
| Cacti 0.8.7g | Spine 0.8.7g | MySQL 5.0.77 | Net-SNMP 5.3.2.2 | Apache 2.2.3 | PHP 5.3.3 | RRDtool 1.2.27 | Rhel6 | Dual Xeon E5410@2.33ghz | Sunfire x4150
brononius
Posts: 27
Joined: Fri Dec 30, 2011 4:53 am

Re: data query and graph creation problem

Post by brononius »

Seem that i'm having the same...

Code: Select all

perl /var/www/html/scripts/cbwfq.pl testnode.my.domain communitystring index
Timeout: No Response from testnode.my.domain
Cacti: 0.8.7i PIA on Ubuntu (linuxmce) with NET-SNMP 5.4.1 / RRDTool 1.2.x
Plugins: Manage062, Syslog122, Mactrack29, Settings071, Weathermap097a, Quicktree02, Thold049, Configmanager0826, Aggregate070, Realtime043, Nettools015
Private use: 24 hosts (and trying to integrate it into linuxmce)
Professional use 1635 nodes with 3616 graphs (backup / syslog / weathermaps...)
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: data query and graph creation problem

Post by gandalf »

brononius wrote:Seem that i'm having the same...

Code: Select all

perl /var/www/html/scripts/cbwfq.pl testnode.my.domain communitystring index
Timeout: No Response from testnode.my.domain
That's either an issue with that custom script (please post to the thread where it was published, then) or with the target host
R.
brononius
Posts: 27
Joined: Fri Dec 30, 2011 4:53 am

Re: data query and graph creation problem

Post by brononius »

gandalf wrote:
brononius wrote:Seem that i'm having the same...

Code: Select all

perl /var/www/html/scripts/cbwfq.pl testnode.my.domain communitystring index
Timeout: No Response from testnode.my.domain
That's either an issue with that custom script (please post to the thread where it was published, then) or with the target host
R.
I'm using the same credentials for other graphs (bw, cpu load...), so the target seem fine.
I'll try to find out where i found this template/script...

Thanks
Cacti: 0.8.7i PIA on Ubuntu (linuxmce) with NET-SNMP 5.4.1 / RRDTool 1.2.x
Plugins: Manage062, Syslog122, Mactrack29, Settings071, Weathermap097a, Quicktree02, Thold049, Configmanager0826, Aggregate070, Realtime043, Nettools015
Private use: 24 hosts (and trying to integrate it into linuxmce)
Professional use 1635 nodes with 3616 graphs (backup / syslog / weathermaps...)
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests