diff options
author | Sergey Poznyakoff <gray@gnu.org> | 2019-02-14 10:53:03 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org> | 2019-02-14 11:01:50 +0200 |
commit | 45c6086f8c0c0f6fe1a46b950682abfdbf104687 (patch) | |
tree | 61923d59ed3dbbe0365d88e574b7e4f1aec4fbcc /src/varnish-mib.8 | |
parent | dffed71f70f7e7b6bf1cd32539a1a1131916a8b4 (diff) | |
download | varnish-mib-45c6086f8c0c0f6fe1a46b950682abfdbf104687.tar.gz varnish-mib-45c6086f8c0c0f6fe1a46b950682abfdbf104687.tar.bz2 |
Rewrite as a stand-alone snmpd agent.
* NEWS: Document new features.
* configure.ac: Raise version number.
* src/.gitignore: Update.
* src/Makefile.am: Build as an agent.
* src/main.c: New file.
* src/modconf.c: Remove "varnish" prefix from the configuration
directives.
(varnish_mib_config_init): Use program name as the base for the
configuration file name.
(varnish_mib_config_help): New function.
* src/modconf.h (progname, pid_file, pid_file_immutable): New externs.
* src/varnish-mib.8: Rewrite.
* src/varnish_mib.mib2c (varnish_snmp_init)
(varnish_snmp_deinit): Remove.
(post_config): Extern. Called from main().
Diffstat (limited to 'src/varnish-mib.8')
-rw-r--r-- | src/varnish-mib.8 | 153 |
1 files changed, 97 insertions, 56 deletions
diff --git a/src/varnish-mib.8 b/src/varnish-mib.8 index 6458321..0856c69 100644 --- a/src/varnish-mib.8 +++ b/src/varnish-mib.8 @@ -1,5 +1,5 @@ .\" This file is part of Varnish-mib -*- nroff -*- -.\" Copyright (C) 2014-2018 Sergey Poznyakoff +.\" Copyright (C) 2014-2019 Sergey Poznyakoff .\" .\" Varnish-mib is free software; you can redistribute it and/or modify .\" it under the terms of the GNU General Public License as published by @@ -13,22 +13,29 @@ .\" .\" 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 "February 5, 2018" "varnish-mib" +.TH VARNISH-MIB 8 "February 14, 2019" "varnish-mib" .SH NAME -varnish\-mib \- Net-SNMP module for Varnish Cache monitoring +varnish\-mib \- Net-SNMP agent for Varnish Cache monitoring .SH SYNOPSIS -In \fBsnmpd.conf\fR(5): -.PP -.B dlmod varnish_mib /usr/lib/snmp/varnish\-mib.so +\fBvarnish-mib\fR\ + [\fB\-ACHdfh\fR]\ + [\fB\-D \ITOKEN\fR[,\fITOKEN\fR...]]\ + [\fB\-L[eo]\fR]\ + [\fB\-Lf \fIFILE\fR]\ + [\fB\-Ls \fIFACILITY\fR]\ + [\fB\-LE \fIPRI\fR[\fB\-\fIPRI2\fR]]\ + [\fB\-c \fIFILE\fR]\ + [\fB\-n \fINAME\fR]\ + [\fB\-p \fIFILE\fR] .SH DESCRIPTION -Dynamically loadable object module for -.B net-snmp -that provides access to Varnish Cache statistics. The module is -loaded into +An agent for .BR snmpd (8) -as shown above (actual path can of course differ, depending on how -the package was configured). This version is written for Varnish -\fB5.2.1\fR. +that provides access to Varnish Cache statistics. To successfully +couple with the \fBsnmpd\fR the latter must be started with the +.B \-x +command line option, or with the \fBmaster agentx\fR directive in +.BR snmpd.conf (5) +file. .PP The values in the OID branches .BR client , @@ -47,35 +54,25 @@ are obtained using \fBvarnishd\fR administrative interface (similar to .BR varnishadm (8)). .PP -To retrieve this information, the module must +To retrieve this information, the agent must have enough permissions to scan the Varnish management directory and -read files located in it. This directory is normally named -\fB/var/lib/varnish/\fIHOSTNAME\fB/_.vsm_mgt\fR, where \fIHOSTNAME\fR -stands for the server's hostname. Unless -.BR snmpd (8) -is run as root, special measures should be undertaken in order to -grant access rights. For example, if the daemon runs as user -\fBsnmp\fR, running the following two commands after starting -\fBvarnishd\fR will do the trick: - -.EX - setfacl -m u:snmp:rx /var/lib/varnish/$(hostname)/_.vsm_mgt - setfacl -m u:snmp:r /var/lib/varnish/$(hostname)/_.vsm_mgt/* -.EE +read files located in it. Normally this means that it must be started +either as root or as the user +.B varnishd +is started as. .PP - -.SH CONFIGURATION OPTIONS -Configuration statements specific to +The configuration for .B varnish\-mib -must appear in the -.B snmpd.conf -file, after the -.B dlmod -statement that loads the module. -.PP -The following configuration statements are available: +is read from the file +.B varnish\-mib.conf +located in one of the SNMP configuration path directories. The +following configuration directives are understood: +.TP +\fBpidfile\fR \fIFILE\fR +Upon startup, write the process ID of the \fBvarnish\-mib\fR daemon to +\fIFILE\fR. See also the \fB\-p\fR command line option, below. .TP -\fBvarnishBanTableTimeout\fR \fINUMBER\fR +\fBbanTableTimeout\fR \fINUMBER\fR To create \fBbanTable\fR (see below), \fBvarnish_mib\fR connects to \fBvarnish\fR administration port and issues the \fBban.list\fR command. To minimize the performance impact, the information obtained @@ -83,24 +80,42 @@ 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 +\fBbackendTableTimeout\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. +\fBcliPortTimeout\fR \fINUMBER\fR +Set timeout for I/O operations with Varnish administrative port. Default is 5 seconds. .PP The following two statements are not normally needed, but are provided for completeness sake: .TP -\fBvarnishCLISocket\fR \fIADDRESS\fR[:\fIPORT\fR] -Sets the address of Varnish administrative interface -socket. +\fBcliSocket\fR \fIADDRESS\fR[:\fIPORT\fR] +Set the address of Varnish administrative interface socket. +.TP +\fBcliSecretFile\fR \fIFILE\fR +Set the pathname of the Varnish secret file. +.SH OPTIONS +.TP +.B \-A +Append to the log file rather than truncating it. .TP -\fBvarnishCLISecretFile\fR \fIFILE\fR -Sets the pathname of the Varnish secret file. -.SH DEBUGGING -The module defines the following debugging tokens: +\fB\-c \fIFILE\fR +Read \fIFILE\fR as a configuration file (or a comma-separated list of +configuration files). +.TP +.B \-C +Do not read any configuration files except the ones specified by the +\fB\-c\fR option. +.TP +\fB\-d +Dump (in hexadecimal) the sent and received SNMP packets. +.TP +\fB\-D \ITOKEN\fR[,\fITOKEN\fR...] +Turn on debugging output for the given TOKEN(s). Special token +\fIALL\fR produces extremely verbose output. Other tokens available +are: +.RS 4 .TP .B varnish_mib Produces general debugging information. @@ -118,6 +133,34 @@ Enables full transcript of varnish CLI session. .TP .B varnish_mib:backend Outputs verbose information about loading the backend information. +.RE +.TP +.B \-f +Remain in the foreground. +.TP +\fB\-h\fR, \fB\-?\fR +Print a short usage summary and exit. +.TP +.B \-H +Print a list of configuration file directives understood by the agent +and then exit. +.TP +\fB\-Le\fR, \fB\-Lo\fR, \fB\-Lf \fIFILE\fR, \fB\-Ls \fIFACILITY\fR, \fB\-LE \fIPRI\fR[\fB\-\fIPRI2\fR] +Specify where logging output should be directed (standard error or +output, to a file or via syslog). See +.B LOGGING OPTIONS +in +.BR snmpcmd (5) +for details. +.TP +\fB\-n \fINAME\fR +Set an alternative application name (which will affect the +configuration files loaded). By default it is the same as the name +of the binary. +.TP +\fB\-p \fIFILE\fR +Save the process ID of the daemon in \fIFILE\fR. This option +overrides the \fBpidfile\fR configuration directive. .SH OIDS The following OIDs are defined in the .B VARNISH-MIB.txt @@ -449,19 +492,16 @@ The \fBagent\fR branch is reserved 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: +available in newer Varnish releases: .TP .B clientRequests411 -Client requests received, subject to 411 errors. This variable is -available only in Varnish version \fR4.0\fR. +Client requests received, subject to 411 errors. .TP .B clientRequests413 -Client requests received, subject to 413 errors. This variable is -available only in Varnish version \fR4.0\fR. +Client requests received, subject to 413 errors. .TP .B backendConnUnused -Number of unused backend connections. This variable is available only -in Varnish version \fR4.0\fR. +Number of unused backend connections. .PP The OIDs .B clientRequestsReceived @@ -471,6 +511,7 @@ return the same value. .SH "SEE ALSO" .BR snmpd.conf (5), .BR snmpd (8), +.BR snmpcmd (1), .BR varnish (7), .BR varnishstat (1). .SH AUTHORS @@ -478,7 +519,7 @@ Sergey Poznyakoff .SH "BUG REPORTS" Report bugs to <gray@gnu.org>. .SH COPYRIGHT -Copyright \(co 2014-2018 Sergey Poznyakoff +Copyright \(co 2014-2019 Sergey Poznyakoff .br .na License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html> |