--------------------- PatchSet 10599 Date: 2008/06/10 04:55:52 Author: adri Branch: delay_snmp Tag: (none) Log: Create cacheDelayPools under cacheNetwork; add a simple OID for cacheDelayPoolCount. Members: include/cache_snmp.h:1.6->1.6.28.1 src/delay_pools.c:1.21.2.1->1.21.2.2 src/mib.txt:1.10->1.10.4.1 src/protos.h:1.166->1.166.2.1 src/snmp_core.c:1.19->1.19.2.1 Index: squid/include/cache_snmp.h =================================================================== RCS file: /cvsroot/squid-sf//squid/include/cache_snmp.h,v retrieving revision 1.6 retrieving revision 1.6.28.1 diff -u -r1.6 -r1.6.28.1 --- squid/include/cache_snmp.h 22 Sep 2006 02:53:14 -0000 1.6 +++ squid/include/cache_snmp.h 10 Jun 2008 04:55:52 -0000 1.6.28.1 @@ -1,5 +1,5 @@ /* - * $Id: cache_snmp.h,v 1.6 2006/09/22 02:53:14 squidadm Exp $ + * $Id: cache_snmp.h,v 1.6.28.1 2008/06/10 04:55:52 adri Exp $ */ #ifndef SQUID_CACHE_SNMP_H @@ -152,6 +152,7 @@ NET_IP_CACHE, NET_FQDN_CACHE, NET_DNS_CACHE, + NET_DELAY_CACHE, NET_END }; Index: squid/src/delay_pools.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/delay_pools.c,v retrieving revision 1.21.2.1 retrieving revision 1.21.2.2 diff -u -r1.21.2.1 -r1.21.2.2 --- squid/src/delay_pools.c 10 Jun 2008 04:50:53 -0000 1.21.2.1 +++ squid/src/delay_pools.c 10 Jun 2008 04:55:52 -0000 1.21.2.2 @@ -1,6 +1,6 @@ /* - * $Id: delay_pools.c,v 1.21.2.1 2008/06/10 04:50:53 adri Exp $ + * $Id: delay_pools.c,v 1.21.2.2 2008/06/10 04:55:52 adri Exp $ * * DEBUG: section 77 Delay Pools * AUTHOR: David Luyer @@ -984,4 +984,27 @@ } } +#if SQUID_SNMP +/* + * The function to return the Delay pool info via SNMP + */ +variable_list * +snmp_DelayInfo(variable_list * Var, snint * ErrP) +{ + variable_list *Answer = NULL; + debug(49, 5) ("snmp_delayInfo: Processing request: \n"); + snmpDebugOid(5, Var->name, Var->name_length); + *ErrP = SNMP_ERR_NOERROR; + switch (Var->name[LEN_SQ_NET + 2]) { + case 1: /* cacheDelayPoolCount */ + Answer = snmp_var_new_integer(Var->name, Var->name_length, + Config.Delay.pools, SMI_COUNTER32); + break; + default: + *ErrP = SNMP_ERR_NOSUCHNAME; + } + return Answer; +} +#endif + #endif Index: squid/src/mib.txt =================================================================== RCS file: /cvsroot/squid-sf//squid/src/mib.txt,v retrieving revision 1.10 retrieving revision 1.10.4.1 diff -u -r1.10 -r1.10.4.1 --- squid/src/mib.txt 25 Nov 2007 23:51:58 -0000 1.10 +++ squid/src/mib.txt 10 Jun 2008 04:55:52 -0000 1.10.4.1 @@ -2,7 +2,7 @@ SQUID-MIB DEFINITIONS ::= BEGIN -- --- $Id: mib.txt,v 1.10 2007/11/25 23:51:58 squidadm Exp $ +-- $Id: mib.txt,v 1.10.4.1 2008/06/10 04:55:52 adri Exp $ -- IMPORTS @@ -540,6 +540,7 @@ cacheIpCache OBJECT IDENTIFIER ::= { cacheNetwork 1 } cacheFqdnCache OBJECT IDENTIFIER ::= { cacheNetwork 2 } cacheDns OBJECT IDENTIFIER ::= { cacheNetwork 3 } + cacheDelayPools OBJECT IDENTIFIER ::= { cacheNetwork 4 } -- -- cacheIpCache @@ -696,6 +697,22 @@ DESCRIPTION " Number of external dnsserver processes " ::= { cacheDns 3 } + +-- +-- cacheDelayPools +-- + + cacheDelayPoolInfo OBJECT IDENTIFIER ::= { cacheDelayPools 1 } + cacheDelayPoolPool OBJECT IDENTIFIER ::= { cacheDelayPools 2 } + + cacheDelayPoolCount OBJECT-TYPE + SYNTAX Counter32 + MAX-ACCESS read-only + STATUS current + DESCRIPTION + " Number of Delay Pool classes configured " + ::= { cacheDelayPoolInfo 1 } + -- -- cacheMesh group Index: squid/src/protos.h =================================================================== RCS file: /cvsroot/squid-sf//squid/src/protos.h,v retrieving revision 1.166 retrieving revision 1.166.2.1 diff -u -r1.166 -r1.166.2.1 --- squid/src/protos.h 31 May 2008 17:53:19 -0000 1.166 +++ squid/src/protos.h 10 Jun 2008 04:55:52 -0000 1.166.2.1 @@ -1,6 +1,6 @@ /* - * $Id: protos.h,v 1.166 2008/05/31 17:53:19 squidadm Exp $ + * $Id: protos.h,v 1.166.2.1 2008/06/10 04:55:52 adri Exp $ * * * SQUID Web Proxy Cache http://www.squid-cache.org/ @@ -582,6 +582,8 @@ #endif extern variable_list *snmp_meshPtblFn(variable_list *, snint *); extern variable_list *snmp_meshCtblFn(variable_list *, snint *); +extern variable_list * snmp_DelayInfo(variable_list * Var, snint * ErrP); + #endif /* SQUID_SNMP */ #if USE_WCCP Index: squid/src/snmp_core.c =================================================================== RCS file: /cvsroot/squid-sf//squid/src/snmp_core.c,v retrieving revision 1.19 retrieving revision 1.19.2.1 diff -u -r1.19 -r1.19.2.1 --- squid/src/snmp_core.c 25 Apr 2008 20:55:52 -0000 1.19 +++ squid/src/snmp_core.c 10 Jun 2008 04:55:52 -0000 1.19.2.1 @@ -1,6 +1,6 @@ /* - * $Id: snmp_core.c,v 1.19 2008/04/25 20:55:52 squidadm Exp $ + * $Id: snmp_core.c,v 1.19.2.1 2008/06/10 04:55:52 adri Exp $ * * DEBUG: section 49 SNMP support * AUTHOR: Glenn Chisholm @@ -234,7 +234,7 @@ snmpAddNode(snmpCreateOid(LEN_SQ_PRF + 4, SQ_PRF, PERF_PROTO, 2, 1, 11), LEN_SQ_PRF + 4, snmp_prfProtoFn, time_Inst, 0))))), snmpAddNode(snmpCreateOid(LEN_SQ_NET, SQ_NET), - LEN_SQ_NET, NULL, NULL, 3, + LEN_SQ_NET, NULL, NULL, 4, snmpAddNode(snmpCreateOid(LEN_SQ_NET + 1, SQ_NET, NET_IP_CACHE), LEN_SQ_NET + 1, NULL, NULL, 8, snmpAddNode(snmpCreateOid(LEN_SQ_NET + 2, SQ_NET, NET_IP_CACHE, IP_ENT), @@ -277,15 +277,27 @@ snmpAddNode(snmpCreateOid(LEN_SQ_NET + 2, SQ_NET, NET_DNS_CACHE, DNS_REP), LEN_SQ_NET + 2, snmp_netDnsFn, static_Inst, 0), snmpAddNode(snmpCreateOid(LEN_SQ_NET + 2, SQ_NET, NET_DNS_CACHE, DNS_SERVERS), - LEN_SQ_NET + 2, snmp_netDnsFn, static_Inst, 0))), + LEN_SQ_NET + 2, snmp_netDnsFn, static_Inst, 0)), #else snmpAddNode(snmpCreateOid(LEN_SQ_NET + 2, SQ_NET, NET_DNS_CACHE, DNS_REQ), LEN_SQ_NET + 2, snmp_netIdnsFn, static_Inst, 0), snmpAddNode(snmpCreateOid(LEN_SQ_NET + 2, SQ_NET, NET_DNS_CACHE, DNS_REP), LEN_SQ_NET + 2, snmp_netIdnsFn, static_Inst, 0), snmpAddNode(snmpCreateOid(LEN_SQ_NET + 2, SQ_NET, NET_DNS_CACHE, DNS_SERVERS), - LEN_SQ_NET + 2, snmp_netIdnsFn, static_Inst, 0))), + LEN_SQ_NET + 2, snmp_netIdnsFn, static_Inst, 0)), + #endif + snmpAddNode(snmpCreateOid(LEN_SQ_NET + 1, SQ_NET, NET_DELAY_CACHE), + LEN_SQ_NET + 1, NULL, NULL, 1, + + snmpAddNode(snmpCreateOid(LEN_SQ_NET + 2, SQ_NET, NET_DELAY_CACHE, 1), + LEN_SQ_NET + 2, NULL, NULL, 1, + + snmpAddNode(snmpCreateOid(LEN_SQ_NET + 3, SQ_NET, NET_DELAY_CACHE, 1, 1), + LEN_SQ_NET + 3, snmp_DelayInfo, static_Inst, 0))) + + ), + snmpAddNode(snmpCreateOid(LEN_SQ_MESH, SQ_MESH), LEN_SQ_MESH, NULL, NULL, 2, snmpAddNode(snmpCreateOid(LEN_SQ_MESH + 1, SQ_MESH, 1),