Cacti (home)ForumsRepositoryDocumentation
Cacti: offical forums and support  

 FAQFAQ   SearchSearch   MemberlistMemberlist    RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in    


[XML] SquidStats version 0.1 (cacti 0.8.5 only!!!)
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
 
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates
Author Message
le_mackeux



Joined: 19 Sep 2005
Posts: 4

PostPosted: Sun Mar 26, 2006 10:09 am    Post subject: Reply with quote

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

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


Code:
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:

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
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12148
Location: Muenster, Germany

PostPosted: Sun Mar 26, 2006 10:43 am    Post subject: Reply with quote

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

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


Code:
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
Back to top
le_mackeux



Joined: 19 Sep 2005
Posts: 4

PostPosted: Sun Mar 26, 2006 11:10 am    Post subject: Reply with quote

Quote:
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.
Back to top
voron



Joined: 20 Apr 2006
Posts: 3

PostPosted: Thu Apr 20, 2006 3:45 pm    Post subject: Reply with quote

2paulbeard206
I have the same problem
Code:
+ 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'
Back to top
voron



Joined: 20 Apr 2006
Posts: 3

PostPosted: Fri Apr 21, 2006 2:03 pm    Post subject: Re: My fix for no .rrd files Reply with quote

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
Back to top
nayco



Joined: 27 Apr 2006
Posts: 7

PostPosted: Thu Apr 27, 2006 4:50 am    Post subject: Reply with quote

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

RRDTool Command:
Code:
/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:
ERROR: can't parse '#AAABA1:Unused FDs\:'


What can I do ?
Back to top
nayco



Joined: 27 Apr 2006
Posts: 7

PostPosted: Thu Apr 27, 2006 8:32 am    Post subject: Reply with quote

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

RRDTool Command:
Code:
/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:
ERROR: opening '/var/www/html/cacti/rra/proxy3_squid_serverinkb_9.rrd': No such file or directory


And the rra directory is empty :
Code:
[root@... cacti]# ls -l rra
total 0


Stilll do not know what to do ... What is responsible for creating the rrd's ?
Back to top
nayco



Joined: 27 Apr 2006
Posts: 7

PostPosted: Thu Apr 27, 2006 10:26 am    Post subject: Reply with quote

Oh God, I used this data source debugging output to manually create the rrd file, and the command works !
Code:
# /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 :

Code:
# 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 ?
Back to top
nayco



Joined: 27 Apr 2006
Posts: 7

PostPosted: Thu Apr 27, 2006 10:33 am    Post subject: Reply with quote

Oh, here is the logfile when doing this :
Code:
 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"
Back to top
nayco



Joined: 27 Apr 2006
Posts: 7

PostPosted: Thu Apr 27, 2006 11:34 am    Post subject: Reply with quote

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


I managed to have everything working fine by modifying "cmd.php", and adding, at line 190, this single line :
Code:
          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
Back to top
anuraganuj
Cacti User


Joined: 21 Feb 2006
Posts: 70

PostPosted: Fri Apr 28, 2006 1:41 am    Post subject: Reply with quote

Can u check u r snmp version installed n u r server if u r using UCD-snmp
it may not support proxying
Back to top
nayco



Joined: 27 Apr 2006
Posts: 7

PostPosted: Fri Apr 28, 2006 4:51 am    Post subject: Reply with quote

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...
Back to top
gandalf
Developer


Joined: 02 Dec 2004
Posts: 12148
Location: Muenster, Germany

PostPosted: Sat Apr 29, 2006 6:53 am    Post subject: Reply with quote

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
Back to top
OgeeN



Joined: 10 Feb 2005
Posts: 3

PostPosted: Tue May 02, 2006 8:15 am    Post subject: problem with monitoring squid Reply with quote

Hello,
I have following problem.
Even if I have performed this steps :

Quote:

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:
...
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.
Back to top
koniczynek



Joined: 29 Jul 2006
Posts: 3

PostPosted: Sat Jul 29, 2006 8:49 am    Post subject: Reply with quote

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?
Back to top
Display posts from previous:   
Post new topic   Reply to topic    Cacti Forum Index -> Scripts and Templates All times are GMT - 5 Hours
Goto page Previous  1, 2, 3, 4, 5, 6, 7, 8, 9  Next
Page 7 of 9

 



Powered by phpBB © 2001, 2005 phpBB Group