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