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

 

Introduction

Documentation

Support

Miscellaneous