[XML] SquidStats version 0.1 (cacti 0.8.5 only!!!)

Templates, scripts for templates, scripts and requests for templates.

Moderators: Developers, Moderators

Post Reply
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

log results against WebCache device

Post by paulbeard206 »

Here's the output of another run. Any ideas what's happening here? I don't know if I see the squid query being made. But it all seemed to install OK.

??

Code: Select all

# cactid --verbosity=5 10 10
CACTID: Using cactid config file [/usr/local/etc/cactid.conf]
CACTID: DEBUG: MySQL Query ID '0': 'SELECT value FROM settings WHERE name = 'path_webroot''
CACTID: DEBUG: MySQL Query ID '0': OK
CACTID: DEBUG: MySQL Query ID '1': 'SELECT value FROM settings WHERE name = 'path_cactilog''
CACTID: DEBUG: MySQL Query ID '1': OK
CACTID: DEBUG: The path_php_server variable is /usr/local/share/cacti/script_server.php
CACTID: DEBUG: The path_cactilog variable is /usr/local/share/cacti/log/cacti.log
CACTID: DEBUG: MySQL Query ID '2': 'SELECT value FROM settings WHERE name = 'log_destination''
CACTID: DEBUG: MySQL Query ID '2': OK
CACTID: DEBUG: The log_destination variable is 1 (FILE)
CACTID: DEBUG: MySQL Query ID '3': 'SELECT value FROM settings WHERE name = 'path_php_binary''
CACTID: DEBUG: MySQL Query ID '3': OK
CACTID: DEBUG: The path_php variable is /usr/local/bin/php
CACTID: DEBUG: MySQL Query ID '4': 'SELECT value FROM settings WHERE name = 'availability_method''
CACTID: DEBUG: MySQL Query ID '4': OK
CACTID: DEBUG: The availability_method variable is 1
CACTID: DEBUG: MySQL Query ID '5': 'SELECT value FROM settings WHERE name = 'ping_recovery_count''
CACTID: DEBUG: MySQL Query ID '5': OK
CACTID: DEBUG: The ping_recovery_count variable is 3
CACTID: DEBUG: MySQL Query ID '6': 'SELECT value FROM settings WHERE name = 'ping_failure_count''
CACTID: DEBUG: MySQL Query ID '6': OK
CACTID: DEBUG: The ping_failure_count variable is 2
CACTID: DEBUG: MySQL Query ID '7': 'SELECT value FROM settings WHERE name = 'ping_method''
CACTID: DEBUG: MySQL Query ID '7': OK
CACTID: DEBUG: The ping_method variable is 2
CACTID: DEBUG: MySQL Query ID '8': 'SELECT value FROM settings WHERE name = 'ping_retries''
CACTID: DEBUG: MySQL Query ID '8': OK
CACTID: DEBUG: The ping_retries variable is 5
CACTID: DEBUG: MySQL Query ID '9': 'SELECT value FROM settings WHERE name = 'ping_timeout''
CACTID: DEBUG: MySQL Query ID '9': OK
CACTID: DEBUG: The ping_timeout variable is 400
CACTID: DEBUG: MySQL Query ID '10': 'SELECT value FROM settings WHERE name = 'log_perror''
CACTID: DEBUG: MySQL Query ID '10': OK
CACTID: DEBUG: The log_perror variable is 1
CACTID: DEBUG: MySQL Query ID '11': 'SELECT value FROM settings WHERE name = 'log_pwarn''
CACTID: DEBUG: MySQL Query ID '11': OK
CACTID: DEBUG: The log_pwarn variable is 0
CACTID: DEBUG: MySQL Query ID '12': 'SELECT value FROM settings WHERE name = 'log_pstats''
CACTID: DEBUG: MySQL Query ID '12': OK
CACTID: DEBUG: The log_pstats variable is 0
CACTID: DEBUG: MySQL Query ID '13': 'SELECT value FROM settings WHERE name = 'max_threads''
CACTID: DEBUG: MySQL Query ID '13': OK
CACTID: DEBUG: The threads variable is 16
CACTID: DEBUG: MySQL Query ID '14': 'SELECT value FROM settings WHERE name = 'poller_interval''
CACTID: DEBUG: MySQL Query ID '14': OK
CACTID: DEBUG: The polling interval is the system default
CACTID: DEBUG: MySQL Query ID '15': 'SELECT value FROM settings WHERE name = 'concurrent_processes''
CACTID: DEBUG: MySQL Query ID '15': OK
CACTID: DEBUG: The number of concurrent processes is 8
CACTID: DEBUG: MySQL Query ID '16': 'SELECT value FROM settings WHERE name = 'script_timeout''
CACTID: DEBUG: MySQL Query ID '16': OK
CACTID: DEBUG: The script timeout is 25
CACTID: DEBUG: MySQL Query ID '17': 'SELECT value FROM settings WHERE name = 'php_servers''
CACTID: DEBUG: MySQL Query ID '17': OK
CACTID: DEBUG: The number of php script servers to run is 1
CACTID: DEBUG: MySQL Query ID '18': 'SELECT action FROM poller_item WHERE action=2 AND host_id BETWEEN 10 AND 10 LIMIT 1'
CACTID: DEBUG: MySQL Query ID '18': OK
CACTID: DEBUG: StartHost='10', EndHost='10', TotalPHPScripts='0'
CACTID: DEBUG: The PHP Script Server is Not Required
CACTID: DEBUG: MySQL Query ID '19': 'SELECT value FROM settings WHERE name = 'max_get_size''
CACTID: DEBUG: MySQL Query ID '19': OK
CACTID: DEBUG: The Maximum SNMP OID Get Size is 60
CACTID: CACTID: Version 0.8.6f starting
CACTID: MYSQL: Connecting to MySQL database 'cacti' on 'localhost'...
CACTID: MYSQL: Connected to MySQL database 'cacti' on 'localhost'...
CACTID: CACTID: Initializing Net-SNMP API
CACTID: CACTID: Initializing PHP Script Server
CACTID: DEBUG: MySQL Query ID '20': 'SELECT id FROM host WHERE disabled='' AND id BETWEEN 10 AND 10 ORDER BY id'
CACTID: DEBUG: MySQL Query ID '20': OK
CACTID: DEBUG: Initial Value of Active Threads is 0
CACTID: DEBUG: Valid Thread to be Created
CACTID: DEBUG: The Value of Active Threads is 1
CACTID: DEBUG: In Poller, About to Start Polling of Host
CACTID: MYSQL: Connecting to MySQL database 'cacti' on 'localhost'...
CACTID: MYSQL: Connected to MySQL database 'cacti' on 'localhost'...
CACTID: DEBUG: MySQL Query ID '21': 'SELECT action,hostname,snmp_community,snmp_version,snmp_username,snmp_password,rrd_name,rrd_path,arg1,arg2,arg3,local_data_id,rrd_num,snmp_port,snmp_timeout FROM poller_item WHERE host_id=0 ORDER BY arg1'
CACTID: DEBUG: MySQL Query ID '21': OK
CACTID: Host[0] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
CACTID: DEBUG: Valid Thread to be Created
CACTID: DEBUG: The Value of Active Threads is 2
CACTID: DEBUG: In Poller, About to Start Polling of Host
CACTID: MYSQL: Connecting to MySQL database 'cacti' on 'localhost'...
CACTID: MYSQL: Connected to MySQL database 'cacti' on 'localhost'...
CACTID: DEBUG: MySQL Query ID '22': 'SELECT id, hostname,snmp_community,snmp_username,snmp_password,snmp_version,snmp_port,snmp_timeout,status,status_event_count,status_fail_date,status_rec_date,status_last_error,min_time,max_time,cur_time,avg_time,total_polls,failed_polls,availability FROM host WHERE id=10'
CACTID: DEBUG: MySQL Query ID '22': OK
CACTID: DEBUG: The UDP Ping return_code was -1, errno was 61, total_time was 118.9709
CACTID: Host[10] PING Result: UDP: Host is Alive
CACTID: Host[10] SNMP Result: Host responded to SNMP
CACTID: DEBUG: MySQL Insert ID '0': 'update host set status='3',status_event_count='0', status_fail_date='2006-01-22 01:35:11',status_rec_date='2005-12-10 06:45:00',status_last_error='Host did not respond to SNMP',min_time='0.000000',max_time='278415.750000',cur_time='0.844480',avg_time='145.174295',total_polls='109254',failed_polls='334',availability='99.6943' where id='10''
CACTID: DEBUG: MySQL Insert ID '0': OK
CACTID: DEBUG: MySQL Query ID '23': 'SELECT data_query_id,action,op,assert_value,arg1 FROM poller_reindex WHERE host_id=10'
CACTID: DEBUG: MySQL Query ID '23': OK
CACTID: Host[10] RECACHE: Processing 2 items in the auto reindex cache for 'red.paulbeard.org'
CACTID: DEBUG: MySQL Insert ID '1': 'update poller_reindex set assert_value='25826952' where host_id='10' and data_query_id='14' and arg1='.1.3.6.1.2.1.1.3.0''
CACTID: DEBUG: MySQL Insert ID '1': OK
CACTID: DEBUG: MySQL Insert ID '2': 'update poller_reindex set assert_value='25826952' where host_id='10' and data_query_id='15' and arg1='.1.3.6.1.2.1.1.3.0''
CACTID: DEBUG: MySQL Insert ID '2': OK
CACTID: DEBUG: MySQL Query ID '24': 'SELECT action,hostname,snmp_community,snmp_version,snmp_username,snmp_password,rrd_name,rrd_path,arg1,arg2,arg3,local_data_id,rrd_num,snmp_port,snmp_timeout FROM poller_item WHERE host_id=10 ORDER BY arg1'
CACTID: DEBUG: MySQL Query ID '24': OK
CACTID: Host[10] DEBUG: HOST COMPLETE: About to Exit Host Polling Thread Function
CACTID: DEBUG: The Value of Active Threads is 1
CACTID: DEBUG: The Value of Active Threads is 0
CACTID: DEBUG: MySQL Insert ID '3': 'replace into settings (name,value) values ('date',NOW())'
CACTID: DEBUG: MySQL Insert ID '3': OK
CACTID: DEBUG: MySQL Insert ID '4': 'insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())'
CACTID: DEBUG: MySQL Insert ID '4': OK
CACTID: DEBUG: Thread Cleanup Complete
CACTID: DEBUG: PHP Script Server Pipes Closed
CACTID: DEBUG: Allocated Variable Memory Freed
CACTID: CACTID: Net-SNMP API Shutdown Completed
CACTID: DEBUG: MYSQL Free & Close Completed
CACTID: Time: 1.6022 s, Threads: 16, Hosts: 2
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Either you're polling the wrong host or the template has not been assigned ...
You should see sth like the OID 1.3.6.1.4.1.3495.1 in the logs. This is the OID queried (see XML file for more)
Reinhard
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

