Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 21 additions & 21 deletions poller.c
Original file line number Diff line number Diff line change
Expand Up @@ -2153,37 +2153,37 @@ void get_system_information(host_t *host, MYSQL *mysql, int system) {
SPINE_LOG_MEDIUM(("Device[%d] Updating Full System Information Table", host->id));
}

SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.1.0');", host->id));
poll_result = snmp_get(host, ".1.3.6.1.2.1.1.1.0");
SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.1.0'); [complete]", host->id));
SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.1.0');", host->id));
poll_result = snmp_get_allow_fail(host, ".1.3.6.1.2.1.1.1.0");
SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.1.0'); [complete]", host->id));

if (poll_result) {
db_escape(mysql, host->snmp_sysDescr, sizeof(host->snmp_sysDescr), poll_result);
SPINE_FREE(poll_result);
}

SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.2.0');", host->id));
poll_result = snmp_get(host, ".1.3.6.1.2.1.1.2.0");
SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.2.0'); [complete]", host->id));
SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.2.0');", host->id));
poll_result = snmp_get_allow_fail(host, ".1.3.6.1.2.1.1.2.0");
SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.2.0'); [complete]", host->id));

if (poll_result) {
db_escape(mysql, host->snmp_sysObjectID, sizeof(host->snmp_sysObjectID), poll_result);
SPINE_FREE(poll_result);
}

// Get the legacy system uptime instance first
SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.3.0');", host->id));
poll_result = snmp_get(host, ".1.3.6.1.2.1.1.3.0");
SPINE_LOG_DEVDBG(("DEVDGB: Device[%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.3.0'); [complete]", host->id));
SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.3.0');", host->id));
poll_result = snmp_get_allow_fail(host, ".1.3.6.1.2.1.1.3.0");
SPINE_LOG_DEVDBG(("DEVDGB: Device[%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.3.0'); [complete]", host->id));

if (poll_result && is_numeric(poll_result)) {
host->snmp_sysUpTimeInstance = atoll(poll_result);
SPINE_FREE(poll_result);

// Attempt to get the more modern version
SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get(host, '.1.3.6.1.6.3.10.2.1.3.0');", host->id));
poll_result = snmp_get_base(host, ".1.3.6.1.6.3.10.2.1.3.0", false);
SPINE_LOG_DEVDBG(("DEVDGB: Device[%d] poll_result = snmp_get(host, '.1.3.6.1.6.3.10.2.1.3.0'); [complete]", host->id));
SPINE_LOG_DEVDBG(("DEVDBG: Device[%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.6.3.10.2.1.3.0');", host->id));
poll_result = snmp_get_allow_fail(host, ".1.3.6.1.6.3.10.2.1.3.0");
SPINE_LOG_DEVDBG(("DEVDGB: Device[%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.6.3.10.2.1.3.0'); [complete]", host->id));

if (poll_result && is_numeric(poll_result)) {
host->snmp_sysUpTimeInstance = atoll(poll_result) * 100;
Expand All @@ -2193,27 +2193,27 @@ void get_system_information(host_t *host, MYSQL *mysql, int system) {
SPINE_FREE(poll_result);
}

SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.4.0');", host->id));
poll_result = snmp_get(host, ".1.3.6.1.2.1.1.4.0");
SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.4.0'); [complete]", host->id));
SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.4.0');", host->id));
poll_result = snmp_get_allow_fail(host, ".1.3.6.1.2.1.1.4.0");
SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.4.0'); [complete]", host->id));

if (poll_result) {
db_escape(mysql, host->snmp_sysContact, sizeof(host->snmp_sysContact), poll_result);
SPINE_FREE(poll_result);
}

SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.5.0');", host->id));
poll_result = snmp_get(host, ".1.3.6.1.2.1.1.5.0");
SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.5.0'); [complete]", host->id));
SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.5.0');", host->id));
poll_result = snmp_get_allow_fail(host, ".1.3.6.1.2.1.1.5.0");
SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.5.0'); [complete]", host->id));

if (poll_result) {
db_escape(mysql, host->snmp_sysName, sizeof(host->snmp_sysName), poll_result);
SPINE_FREE(poll_result);
}

SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.6.0');", host->id));
poll_result = snmp_get(host, ".1.3.6.1.2.1.1.6.0");
SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get(host, '.1.3.6.1.2.1.1.6.0'); [complete]", host->id));
SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.6.0');", host->id));
poll_result = snmp_get_allow_fail(host, ".1.3.6.1.2.1.1.6.0");
SPINE_LOG_DEVDBG(("DEVDBG: Device [%d] poll_result = snmp_get_allow_fail(host, '.1.3.6.1.2.1.1.6.0'); [complete]", host->id));

if (poll_result) {
db_escape(mysql, host->snmp_sysLocation, sizeof(host->snmp_sysLocation), poll_result);
Expand Down
4 changes: 4 additions & 0 deletions snmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -682,6 +682,10 @@ char *snmp_get(host_t *current_host, const char *snmp_oid) {
return snmp_get_base(current_host, snmp_oid, true);
}

char *snmp_get_allow_fail(host_t *current_host, const char *snmp_oid) {
return snmp_get_base(current_host, snmp_oid, true);
}
Comment on lines +685 to +687

/*! \fn char *snmp_getnext(host_t *current_host, const char *snmp_oid)
* \brief performs a single snmp_getnext for a specific snmp OID
*
Expand Down
1 change: 1 addition & 0 deletions snmp.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,7 @@ extern void snmp_host_cleanup(void *snmp_session);
extern char *snmp_get_base(host_t *current_host, const char *snmp_oid, bool should_fail);
extern int snmp_varbind_is_exception(const struct variable_list *vars);
extern char *snmp_get(host_t *current_host, const char *snmp_oid);
extern char *snmp_get_allow_fail(host_t *current_host, const char *snmp_oid);
extern char *snmp_getnext(host_t *current_host, const char *snmp_oid);
extern int snmp_count(host_t *current_host, const char *snmp_oid);
extern void snmp_get_multi(host_t *current_host, target_t *poller_items, snmp_oids_t *snmp_oids, int num_oids);
Expand Down