]>
Commit | Line | Data |
---|---|---|
0e2cd867 | 1 | /* |
cc192b50 | 2 | * $Id: cache_snmp.h,v 1.30 2007/12/14 23:11:44 amosjeffries Exp $ |
0e2cd867 | 3 | */ |
4 | ||
f13f02e9 | 5 | #ifndef SQUID_CACHE_SNMP_H |
6 | #define SQUID_CACHE_SNMP_H | |
b5638623 | 7 | |
d82d8654 | 8 | #ifdef SQUID_SNMP |
d82d8654 | 9 | |
5511b7c7 | 10 | #if SIZEOF_LONG == 8 |
c6da280c | 11 | #define snint int |
12 | #else | |
13 | #define snint long | |
14 | #endif | |
15 | ||
43d4303e | 16 | #ifndef MIN |
17 | #define MIN(a,b) (a<b?a:b) | |
18 | #endif | |
19 | ||
d60c11be | 20 | #include "snmp.h" |
21 | #include "snmp_impl.h" | |
22 | #include "asn1.h" | |
23 | #include "snmp_api.h" | |
d82d8654 | 24 | |
a6db53c5 | 25 | #include "snmp_vars.h" |
9089cc70 | 26 | |
d82d8654 | 27 | /* MIB definitions |
85ee654a | 28 | * SQUID-MIB |
eba4a24f | 29 | * .iso.org.dod.internet.private.enterprises.nlanr.squid |
30 | * 1 3 6 1 4 1 3495 1 | |
d82d8654 | 31 | * |
85ee654a | 32 | * PROXY-MIB |
eba4a24f | 33 | * .iso.org.dod.internet.experimental.nsfnet.proxy |
34 | * 1 3 6 1 3 25 17 | |
d82d8654 | 35 | */ |
36 | ||
85ee654a | 37 | #define SQUIDMIB 1, 3, 6, 1, 4, 1, 3495, 1 |
38 | #define LEN_SQUIDMIB 8 | |
b6a2f15e | 39 | #define INSTANCE 0 |
40 | #define TIME_INDEX 1, 5, 60 | |
41 | #define TIME_INDEX_LEN 3 | |
ad82c599 | 42 | |
d82d8654 | 43 | /* basic groups under .squid */ |
44 | ||
cc192b50 | 45 | #define SQ_SYS SQUIDMIB, 1 /* cacheSystem group { squid 1 } */ |
d60c11be | 46 | #define LEN_SQ_SYS LEN_SQUIDMIB+1 |
cc192b50 | 47 | #define SQ_CONF SQUIDMIB, 2 /* cacheConfig group { squid 2 } */ |
d60c11be | 48 | #define LEN_SQ_CONF LEN_SQUIDMIB+1 |
cc192b50 | 49 | #define SQ_PRF SQUIDMIB, 3 /* cachePerformance group { squid 3 } */ |
d60c11be | 50 | #define LEN_SQ_PRF LEN_SQUIDMIB+1 |
cc192b50 | 51 | #define SQ_NET SQUIDMIB, 4 /* cacheNetwork group { squid 4 } */ |
d60c11be | 52 | #define LEN_SQ_NET LEN_SQUIDMIB+1 |
cc192b50 | 53 | #define SQ_MESH SQUIDMIB, 5 /* cacheMesh group { squid 5 } */ |
81d0c856 | 54 | #define LEN_SQ_MESH LEN_SQUIDMIB+1 |
d82d8654 | 55 | |
85ee654a | 56 | /* |
cc192b50 | 57 | * cacheSystem group { squid 1 } |
eba4a24f | 58 | */ |
d82d8654 | 59 | |
60 | enum { | |
d60c11be | 61 | SYS_START, |
cc192b50 | 62 | SYSVMSIZ, /* cacheSysVMsize */ |
63 | SYSSTOR, /* cacheSysStorage */ | |
64 | SYS_UPTIME,/* cacheUptime */ | |
d60c11be | 65 | SYS_END |
d82d8654 | 66 | }; |
1b058963 | 67 | |
b6a2f15e | 68 | #define LEN_SYS LEN_SQ_SYS + 1 |
69 | #define LEN_SYS_INST LEN_SQ_SYS + 2 | |
70 | ||
85ee654a | 71 | /* |
cc192b50 | 72 | * cacheConfig group { squid 2 } |
eba4a24f | 73 | */ |
d82d8654 | 74 | |
75 | enum { | |
d60c11be | 76 | CONF_START, |
cc192b50 | 77 | CONF_ADMIN, /* cacheAdmin */ |
78 | CONF_VERSION, /* cacheSoftware */ | |
79 | CONF_VERSION_ID, /* cacheVersionId */ | |
80 | CONF_LOG_FAC, /* cacheLoggingFacility */ | |
81 | CONF_STORAGE, /* cacheStorageConfig group */ | |
82 | CONF_UNIQNAME, /* cacheUniqName */ | |
d60c11be | 83 | CONF_END |
84 | }; | |
85 | ||
b6a2f15e | 86 | #define LEN_CONF LEN_SQ_CONF + 1 |
87 | #define LEN_CONF_INST LEN_SQ_CONF + 2 | |
88 | ||
cc192b50 | 89 | |
90 | /* | |
91 | * cacheStorageConfig group { cacheConfig 5 } | |
92 | */ | |
d60c11be | 93 | enum { |
94 | CONF_ST_START, | |
cc192b50 | 95 | CONF_ST_MMAXSZ, /* cacheMemMaxSize */ |
96 | CONF_ST_SWMAXSZ, /* cacheSwapMaxSize */ | |
97 | CONF_ST_SWHIWM, /* cacheSwapHighWM */ | |
98 | CONF_ST_SWLOWM, /* cacheSwapLowWM */ | |
d60c11be | 99 | CONF_ST_END |
100 | }; | |
101 | ||
b6a2f15e | 102 | #define LEN_CONF_ST LEN_CONF + 1 |
103 | #define LEN_CONF_ST_INST LEN_CONF + 2 | |
104 | ||
85ee654a | 105 | /* |
cc192b50 | 106 | * Cache Performance Group {squid 3} |
eba4a24f | 107 | */ |
81d0c856 | 108 | |
d60c11be | 109 | enum { |
cc192b50 | 110 | PERF_START, |
111 | PERF_SYS, /* cacheSysPerf */ | |
112 | PERF_PROTO, /* cacheProtoStats */ | |
113 | PERF_END | |
d60c11be | 114 | }; |
115 | ||
cc192b50 | 116 | |
117 | /* cacheSysPerf */ | |
118 | enum { | |
119 | PERF_SYS_START, | |
120 | PERF_SYS_PF, /* cacheSysPageFaults */ | |
121 | PERF_SYS_NUMR, /* cacheSysNumReads */ | |
122 | PERF_SYS_MEMUSAGE, /* cacheMemUsage */ | |
123 | PERF_SYS_CPUTIME, /* cacheCpuTime */ | |
124 | PERF_SYS_CPUUSAGE, /* cacheCpuUsage */ | |
125 | PERF_SYS_MAXRESSZ, /* cacheMaxResSize */ | |
126 | PERF_SYS_NUMOBJCNT, /* cacheNumObjCount */ | |
127 | PERF_SYS_CURLRUEXP, /* cacheCurrentLRUExpiration */ | |
128 | PERF_SYS_CURUNLREQ, /* cacheCurrentUnlinkRequests */ | |
129 | PERF_SYS_CURUNUSED_FD, /* cacheCurrentUnusedFDescrCnt */ | |
130 | PERF_SYS_CURRESERVED_FD, /* cacheCurrentResFileDescrCnt */ | |
131 | PERF_SYS_CURUSED_FD, /* cacheCurrentFileDescrCnt */ | |
132 | PERF_SYS_CURMAX_FD, /* cacheCurrentFileDescrMax */ | |
133 | PERF_SYS_END | |
81d0c856 | 134 | }; |
135 | ||
cc192b50 | 136 | /* cacheProtoStats */ |
137 | enum { | |
138 | PERF_PROTOSTAT_START, | |
139 | PERF_PROTOSTAT_AGGR, /* cacheProtoAggregateStats */ | |
140 | PERF_PROTOSTAT_MEDIAN, /* cacheMedianSvcTable */ | |
141 | PERF_PROTOSTAT_END | |
142 | }; | |
143 | ||
144 | /* cacheProtoAggregateStats */ | |
145 | enum { | |
146 | PERF_PROTOSTAT_AGGR_START, | |
147 | PERF_PROTOSTAT_AGGR_HTTP_REQ, /* cacheProtoClientHttpRequests */ | |
148 | PERF_PROTOSTAT_AGGR_HTTP_HITS, /* cacheHttpHits */ | |
149 | PERF_PROTOSTAT_AGGR_HTTP_ERRORS, /* cacheHttpErrors */ | |
150 | PERF_PROTOSTAT_AGGR_HTTP_KBYTES_IN, /* cacheHttpInKb */ | |
151 | PERF_PROTOSTAT_AGGR_HTTP_KBYTES_OUT, /* cacheHttpOutKb */ | |
152 | PERF_PROTOSTAT_AGGR_ICP_S, /* cacheIcpPktsSent */ | |
153 | PERF_PROTOSTAT_AGGR_ICP_R, /* cacheIcpPktsRecv */ | |
154 | PERF_PROTOSTAT_AGGR_ICP_SKB, /* cacheIcpKbSent */ | |
155 | PERF_PROTOSTAT_AGGR_ICP_RKB, /* cacheIcpKbRecv */ | |
156 | PERF_PROTOSTAT_AGGR_REQ, /* cacheServerRequests */ | |
157 | PERF_PROTOSTAT_AGGR_ERRORS, /* cacheServerErrors */ | |
158 | PERF_PROTOSTAT_AGGR_KBYTES_IN, /* cacheServerInKb */ | |
159 | PERF_PROTOSTAT_AGGR_KBYTES_OUT, /* cacheServerOutKb */ | |
160 | PERF_PROTOSTAT_AGGR_CURSWAP, /* cacheCurrentSwapSize */ | |
161 | PERF_PROTOSTAT_AGGR_CLIENTS, /* cacheClients */ | |
162 | PERF_PROTOSTAT_AGGR_END | |
163 | }; | |
164 | ||
165 | ||
166 | /* CacheMedianSvcEntry */ | |
167 | enum { | |
168 | PERF_MEDIAN_START, | |
169 | PERF_MEDIAN_TIME, /* cacheMedianTime */ | |
170 | PERF_MEDIAN_HTTP_ALL, /* cacheHttpAllSvcTime */ | |
171 | PERF_MEDIAN_HTTP_MISS, /* cacheHttpMissSvcTime */ | |
172 | PERF_MEDIAN_HTTP_NM, /* cacheHttpNmSvcTime */ | |
173 | PERF_MEDIAN_HTTP_HIT, /* cacheHttpHitSvcTime */ | |
174 | PERF_MEDIAN_ICP_QUERY, /* cacheIcpQuerySvcTime */ | |
175 | PERF_MEDIAN_ICP_REPLY, /* cacheIcpReplySvcTime */ | |
176 | PERF_MEDIAN_DNS, /* cacheDnsSvcTime */ | |
177 | PERF_MEDIAN_RHR, /* cacheRequestHitRatio */ | |
178 | PERF_MEDIAN_BHR, /* cacheRequestByteRatio */ | |
179 | PERF_MEDIAN_HTTP_NH, /* cacheHttpNhSvcTime */ | |
180 | PERF_MEDIAN_END | |
d82d8654 | 181 | }; |
182 | ||
cc192b50 | 183 | |
184 | ||
185 | ||
85ee654a | 186 | /* |
cc192b50 | 187 | * cacheNetwork group { squid 4 } |
eba4a24f | 188 | */ |
d60c11be | 189 | |
b6a2f15e | 190 | enum { |
191 | NET_START, | |
cc192b50 | 192 | NET_IP_CACHE, /* cacheIpCache */ |
193 | NET_FQDN_CACHE, /* cacheFqdnCache */ | |
194 | NET_DNS_CACHE, /* cacheDns */ | |
b6a2f15e | 195 | NET_END |
196 | }; | |
197 | ||
cc192b50 | 198 | /* cacheIpCache */ |
d60c11be | 199 | enum { |
cc192b50 | 200 | IP_START, |
201 | IP_ENT, /* cacheIpEntrie */ | |
202 | IP_REQ, /* cacheIpRequests */ | |
203 | IP_HITS, /* acheIpHits */ | |
204 | IP_PENDHIT, /* cacheIpPendingHits */ | |
205 | IP_NEGHIT, /* cacheIpNegativeHit */ | |
206 | IP_MISS, /* cacheIpMisses */ | |
207 | IP_GHBN, /* cacheBlockingGetHostByName */ | |
208 | IP_LOC, /* cacheAttemptReleaseLckEntries */ | |
85ee654a | 209 | IP_END |
d60c11be | 210 | }; |
211 | ||
cc192b50 | 212 | /* cacheFqdnCache */ |
d60c11be | 213 | enum { |
85ee654a | 214 | FQDN_START, |
cc192b50 | 215 | FQDN_ENT, /* cacheFqdnEntries */ |
216 | FQDN_REQ, /* cacheFqdnRequests */ | |
217 | FQDN_HITS, /* cacheFqdnHits */ | |
218 | FQDN_PENDHIT, /* cacheFqdnPendingHits */ | |
219 | FQDN_NEGHIT, /* cacheFqdnNegativeHits */ | |
220 | FQDN_MISS, /* cacheFqdnMisses */ | |
221 | FQDN_GHBN, /* cacheBlockingGetHostByAddr */ | |
85ee654a | 222 | FQDN_END |
d60c11be | 223 | }; |
224 | ||
cc192b50 | 225 | |
226 | /* cacheDNS */ | |
d60c11be | 227 | enum { |
85ee654a | 228 | DNS_START, |
cc192b50 | 229 | DNS_REQ, /* cacheDnsRequests */ |
230 | DNS_REP, /* cacheDnsReplies */ | |
231 | DNS_SERVERS, /* cacheDnsNumberServers */ | |
85ee654a | 232 | DNS_END |
d82d8654 | 233 | }; |
234 | ||
cc192b50 | 235 | |
236 | ||
237 | ||
85ee654a | 238 | /* |
cc192b50 | 239 | * cacheMesh group { squid 5 } |
eba4a24f | 240 | */ |
d60c11be | 241 | |
43d4303e | 242 | enum { |
cc192b50 | 243 | MESH_START, |
244 | MESH_PTBL, /* cachePeerTable */ | |
245 | MESH_CTBL, /* cacheClientTable */ | |
246 | MESH_END | |
d60c11be | 247 | }; |
248 | ||
cc192b50 | 249 | /* cachePeerEntry */ |
250 | enum { | |
251 | MESH_PTBL_START, | |
252 | MESH_PTBL_INDEX, /* cachePeerIndex */ | |
253 | MESH_PTBL_NAME, /* cachePeerName */ | |
254 | MESH_PTBL_ADDR_TYPE, /* cachePeerAddressType */ | |
255 | MESH_PTBL_ADDR, /* cachePeerAddress */ | |
256 | MESH_PTBL_HTTP, /* cachePortHttp */ | |
257 | MESH_PTBL_ICP, /* cachePeerPortIcp */ | |
258 | MESH_PTBL_TYPE, /* cachePeerType */ | |
259 | MESH_PTBL_STATE, /* cachePeerStat */ | |
260 | MESH_PTBL_SENT, /* cachePeerPingsSent */ | |
261 | MESH_PTBL_PACKED, /* cachePeerPingsAcked */ | |
262 | MESH_PTBL_FETCHES, /* cachePeerFetches */ | |
263 | MESH_PTBL_RTT, /* cachePeerRtt */ | |
264 | MESH_PTBL_IGN, /* cachePeerIgnored */ | |
265 | MESH_PTBL_KEEPAL_S, /* cachePeerKeepAlSent */ | |
266 | MESH_PTBL_KEEPAL_R, /* cachePeerKeepAlRecv */ | |
267 | MESH_PTBL_END | |
d60c11be | 268 | }; |
269 | ||
cc192b50 | 270 | /* cacheClientEntry */ |
271 | enum { | |
272 | MESH_CTBL_START, | |
273 | MESH_CTBL_ADDR_TYPE, /* cacheClientAddressType */ | |
274 | MESH_CTBL_ADDR, /* cacheClientAddress */ | |
275 | MESH_CTBL_HTREQ, /* cacheClientHttpRequests */ | |
276 | MESH_CTBL_HTBYTES, /* cacheClientHttpKb */ | |
277 | MESH_CTBL_HTHITS, /* cacheClientHttpHits */ | |
278 | MESH_CTBL_HTHITBYTES, /* cacheClientHTTPHitKb */ | |
279 | MESH_CTBL_ICPREQ, /* cacheClientIcpRequests */ | |
280 | MESH_CTBL_ICPBYTES, /* cacheClientIcpKb */ | |
281 | MESH_CTBL_ICPHITS, /* cacheClientIcpHits */ | |
282 | MESH_CTBL_ICPHITBYTES,/* cacheClientIcpHitKb */ | |
283 | MESH_CTBL_END | |
d60c11be | 284 | }; |
285 | ||
d60c11be | 286 | |
451b07c5 | 287 | |
b5638623 | 288 | #endif /* SQUID_SNMP */ |
289 | ||
f13f02e9 | 290 | #endif /* SQUID_CACHE_SNMP_H */ |