summaryrefslogtreecommitdiffabout
path: root/src/varnish_mib.mib2c
Side-by-side diff
Diffstat (limited to 'src/varnish_mib.mib2c') (more/less context) (ignore whitespace changes)
-rw-r--r--src/varnish_mib.mib2c33
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();

Return to:

Send suggestions and report system problems to the System administrator.