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