Graph templates for Squid

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

Moderators: Developers, Moderators

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

Re: Graph templates for Squid

Post by gandalf »

Edit the graph template of the broken graph. As a first step, remove the entry from "--y-grid" and retry
R.
Tinuva
Posts: 1
Joined: Fri Feb 03, 2012 4:49 am

Re: Graph templates for Squid

Post by Tinuva »

I've read through the whole thread and haven't found a solution to my problem.

This is the output on the graph:

Code: Select all

RRDTool Command:

/usr/bin/rrdtool graph - \
--imgformat=PNG \
--start=-86400 \
--end=-60 \
--title='wnls-cache1 - HTTP Data' \
--rigid \
--base=1000 \
--height=120 \
--width=500 \
--alt-autoscale-max \
--lower-limit=0 \
--vertical-label='bytes per second' \
--slope-mode \
--font TITLE:10: \
--font AXIS:8: \
--font LEGEND:8: \
--font UNIT:8: \
DEF:a="/var/www/cacti/rra/wnls-cache1_http_data_received_6348.rrd":http_data_received:AVERAGE \
DEF:b="/var/www/cacti/rra/wnls-cache1_http_data_sent_6352.rrd":http_data_sent:AVERAGE \
DEF:c="/var/www/cacti/rra/wnls-cache1_http_data_saved_6350.rrd":http_data_saved:AVERAGE \
CDEF:cdefa=a,1024,* \
CDEF:cdefe=b,1024,* \
CDEF:cdefi=b,d,+,8,*,TIME,1328262622,GT,a,a,UN,0,a,IF,IF,TIME,1328262622,GT,b,b,UN,0,b,IF,IF,TIME,1328262622,GT,c,c,UN,0,c,IF,IF,+,+,*,1024,* \
AREA:cdefa#00CF00FF:"Received"  \
GPRINT:cdefa:LAST:"Current\:%8.2lf %s"  \
GPRINT:cdefa:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefa:MAX:"Max\:%8.2lf %s\n"  \
LINE1:cdefe#002A97FF:"Sent"  \
GPRINT:cdefe:LAST:"    Current\:%8.2lf %s"  \
GPRINT:cdefe:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefe:MAX:"Max\:%8.2lf %s\n"  \
LINE1:cdefi#FF0000FF:"Saved"  \
GPRINT:cdefi:LAST:"   Current\:%8.2lf %s"  \
GPRINT:cdefi:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:cdefi:MAX:"Max\:%8.2lf %s\n"  \
LINE1:c#000000FF:"Saved %"  \
GPRINT:c:LAST:" Current\:%8.2lf %s"  \
GPRINT:c:AVERAGE:"Average\:%8.2lf %s"  \
GPRINT:c:MAX:"Max\:%8.2lf %s" 

RRDTool Says:
ERROR: invalid rpn expression in: b,d,+,8,*,TIME,1328262622,GT,a,a,UN,0,a,IF,IF,TIME,1328262622,GT,b,b,UN,0,b,IF,IF,TIME,1328262622,GT,c,c,UN,0,c,IF,IF,+,+,*,1024,*
Now what I have noticed is, I only have:

Code: Select all

DEF:a="/var/www/cacti/rra/wnls-cache1_http_data_received_6348.rrd":http_data_received:AVERAGE \
DEF:b="/var/www/cacti/rra/wnls-cache1_http_data_sent_6352.rrd":http_data_sent:AVERAGE \
DEF:c="/var/www/cacti/rra/wnls-cache1_http_data_saved_6350.rrd":http_data_saved:AVERAGE \
where others have:

Code: Select all

DEF:a="/var/cacti-0.8.7a/rra/stg-srv-squid01_http_data_received_477.rrd":http_data_received:AVERAGE \ 
DEF:b="/var/cacti-0.8.7a/rra/stg-srv-squid01_http_data_received_477.rrd":http_data_received:MAX \ 
DEF:c="/var/cacti-0.8.7a/rra/stg-srv-squid01_http_data_sent_479.rrd":http_data_sent:AVERAGE \ 
DEF:d="/var/cacti-0.8.7a/rra/stg-srv-squid01_http_data_sent_479.rrd":http_data_sent:MAX \ 
DEF:e="/var/cacti-0.8.7a/rra/stg-srv-squid01_http_data_saved_478.rrd":http_data_saved:AVERAGE \ 
DEF:f="/var/cacti-0.8.7a/rra/stg-srv-squid01_http_data_saved_478.rrd":http_data_saved:MAX \ 
Why would my cacti install not pick up the "MAX" definitions and only the "AVERAGE" definitions unlike those who have the HTTP Data graph working?

My y-grid entry on the graph template is empty.

Thank you in advance.
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Graph templates for Squid

Post by noname »

"ERROR: invalid rpn expression" occurs because of associating wrong CDEF.
Devroush wrote: 2) The graphs that bshoebottom made looked really nice in my opinion. His templates can be found at page 3 (3rd post are the templates, a little further down are some screenshots)
The graphs all work except for HTTP Data. Debugging gives the following error:

Code: Select all

