diff options
author | Sergey Poznyakoff <gray@nxc.no> | 2018-02-05 20:56:59 +0100 |
---|---|---|
committer | Sergey Poznyakoff <gray@nxc.no> | 2018-02-05 20:56:59 +0100 |
commit | f7677f32b90eea37e54b39a3e26e5437924a2ada (patch) | |
tree | 4112eecd0acecd664e613fd1b66dd177b7ab87ba /src | |
parent | 027e83b6f5dc6a63ed9c69e534c0b994041df14f (diff) | |
download | varnish-mib-f7677f32b90eea37e54b39a3e26e5437924a2ada.tar.gz varnish-mib-f7677f32b90eea37e54b39a3e26e5437924a2ada.tar.bz2 |
Version 2.0
Diffstat (limited to 'src')
-rw-r--r-- | src/Makefile.am | 2 | ||||
-rw-r--r-- | src/VARNISH-MIB.txt | 6 | ||||
-rw-r--r-- | src/auth.c | 2 | ||||
-rw-r--r-- | src/backend.h | 3 | ||||
-rw-r--r-- | src/ban.c | 2 | ||||
-rw-r--r-- | src/belex.l | 17 | ||||
-rw-r--r-- | src/modconf.c | 17 | ||||
-rw-r--r-- | src/varnish-mib.8 | 85 | ||||
-rw-r--r-- | src/vcli.c | 2 |
9 files changed, 99 insertions, 37 deletions
diff --git a/src/Makefile.am b/src/Makefile.am index 55cdb85..5c79dfc 100644 --- a/src/Makefile.am +++ b/src/Makefile.am | |||
@@ -1,5 +1,5 @@ | |||
1 | # This file is part of varnish-mib -*- automake -*- | 1 | # This file is part of varnish-mib -*- automake -*- |
2 | # Copyright (C) 2014-2015 Sergey Poznyakoff | 2 | # Copyright (C) 2014-2018 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 |
diff --git a/src/VARNISH-MIB.txt b/src/VARNISH-MIB.txt index 6b03f21..b7e77f1 100644 --- a/src/VARNISH-MIB.txt +++ b/src/VARNISH-MIB.txt | |||
@@ -20,14 +20,14 @@ IMPORTS | |||
20 | FROM SNMPv2-CONF; | 20 | FROM SNMPv2-CONF; |
21 | 21 | ||
22 | varnishMIB MODULE-IDENTITY | 22 | varnishMIB MODULE-IDENTITY |
23 | LAST-UPDATED "201802020845Z" | 23 | LAST-UPDATED "201802052024Z" |
24 | ORGANIZATION "Shared Autonomous sYstems" | 24 | ORGANIZATION "Shared Autonomous sYstems" |
25 | CONTACT-INFO "Morten Hermanrud <mhe@say.no> | 25 | CONTACT-INFO "Morten Hermanrud <mhe@say.no> |
26 | Sergey Poznyakoff <gray@gnu.org> | 26 | Sergey Poznyakoff <gray@gnu.org> |
27 | " | 27 | " |
28 | DESCRIPTION | 28 | DESCRIPTION |
29 | "This MIB module defines objects for Varnish reverse web proxy." | 29 | "This MIB module defines objects for Varnish reverse web proxy." |
30 | REVISION "201802020845Z" | 30 | REVISION "201802052024Z" |
31 | DESCRIPTION | 31 | DESCRIPTION |
32 | "Second revision." | 32 | "Second revision." |
33 | ::= { varnish 0 } | 33 | ::= { varnish 0 } |
@@ -854,7 +854,7 @@ objectsPurges OBJECT-TYPE | |||
854 | MAX-ACCESS read-only | 854 | MAX-ACCESS read-only |
855 | STATUS current | 855 | STATUS current |
856 | DESCRIPTION | 856 | DESCRIPTION |
857 | "Number of purge operations executed" | 857 | "Number of purge operations executed." |
858 | ::= { objects 8 } | 858 | ::= { objects 8 } |
859 | 859 | ||
860 | objectsObjPurged OBJECT-TYPE | 860 | objectsObjPurged OBJECT-TYPE |
@@ -1,5 +1,5 @@ | |||
1 | /* This file is part of varnish-mib -*- c -*- | 1 | /* This file is part of varnish-mib -*- c -*- |
2 | Copyright (C) 2014-2015 Sergey Poznyakoff | 2 | Copyright (C) 2014-2018 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 |
diff --git a/src/backend.h b/src/backend.h index d60f613..b13e644 100644 --- a/src/backend.h +++ b/src/backend.h | |||
@@ -5,8 +5,7 @@ typedef struct be_string { | |||
5 | 5 | ||
6 | typedef void (*regfun_t)(be_string_t *, be_string_t *, be_string_t *, void *); | 6 | typedef void (*regfun_t)(be_string_t *, be_string_t *, be_string_t *, void *); |
7 | 7 | ||
8 | void read_defs(const char *str, size_t len, regfun_t regfun, void *d); | 8 | struct vsm; |
9 | void varnish_backend_table_timeout_parser(const char *token, char *line); | ||
10 | struct VSC_point; | 9 | struct VSC_point; |
11 | void backend_register(char const *name, size_t len, char const *param, | 10 | void backend_register(char const *name, size_t len, char const *param, |
12 | const struct VSC_point *vpt); | 11 | const struct VSC_point *vpt); |
@@ -1,5 +1,5 @@ | |||
1 | /* This file is part of varnish-mib -*- c -*- | 1 | /* This file is part of varnish-mib -*- c -*- |
2 | Copyright (C) 2014-2015 Sergey Poznyakoff | 2 | Copyright (C) 2014-2018 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 |
diff --git a/src/belex.l b/src/belex.l index f35f114..bc0bfc0 100644 --- a/src/belex.l +++ b/src/belex.l | |||
@@ -1,3 +1,20 @@ | |||
1 | /* This file is part of varnish-mib | ||
2 | Copyright (C) 2018 Sergey Poznyakoff | ||
3 | |||
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 | ||
6 | the Free Software Foundation; either version 3, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | Varnish-mib is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
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/>. | ||
16 | */ | ||
17 | |||
1 | %option nounput | 18 | %option nounput |
2 | %option noinput | 19 | %option noinput |
3 | 20 | ||
diff --git a/src/modconf.c b/src/modconf.c index 85b2582..64177c1 100644 --- a/src/modconf.c +++ b/src/modconf.c | |||
@@ -1,3 +1,20 @@ | |||
1 | /* This file is part of varnish-mib | ||
2 | Copyright (C) 2018 Sergey Poznyakoff | ||
3 | |||
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 | ||
6 | the Free Software Foundation; either version 3, or (at your option) | ||
7 | any later version. | ||
8 | |||
9 | Varnish-mib is distributed in the hope that it will be useful, | ||
10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
12 | GNU General Public License for more details. | ||
13 | |||
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/>. | ||
16 | */ | ||
17 | |||
1 | #include "varnish_mib.h" | 18 | #include "varnish_mib.h" |
2 | #include <ctype.h> | 19 | #include <ctype.h> |
3 | 20 | ||
diff --git a/src/varnish-mib.8 b/src/varnish-mib.8 index 8d86f18..77912af 100644 --- a/src/varnish-mib.8 +++ b/src/varnish-mib.8 | |||
@@ -1,5 +1,5 @@ | |||
1 | .\" This file is part of Varnish-mib -*- nroff -*- | 1 | .\" This file is part of Varnish-mib -*- nroff -*- |
2 | .\" Copyright (C) 2014-2016 Sergey Poznyakoff | 2 | .\" Copyright (C) 2014-2018 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 |
@@ -13,9 +13,9 @@ | |||
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 "February 2, 2018" "varnish-mib" | 16 | .TH VARNISH-MIB 8 "February 5, 2018" "varnish-mib" |
17 | .SH NAME | 17 | .SH NAME |
18 | varnish\-mib \- net-snmp module for obtaining Varnish Cache statistics | 18 | varnish\-mib \- Net-SNMP module for Varnish Cache monitoring |
19 | .SH SYNOPSIS | 19 | .SH SYNOPSIS |
20 | In \fBsnmpd.conf\fR(5): | 20 | In \fBsnmpd.conf\fR(5): |
21 | .PP | 21 | .PP |
@@ -27,23 +27,49 @@ that provides access to Varnish Cache statistics. The module is | |||
27 | loaded into | 27 | loaded into |
28 | .BR snmpd (8) | 28 | .BR snmpd (8) |
29 | as shown above (actual path can of course differ, depending on how | 29 | as shown above (actual path can of course differ, depending on how |
30 | the package was configured). The module is written for Varnish | 30 | the package was configured). This version is written for Varnish |
31 | version \fB5.\fIX\fR. | 31 | \fB5.2.0\fR. |
32 | .PP | 32 | .PP |
33 | The module obtains most of the data using Varnish API, and \fBvarnishd\fR | 33 | The values in the OID branches |
34 | administrative interface. You should make sure that \fBsnmpd\fR is | 34 | .BR client , |
35 | able to access both data sources. | 35 | .BR total , |
36 | .BR master , | ||
37 | .BR session , | ||
38 | .BR threads ", and " | ||
39 | .B objects | ||
40 | are obtained from Varnish API. | ||
36 | .PP | 41 | .PP |
37 | The user \fBsnmpd\fR runs as should be able to read contents of the | 42 | The OID branches |
38 | \fB/var/lib/varnish/\fIHOSTNAME\fB/_.vsm_mgt\fR directory and read | 43 | .BR backend , |
39 | files located in it. It must also have read permission on the varnish | 44 | .BR bans ", and " |
40 | secret file. | 45 | .B vcl |
46 | are obtained using \fBvarnishd\fR administrative interface (similar | ||
47 | to | ||
48 | .BR varnishadm (8)). | ||
49 | .PP | ||
50 | To retrieve this information, the module must | ||
51 | have enough permissions to scan the Varnish management directory and | ||
52 | read files located in it. This directory is normally named | ||
53 | \fB/var/lib/varnish/\fIHOSTNAME\fB/_.vsm_mgt\fR, where \fIHOSTNAME\fR | ||
54 | stands for the server's hostname. Unless | ||
55 | .BR snmpd (8) | ||
56 | is run as root, special measures should be undertaken in order to | ||
57 | grant access rights. For example, if the daemon runs as user | ||
58 | \fBsnmp\fR, running the following two commands after starting | ||
59 | \fBvarnishd\fR will do the trick: | ||
60 | |||
61 | .EX | ||
62 | setfacl -m u:snmp:rx /var/lib/varnish/$(hostname)/_.vsm_mgt | ||
63 | setfacl -m u:snmp:r /var/lib/varnish/$(hostname)/_.vsm_mgt/* | ||
64 | .EE | ||
65 | .PP | ||
66 | |||
41 | .SH CONFIGURATION OPTIONS | 67 | .SH CONFIGURATION OPTIONS |
42 | Configuration statements specific to | 68 | Configuration statements specific to |
43 | .B varnish\-mib | 69 | .B varnish\-mib |
44 | must appear in the | 70 | must appear in the |
45 | .B snmpd.conf | 71 | .B snmpd.conf |
46 | file below the | 72 | file, after the |
47 | .B dlmod | 73 | .B dlmod |
48 | statement that loads the module. | 74 | statement that loads the module. |
49 | .PP | 75 | .PP |
@@ -64,36 +90,38 @@ Update interval for \fBbackendTable\fR. Default is 5 seconds. | |||
64 | Sets timeout for I/O operations with Varnish administrative port. | 90 | Sets timeout |