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