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

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

Moderators: Developers, Moderators

Post Reply
User avatar
kwabbernoot
Cacti User
Posts: 99
Joined: Mon Oct 13, 2003 4:11 am
Location: Zottegem, Belgium

0.8.5 upgrade Bug

Post by kwabbernoot »

b0fh,

You have the same problem that I had. This seems to be an 0.8.5 upgrade bug.

Please follow this link for the solution:
http://www.raxnet.net/board/viewtopic.p ... highlight=

Regards,
Kwabbernoot
b0fh
Posts: 32
Joined: Fri Jul 18, 2003 3:46 am

Post by b0fh »

Yesterday I had to restart squid because of an update. It might be that squid was down at the moment when cacti tried reading out values via snmp.
The whole thing gave a pretty ugly effect: At the restart-time, I have a very large value in graphs "Client request rate", "Squid CPU usage", "DNS Statistics", "Squid error rate" and "page faults" (all about 10M (Megs)...). Anything you could update about this?
b0fh
Posts: 32
Joined: Fri Jul 18, 2003 3:46 am

Post by b0fh »

I updated to rrdtool 1.0.47, now I get very "fat" lines in "client request rate" and "DNS statistics". (Seems to be LINE3 or so)... Whos issue is this?
bilbo
Posts: 7
Joined: Sat Oct 23, 2004 10:03 am

problems running squidstats with cacti 0.8.6b

Post by bilbo »

Well, I know that squidstats is made for 0.8.5, but I even tried to use it with the current release. XML Import was ok.
But then I genereated the first host using the template "WebCache - Squid Server (SNMP)", SNMP Version set to 2 (even tried with version 1) and got
  • Warning: Variable passed to each() is not an array or object in /usr/local/cacti-0.8.6b/lib/data_query.php on line 464

    Warning: Variable passed to each() is not an array or object in /usr/local/cacti-0.8.6b/lib/data_query.php on line 464

    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cacti-0.8.6b/lib/data_query.php:464) in /usr/local/cacti-0.8.6b/host.php on line 121
SNMP is working for the requested host. But the data query "WebCache - Squid Statistics - Core" does not show any item. Verbose query results in
  • Warning: Variable passed to each() is not an array or object in /usr/local/cacti-0.8.6b/lib/data_query.php on line 464

    Warning: Cannot modify header information - headers already sent by (output started at /usr/local/cacti-0.8.6b/lib/data_query.php:464) in /usr/local/cacti-0.8.6b/host.php on line 75
Thnx for any help
bilbo
Posts: 7
Joined: Sat Oct 23, 2004 10:03 am

Re: problems running squidstats with cacti 0.8.6b

Post by bilbo »

bilbo wrote:Well, I know that squidstats is made for 0.8.5, ...
Ok, I think I'm on the way now :oops:. Missed something from the README. Have to reconfigure my squid, will last a while. :-?
I'll post the results for cacti-0.8.6b with patches applied. :wink:
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

SquidStats and Cacti 0.8.6b

Post by gninja »

Has anyone gotten this to work with 0.8.6b?

I set my poll method to ping only, to try and get around the snmp errors, but I'm still getting host down, and no rrd files are getting created. The squid specific snmp queries ARE working, though.
FreeBSD/RHEL
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
User avatar
gandalf
Developer
Posts: 22383
Joined: Thu Dec 02, 2004 2:46 am
Location: Muenster, Germany
Contact:

Re: SquidStats and Cacti 0.8.6b

Post by gandalf »

gninja wrote:Has anyone gotten this to work with 0.8.6b?
Yes, it's now working for me.

But as long as you get ping problems (ICMP or SNMP), cacti o.8.6b won't even ask your squid to get the stats.
Try setting "Configuration Settings" -> "poller specific logging" -> "poller logging level" to debug and have a look at your cacti.log file. You will see, that ping test fails and nothing more happening, I suppose.

As far as I know there will be a change in 0.8.7 to suppress ping probing.
Perhaps, there is a firewall in between, blocking the ping probe?
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

Nope, both machines are on the same subnet with nothing more than a switch and a patch panel between them. I'll check the log output the next time I can drag myself away from World of Warcraft.
FreeBSD/RHEL
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

Ended up restraining myself and testing it.

Set log level to debug, and from what I can tell, it's not even attempting the ping. There're no messages at all for that host.
FreeBSD/RHEL
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

Still showing as down, despite successful pings. Maybe I can trick squid into supplying the information that cacti seems to want.
FreeBSD/RHEL
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
User avatar
Instigater
Cacti User
Posts: 141
Joined: Mon Dec 13, 2004 5:14 pm
Location: Jurmala, Latvia

