summaryrefslogtreecommitdiffabout
path: root/src
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 /src
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 (limited to 'src') (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
@@ -39,3 +39,3 @@ 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
@@ -47,2 +47,3 @@ NET_SNMP_EXLIBS = `$(NET_SNMP_CONFIG) --external-libs`
NET_SNMP_MIBDIRS = `net-snmp-config --mibdirs`
+NET_SNMP_MIBS = `net-snmp-config --default-mibs`
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
@@ -22,3 +22,3 @@ IMPORTS
varnishMIB MODULE-IDENTITY
- LAST-UPDATED "201509250838Z"
+ LAST-UPDATED "201802012132Z"
ORGANIZATION "Shared Autonomous sYstems"
@@ -29,3 +29,3 @@ varnishMIB MODULE-IDENTITY
"This MIB module defines objects for Varnish reverse web proxy."
- REVISION "201509250838Z"
+ REVISION "201802012132Z"
DESCRIPTION
@@ -43,2 +43,4 @@ bans OBJECT IDENTIFIER ::= { varnish 7 }
agent OBJECT IDENTIFIER ::= { varnish 8 }
+objects OBJECT IDENTIFIER ::= { varnish 9 }
+vcl OBJECT IDENTIFIER ::= { varnish 10 }
@@ -785,2 +787,132 @@ banExpression OBJECT-TYPE
+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 }
+
--
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
@@ -100,3 +100,19 @@ $vars{'varnish_translate_table'} = {
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' ],
};
@@ -239,2 +255,3 @@ varnish_get_vsm_data()
@foreach $i scalar@
+/* COMMX $i */
@startperl@
@@ -242,2 +259,3 @@ varnish_get_vsm_data()
@endperl@
+@if $varnish_type ne 'NULL'@
$varnish_if
@@ -304,6 +322,6 @@ handle_$i(netsnmp_mib_handler *handler,
@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,
@@ -312,3 +330,3 @@ handle_$i(netsnmp_mib_handler *handler,
@else@
- uint64_t val;
+ uint64_t val = $varnish_member;
snmp_set_var_typed_value(requests->requestvb, $i.type,
@@ -390,2 +408,3 @@ $varnish_endif
@end@
+@end@
@@ -576,2 +595,3 @@ init_$modulename(void)
@endperl@
+ @if $varnish_type ne 'NULL'@
$varnish_if
@@ -579,2 +599,3 @@ $varnish_if
$varnish_endif
+ @end@
@end@
@@ -603,2 +624,3 @@ $varnish_endif
@endperl@
+ @if $varnish_type ne 'NULL'@
$varnish_if
@@ -614,3 +636,4 @@ $varnish_if
));
-$varnish_endif
+$varnish_endif
+ @end@
@end@

Return to:

Send suggestions and report system problems to the System administrator.