so far so what?

Post by paulbeard206 »

lvm wrote:Either you're polling the wrong host or the template has not been assigned ...
You should see sth like the OID 1.3.6.1.4.1.3495.1 in the logs. This is the OID queried (see XML file for more)
Reinhard
You're probably right. Where do I assign the template? I thought I was missing something in the docs but I don't see where I do that: it seems to be assumed to just happen.

[grumble] I just re-read the docs and reviewed my install. Yes, the template is assigned/associated. I can choose items to graph, and the graphs are made -- just blank.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Please select your squid device and Add Webcache Statistics under Associated Data Queries. Then Create Graphs for this Host
Reinhard
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

Post by paulbeard206 »

lvm wrote:Please select your squid device and Add Webcache Statistics under Associated Data Queries. Then Create Graphs for this Host
Reinhard
I updated my original message: the graph templates *are* associated. I see the two types of data points, with the correct numbers of rows and items.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

So please do a Verbose Query and post the findings. You are aware of the fact, that squid's SNMP port is 3401, are you? You you must change cacti's settings to 3401 or perhaps use an SNMP proxy (you may configure net-snmp for that)
Reinhard
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

verbose query findings

Post by paulbeard206 »

Code: Select all

+ Running data query [14].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.3495.1.3.2.1.11'
+ Located input field 'versionID' [get]
+ Executing SNMP get for data @ '.1.3.6.1.4.1.3495.1.2.3.0' [value='2.5.STABLE12']
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_core.xml'
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

