summaryrefslogtreecommitdiffabout
path: root/src
authorSergey Poznyakoff <gray@gnu.org.ua>2014-11-17 19:58:14 (GMT)
committer Sergey Poznyakoff <gray@gnu.org.ua>2014-11-17 19:58:14 (GMT)
commitf0671d1bc19592e5b659959920b51e3da05de79f (patch) (unidiff)
treeb796d82e0ffe0f72fe0fc5b89ea7336653c826d7 /src
parent05fa31b7d7d1f23dde152341fc2f8149e66c40a5 (diff)
downloadvarnish-mib-f0671d1bc19592e5b659959920b51e3da05de79f.tar.gz
varnish-mib-f0671d1bc19592e5b659959920b51e3da05de79f.tar.bz2
Check if vsm is abandoned, reopen if so.
Diffstat (limited to 'src') (more/less context) (ignore whitespace changes)
-rw-r--r--src/varnish_mib.mib2c19
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
@@ -116,19 +116,26 @@ handle_$i(netsnmp_mib_handler *handler,
116 &{$vars{'varnish_translate'}}($vars{'i'}); 116 &{$vars{'varnish_translate'}}($vars{'i'});
117 @endperl@ 117 @endperl@
118 if (reqinfo->mode == MODE_GET) { 118 if (reqinfo->mode == MODE_GET) {
119 struct VSC_C_main const *st = VSC_Main(vd, NULL); 119 struct VSC_C_main const *st;
120
121 if (VSM_Abandoned(vd)) {
122 VSM_Close(vd);
123 VSM_Open(vd);
124 }
125
126 st = VSC_Main(vd, NULL);
120 if (!st) 127 if (!st)
121 return SNMP_ERR_NOSUCHNAME; 128 return SNMP_ERR_NOSUCHNAME;
122 snmp_set_var_typed_value(requests->requestvb, $i.type, 129 snmp_set_var_typed_value(requests->requestvb, $i.type,
123 &st->$varnish_member, 130 &st->$varnish_member,
124 sizeof(st->$varnish_member)); 131 sizeof(st->$varnish_member));
125 } else { 132 } else {
126 snmp_log(LOG_ERR, "unknown mode (%d) in handle_${i}\n", 133 snmp_log(LOG_ERR, "unknown mode (%d) in handle_${i}\n",
127 reqinfo->mode ); 134 reqinfo->mode );
128 return SNMP_ERR_GENERR; 135 return SNMP_ERR_GENERR;
129 } 136 }
130 137
131 return SNMP_ERR_NOERROR; 138 return SNMP_ERR_NOERROR;
132} 139}
133@end@ 140@end@
134 141
@@ -140,7 +147,7 @@ init_$modulename(void)
140 const oid ${i}_oid[] = { $i.commaoid }; 147 const oid ${i}_oid[] = { $i.commaoid };
141 @end@ 148 @end@
142 149
143 DEBUGMSGTL(("$name", "Initializing\n")); 150 DEBUGMSGTL(("$modulename", "Initializing\n"));
144 151
145 @foreach $i scalar@ 152 @foreach $i scalar@
146 netsnmp_register_scalar( 153 netsnmp_register_scalar(

Return to:

Send suggestions and report system problems to the System administrator.