diff options
author | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-11-28 10:20:18 +0200 |
---|---|---|
committer | Sergey Poznyakoff <gray@gnu.org.ua> | 2014-11-28 10:20:18 +0200 |
commit | 38cd993057ababdbf6b32aab35f834363647b7d8 (patch) | |
tree | bd8f576b2a833b5a597b7a8dd7309f5ee5413180 /src | |
parent | 443bc6290a6a90b2c74612d7d68945e375af0ec3 (diff) | |
download | varnish-mib-38cd993057ababdbf6b32aab35f834363647b7d8.tar.gz varnish-mib-38cd993057ababdbf6b32aab35f834363647b7d8.tar.bz2 |
Remove banTableTimeout oid.
Diffstat (limited to 'src')
-rw-r--r-- | src/VARNISH-MIB.txt | 13 | ||||
-rw-r--r-- | src/ban.c | 14 | ||||
-rw-r--r-- | src/varnish-mib.8 | 14 | ||||
-rw-r--r-- | src/varnish_mib.mib2c | 8 |
4 files changed, 6 insertions, 43 deletions
diff --git a/src/VARNISH-MIB.txt b/src/VARNISH-MIB.txt index bb6075d..71556c4 100644 --- a/src/VARNISH-MIB.txt +++ b/src/VARNISH-MIB.txt | |||
@@ -17,20 +17,20 @@ IMPORTS | |||
17 | InetAddressIPv4, InetAddressIPv6, InetPortNumber, | 17 | InetAddressIPv4, InetAddressIPv6, InetPortNumber, |
18 | FROM INET-ADDRESS-MIB | 18 | FROM INET-ADDRESS-MIB |
19 | OBJECT-GROUP, MODULE-COMPLIANCE | 19 | OBJECT-GROUP, MODULE-COMPLIANCE |
20 | FROM SNMPv2-CONF; | 20 | FROM SNMPv2-CONF; |
21 | 21 | ||
22 | varnishMIB MODULE-IDENTITY | 22 | varnishMIB MODULE-IDENTITY |
23 | LAST-UPDATED "201411280136Z" | 23 | LAST-UPDATED "201411280837Z" |
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 "201411280136Z" | 30 | REVISION "201411280837Z" |
31 | DESCRIPTION | 31 | DESCRIPTION |
32 | "Second revision." | 32 | "Second revision." |
33 | ::= { varnish 0 } | 33 | ::= { varnish 0 } |
34 | 34 | ||
35 | varnish OBJECT IDENTIFIER ::= { enterprises 33043 6 1 } | 35 | varnish OBJECT IDENTIFIER ::= { enterprises 33043 6 1 } |
36 | client OBJECT IDENTIFIER ::= { varnish 1 } | 36 | client OBJECT IDENTIFIER ::= { varnish 1 } |
@@ -780,21 +780,12 @@ banExpression OBJECT-TYPE | |||
780 | MAX-ACCESS read-only | 780 | MAX-ACCESS read-only |
781 | STATUS current | 781 | STATUS current |
782 | DESCRIPTION | 782 | DESCRIPTION |
783 | "VCL expression of the ban." | 783 | "VCL expression of the ban." |
784 | ::= { varnishBanEntry 4 } | 784 | ::= { varnishBanEntry 4 } |
785 | 785 | ||
786 | banTableTimeout OBJECT-TYPE | ||
787 | SYNTAX Unsigned32 | ||
788 | MAX-ACCESS read-write | ||
789 | STATUS current | ||
790 | DESCRIPTION | ||
791 | "If banTable content is cached, this variable keeps | ||
792 | the time in seconds after which the table is reloaded. | ||
793 | Setting it changes that value." | ||
794 | ::= { agent 1 } | ||
795 | -- | 786 | -- |
796 | -- Groups and Compliance | 787 | -- Groups and Compliance |
797 | -- | 788 | -- |
798 | varnishConfs OBJECT IDENTIFIER ::= { varnish 100 } | 789 | varnishConfs OBJECT IDENTIFIER ::= { varnish 100 } |
799 | varnishGroups OBJECT IDENTIFIER ::= { varnishConfs 1 } | 790 | varnishGroups OBJECT IDENTIFIER ::= { varnishConfs 1 } |
800 | varnishCompl OBJECT IDENTIFIER ::= { varnishConfs 2 } | 791 | varnishCompl OBJECT IDENTIFIER ::= { varnishConfs 2 } |
@@ -96,26 +96,12 @@ varnish_mib_timeout_parser(const char *token, char *line, unsigned *retval) | |||
96 | void | 96 | void |
97 | varnish_ban_table_timeout_parser(const char *token, char *line) | 97 | varnish_ban_table_timeout_parser(const char *token, char *line) |
98 | { | 98 | { |
99 | varnish_mib_timeout_parser(token, line, &banTable_timeout); | 99 | varnish_mib_timeout_parser(token, line, &banTable_timeout); |
100 | } | 100 | } |
101 | 101 | ||
102 | int | ||
103 | varnish_ban_table_timeout_set(netsnmp_agent_request_info *reqinfo, | ||
104 | netsnmp_request_info *requests, | ||
105 | struct VSM_data *vd) | ||
106 | { | ||
107 | if (*requests->requestvb->val.integer < 0 || | ||
108 | *requests->requestvb->val.integer > UINT_MAX) | ||
109 | return SNMP_ERR_BADVALUE; | ||
110 | DEBUGMSGTL(("varnish_ban", "setting banTable timeout %ld\n", | ||
111 | *requests->requestvb->val.integer)); | ||
112 | banTable_timeout = *requests->requestvb->val.integer; | ||
113 | return SNMP_ERR_NOERROR; | ||
114 | } | ||
115 | |||
116 | /* | 102 | /* |
117 | * create a new row in the table | 103 | * create a new row in the table |
118 | */ | 104 | */ |
119 | static struct banTable_entry * | 105 | static struct banTable_entry * |
120 | create_entry(netsnmp_tdata *table_data, long idx, struct banTable_entry *ent) | 106 | create_entry(netsnmp_tdata *table_data, long idx, struct banTable_entry *ent) |
121 | { | 107 | { |
diff --git a/src/varnish-mib.8 b/src/varnish-mib.8 index c2d37cd..05fa177 100644 --- a/src/varnish-mib.8 +++ b/src/varnish-mib.8 | |||
@@ -51,15 +51,12 @@ The following configuration statements are available: | |||
51 | To create \fBbanTable\fR (see below), \fBvarnish_mib\fR connects to | 51 | To create \fBbanTable\fR (see below), \fBvarnish_mib\fR connects to |
52 | \fBvarnish\fR administration port and issues the \fBban.list\fR | 52 | \fBvarnish\fR administration port and issues the \fBban.list\fR |
53 | command. To minimize the performance impact, the information obtained | 53 | command. To minimize the performance impact, the information obtained |
54 | is cached for a predefined amount of time (60 seconds by default). | 54 | is cached for a predefined amount of time (60 seconds by default). |
55 | This amount (in seconds) is configured by \fBvarnishBanTableTimeout\fR | 55 | This amount (in seconds) is configured by \fBvarnishBanTableTimeout\fR |
56 | statement. | 56 | statement. |
57 | |||
58 | It can also be set remotely by assigning new value to the | ||
59 | \fBbanTableTimeout\fR oid. | ||
60 | .TP | 57 | .TP |
61 | \fBvarnishCLIPortTimeout\fR \fINUMBER\fR | 58 | \fBvarnishCLIPortTimeout\fR \fINUMBER\fR |
62 | Sets timeout for I/O operations with Varnish administrative port. | 59 | Sets timeout for I/O operations with Varnish administrative port. |
63 | Default is 5 seconds. | 60 | Default is 5 seconds. |
64 | .TP | 61 | .TP |
65 | \fBvarnishBackendTableTimeout\fR \fINUMBER\fR | 62 | \fBvarnishBackendTableTimeout\fR \fINUMBER\fR |
@@ -332,20 +329,17 @@ in the varnish cache affected by that ban. | |||
332 | VCL expression of the ban. | 329 | VCL expression of the ban. |
333 | .RE | 330 | .RE |
334 | 331 | ||
335 | Notice that for performance reasons, the ban table is cached, so the | 332 | Notice that for performance reasons, the ban table is cached, so the |
336 | total number of rows in the \fBbanTable\fR may diverge from the value | 333 | total number of rows in the \fBbanTable\fR may diverge from the value |
337 | of \fBbansTotal\fR variable. The default update interval is 60 | 334 | of \fBbansTotal\fR variable. The default update interval is 60 |
338 | seconds. It can be configured either in the \fBsnmpd.conf\fR file | 335 | seconds. It can be configured in the \fBsnmpd.conf\fR file |
339 | (see the \fBvarnishBanTableTimeout\fR statement above), or via | 336 | (see the \fBvarnishBanTableTimeout\fR statement above). |
340 | the \fBbanTableTimeout\fR variable. | ||
341 | .SS Branch \(dqagent\(dq | 337 | .SS Branch \(dqagent\(dq |
342 | .TP | 338 | The \fBagent\fR branch is reserved for OIDs for |
343 | .B banTableTimeout | 339 | implementation-specific management. It is not used currently. |
344 | Update interval for the \fBbanTable\fR cache. If set, it takes effect | ||
345 | immediately. | ||
346 | .SH "SEE ALSO" | 340 | .SH "SEE ALSO" |
347 | .BR snmpd.conf (5), | 341 | .BR snmpd.conf (5), |
348 | .BR snmpd (8), | 342 | .BR snmpd (8), |
349 | .BR varnish (7), | 343 | .BR varnish (7), |
350 | .BR varnishstat (1). | 344 | .BR varnishstat (1). |
351 | .SH AUTHORS | 345 | .SH AUTHORS |
diff --git a/src/varnish_mib.mib2c b/src/varnish_mib.mib2c index c120b0e..5d9cc6b 100644 --- a/src/varnish_mib.mib2c +++ b/src/varnish_mib.mib2c | |||
@@ -98,16 +98,12 @@ $vars{'varnish_translate'} = sub { | |||
98 | bansLurkerTestTested => [ 'MAIN', 'bans_lurker_tests_tested' ], | 98 | bansLurkerTestTested => [ 'MAIN', 'bans_lurker_tests_tested' ], |
99 | bansLurkerObjKilled => [ 'MAIN', 'bans_lurker_obj_killed' ], | 99 | bansLurkerObjKilled => [ 'MAIN', 'bans_lurker_obj_killed' ], |
100 | bansDups => [ 'MAIN', 'bans_dups' ], | 100 | bansDups => [ 'MAIN', 'bans_dups' ], |
101 | bansLurkerContention => [ 'MAIN', 'bans_lurker_contention' ], | 101 | bansLurkerContention => [ 'MAIN', 'bans_lurker_contention' ], |
102 | bansPersistedBytes => [ 'MAIN', 'bans_persisted_bytes' ], | 102 | bansPersistedBytes => [ 'MAIN', 'bans_persisted_bytes' ], |
103 | bansPersistedFragmentation => [ 'MAIN', 'bans_persisted_fragmentation' ], | 103 | bansPersistedFragmentation => [ 'MAIN', 'bans_persisted_fragmentation' ], |
104 | |||
105 | banTableTimeout => [ 'VAR', 'banTable_timeout', | ||
106 | { varnish_set_action => 'varnish_ban_table_timeout_set' | ||
107 | } ], | ||
108 | 104 | ||
109 | ); | 105 | ); |
110 | 106 | ||
111 | my $r = $trans{$name}; | 107 | my $r = $trans{$name}; |
112 | if (!defined($r)) { | 108 | if (!defined($r)) { |
113 | print STDERR "no translation for $name!\n"; | 109 | print STDERR "no translation for $name!\n"; |
@@ -185,16 +181,12 @@ int varnish_ban(netsnmp_agent_request_info *reqinfo, | |||
185 | int varnish_mib_timeout_parser(const char *token, char *line, | 181 | int varnish_mib_timeout_parser(const char *token, char *line, |
186 | unsigned *retval); | 182 | unsigned *retval); |
187 | 183 | ||
188 | void varnish_ban_table_timeout_parser(const char *token, char *line); | 184 | void varnish_ban_table_timeout_parser(const char *token, char *line); |
189 | void varnish_vcli_timeout_parser(const char *token, char *line); | 185 | void varnish_vcli_timeout_parser(const char *token, char *line); |
190 | 186 | ||
191 | int varnish_ban_table_timeout_set(netsnmp_agent_request_info *reqinfo, | ||
192 | netsnmp_request_info *requests, | ||
193 | struct VSM_data *vd); | ||
194 | |||
195 | void varnish_backend_table_timeout_parser(const char *token, char *line); | 187 | void varnish_backend_table_timeout_parser(const char *token, char *line); |
196 | 188 | ||
197 | @open ${name}@ | 189 | @open ${name}@ |
198 | /* THIS FILE IS GENERATED AUTOMATICALLY. PLEASE DO NOT EDIT. */ | 190 | /* THIS FILE IS GENERATED AUTOMATICALLY. PLEASE DO NOT EDIT. */ |
199 | 191 | ||
200 | #include "varnish_mib.h" | 192 | #include "varnish_mib.h" |