My Verbose Query looks like

Code: Select all

+ Running data query [12].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.3495.1.3.2.1.11'
+ Located input field 'versionID' [get]
+ Executing SNMP get for data @ '.1.3.6.1.4.1.3495.1.2.3.0' [value='2.5.STABLE11']
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/html/cacti/resource/snmp_queries/webcache_squid_core.xml'
Did you cut some lines off? Or is it some other XML that you're using?
Reinhard
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

now why would I do that?

Post by paulbeard206 »

That result is from one of the two queries and that's all there is. Here's the WebCache - Squid Statistics - Median Based result.

Code: Select all

+ Running data query [15].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_median.xml'
+ XML file parsed ok.
+ Executing SNMP walk for list of indexes @ '.1.3.6.1.4.1.3495.1.3.2.2.1.1'
+ Located input field 'medianTime' [walk]
+ Executing SNMP walk for data @ '.1.3.6.1.4.1.3495.1.3.2.2.1.1'
+ Found item [medianTime='1'] index: 1 [from value]
+ Found item [medianTime='5'] index: 5 [from value]
+ Found item [medianTime='60'] index: 60 [from value]
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_median.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_median.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_median.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_median.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_median.xml'
+ Found data query XML file at '/usr/local/share/cacti/resource/snmp_queries/webcache_squid_median.xml'
And here are the particulars on the files:

