On 23/12/2010, at 12:03 AM, Amos Jeffries wrote:
> On 22/12/10 18:39, Tom Tux wrote:
>> Hi
>>
>> Is there a squid-snmp-oid or a squidclient-option to get the
>> following
>> values (since startup of squid or since creation of cache_dirs)?
>>
>> - tcp_miss
>> - tcp_hit
>> - tcp_mem_hit
>>
>> If not, how can I determine these values?
>> Thanks a lot.
>> Tom
>
> http://wiki.squid-cache.org/Features/Snmp#Squid_OIDs
>
> Under "Per-Protocol Statistics" OIDs:
>
> MISS = cacheProtoClientHttpRequests - cacheHttpHits
> HIT = cacheHttpHits
>
> The individual cache storage locations are not accounted separately.
> So MEM_HIT are not available.
>
> The same details can be found under squidclient mgr:utilization with
> various time-brackets of accumulation.
>
> Amos
> --
> Please be using
> Current Stable Squid 2.7.STABLE9 or 3.1.9
> Beta testers wanted for 3.2.0.3
I recently created the patch below to allow HTTP HIT KB's to be
retrieved via SNMP. This is for 3.0STABLE19 and not sure if it's
transferable to other version. I'm not an experienced coder so if
anyone has any feedback on this (e.g if there are any problems with
the patch) I'd like to hear:
diff -u -r squid-3.0.STABLE19/include/cache_snmp.h squid-3.0.STABLE19-
snmp_http_kit_kb/include/cache_snmp.h
--- squid-3.0.STABLE19/include/cache_snmp.h 2009-09-06
20:59:34.000000000 +0930
+++ squid-3.0.STABLE19-snmp_http_kit_kb/include/cache_snmp.h
2010-12-21 17:23:27.000000000 +1030
@@ -239,6 +239,7 @@
PERF_PROTOSTAT_AGGR_KBYTES_OUT,
PERF_PROTOSTAT_AGGR_CURSWAP,
PERF_PROTOSTAT_AGGR_CLIENTS,
+ PERF_PROTOSTAT_AGGR_HTTP_HIT_KBYTES_OUT,
PERF_PROTOSTAT_AGGR_END
};
diff -u -r squid-3.0.STABLE19/src/mib.txt squid-3.0.STABLE19-
snmp_http_kit_kb/src/mib.txt
--- squid-3.0.STABLE19/src/mib.txt 2009-09-06 20:59:38.000000000 +0930
+++ squid-3.0.STABLE19-snmp_http_kit_kb/src/mib.txt 2010-12-21
19:54:57.000000000 +1030
@@ -405,6 +405,13 @@
" Number of clients accessing cache "
::= { cacheProtoAggregateStats 15 }
+ cacheHttpHitKb OBJECT-TYPE
+ SYNTAX Counter32
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ " HTTP KB's served from cache "
+ ::= { cacheProtoAggregateStats 16 }
--
-- cacheProtoMedianSvcStats group
--
diff -u -r squid-3.0.STABLE19/src/snmp_agent.cc squid-3.0.STABLE19-
snmp_http_kit_kb/src/snmp_agent.cc
--- squid-3.0.STABLE19/src/snmp_agent.cc 2009-09-06 20:59:38.000000000
+0930
+++ squid-3.0.STABLE19-snmp_http_kit_kb/src/snmp_agent.cc 2010-12-21
17:24:44.000000000 +1030
@@ -504,6 +504,12 @@
SMI_GAUGE32);
break;
+ case PERF_PROTOSTAT_AGGR_HTTP_HIT_KBYTES_OUT:
+ Answer = snmp_var_new_integer(Var->name, Var->name_length,
+ (snint)
statCounter.client_http.hit_kbytes_out.kb,
+ SMI_COUNTER32);
+ break;
+
default:
*ErrP = SNMP_ERR_NOSUCHNAME;
break;
diff -u -r squid-3.0.STABLE19/src/snmp_core.cc squid-3.0.STABLE19-
snmp_http_kit_kb/src/snmp_core.cc
--- squid-3.0.STABLE19/src/snmp_core.cc 2009-09-06 20:59:38.000000000
+0930
+++ squid-3.0.STABLE19-snmp_http_kit_kb/src/snmp_core.cc 2010-12-21
16:32:52.000000000 +1030
@@ -179,7 +179,7 @@
snmpAddNode
(snmpCreateOid(LEN_SQ_PRF + 1, SQ_PRF, PERF_PROTO),
LEN_SQ_PRF
+ 1, NULL, NULL, 2,
snmpAddNode
(snmpCreateOid(LEN_SQ_PRF + 2, SQ_PRF, PERF_PROTO, 1),
- LEN_SQ_PRF
+ 2, NULL, NULL, 15,
+
LEN_SQ_PRF
+ 2, NULL, NULL, 16,
snmpAddNode
(snmpCreateOid(LEN_SQ_PRF + 3, SQ_PRF, PERF_PROTO, 1, 1),
LEN_SQ_PRF
+ 3, snmp_prfProtoFn, static_Inst, 0),
snmpAddNode
(snmpCreateOid(LEN_SQ_PRF + 3, SQ_PRF, PERF_PROTO, 1, 2),
@@ -208,7 +208,9 @@
LEN_SQ_PRF
+ 3, snmp_prfProtoFn, static_Inst, 0),
snmpAddNode
(snmpCreateOid(LEN_SQ_PRF + 3, SQ_PRF, PERF_PROTO, 1, 14),
LEN_SQ_PRF
+ 3, snmp_prfProtoFn, static_Inst, 0),
- snmpAddNode
(snmpCreateOid(LEN_SQ_PRF + 3, SQ_PRF, PERF_PROTO, 1, 15),
+
snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 3, SQ_PRF, PERF_PROTO, 1, 15),
+ LEN_SQ_PRF + 3, snmp_prfProtoFn,
static_Inst, 0),
+
snmpAddNode
(snmpCreateOid(LEN_SQ_PRF + 3, SQ_PRF, PERF_PROTO, 1, 16),
LEN_SQ_PRF
+ 3, snmp_prfProtoFn, static_Inst, 0)),
snmpAddNode
(snmpCreateOid(LEN_SQ_PRF + 2, SQ_PRF, PERF_PROTO, 2),
LEN_SQ_PRF
+ 2, NULL, NULL, 1,
Received on Thu Dec 23 2010 - 07:21:47 MST
This archive was generated by hypermail 2.2.0 : Thu Dec 23 2010 - 12:00:04 MST