[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
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

Adding that line to snmpd is what should enable proxying.

Try just doing an snmpwalk.

(sorry about the delay in replying. just got back from vacation.)
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 »

If I do an snmpwalk, I get:

Code: Select all

snmpwalk 127.0.0.1:3401 snmppublic .1.3.6.1.4.1.3495.1.1
snmppublic: Unknown Object Identifier (Sub-id not found: (top) -> snmppublic)
Though I think my squid is configured properly:

Code: Select all

acl snmppublic snmp_community public
snmp_port 3401
snmp_access allow snmppublic localhost
Squid is also listenung on port 3401 udp
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

Try changing the snmp_access from localhost to all, and see if that works. It's possible, though unlikely, that your routing is causing the request to appear to come from the network interface rather than the loopback interface.

Also, which version of squid are you running?
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 »

I changed it to "all", but no success. I'm running squid 2.5.7 and net-snmp 5.2
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

try:

Code: Select all

snmpwalk -v 1 -c snmppublic  localhost:3401 1.3.6.1.4.1.3495.1
Your syntax was wrong, and it was trying to hit the 'snmppublic' oid, which of course doesn't exist.

If that command works, then squid's snmp is working. And then you can try:

Code: Select all

snmpwalk -v 2c -c snmppublic localhost 1.3.6.1.4.1.3495.1
Which will hit snmpd, and hopefully proxy right.
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 »

Mh, strange, I get

Code: Select all

snmpwalk -v 1 -c snmppublic  localhost:3401 1.3.6.1.4.1.3495.1
Timeout: No Response from localhost:3401
although squid is running and listening on 3401
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

Well, at this point it's a squid problem, not a cacti problem...

I suggest maybe trying it on a different machine, or recompiling squid.

Alternatly try hitting a squid list, or google?
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 »

I had some stuff messed up in my squid-config, now the snmpwalk works (also if I use the proxy over snmpd). But cacti doesn't graph anything, the rrds aren't updated and the logfile doesn't show any errors (loglevel set to debug). I tried both setting the port to 161 (proxy) and 3401 (direct to squid) in the cacti-device; at 3401 I get an "snmp error", at 161 cacti seems to connect to the host, at least it displays host informations.
Any ideas?
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

set it to port 161, and make sure to refresh your data queries. (hit the little green circle next to them on the device page) You should see something like:

Code: Select all

3) WebCache - Squid Statistics - Core  	 (Verbose Query)  	 Uptime Goes Backwards  	 Success [1 Item, 1 Row]  	 Reload Data Query  Delete Data Query Association
4) WebCache - Squid Statistics - Median Based 	(Verbose Query) 	Uptime Goes Backwards 	Success [3 Items, 3 Rows] 	Reload Data Query  Delete Data Query Association
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 »

Thanks for your quick reply. I already tried it, but it gives me the following php-error:

Code: Select all

Warning: Variable passed to each() is not an array or object in /home/httpd/htdocs/cacti08/lib/data_query.php on line 490

Warning: Cannot modify header information - headers already sent by (output started at /home/httpd/htdocs/cacti08/lib/data_query.php:490) in /home/httpd/htdocs/cacti08/host.php on line 70
cacti 0.8.6c, php 4.3.10...
User avatar
gninja
Cacti User
Posts: 371
Joined: Tue Aug 24, 2004 5:02 pm
Location: San Francisco, CA
Contact:

Post by gninja »

Hrm. Check your data queries and make sure they can find the xml files?
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
abdock
Posts: 15
Joined: Fri Mar 18, 2005 4:38 am

Post by abdock »

I have the same problem. Cannot get squid stats.

Have installed snmpd on squid pc, but somehow am not able to query snmp to that machine.
joecen
Posts: 15
Joined: Wed Mar 02, 2005 10:40 am

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

Post by joecen »

Rolf Poser wrote:Folks:

I'm placing this first release in this forum because you either have to be brave enough to be using a cacti 0.8.5 pre-release installation or desperate enough to upgrade in order to get your squid system monitored. 8)

So this most definitely needs an upgrade to the latest pre-release version - I've tested SquidStats v0.1 with the 28Jan build.

The other reason I'm putting this out here, is that it would be great if someone could give it a spin and see whether there are any problems with it.

I will then re-release as v0.2 in the main add-ons forum once cacti 0.8.5 is out.

For further details please see the included readme.txt file.

Kind Regards,
Rolf.
I use it fine!
thank u!
David Rickard
Posts: 8
Joined: Fri Apr 15, 2005 2:21 am
Location: High Wycombe, Bucks, UK

Post by David Rickard »

I've got Cacti 0.8.6c running on Gentoo - everything was installed from portage.

I've added these templates, added the host, and bam, I get:

Code: Select all

Warning: Variable passed to each() is not an array or object in /data/www/localhost/htdocs/cacti/lib/data_query.php on line 490

Warning: Variable passed to each() is not an array or object in /data/www/localhost/htdocs/cacti/lib/data_query.php on line 490

Warning: Cannot modify header information - headers already sent by (output started at /data/www/localhost/htdocs/cacti/lib/data_query.php:490) in /data/www/localhost/htdocs/cacti/host.php on line 121
Now this looks like somewhere along the lines, when the snmp utils are talking to the server, they are getting mangled data. If I try and query the server as per the docs:

Code: Select all

root@server / # snmpwalk -c public -v1 server.bcuc.ac.uk:3401 .1.3.6.1.4.1.3495.1
SNMPv2-SMI::enterprises.3495.1.1.1.0 = INTEGER: 8176
SNMPv2-SMI::enterprises.3495.1.1.2.0 = INTEGER: 28934796

<SNIP>   ---------- 8<-----------

Error: OID not increasing: SNMPv2-SMI::enterprises.3495.1.5.2.1.1.x.x.x.x
 >= SNMPv2-SMI::enterprises.3495.1.5.2.1.1.x.x.x.x
I get quite a few lines of info, and the last line is the above error. I've added the x.x.x.x to protect our IPs :)

If I click Back after the error, it says save successful, and manually querying the data sources from the little green 'O' icons produces similar error.

Now, the server is configured correctly, is running the latest stable version of squid, and seems quite happy. I'm stumped! I'm querying Novell servers, printers and a few other bits with no problems, so I don't know why its doing this.

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

title changes for median based stats

Post by gandalf »

Rolf,

a great thanks to you for those stats.
The first time I used the median based one, I got some trouble interpreting 3 Hits graphs and three service stat graphs, because the title looks all the same (I generated the stats for all 3 medians, 1 min, 5 min and 60 mins). So my suggestions is to change the graph title in graph templates from

Code: Select all

|host_description| - Squid - Service Timers
to

Code: Select all

|host_description| - Squid - Service Timers (|query_medianTime| min)
which will do the trick.
This relates to both
  • WebCache - Squid - Cache Hit Rate and
    WebCache - Squid - Service Timers
SW: cacti 0.8.6c with cactid 0.8.6e

Cheers
Reinhard :wink:
Post Reply

Who is online

Users browsing this forum: No registered users and 3 guests