ERROR: invalid rpn expression in: cdefb,0,EQ,0,cdefa,1024,*,cdefb,/,IF,0,1000000,LIMIT,TIME,1295231273,GT,a,a,UN,0,a,IF,IF,TIME,1295231273,GT,b,b,UN,0,b,IF,IF,TIME,1295231273,GT,c,c,UN,0,c,IF,IF,+,+,*,1024,*
It seems a lot of people in this thread got such an error but I haven't found a solution for it.
...
edit: Found out what the problem was with the HTTP Data graph! I have an Apache template that has a CDEF function "Apache - Calculate Bytes/Request". A CDEF used by the HTTP Data graph is "squid bandwidth". For some reason, it references the Apache CDEF. You have to edit this CDEF: change the reference "Apache - Calculate Bytes/request" to "Divide by -10".
"squid bandwidth" CDEF is shown like this:
Image
Referenced CDEF varies on each server. Please make sure in your case.
But I don't know what it should be for calculating "squid bandwidth"..

churchi wrote: Basically i think the CDEF string got toasted when i imported the xml file and any other re-imports of the file seem to not fix the problem. i have since just chosen the "Normal" CDEF and its graphing, however its not the correct values for the saved cache.
If another CDEF is used in the CDEF definition, Cacti seems to store its reference by the CDEF id. (In this case, CDEF #18 is selected)
So it's highly possible that the incorrect CDEF will be referenced at others' Cacti server.
It's recommended not to use "Another CDEF" when exporting templates.

EDIT: Oops, it was already filed and fixed in latest 0.8.7i.. :)
CHANGELOG:
-bug#0002094: CDEF: "another cdef" references not included in template export
noname
Cacti Guru User
Posts: 1566
Joined: Thu Aug 05, 2010 2:04 am
Location: Japan

Re: Graph templates for Squid

Post by noname »

P.S.
Tinuva wrote:Why would my cacti install not pick up the "MAX" definitions and only the "AVERAGE" definitions unlike those who have the HTTP Data graph working?
It might be related to this:
- http://forums.cacti.net/viewtopic.php?p=226140#p226140
(And that's not a big problem except CDEF definition)
fendy97
Posts: 6
Joined: Fri Mar 16, 2012 5:22 am

Re: Graph templates for Squid

Post by fendy97 »

host template for lusca head and squid 2-head to share
Attachments
cacti_host_template_blusca.xml
compatible with squid head 2 or lusca-head
(139.1 KiB) Downloaded 605 times
Chilloutfaktor
Posts: 16
Joined: Mon Nov 01, 2010 5:58 am

Re: Graph templates for Squid

Post by Chilloutfaktor »

I'm having issues that ma graphes are white and no data could be fetched. (Squid Version: 3.1.14)
in squid cache.log it looks like this:

Code: Select all

2012/03/19 13:49:55| snmp_core.cc(489) snmpDecodePacket: Failed SNMP agent query from : 10.1.40.1236:36364
2012/03/19 13:54:49| snmp_core.cc(489) snmpDecodePacket: Failed SNMP agent query from : 10.1.40.123:56083
2012/03/19 13:54:49| snmp_core.cc(489) snmpDecodePacket: Failed SNMP agent query from : 10.1.40.123:49403
.....
If i'm doing a snmpwalk (root@SERVER:~# snmpwalk -m /usr/share/mibs/squid-mib.txt -v2c -c public 10.0.83.13:3401 1.3.6.1.4.1.3495) it stops at:
SQUID-MIB::cacheClientAddressType.10.0.102.176 = INTEGER: ipv4(1)
SQUID-MIB::cacheClientAddressType.10.0.102.190 = INTEGER: ipv4(1)
SQUID-MIB::cacheClientAddressType.10.0.101.54 = INTEGER: ipv4(1)
Error: OID not increasing: SQUID-MIB::cacheClientAddressType.10.0.102.190
>= SQUID-MIB::cacheClientAddressType.10.0.101.54

Is that a bug, because it should not increase - this is a normal ip adress listed.....?

maybe that is the problem? or sth. different.i think its related to squid version cause in 3.1.6 it was working.

using 1) WebCache - Squid Statistics - Core | WebCache Squid Server (SNMP) Template from this thread
User avatar
knebb
Cacti User
Posts: 138
Joined: Tue Sep 19, 2006 11:29 am

Re: Graph templates for Squid

Post by knebb »

Sorry guys to revive such an old topic... :oops:

I am looking for a nice solution to monitor my Squid instances.

I downloaded the three xml files here and imported them into Cacti. I can easily monitor now these three items:
  • Squid Cache Objects
  • HTTP Data
  • HTTP Requests
So far so good. But I have seen several screenshots where some other guys are monitoring much more Squid metrics. Before I start to re-invent the wheel... is there some place where such templates for more Squid data can be found?

I found another site from where I imported a Squid Host template, but this one only shows Data Query [WebCache - Squid Statistics - Core] and Data Query [WebCache - Squid Statistics - Median Based] - both appear as "Error in Data query".

Anyone having an idea how to monitor Squid in detail?

Thank& Greetings!

/KNEBB
Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest