aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSergey Poznyakoff <gray@gnu.org.ua>2018-02-05 22:36:39 +0200
committerSergey Poznyakoff <gray@gnu.org.ua>2018-02-05 22:36:39 +0200
commitb15d315e7eacad50ca4375df452d9d7ba9fac597 (patch)
tree02941a6fe928978295c083ead430da882bdafce9
parent14dc6b025e8c685e68ce8afe773f888312c73759 (diff)
downloadvarnish-mib-4.1.tar.gz
varnish-mib-4.1.tar.bz2
Version 1.2release-1.24.1
-rw-r--r--NEWS75
-rw-r--r--README18
-rw-r--r--configure.ac14
-rw-r--r--src/betab.c6
-rw-r--r--src/varnish-mib.862
-rw-r--r--src/varnish_mib.mib2c2
6 files changed, 149 insertions, 28 deletions
diff --git a/NEWS b/NEWS
index f12c539..bfde877 100644
--- a/NEWS
+++ b/NEWS
@@ -1,9 +1,78 @@
-Varnish-mib NEWS -- history of user-visible changes. 2016-04-27
-Copyright (C) 2014-2016 Sergey Poznyakoff
+Varnish-mib NEWS -- history of user-visible changes. 2018-02-05
See the end of file for copying conditions.
Please send Varnish-mib bug reports to <gray@gnu.org>
+Version 1.2, 2018-02-05
+
+This version introduces support for the following new OIDs:
+
+** VarnishMIB::objects branch
+
+ objectsCount
+
+ Approximate number of HTTP objects (headers + body,
+ if present) in the cache.
+ [Varnish variable MAIN.n_object]
+
+ objectsVampire
+ Number of unresurrected objects.
+ [MAIN.n_vampireobject]
+
+ objectsCore
+ Approximate number of object metadata elements in the cache. Each
+ object needs an objectcore, extra objectcores are for
+ hit-for-miss, hit-for-pass and busy objects.
+ [MAIN.n_objectcore]
+
+ objectsHead
+ Approximate number of different hash entries in the cache.
+ [MAIN.n_objecthead]
+
+ objectsExpired
+ Number of objects that expired from cache because of old age.
+ [MAIN.n_expired]
+
+ objectsLRUNuked
+ How many objects have been forcefully evicted from
+ storage to make room for a new object.
+ [MAIN.n_lru_nuked]
+
+ objectsLRUMoved
+ Number of move operations done on the LRU list.
+ [MAIN.n_lru_moved]
+
+ objectsPurges
+ Number of purge operations executed.
+ [MAIN.n_purges]
+
+ objectsObjPurged
+ Number of purged objects.
+ [MAIN.n_obj_purged]
+
+ objectsGzip
+ Number of gzip operations.
+ [MAIN.n_gzip]
+
+ objectsGunzip
+ Number of gunzip operations.
+ [MAIN.n_gunzip]
+
+** VarnishMIB::vcl branch
+
+ vclTotal
+ Number of loaded VCLs in total.
+ [MAIN.n_vcl]
+
+ vclAvail
+ Number of VCLs available.
+ [MAIN.n_vcl_avail]
+
+ vclDiscard
+ Number of discarded VCLs.
+ [MAIN.n_vcl_discard]
+
+
Version 1.1.90 (Git)
* Support for Varnish 4.1
@@ -21,7 +90,7 @@ Initial release.
* Copyright information:
-Copyright (C) 2014-2016 Sergey Poznyakoff
+Copyright (C) 2014-2018 Sergey Poznyakoff
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/README b/README
index 8e68d6a..62f328e 100644
--- a/README
+++ b/README
@@ -1,5 +1,4 @@
Varnish-mib README
-Copyright (C) 2014-2015 Sergey Poznyakoff
See the end of file for copying conditions.
* Introduction
@@ -16,11 +15,20 @@ Varnish-mib is a dynamically loadable object module for net-snmp
snmpd, that provides access to Varnish Cache statistics. It uses
MIBs from varnishsnmp project (http://varnishsnmp.sourceforge.net).
+This and other versions of Varnish-mib is available for download from
+<http://download.gnu.org.ua/release/varnish-mib>. The following table
+describes the relation between the release number and the version
+of Varnish API version it is written for:
+
+ 1.0, 1.1 Varnish 4.0 and 4.1
+ 1.2 (this release) Varnish 4.0, 4.1, 5.1
+ 2.0 Varnish 5.2.0
+ 3.0 Varnish 5.2.1
+
* Installation
-In order to compile the package you need to have Net-snmp and Varnish
-installed. Only Varnish 4.x is supported. The installation sequence
-is as usual:
+In order to compile the package you need to have Net-SNMP and Varnish
+installed. The installation sequence is as usual:
./configure [options]
make
@@ -47,7 +55,7 @@ Send bug reports and suggestions to <gray@gnu.org>
* Copyright information:
-Copyright (C) 2014 Sergey Poznyakoff
+Copyright (C) 2014-2018 Sergey Poznyakoff
Permission is granted to anyone to make or distribute verbatim copies
of this document as received, in any medium, provided that the
diff --git a/configure.ac b/configure.ac
index cf0bf05..148ef1e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -15,7 +15,7 @@
# along with Varnish-mib. If not, see <http://www.gnu.org/licenses/>.
AC_PREREQ(2.69)
-AC_INIT([varnish-mib], 1.1.90, [gray@gnu.org])
+AC_INIT([varnish-mib], 1.2, [gray@gnu.org])
AC_CONFIG_SRCDIR(src/varnish_mib.mib2c)
AM_CONFIG_HEADER(config.h)
AC_CONFIG_AUX_DIR([build-aux])
@@ -43,17 +43,17 @@ PKG_PROG_PKG_CONFIG
# Checks for Varnish
PKG_CHECK_MODULES([VARNISHAPI], [varnishapi >= 4.0])
-varnishapi_version() {
- AC_DEFINE_UNQUOTED([VARNISHAPI_MAJOR],[$1],[Varnish API major version number])
- AC_DEFINE_UNQUOTED([VARNISHAPI_MINOR],[$2],[Varnish API minor version number])
- AC_DEFINE_UNQUOTED([VARNISHAPI_PATCH],[$3],[Varnish API patchlevel])
+check_upper_bound() {
+ if [ "$1" -eq 5 ] && [ "$2" -gt 1]; then
+ AC_MSG_ERROR([Unsupported Varnish API version; please try varnish_mib 2\.0 or newer])
+ fi
}
-
+
v=$($PKG_CONFIG --modversion varnishapi)
if test -n "$v"; then
save_IFS=$IFS
IFS='.'
- varnishapi_version $v
+ check_upper_bound $v
IFS=$save_IFS
fi
diff --git a/src/betab.c b/src/betab.c
index 49e02f7..4b1358d 100644
--- a/src/betab.c
+++ b/src/betab.c
@@ -59,12 +59,10 @@ create_entry(netsnmp_tdata *table_data, long idx,
#define VSC_POINT_TYPE(p) ((p)->section->fantom->type)
#define VSC_POINT_IDENT(p) ((p)->section->fantom->ident)
#define VSC_POINT_NAME(p) ((p)->desc->name)
-#if VARNISHAPI_MINOR == 0
+#if VARNISHAPI_MAJOR == 4 && VARNISHAPI_MINOR == 0
# define VSC_POINT_FMT(p) ((p)->desc->fmt)
-#elif VARNISHAPI_MINOR == 1
-# define VSC_POINT_FMT(p) ((p)->desc->ctype)
#else
-# error "unsupported Varnish API minor number"
+# define VSC_POINT_FMT(p) ((p)->desc->ctype)
#endif
struct betab_priv {
diff --git a/src/varnish-mib.8 b/src/varnish-mib.8
index 0c54e6f..d321e8b 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 5, 2018" "varnish-mib"
.SH NAME
varnish\-mib \- net-snmp module for obtaining Varnish Cache statistics
.SH SYNOPSIS
@@ -27,13 +27,13 @@ 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). It supports Varnish versions \fB4.0\fR,
+\fB4.1\fR, and \fB5.1\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)
+When using with \fBVarnish\fR versions \fB4.1\fR and \fB5.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.
@@ -366,6 +366,52 @@ total number of rows in the \fBbanTable\fR may diverge from the value
of \fBbansTotal\fR variable. The default update interval is 60
seconds. It can be configured in the \fBsnmpd.conf\fR file
(see the \fBvarnishBanTableTimeout\fR statement above).
+.SS Branch \(dqobjects\(dq
+.TP
+.B objectsCount
+Approximate number of HTTP objects (headers + body, if present) in the cache.
+.TP
+.B objectsVampire
+Number of unresurrected objects.
+.TP
+.B objectsCore
+Approximate number of object metadata elements in the cache. Each
+object needs an objectcore, extra objectcores are for
+hit-for-miss, hit-for-pass and busy objects.
+.TP
+.B objectsHead
+Approximate number of different hash entries in the cache.
+.TP
+.B objectsExpired
+Number of objects that expired from cache because of old age.
+.TP
+.B objectsLRUNuked
+How many objects have been forcefully evicted from storage to make
+room for a new object.
+.TP
+.B objectsLRUMoved
+Number of move operations done on the LRU list.
+.TP
+.B objectsPurges
+Number of purge operations executed.
+.TP
+.B objectsObjPurged
+.TP
+.B objectsGzip
+Number of gzip operations.
+.TP
+.B objectsGunzip
+Number of gunzip operations.
+.SS Branch \(dqvcl\(dq
+.TP
+.B vclTotal
+Number of loaded VCLs in total.
+.TP
+.B vclAvail
+Number of VCLs available.
+.TP
+.B vclDiscard
+Number of discarded VCLs.
.SS Branch \(dqagent\(dq
The \fBagent\fR branch is reserved for OIDs for
implementation-specific management. It is not used currently.
@@ -379,7 +425,7 @@ Sergey Poznyakoff
.SH "BUG REPORTS"
Report bugs to <gray@gnu.org>.
.SH COPYRIGHT
-Copyright \(co 2014-2016 Sergey Poznyakoff
+Copyright \(co 2014-2018 Sergey Poznyakoff
.br
.na
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
diff --git a/src/varnish_mib.mib2c b/src/varnish_mib.mib2c
index ee6b119..6967673 100644
--- a/src/varnish_mib.mib2c
+++ b/src/varnish_mib.mib2c
@@ -1,5 +1,5 @@
# This file is part of varnish-mib -*- c -*-
-# Copyright (C) 2014-2016 Sergey Poznyakoff
+# Copyright (C) 2014-2018 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

Return to:

Send suggestions and report system problems to the System administrator.