snmp_sess_error (host->sess_handle, NULL, NULL, &errstr);
- ERROR ("snmp plugin: snmp_sess_close failed: %s",
- (errstr == NULL) ? "Unknown problem" : errstr);
+ ERROR ("snmp plugin: host %s: snmp_sess_close failed: %s",
+ host->name, (errstr == NULL) ? "Unknown problem" : errstr);
sfree (errstr);
}
snmp_error (&sess, NULL, NULL, &errstr);
- ERROR ("snmp plugin: snmp_sess_open failed: %s",
- (errstr == NULL) ? "Unknown problem" : errstr);
+ ERROR ("snmp plugin: host %s: snmp_sess_open failed: %s",
+ host->name, (errstr == NULL) ? "Unknown problem" : errstr);
sfree (errstr);
}
} /* void csnmp_host_open_session */
DEBUG ("snmp plugin: csnmp_read_table (host = %s, data = %s)",
host->name, data->name);
+ if (host->sess_handle == NULL)
+ {
+ DEBUG ("snmp plugin: csnmp_read_table: host->sess_handle == NULL");
+ return (-1);
+ }
+
ds = plugin_get_ds (data->type);
if (!ds)
{
char *errstr = NULL;
snmp_sess_error (host->sess_handle, NULL, NULL, &errstr);
- ERROR ("snmp plugin: snmp_sess_synch_response failed: %s",
- (errstr == NULL) ? "Unknown problem" : errstr);
+ ERROR ("snmp plugin: host %s: snmp_sess_synch_response failed: %s",
+ host->name, (errstr == NULL) ? "Unknown problem" : errstr);
csnmp_host_close_session (host);
status = -1;
DEBUG ("snmp plugin: csnmp_read_value (host = %s, data = %s)",
host->name, data->name);
+ if (host->sess_handle == NULL)
+ {
+ DEBUG ("snmp plugin: csnmp_read_table: host->sess_handle == NULL");
+ return (-1);
+ }
+
ds = plugin_get_ds (data->type);
if (!ds)
{
char *errstr = NULL;
snmp_sess_error (host->sess_handle, NULL, NULL, &errstr);
- ERROR ("snmp plugin: snmp_sess_synch_response failed: %s",
- (errstr == NULL) ? "Unknown problem" : errstr);
+ ERROR ("snmp plugin: host %s: snmp_sess_synch_response failed: %s",
+ host->name, (errstr == NULL) ? "Unknown problem" : errstr);
csnmp_host_close_session (host);
sfree (errstr);