summaryrefslogtreecommitdiffabout
authorSergey Poznyakoff <gray@nxc.no>2018-02-01 20:36:41 (GMT)
committer Sergey Poznyakoff <gray@nxc.no>2018-02-01 20:36:41 (GMT)
commit8bba300e4118da5737b2f015028a9ca425e83628 (patch) (side-by-side diff)
tree7de98c55cf47c87d17f0404c44f91f879eafb898
parent85f908426e444a596b979a9569bf83fadfa5ace1 (diff)
downloadvarnish-mib-8bba300e4118da5737b2f015028a9ca425e83628.tar.gz
varnish-mib-8bba300e4118da5737b2f015028a9ca425e83628.tar.bz2
Add new object IDs as per https://puszcza.gnu.org.ua/bugs/?362
* src/Makefile.am: Make sure VARNISH-MIB.txt is read from the src directory. * src/VARNISH-MIB.txt: Add new mibs. * src/varnish_mib.mib2c: Add new objects. Make sure objects marked with varnish_type NULL will never be returned.
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--src/Makefile.am3
-rw-r--r--src/VARNISH-MIB.txt136
-rw-r--r--src/varnish_mib.mib2c33
3 files changed, 164 insertions, 8 deletions
diff --git a/src/Makefile.am b/src/Makefile.am
index 3a7f12a..3b5547b 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -37,7 +37,7 @@ BUILT_SOURCES = \
varnish_mib.c varnish_mib.h: varnish_mib.mib2c VARNISH-MIB.txt
.mib2c.c:
- MIBDIRS=${top_srcdir}/src:${NET_SNMP_MIBDIRS} MIBS="+VARNISH-MIB" \
+ MIBDIRS=${top_srcdir}/src:${NET_SNMP_MIBDIRS} MIBS="VARNISH-MIB:${NET_SNMP_MIBS}" \
mib2c -c $< -f $@ varnish
#NET_SNMP_INCLUDES = `$(NET_SNMP_CONFIG) --cflags`
@@ -45,6 +45,7 @@ varnish_mib.c varnish_mib.h: varnish_mib.mib2c VARNISH-MIB.txt
NET_SNMP_LIBS = `$(NET_SNMP_CONFIG) --libs`
NET_SNMP_EXLIBS = `$(NET_SNMP_CONFIG) --external-libs`
NET_SNMP_MIBDIRS = `net-snmp-config --mibdirs`
+NET_SNMP_MIBS = `net-snmp-config --default-mibs`
AM_LDFLAGS = \
-module \
diff --git a/src/VARNISH-MIB.txt b/src/VARNISH-MIB.txt
index 59a9d42..8d60477 100644
--- a/src/VARNISH-MIB.txt
+++ b/src/VARNISH-MIB.txt
@@ -20,14 +20,14 @@ IMPORTS
FROM SNMPv2-CONF;
varnishMIB MODULE-IDENTITY
- LAST-UPDATED "201509250838Z"
+ LAST-UPDATED "201802012132Z"
ORGANIZATION "Shared Autonomous sYstems"
CONTACT-INFO "Morten Hermanrud <mhe@say.no>
Sergey Poznyakoff <gray@gnu.org>
"
DESCRIPTION
"This MIB module defines objects for Varnish reverse web proxy."
- REVISION "201509250838Z"
+ REVISION "201802012132Z"
DESCRIPTION
"Second revision."
::= { varnish 0 }
@@ -41,6 +41,8 @@ session OBJECT IDENTIFIER ::= { varnish 5 }
threads OBJECT IDENTIFIER ::= { varnish 6 }
bans OBJECT IDENTIFIER ::= { varnish 7 }
agent OBJECT IDENTIFIER ::= { varnish 8 }
+objects OBJECT IDENTIFIER ::= { varnish 9 }
+vcl OBJECT IDENTIFIER ::= { varnish 10 }
clientAcceptedConnections OBJECT-TYPE
SYNTAX Counter64
@@ -783,6 +785,136 @@ banExpression OBJECT-TYPE
"VCL expression of the ban."
::= { varnishBanEntry 4 }
+objectsCount OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Approximate number of HTTP objects (headers + body,
+ if present) in the cache."
+ ::= { objects 1 }
+
+objectsVampire OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of unresurrected objects."
+ ::= { objects 2 }
+
+objectsCore OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "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."
+ ::= { objects 3 }
+
+objectsHead OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Approximate number of different hash entries in the cache."
+ ::= { objects 4 }
+
+objectsExpired OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of objects that expired from cache because of old age."
+ ::= { objects 5 }
+
+objectsLRUNuked OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "How many objects have been forcefully evicted from
+ storage to make room for a new object."
+ ::= { objects 6 }
+
+objectsLRUMoved OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of move operations done on the LRU list."
+ ::= { objects 7 }
+
+objectsPurges OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of purge operations executed"
+ ::= { objects 8 }
+
+objectsObjPurged OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of purged objects."
+ ::= { objects 9 }
+
+objectsGzip OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of gzip operations."
+ ::= { objects 10 }
+
+objectsGunzip OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of gunzip operations."
+ ::= { objects 11 }
+
+
+--
+-- VCL statistics
+--
+
+vclTotal OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of loaded VCLs in total."
+ ::= { vcl 1 }
+
+vclAvail OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of VCLs available."
+ ::= { vcl 2 }
+
+vclDiscard OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of discarded VCLs."
+ ::= { vcl 3 }
+
+vclFail OBJECT-TYPE
+ SYNTAX Counter64
+ MAX-ACCESS read-only
+ STATUS current
+ DESCRIPTION
+ "Number of VCL failures"
+ ::= { vcl 4 }
+
--
-- Groups and Compliance
--
diff --git a/src/varnish_mib.mib2c b/src/varnish_mib.mib2c
index a458723..155df42 100644
--- a/src/varnish_mib.mib2c
+++ b/src/varnish_mib.mib2c
@@ -98,7 +98,23 @@ $vars{'varnish_translate_table'} = {
bansLurkerContention => [ 'DICT', 'MAIN.bans_lurker_contention' ],
bansPersistedBytes => [ 'DICT', 'MAIN.bans_persisted_bytes' ],
bansPersistedFragmentation => [ 'DICT', 'MAIN.bans_persisted_fragmentation' ],
-
+
+ objectsCount => [ 'DICT', 'MAIN.n_object' ],
+ objectsVampire => [ 'DICT', 'MAIN.n_vampireobject' ],
+ objectsCore => [ 'DICT', 'MAIN.n_objectcore' ],
+ objectsHead => [ 'DICT', 'MAIN.n_objecthead' ],
+ objectsExpired => [ 'DICT', 'MAIN.n_expired' ],
+ objectsLRUNuked => [ 'DICT', 'MAIN.n_lru_nuked' ],
+ objectsLRUMoved => [ 'DICT', 'MAIN.n_lru_moved' ],
+ objectsPurges => [ 'DICT', 'MAIN.n_purges' ],
+ objectsObjPurged => [ 'DICT', 'MAIN.n_obj_purged' ],
+ objectsGzip => [ 'DICT', 'MAIN.n_gzip' ],
+ objectsGunzip => [ 'DICT', 'MAIN.n_gunzip' ],
+
+ vclTotal => [ 'DICT', 'MAIN.n_vcl' ],
+ vclAvail => [ 'DICT', 'MAIN.n_vcl_avail' ],
+ vclDiscard => [ 'DICT', 'MAIN.n_vcl_discard' ],
+ vclFail => [ 'DICT', 'MAIN.vcl_fail' ],
};
$vars{'varnish_translate'} = sub {
@@ -237,9 +253,11 @@ varnish_get_vsm_data()
*/
@foreach $i scalar@
+/* COMMX $i */
@startperl@
&{$vars{'varnish_translate'}}($vars{'i'});
@endperl@
+@if $varnish_type ne 'NULL'@
$varnish_if
static int
handle_$i(netsnmp_mib_handler *handler,
@@ -302,15 +320,15 @@ handle_$i(netsnmp_mib_handler *handler,
snmp_set_var_typed_value(requests->requestvb, $i.type,
&$varnish_member, sizeof($varnish_member));
@end@
- @elsif $varnish_type eq 'NULL'@
+ @elsif $varnish_type eq 'NUMBER'@
{
@if $i.type eq 'ASN_COUNTER64'@
- struct counter64 ctr = { 0, 0};
+ struct counter64 ctr = { ($varnish_member>>32)&0xffffffff, ($varnish_member)&0xffffffff };
snmp_set_var_typed_value(requests->requestvb, $i.type,
&ctr,
sizeof(ctr));
@else@
- uint64_t val;
+ uint64_t val = $varnish_member;
snmp_set_var_typed_value(requests->requestvb, $i.type,
&val,
sizeof(val));
@@ -388,6 +406,7 @@ handle_$i(netsnmp_mib_handler *handler,
}
$varnish_endif
@end@
+@end@
@foreach $i table@
## Determine the first/last column names
@@ -574,9 +593,11 @@ init_$modulename(void)
@startperl@
&{$vars{'varnish_translate'}}($vars{'i'});
@endperl@
+ @if $varnish_type ne 'NULL'@
$varnish_if
const oid ${i}_oid[] = { $i.commaoid };
$varnish_endif
+ @end@
@end@
DEBUGMSGTL(("$modulename", "Initializing\n"));
@@ -601,6 +622,7 @@ $varnish_endif
@startperl@
&{$vars{'varnish_translate'}}($vars{'i'});
@endperl@
+ @if $varnish_type ne 'NULL'@
$varnish_if
netsnmp_register_scalar(
netsnmp_create_handler_registration("$i", handle_$i,
@@ -612,7 +634,8 @@ $varnish_if
HANDLER_CAN_RWRITE
@end@
));
-$varnish_endif
+$varnish_endif
+ @end@
@end@
@foreach $i table@
initialize_table_$i();

Return to:

Send suggestions and report system problems to the System administrator.