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

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

Moderators: Developers, Moderators

Post Reply
le_mackeux
Posts: 4
Joined: Mon Sep 19, 2005 7:08 pm

Post by le_mackeux »

I did. 3401 is the port set and my snmp deamon has the proxy line to bind it.

Code: Select all

proxy -v 2c -c snmppublic localhost:3401 .1.3.6.1.4.1.3495.1 

Code: Select all

snmp_port 3401
acl snmppublic snmp_community snmppublic
snmp_access allow snmppublic all
My snmp port for that squid device is to 3401 in the device section. Though, i'm stilll getting the snmp error status in the Device section. It's probably cuz it can't get the hostinfo(contact and location).

Don't know where else to look. snmpwalk doesn't send me a stupid error anymore. I can get all data correctly with snmpwalk from my cacti host....

Code: Select all

RRDTool Command:
/opt/local/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="Squid - Squid Traffic In / Out / Saved" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=-100 \
--vertical-label="bits / s" \
--slope-mode \
DEF:a="/Users/cacti/cacti-0.8.6h/rra/squid_squid_httpoutkb_59.rrd":squid_serverInKb:AVERAGE \
DEF:b="/Users/cacti/cacti-0.8.6h/rra/squid_squid_httpoutkb_59.rrd":squid_httpOutKb:AVERAGE \
CDEF:cdefa=a,1024,*,8,* \
CDEF:cdefe=b,1024,*,8,* \
CDEF:cdefi=b,a,LT,0,a,b,-,IF,1024,*,8,* \
AREA:cdefa#00CF00:"Traffic In\:"  \
GPRINT:cdefa:LAST:"     Current\:%8.2lf%s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:cdefe#4444FF:"Traffic Out\:"  \
GPRINT:cdefe:LAST:"    Current\:%8.2lf%s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf%s\n"  \
AREA:cdefi#FF0000:"Traffic Savings\:"  \
GPRINT:cdefi:LAST:"Current\:%8.2lf%s"  \
GPRINT:cdefi:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:cdefi:MIN:"Maximum\:%8.2lf%s\n"  \
COMMENT:"                   Represents the traffic incoming and outgoing in bits per second\n"  \
COMMENT:"               with the red area (negative) showing the bits/s savings through caching\n"  \
COMMENT:"                                 SquidStats v0.1 - Rolf Poser\n" 
RRDTool Says:
ERROR: opening '/Users/cacti/cacti-0.8.6h/rra/squid_squid_httpoutkb_59.rrd': No such file or directory
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

le_mackeux wrote:I did. 3401 is the port set and my snmp deamon has the proxy line to bind it.

Code: Select all

proxy -v 2c -c snmppublic localhost:3401 .1.3.6.1.4.1.3495.1 

Code: Select all