Code: Select all

[.../local/share/cacti/resource/snmp_queries]:: ls -l webcache_squid_* cacti_graph_template_ping_advanced_ping_v1_2.xml 
-rw-r--r--  1 cacti  cacti  37945 Aug 21  2005 cacti_graph_template_ping_advanced_ping_v1_2.xml
-rw-r--r--  1 cacti  wheel   3688 Feb 15 19:05 webcache_squid_core.xml
-rw-r--r--  1 cacti  wheel   2153 Feb 15 19:05 webcache_squid_median.xml

[.../local/share/cacti/resource/snmp_queries]:: md5  webcache_squid_* cacti_graph_template_ping_advanced_ping_v1_2.xml 
MD5 (webcache_squid_core.xml) = 456131c9c5d21da771579e8a79bc05d7
MD5 (webcache_squid_median.xml) = e37858bad7658b8d0977316d28427c86
MD5 (cacti_graph_template_ping_advanced_ping_v1_2.xml) = da2788154a4545205c58e2c41aa32794

User avatar
nahun
Cacti User
Posts: 92
Joined: Wed Feb 15, 2006 11:27 pm
Location: Idaho
Contact:

Post by nahun »

hey, I just got this working, but there is an error in my cacti log

Code: Select all

02/27/2006 09:46:19 PM - THOLD: Poller[0] Checking Thresholds
02/27/2006 09:46:19 PM - RECACHE STATS: RecacheTime:0.3866 HostsRecached:1
02/27/2006 09:46:19 PM - CMDPHP: Poller[0] ERROR: SQL Assoc Failed "select snmp_query_graph_rrd.snmp_field_name, data_template_rrd.id as data_template_rrd_id from (snmp_query_graph_rrd,data_template_rrd) where snmp_query_graph_rrd.data_template_rrd_id=data_template_rrd.local_data_template_rrd_id and snmp_query_graph_rrd.snmp_query_graph_id= and snmp_query_graph_rrd.data_template_id=64 and data_template_rrd.local_data_id=109"
02/27/2006 09:46:18 PM - PCOMMAND: Poller[0] Host[16] WARNING: Recache Event Detected for Host
02/27/2006 09:46:18 PM - SYSTEM STATS: Time:76.5283 Method:cmd.php Processes:10 Threads:N/A Hosts:23 HostsPerProcess:3 DataSources:89 RRDsProcessed:79
02/27/2006 09:45:21 PM - CMDPHP: Poller[0] ASSERT: '<' failed. Recaching host '*.*.*.*', data query #11
02/27/2006 09:45:21 PM - CMDPHP: Poller[0] ASSERT: '<' failed. Recaching host '*.*.*.*', data query #10
It seems to working though, except the CPU usage graph. I haven't tried them all though. Host 16 is the squid host and data query 10 and 11 are the squid queries.
[size=75]Solaris 10 x86 [color=red][b]||[/b][/color] Cacti - 0.8.7 [color=red][b]||[/b][/color] MySQL - 5.0.45 [color=red][b]||[/b][/color] PHP - 5.2.6 [color=red][b]||[/b][/color] RRDTool - 1.2.23 [color=red][b]||[/b][/color] NET-SNMP - 5.4.1 [color=red][b]||[/b][/color] Syslog-ng 2.0.5
[url=http://www.indigo-networks.com]indigo-networks.com[/url][/size]
User avatar
nahun
Cacti User
Posts: 92
Joined: Wed Feb 15, 2006 11:27 pm
Location: Idaho
Contact:

Post by nahun »

any ideas?
[size=75]Solaris 10 x86 [color=red][b]||[/b][/color] Cacti - 0.8.7 [color=red][b]||[/b][/color] MySQL - 5.0.45 [color=red][b]||[/b][/color] PHP - 5.2.6 [color=red][b]||[/b][/color] RRDTool - 1.2.23 [color=red][b]||[/b][/color] NET-SNMP - 5.4.1 [color=red][b]||[/b][/color] Syslog-ng 2.0.5
[url=http://www.indigo-networks.com]indigo-networks.com[/url][/size]
paulbeard206
Cacti User
Posts: 150
Joined: Sat Jul 30, 2005 2:15 pm

net-snmp version is pretty old

Post by paulbeard206 »

Any thoughts on updating it? Not sure if it will make any difference, but worth a try, perhaps.
apiset
Posts: 1
Joined: Fri Mar 17, 2006 2:25 pm

My fix for no .rrd files

Post by apiset »

I'm using 0.8.6h and also initially having no .rrd files problem. I fixed it using the following steps:

1. Goto menu "Data Queries" and select "WebCache - Squid Statistics - Core"
2. For each associated graph templates links, choose the correct data source and (this is the trick!) tick the checkbox on the right hand side and click save.
3. Repeat steps 2 for "WebCache - Squid Statistics - Median Based"
4. Delete all your old squid graphs and re-create them again.

It work for me..
le_mackeux
Posts: 4
Joined: Mon Sep 19, 2005 7:08 pm

Post by le_mackeux »

Do you have an other idea... i tried it but on my side, never fixed my problem. Imported, reimported, deleted, reimported, install, configure redo it.... still not fixing it.
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

Did you pay attention to the fact, that SQUIDs snmp agent is not listening on 161? You may put the correct port into the DEVICE definition or you may setup the snmp-agent on the squid's host to proxy 161 requests to the correct port (that's the way I decided to go)
Reinhard
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests