aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2016-04-27 14:26:04 +0300
committerSergey Poznyakoff <gray@gnu.org.ua>2016-04-27 15:02:18 +0300
commit94973146c58df26b20e17e2e5b1274216ca88969 (patch)
tree17538cc2991af0acec5bebfe6a826ef67cd9fc95 /src
parent319c154c46214fdc5d8f8b498ae5a23bc8d03072 (diff)
downloadvarnish-mib-94973146c58df26b20e17e2e5b1274216ca88969.tar.gz
varnish-mib-94973146c58df26b20e17e2e5b1274216ca88969.tar.bz2
Support for Varnish 4.1
* NEWS: Update. * bootstrap: Rewrite as a Perl script; create m4/varnish_mib.m4 from src/varnish_mib.mib2c * configure.ac: Version 1.1.90 Use AC_CHECK_VSC_C_MAIN_MEMBERS Define VARNISHAPI_MAJOR, VARNISHAPI_MINOR and VARNISHAPI_PATCH for use in preprocessor directives. * src/betab.c [VARNISHAPI_MINOR] (VSC_POINT_FMT): Define depending on Varnish API minor version. * src/varnish_mib.mib2c (varnish_translate_table): New variable. It is used both by varnish_translate in this module, and by bootstrap to produce a list of macros checking for members of struct VSC_C_main. Output preprocessor conditionals in right places. * src/vcli.c (vcli_connect): Fix cc warnings. * src/varnish-mib.8: Update.
Diffstat (limited to 'src')
-rw-r--r--src/betab.c8
-rw-r--r--src/varnish-mib.840
-rw-r--r--src/varnish_mib.mib2c39
-rw-r--r--src/vcli.c4
4 files changed, 69 insertions, 22 deletions
diff --git a/src/betab.c b/src/betab.c
index b583958..49e02f7 100644
--- a/src/betab.c
+++ b/src/betab.c
@@ -56,13 +56,19 @@ create_entry(netsnmp_tdata *table_data, long idx,
56 return entry; 56 return entry;
57} 57}
58 58
59#define VSC_POINT_TYPE(p) ((p)->section->fantom->type) 59#define VSC_POINT_TYPE(p) ((p)->section->fantom->type)
60#define VSC_POINT_IDENT(p) ((p)->section->fantom->ident) 60#define VSC_POINT_IDENT(p) ((p)->section->fantom->ident)
61#define VSC_POINT_NAME(p) ((p)->desc->name) 61#define VSC_POINT_NAME(p) ((p)->desc->name)
62#define VSC_POINT_FMT(p) ((p)->desc->fmt) 62#if VARNISHAPI_MINOR == 0
63# define VSC_POINT_FMT(p) ((p)->desc->fmt)
64#elif VARNISHAPI_MINOR == 1
65# define VSC_POINT_FMT(p) ((p)->desc->ctype)
66#else
67# error "unsupported Varnish API minor number"
68#endif
63 69
64struct betab_priv { 70struct betab_priv {
65 int err; 71 int err;
66 long idx; 72 long idx;
67 struct backendTable_entry ent; 73 struct backendTable_entry ent;
68 netsnmp_tdata *table; 74 netsnmp_tdata *table;
diff --git a/src/varnish-mib.8 b/src/varnish-mib.8
index 4559b0c..0c54e6f 100644
--- a/src/varnish-mib.8
+++ b/src/varnish-mib.8
@@ -1,8 +1,8 @@
1.\" This file is part of Varnish-mib -*- nroff -*- 1.\" This file is part of Varnish-mib -*- nroff -*-
2.\" Copyright (C) 2014-2015 Sergey Poznyakoff 2.\" Copyright (C) 2014-2016 Sergey Poznyakoff
3.\" 3.\"
4.\" Varnish-mib is free software; you can redistribute it and/or modify 4.\" Varnish-mib is free software; you can redistribute it and/or modify
5.\" it under the terms of the GNU General Public License as published by 5.\" it under the terms of the GNU General Public License as published by
6.\" the Free Software Foundation; either version 3, or (at your option) 6.\" the Free Software Foundation; either version 3, or (at your option)
7.\" any later version. 7.\" any later version.
8.\" 8.\"
@@ -10,13 +10,13 @@
10.\" but WITHOUT ANY WARRANTY; without even the implied warranty of 10.\" but WITHOUT ANY WARRANTY; without even the implied warranty of
11.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11.\" MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12.\" GNU General Public License for more details. 12.\" GNU General Public License for more details.
13.\" 13.\"
14.\" You should have received a copy of the GNU General Public License 14.\" You should have received a copy of the GNU General Public License
15.\" along with Varnish-mib. If not, see <http://www.gnu.org/licenses/>. 15.\" along with Varnish-mib. If not, see <http://www.gnu.org/licenses/>.
16.TH VARNISH-MIB 8 "November 28, 2014" "varnish-mib" 16.TH VARNISH-MIB 8 "April 27, 2016" "varnish-mib"
17.SH NAME 17.SH NAME
18varnish\-mib \- net-snmp module for obtaining Varnish Cache statistics 18varnish\-mib \- net-snmp module for obtaining Varnish Cache statistics
19.SH SYNOPSIS 19.SH SYNOPSIS
20In \fBsnmpd.conf\fR(5): 20In \fBsnmpd.conf\fR(5):
21.PP 21.PP
22.B dlmod varnish_mib /usr/lib/snmp/varnish\-mib.so 22.B dlmod varnish_mib /usr/lib/snmp/varnish\-mib.so
@@ -24,21 +24,30 @@ In \fBsnmpd.conf\fR(5):
24Dynamically loadable object module for 24Dynamically loadable object module for
25.B net-snmp 25.B net-snmp
26that provides access to Varnish Cache statistics. The module is 26that provides access to Varnish Cache statistics. The module is
27loaded into 27loaded into
28.BR snmpd (8) 28.BR snmpd (8)
29as shown above (actual path can of course differ, depending on how 29as shown above (actual path can of course differ, depending on how
30the package was configured). 30the package was configured). Varnish version \fB4.0\fR and \fB4.1\fR
31are supported.
32.PP
33When using with \fBVarnish\fR version \fB4.1\fR, make sure the
34\fB_.vsm\fR file is readable for \fBsnmpd\fR. This file is normally
35located in \fB/var/lib/varnish/\fIHOSTNAME\fR and has mode \fB640\fR.
36Its owner is determined by the \fB\-j\fR (\fB\-\-jail\fR)
37\fBvarnishd\fR option. There are two ways to ensure it is readable:
38either make sure \fBsnmpd\fR and \fBvarnishd\fR run with the same user
39group, or use \fBsetfacl\fR(1) to tune access to that file.
31.PP 40.PP
32The module obtains most of the data using Varnish API. Information 41The module obtains most of the data using Varnish API. Information
33about available bans (\fBbanTable\fR subtree) as well as the mechanism 42about available bans (\fBbanTable\fR subtree) as well as the mechanism
34for setting bans (\fBclientBan\fR OID) are implemented via \fBvarnishd\fR 43for setting bans (\fBclientBan\fR OID) are implemented via \fBvarnishd\fR
35administrative interface. For these to work, the module must have 44administrative interface. For these to work, the module must have
36read access to Varnish secret file. In other words, the secret file 45read access to Varnish secret file. In other words, the secret file
37must be readable either by the user \fBsnmpd\fR runs as, or by one 46must be readable either by the user \fBsnmpd\fR runs as, or by its
38of this user's groups. 47group.
39.SH CONFIGURATION OPTIONS 48.SH CONFIGURATION OPTIONS
40Configuration statements specific to 49Configuration statements specific to
41.B varnish\-mib 50.B varnish\-mib
42must appear in the 51must appear in the
43.B snmpd.conf 52.B snmpd.conf
44file below the 53file below the
@@ -90,12 +99,23 @@ Number of hits for pass. A cache hit for pass indicates that Varnish
90passes the request to the backend and this decision itself has been cached. 99passes the request to the backend and this decision itself has been cached.
91.TP 100.TP
92.B clientCacheMisses 101.B clientCacheMisses
93Number of misses. A cache miss indicates the object was fetched from 102Number of misses. A cache miss indicates the object was fetched from
94the backend before delivering it to the client. 103the backend before delivering it to the client.
95.TP 104.TP
105.B clientRequests400
106Client requests received, subject to 400 errors.
107.TP
108.B clientRequests411
109Client requests received, subject to 411 errors. This variable is
110available only in Varnish version \fR4.0\fR.
111.TP
112.B clientRequests413
113Client requests received, subject to 413 errors. This variable is
114available only in Varnish version \fR4.0\fR.
115.TP
96.B clientBan 116.B clientBan
97A write-only OID. When set, invalidates the cache using the supplied 117A write-only OID. When set, invalidates the cache using the supplied
98value as argument to ban. When read, returns an empty string. E.g., 118value as argument to ban. When read, returns an empty string. E.g.,
99to invalidate caches of all \fBpng\fR images: 119to invalidate caches of all \fBpng\fR images:
100 120
101.EE 121.EE
@@ -125,13 +145,14 @@ whenever Varnish reuses a recycled connection.
125Number of backend connection recycles. This counter is increased 145Number of backend connection recycles. This counter is increased
126whenever Varnish has keep-alive connection that is put back into 146whenever Varnish has keep-alive connection that is put back into
127the pool of connections. It has not yet been used, but it might be, 147the pool of connections. It has not yet been used, but it might be,
128unless the backend closes it. 148unless the backend closes it.
129.TP 149.TP
130.B backendConnUnused 150.B backendConnUnused
131Number of unused backend connections. 151Number of unused backend connections. This variable is available only
152in Varnish version \fR4.0\fR.
132.TP 153.TP
133.B backendConnRetry 154.B backendConnRetry
134Backend connections retried. 155Backend connections retried.
135.TP 156.TP
136.B backendRequests 157.B backendRequests
137Total backend requests made. 158Total backend requests made.
@@ -234,13 +255,13 @@ Number of times session was queued waiting for a thread.
234Number of sessions dropped because session queue was full. 255Number of sessions dropped because session queue was full.
235.TP 256.TP
236.B sessClosed 257.B sessClosed
237Number of sessions closed. 258Number of sessions closed.
238.TP 259.TP
239.B sessPipeline 260.B sessPipeline
240Session pipeline. 261Session pipeline. This variable is available only in Varnish version \fR4.0\fR.
241.TP 262.TP
242.B sessReadAhead 263.B sessReadAhead
243Session read-ahead. 264Session read-ahead.
244.TP 265.TP
245.B sessHerd 266.B sessHerd
246Session herd. 267Session herd.
@@ -249,13 +270,14 @@ Session herd.
249Number of sessions dropped for thread. 270Number of sessions dropped for thread.
250.TP 271.TP
251.B sessFail 272.B sessFail
252Number of session accept failures. 273Number of session accept failures.
253.TP 274.TP
254.B sessPipeOverflow 275.B sessPipeOverflow
255Number of session pipe overflows. 276Number of session pipe overflows. This variable is available only in
277Varnish version \fR4.0\fR.
256.SS Branch \(dqthreads\(dq 278.SS Branch \(dqthreads\(dq
257.TP 279.TP
258.B threadsPools 280.B threadsPools
259Number of thread pools. 281Number of thread pools.
260.TP 282.TP
261.B threadsTotal 283.B threadsTotal
@@ -354,13 +376,13 @@ implementation-specific management. It is not used currently.
354.BR varnishstat (1). 376.BR varnishstat (1).
355.SH AUTHORS 377.SH AUTHORS
356Sergey Poznyakoff 378Sergey Poznyakoff
357.SH "BUG REPORTS" 379.SH "BUG REPORTS"
358Report bugs to <gray@gnu.org>. 380Report bugs to <gray@gnu.org>.
359.SH COPYRIGHT 381.SH COPYRIGHT
360Copyright \(co 2014 Sergey Poznyakoff 382Copyright \(co 2014-2016 Sergey Poznyakoff
361.br 383.br
362.na 384.na
363License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> 385License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
364.br 386.br
365.ad 387.ad
366This is free software: you are free to change and redistribute it. 388This is free software: you are free to change and redistribute it.
diff --git a/src/varnish_mib.mib2c b/src/varnish_mib.mib2c
index a5367e0..9d49ce9 100644
--- a/src/varnish_mib.mib2c
+++ b/src/varnish_mib.mib2c
@@ -1,8 +1,8 @@
1# This file is part of varnish-mib -*- c -*-