diff options
author | Sergey Poznyakoff <gray@nxc.no> | 2018-02-01 21:36:41 +0100 |
---|---|---|
committer | Sergey Poznyakoff <gray@nxc.no> | 2018-02-01 21:36:41 +0100 |
commit | 8bba300e4118da5737b2f015028a9ca425e83628 (patch) | |
tree | 7de98c55cf47c87d17f0404c44f91f879eafb898 /src/varnish_mib.mib2c | |
parent | 85f908426e444a596b979a9569bf83fadfa5ace1 (diff) | |
download | varnish-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/varnish_mib.mib2c')
-rw-r--r-- | src/varnish_mib.mib2c | 33 |
1 files changed, 28 insertions, 5 deletions
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(); |