Post by Instigater »

The same problem :-(
Importing XML went fine, uploading those 2 XML was OK.
Every graph creation process went without problems.
But graphs doesn't show, even rrd files are not created. Looked into pooler_item mysql table - nothing is shown about squid :-(
What do we miss here?

Update:
Log file states:

Code: Select all

 01/26/2005 04:10:43 AM - SYSTEM STATS: Time: 41.3046 s, Method: cmd.php, Processes: 1, Threads: N/A, Hosts: 8, Hosts/Process: 8
01/26/2005 04:10:43 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /home/cacti/rra/hp_skolas_55_traffic_in_109.rrd --template traffic_out:traffic_in 1106705402:2093071960:1245306230
01/26/2005 04:10:42 AM - CMDPHP: Poller[0] Time: 39.7868 s, Theads: N/A, Hosts: 7
01/26/2005 04:10:42 AM - PHPSVR: Poller[0] DEBUG: PHP Script Server Shutdown request received, exiting
01/26/2005 04:10:42 AM - CMDPHP: Poller[0] Host[13] SNMP: v1: 159.148.196.222, dsname: traffic_in, oid: .1.3.6.1.2.1.2.2.1.10.10, output: 1245306230
01/26/2005 04:10:42 AM - POLLER: Poller[0] CACTI2RRD: /usr/bin/rrdtool update /home/cacti/rra/hp_skolas_55_traffic_in_107.rrd --template traffic_in:traffic_out 1106705402:3609279745:2176950979
01/26/2005 04:10:42 AM - CMDPHP: Poller[0] Host[13] SNMP: v1: 159.148.196.222, dsname: traffic_out, oid: .1.3.6.1.2.1.2.2.1.16.10, output: 2093071960
Poller cache states 7 hosts and nothing about squid box but SNMP cache clearly states presece of squid.

Code: Select all

 Host: ---(squid), SNMP Query: WebCache - Squid Statistics - Core
Index: 0, Field Name: versionID, Field Value: 2.5.STABLE5
OID: .1.3.6.1.4.1.3495.1.2.3.0
Host: ---(squid), SNMP Query: WebCache - Squid Statistics - Median Based
Index: 1, Field Name: medianTime, Field Value: 1
OID: .1.3.6.1.4.1.3495.1.3.2.2.1.1.1
Host: ---(squid), SNMP Query: WebCache - Squid Statistics - Median Based
Index: 5, Field Name: medianTime, Field Value: 5
OID: .1.3.6.1.4.1.3495.1.3.2.2.1.1.5
Host: ---(squid), SNMP Query: WebCache - Squid Statistics - Median Based
Index: 60, Field Name: medianTime, Field Value: 60
OID: .1.3.6.1.4.1.3495.1.3.2.2.1.1.60
As we can see, cmd.php wants to make stats for 8 hosts but poller.php received only 7 of them.
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Snmpd proxy

Post by gninja »

Someone in another thread pointed out that snmpd has a proxy.

So, if you have snmpd running on the same box as you have squid (and you do, right?)... you can add:

proxy -v 1 -c public localhost:3401 .1.3.6.1.4.1.3495.1

(or whatever your community string is) to your snmpd.conf (anywhere in the file is fine)...

And then just add the squidstats queries to the host, instead of creating a seperate host entry.

And it works.
FreeBSD/RHEL
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
b0fh
Posts: 32
Joined: Fri Jul 18, 2003 3:46 am

Post by b0fh »

Ok, I read that this is "0.8.5 only", but did any of you manage to get it running under 0.8.6c? I keep getting an "SNMP error" in my squid-device list...
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

Yes.

Like I posted in the post before yours. Add:

Code: Select all

proxy -v 1 -c public localhost:3401 .1.3.6.1.4.1.3495.1 
to your snmpd.conf

Then, instead of creating a seperate squid device in cacti, just add the squid data queries to your likely already monitored host, and create the graphs from there.
FreeBSD/RHEL
cacti-0.8.7i, spine 0.8.7i, PIA 3.1+boost 5.1
MySQL 5.5/InnoDB
RRDtool 1.2.27, PHP 5.1.6
b0fh
Posts: 32
Joined: Fri Jul 18, 2003 3:46 am

Post by b0fh »

Hm, I did that, but I keep getting "SNMP error" and NaN in my Graphs... Do I need to enable proxing in snmp? Any other configuration needed?
Post Reply

Who is online

Users browsing this forum: No registered users and 0 guests