snmp_port 3401
acl snmppublic snmp_community snmppublic
snmp_access allow snmppublic all
My snmp port for that squid device is to 3401 in the device section. Though, i'm stilll getting the snmp error status in the Device section. It's probably cuz it can't get the hostinfo(contact and location).
AFAIK, this is mutually exclusive. Either set the DEVICE to use port 3401 (the you'll get the snmp error) od use the proxy. In the latter case, set DEVICEs port to 161 in cacti, as the target's snmp proxy function does the trick.
Check this, by querying the target from cacti's cli using snmpwalk againt port 161.
Reinhard
le_mackeux
Posts: 4
Joined: Mon Sep 19, 2005 7:08 pm

Post by le_mackeux »

AFAIK, this is mutually exclusive.
That's what i didn't get into the doc that comes with it. I just passed thru it again and still not seeing the part that says ONE or the OTHER.

What ever, that's y forums are for.

Tks a lot.
voron
Posts: 3
Joined: Thu Apr 20, 2006 10:23 am

Post by voron »

2paulbeard206
I have the same problem

Code: Select all

+ Running data query [17].
+ Found type = '3' [snmp query].
+ Found data query XML file at '/var/www/cacti/htdocs/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 '/var/www/cacti/htdocs/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/cacti/htdocs/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/cacti/htdocs/resource/snmp_queries/webcache_squid_core.xml'
+ Found data query XML file at '/var/www/cacti/htdocs/resource/snmp_queries/webcache_squid_core.xml'
voron
Posts: 3
Joined: Thu Apr 20, 2006 10:23 am

Re: My fix for no .rrd files

Post by voron »

apiset wrote: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..
thanx - it work for me too
nayco
Posts: 7
Joined: Thu Apr 27, 2006 4:42 am

Post by nayco »

Oh God...
I get the same error than above :

RRDTool Command:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="proxy3 - Squid Objects in Cache" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label="file descriptors" \
AREA:#AAABA1:"Unused FDs\:"  \
GPRINT::LAST:"Current\:%8.0lf"  \
GPRINT::AVERAGE:"Average\:%8.0lf"  \
GPRINT::MIN:"Minimum\:%8.0lf"  \
GPRINT::MAX:"Maximum\:%8.0lf\n"  \
COMMENT:"                 Represents the amount of unused and available file descriptors\n"  \
COMMENT:"                                 SquidStats v0.1 - Rolf Poser\n" 

RRDTool Says:

Code: Select all

ERROR: can't parse '#AAABA1:Unused FDs\:'
What can I do ?
nayco
Posts: 7
Joined: Thu Apr 27, 2006 4:42 am

Post by nayco »

Ok, I've done it another way, and that better. But now, i've got a new error :

RRDTool Command:

Code: Select all

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-300 \
--title="proxy3 - Squid Traffic In / Out / Saved" \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=-100 \
--vertical-label="bits / s" \
--slope-mode \
DEF:a="/var/www/html/cacti/rra/proxy3_squid_serverinkb_9.rrd":squid_serverInKb:AVERAGE \
DEF:b="/var/www/html/cacti/rra/proxy3_squid_serverinkb_9.rrd":squid_httpOutKb:AVERAGE \
CDEF:cdefa=a,1024,*,8,* \
CDEF:cdefe=b,1024,*,8,* \
CDEF:cdefi=b,a,LT,0,a,b,-,IF,1024,*,8,* \
AREA:cdefa#00CF00:"Traffic In\:"  \
GPRINT:cdefa:LAST:"     Current\:%8.2lf%s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:cdefa:MAX:"Maximum\:%8.2lf%s\n"  \
LINE1:cdefe#4444FF:"Traffic Out\:"  \
GPRINT:cdefe:LAST:"    Current\:%8.2lf%s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:cdefe:MAX:"Maximum\:%8.2lf%s\n"  \
AREA:cdefi#FF0000:"Traffic Savings\:"  \
GPRINT:cdefi:LAST:"Current\:%8.2lf%s"  \
GPRINT:cdefi:AVERAGE:"Average\:%8.2lf%s"  \
GPRINT:cdefi:MIN:"Maximum\:%8.2lf%s\n"  \
COMMENT:"                   Represents the traffic incoming and outgoing in bits per second\n"  \
COMMENT:"               with the red area (negative) showing the bits/s savings through caching\n"  \
COMMENT:"                                 SquidStats v0.1 - Rolf Poser\n" 
RRDTool Says:

Code: Select all

ERROR: opening '/var/www/html/cacti/rra/proxy3_squid_serverinkb_9.rrd': No such file or directory
And the rra directory is empty :

Code: Select all

[root@... cacti]# ls -l rra
total 0
Stilll do not know what to do :-? ... What is responsible for creating the rrd's ?
nayco
Posts: 7
Joined: Thu Apr 27, 2006 4:42 am

Post by nayco »

Oh God, I used this data source debugging output to manually create the rrd file, and the command works !

Code: Select all

# /usr/bin/rrdtool create \
/var/www/html/cacti/rra/proxy3_squid_serverinkb_11.rrd \
--step 300  \
DS:squid_serverInKb:COUNTER:600:0:1000000000 \
DS:squid_httpOutKb:COUNTER:600:0:1000000000 \
RRA:AVERAGE:0.5:1:600 \
RRA:AVERAGE:0.5:6:700 \
RRA:AVERAGE:0.5:24:775 \
RRA:AVERAGE:0.5:288:797 \
RRA:MAX:0.5:1:600 \
RRA:MAX:0.5:6:700 \
RRA:MAX:0.5:24:775 \
RRA:MAX:0.5:288:797 \

# ls -l rra
total 96
-rw-r--r--  1 root root 94664 avr 27 17:22 proxy3_squid_serverinkb_11.rrd
I now get a graph, but it is empty, and poller.php does nothing, it seems :cry: :

Code: Select all

# php poller.php
Error in packet
Reason: (noSuchName) There is no such variable name in this MIB.
Failed object: .1.3.6.1.2.1.1.3.0

04/27/2006 05:23:08 PM - SYSTEM STATS: Time:1.0392 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:2 RRDsProcessed:0
What's happening ?
nayco
Posts: 7
Joined: Thu Apr 27, 2006 4:42 am

Post by nayco »

Oh, here is the logfile when doing this :

Code: Select all

 04/27/2006 05:30:20 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select realm_id from user_auth_realm where user_id=1"
04/27/2006 05:30:20 PM - CMDPHP: Poller[0] DEBUG: SQL Cell: "select username from user_auth where id=1"
04/27/2006 05:30:20 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select user_auth_realm.realm_id from user_auth_realm where user_auth_realm.user_id='1' and user_auth_realm.realm_id='15'"
04/27/2006 05:30:20 PM - CMDPHP: Poller[0] DEBUG: SQL Cell: "select id from user_auth where username='guest'"
04/27/2006 05:30:20 PM - CMDPHP: Poller[0] DEBUG: SQL Cell: "select cacti from version"
04/27/2006 05:30:17 PM - CMDPHP: Poller[0] DEBUG: SQL Cell: "select count(*) from poller_command"
04/27/2006 05:30:17 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "truncate table poller_output"
04/27/2006 05:30:17 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "replace into settings (name,value) values ('stats_poller','Time:1.0461 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:2 RRDsProcessed:0')"
04/27/2006 05:30:17 PM - SYSTEM STATS: Time:1.0461 Method:cmd.php Processes:1 Threads:N/A Hosts:2 HostsPerProcess:2 DataSources:2 RRDsProcessed:0
04/27/2006 05:30:17 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_output.output, poller_output.time, poller_output.local_data_id, poller_item.rrd_path, poller_item.rrd_name, poller_item.rrd_num from (poller_output,poller_item) where (poller_output.local_data_id=poller_item.local_data_id and poller_output.rrd_name=poller_item.rrd_name)"
04/27/2006 05:30:17 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select poller_id,end_time from poller_time where poller_id = 0"
04/27/2006 05:30:17 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "replace into settings (name,value) values ('date',NOW())"
04/27/2006 05:30:17 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "insert into poller_time (poller_id, start_time, end_time) values (0, NOW(), NOW())"
04/27/2006 05:30:17 PM - CMDPHP: Poller[0] Time: 0.2120 s, Theads: N/A, Hosts: 1
04/27/2006 05:30:17 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "update host set status = '1', status_event_count = '11', status_fail_date = '0000-00-00 00:00:00', status_rec_date = '0000-00-00 00:00:00', status_last_error = 'Host did not respond to SNMP', min_time = '9.99999', max_time = '0.00000', cur_time = '0.00000', avg_time = '0.00000', total_polls = '12', failed_polls = '12', availability = '0' where hostname = 'proxy3'"
04/27/2006 05:30:17 PM - CMDPHP: Poller[0] Host[2] SNMP: Host did not respond to SNMP
04/27/2006 05:30:16 PM - CMDPHP: Poller[0] DEBUG: SQL Cell: "SELECT count(*) from poller_item WHERE (action=2 AND (host_id >= 0 and host_id <= 2))"
04/27/2006 05:30:16 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "SELECT * from poller_item WHERE (host_id >= 0 and host_id <= 2) ORDER by host_id"
04/27/2006 05:30:16 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select * from host where (disabled = '' and id >= 0 and id <= 2) ORDER by id"
04/27/2006 05:30:16 PM - POLLER: Poller[0] DEBUG: About to Spawn a Remote Process [CMD: /usr/bin/php, ARGS: -q /var/www/html/cacti/cmd.php 0 2]
04/27/2006 05:30:16 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "truncate table poller_time"
04/27/2006 05:30:16 PM - CMDPHP: Poller[0] DEBUG: SQL Exec: "replace into settings (name,value) values ('path_webroot','/var/www/html/cacti')"
04/27/2006 05:30:16 PM - CMDPHP: Poller[0] DEBUG: SQL Assoc: "select id from host where disabled = '' order by id"
04/27/2006 05:30:16 PM - CMDPHP: Poller[0] DEBUG: SQL Cell: "select count(*) from poller_item"
nayco
Posts: 7
Joined: Thu Apr 27, 2006 4:42 am

Post by nayco »

Ok, it was, as read in older posts in that topic, a ping-related issue.
:cry:

I managed to have everything working fine by modifying "cmd.php", and adding, at line 190, this single line :

Code: Select all

          update_host_status(HOST_DOWN, $host_id, $hosts, $ping, $ping_availability, $print_data_to_stdout);
        }
      }

