diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/varnish_mib.mib2c | 19 |
1 files changed, 13 insertions, 6 deletions
diff --git a/src/varnish_mib.mib2c b/src/varnish_mib.mib2c index 6df10ec..af56a0e 100644 --- a/src/varnish_mib.mib2c +++ b/src/varnish_mib.mib2c @@ -113,37 +113,44 @@ handle_$i(netsnmp_mib_handler *handler, uint32_t val; @startperl@ &{$vars{'varnish_translate'}}($vars{'i'}); @endperl@ if (reqinfo->mode == MODE_GET) { - struct VSC_C_main const *st = VSC_Main(vd, NULL); + struct VSC_C_main const *st; + + if (VSM_Abandoned(vd)) { + VSM_Close(vd); + VSM_Open(vd); + } + + st = VSC_Main(vd, NULL); if (!st) return SNMP_ERR_NOSUCHNAME; snmp_set_var_typed_value(requests->requestvb, $i.type, &st->$varnish_member, sizeof(st->$varnish_member)); } else { - snmp_log(LOG_ERR, "unknown mode (%d) in handle_${i}\n", - reqinfo->mode ); - return SNMP_ERR_GENERR; + snmp_log(LOG_ERR, "unknown mode (%d) in handle_${i}\n", + reqinfo->mode ); + return SNMP_ERR_GENERR; } - return SNMP_ERR_NOERROR; + return SNMP_ERR_NOERROR; } @end@ /** Initializes the $name module */ void init_$modulename(void) { @foreach $i scalar@ const oid ${i}_oid[] = { $i.commaoid }; @end@ - DEBUGMSGTL(("$name", "Initializing\n")); + DEBUGMSGTL(("$modulename", "Initializing\n")); @foreach $i scalar@ netsnmp_register_scalar( netsnmp_create_handler_registration("$i", handle_$i, ${i}_oid, OID_LENGTH(${i}_oid), HANDLER_CAN_RONLY)); |