aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@nxc.no>2018-02-02 15:45:38 +0100
committerSergey Poznyakoff <gray@nxc.no>2018-02-02 15:46:04 +0100
commite750e533397d27186c13d16cac9c9cc64fe1a387 (patch)
treeca718860eae8eb0d1684789ec428dc1d63523930
parent8a2e9da972cee4714c02f3dd23a3b7fcab9a0476 (diff)
downloadvarnish-mib-e750e533397d27186c13d16cac9c9cc64fe1a387.tar.gz
varnish-mib-e750e533397d27186c13d16cac9c9cc64fe1a387.tar.bz2
Fix docs
-rw-r--r--configure.ac2
-rw-r--r--src/varnish-mib.887
-rw-r--r--src/vcli.c4
3 files changed, 57 insertions, 36 deletions
diff --git a/configure.ac b/configure.ac
index c334724..a800774 100644
--- a/configure.ac
+++ b/configure.ac
@@ -42,7 +42,7 @@ AC_PROG_MAKE_SET
PKG_PROG_PKG_CONFIG
# Checks for Varnish
-PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 4.0])
+PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 5.0])
varnishapi_version() {
AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$1],[Varnish API major version number])
diff --git a/src/varnish-mib.8 b/src/varnish-mib.8
index 0c54e6f..8d86f18 100644
--- a/src/varnish-mib.8
+++ b/src/varnish-mib.8
@@ -13,7 +13,7 @@
.\"
.\" You should have received a copy of the GNU General Public License
.\" along with Varnish-mib. If not, see <http://www.gnu.org/licenses/>.
-.TH VARNISH-MIB 8 "April 27, 2016" "varnish-mib"
+.TH VARNISH-MIB 8 "February 2, 2018" "varnish-mib"
.SH NAME
varnish\-mib \- net-snmp module for obtaining Varnish Cache statistics
.SH SYNOPSIS
@@ -27,24 +27,17 @@ that provides access to Varnish Cache statistics. The module is
loaded into
.BR snmpd (8)
as shown above (actual path can of course differ, depending on how
-the package was configured). Varnish version \fB4.0\fR and \fB4.1\fR
-are supported.
+the package was configured). The module is written for Varnish
+version \fB5.\fIX\fR.
.PP
-When using with \fBVarnish\fR version \fB4.1\fR, make sure the
-\fB_.vsm\fR file is readable for \fBsnmpd\fR. This file is normally
-located in \fB/var/lib/varnish/\fIHOSTNAME\fR and has mode \fB640\fR.
-Its owner is determined by the \fB\-j\fR (\fB\-\-jail\fR)
-\fBvarnishd\fR option. There are two ways to ensure it is readable:
-either make sure \fBsnmpd\fR and \fBvarnishd\fR run with the same user
-group, or use \fBsetfacl\fR(1) to tune access to that file.
+The module obtains most of the data using Varnish API, and \fBvarnishd\fR
+administrative interface. You should make sure that \fBsnmpd\fR is
+able to access both data sources.
.PP
-The module obtains most of the data using Varnish API. Information
-about available bans (\fBbanTable\fR subtree) as well as the mechanism
-for setting bans (\fBclientBan\fR OID) are implemented via \fBvarnishd\fR
-administrative interface. For these to work, the module must have
-read access to Varnish secret file. In other words, the secret file
-must be readable either by the user \fBsnmpd\fR runs as, or by its
-group.
+The user \fBsnmpd\fR runs as should be able to read contents of the
+\fB/var/lib/varnish/\fIHOSTNAME\fB/_.vsm_mgt\fR directory and read
+files located in it. It must also have read permission on the varnish
+secret file.
.SH CONFIGURATION OPTIONS
Configuration statements specific to
.B varnish\-mib
@@ -64,22 +57,41 @@ is cached for a predefined amount of time (60 seconds by default).
This amount (in seconds) is configured by \fBvarnishBanTableTimeout\fR
statement.
.TP
+\fBvarnishBackendTableTimeout\fR \fINUMBER\fR
+Update interval for \fBbackendTable\fR. Default is 5 seconds.
+.TP
\fBvarnishCLIPortTimeout\fR \fINUMBER\fR
Sets timeout for I/O operations with Varnish administrative port.
Default is 5 seconds.
+.PP
+The following two statements are not normally needed, since
+\fBvarnish-mib\fR obtains this information automatically.
.TP
-\fBvarnishBackendTableTimeout\fR \fINUMBER\fR
-Update interval for \fBbackendTable\fR. Default is 5 seconds.
+\fBvarnishCLISocket\fR \fIADDRESS\fR[:\fIPORT\fR]
+Sets the address of Varnish administrative interface
+socket.
+.TP
+\fBvarnishCLISecretFile\fR \fIFILE\fR
+Pathname of the Varnish secret file.
.SH DEBUGGING
The module defines the following debugging tokens:
.TP
-.B varnish_ban
-Enables general debugging information.
+.B varnish_mib
+General debugging information.
+.TP
+.B varnish_mib:ban
+Debug ban table loading.
.TP
.B varnish_mib:vcli
Varnish
.B CLI
interaction.
+.TP
+.B varnish_mib:vcli:transcript
+Enables full transcript of CLI interaction.
+.TP
+.B varnish_mib:backend
+Debug loading the backend information.
.SH OIDS
The following OIDs are defined:
.SS Branch \(dqclient\(dq
@@ -105,14 +117,6 @@ the backend before delivering it to the client.
.B clientRequests400
Client requests received, subject to 400 errors.
.TP
-.B clientRequests411
-Client requests received, subject to 411 errors. This variable is
-available only in Varnish version \fR4.0\fR.
-.TP
-.B clientRequests413
-Client requests received, subject to 413 errors. This variable is
-available only in Varnish version \fR4.0\fR.
-.TP
.B clientBan
A write-only OID. When set, invalidates the cache using the supplied
value as argument to ban. When read, returns an empty string. E.g.,
@@ -147,10 +151,6 @@ whenever Varnish has keep-alive connection that is put back into
the pool of connections. It has not yet been used, but it might be,
unless the backend closes it.
.TP
-.B backendConnUnused
-Number of unused backend connections. This variable is available only
-in Varnish version \fR4.0\fR.
-.TP
.B backendConnRetry
Backend connections retried.
.TP
@@ -369,6 +369,27 @@ seconds. It can be configured in the \fBsnmpd.conf\fR file
.SS Branch \(dqagent\(dq
The \fBagent\fR branch is reserved for OIDs for
implementation-specific management. It is not used currently.
+.SH NOTES
+The following OIDs were used in Varnish 4. They are no longer
+available in Varnish 5:
+.TP
+.B clientRequests411
+Client requests received, subject to 411 errors. This variable is
+available only in Varnish version \fR4.0\fR.
+.TP
+.B clientRequests413
+Client requests received, subject to 413 errors. This variable is
+available only in Varnish version \fR4.0\fR.
+.TP
+.B backendConnUnused
+Number of unused backend connections. This variable is available only
+in Varnish version \fR4.0\fR.
+.PP
+The OIDs
+.B clientRequestsReceived
+and
+.B totalRequests
+return the same value.
.SH "SEE ALSO"
.BR snmpd.conf (5),
.BR snmpd (8),
diff --git a/src/vcli.c b/src/vcli.c
index 2683c9d..7d6c2b9 100644
--- a/src/vcli.c
+++ b/src/vcli.c
@@ -199,7 +199,7 @@ vcli_read(struct vcli_conn *conn, size_t size)
if (conn->bufsize == 0)
ret = -1;
conn->base[conn->bufsize] = 0;
- DEBUGMSGTL(("transcript:varnish_mib", "<<varnish: %s\n", conn->base));
+ DEBUGMSGTL(("varnish_mib:vcli:transcript", "<<varnish: %s\n", conn->base));
}
return ret;
@@ -282,7 +282,7 @@ vcli_write(struct vcli_conn *conn)
{
size_t size;
- DEBUGMSGTL(("transcript:varnish_mib", ">>varnish: %s\n", conn->base));
+ DEBUGMSGTL(("varnish_mib:vcli:transcript", ">>varnish: %s\n", conn->base));
for (size = 0; size < conn->bufsize; ) {
int n = write(conn->fd, conn->base + size,
conn->bufsize - size);

Return to:

Send suggestions and report system problems to the System administrator.