+// Force all hosts up !
+$host_down = false;

      if (!$host_down) {
        /* do the reindex check for this host */
        $reindex = db_fetch_assoc("select
Well, I'm off for a couple of days, so i'll see the result on thuesday... But this is a nasty hack. Is there a clean way to do this ? TIA
anuraganuj
Cacti User
Posts: 70
Joined: Tue Feb 21, 2006 9:50 am

Post by anuraganuj »

Can u check u r snmp version installed n u r server if u r using UCD-snmp
it may not support proxying
nayco
Posts: 7
Joined: Thu Apr 27, 2006 4:42 am

Post by nayco »

anuraganuj wrote:Can u check u r snmp version installed n u r server if u r using UCD-snmp
it may not support proxying
Well, I do not use any snmp server on this host. And I simply cannot install it at the moment on this machine...
But, well, no problem, I finally got graphs... So snmp is working, no ?

What I suspect is that Squidstats is too old, and in not anymore compatible with 0.8.6h...
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Post by gandalf »

nayco wrote:What I suspect is that Squidstats is too old, and in not anymore compatible with 0.8.6h...
Old, yes. But at least running on or production system using 0.8.6g running un-modified cactid. I'm using the snmp proxy function of the target host (not needed on cacti's host), as described above
Reinhard
OgeeN
Posts: 9
Joined: Thu Feb 10, 2005 4:16 am

problem with monitoring squid

Post by OgeeN »

Hello,
I have following problem.
Even if I have performed this 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..
No graphs for squid are created. There are also no items added to poller cache. And when I try to run cmd.php manually I receive this:

Code: Select all

...
Warning: socket_write() unable to write to socket [1]: Operation not permitted in /var/www/www.mydomain.cz/www/cacti/lib/ping.php on line 282
->refused
Warning: socket_write() unable to write to socket [1]: Operation not permitted in /var/www/www.mydomain.cz/www/cacti/lib/ping.php on line 282
->refused
Warning: socket_write() unable to write to socket [1]: Operation not permitted in /var/www/www.mydomain.cz/www/cacti/lib/ping.php on line 282
->refused
Warning: socket_write() unable to write to socket [1]: Operation not permitted in /var/www/www.mydomain.cz/www/cacti/lib/ping.php on line 282
->refused
Warning: socket_write() unable to write to socket [1]: Operation not permitted in /var/www/www.mydomain.cz/www/cacti/lib/ping.php on line 282
...
Where should I start with solving this problem ?
Thanks for help.
User avatar
koniczynek
Posts: 3
Joined: Sat Jul 29, 2006 8:45 am

Post by koniczynek »

Ok, I've managed to run this squid stats, but not everything is working. Median stats are working well (cache hit ratios and timers) but core statistics do not work at all. Do you have any suggestions, ideas or anything that could help me? What debug output do you want to see?
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest