summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--lib/agentx.c13
-rw-r--r--lib/lib_errors.c6
-rw-r--r--lib/lib_errors.h1
3 files changed, 16 insertions, 4 deletions
diff --git a/lib/agentx.c b/lib/agentx.c
index 302bbf0a4..80422c480 100644
--- a/lib/agentx.c
+++ b/lib/agentx.c
@@ -31,6 +31,7 @@
#include "memory.h"
#include "linklist.h"
#include "version.h"
+#include "lib_errors.h"
static int agentx_enabled = 0;
@@ -141,16 +142,20 @@ static int agentx_log_callback(int major, int minor, void *serverarg,
msg[strlen(msg) - 1] = '\0';
switch (slm->priority) {
case LOG_EMERG:
- zlog_err("snmp[emerg]: %s", msg ? msg : slm->msg);
+ zlog_ferr(LIB_ERR_SNMP,
+ "snmp[emerg]: %s", msg ? msg : slm->msg);
break;
case LOG_ALERT:
- zlog_err("snmp[alert]: %s", msg ? msg : slm->msg);
+ zlog_ferr(LIB_ERR_SNMP,
+ "snmp[alert]: %s", msg ? msg : slm->msg);
break;
case LOG_CRIT:
- zlog_err("snmp[crit]: %s", msg ? msg : slm->msg);
+ zlog_ferr(LIB_ERR_SNMP,
+ "snmp[crit]: %s", msg ? msg : slm->msg);
break;
case LOG_ERR:
- zlog_err("snmp[err]: %s", msg ? msg : slm->msg);
+ zlog_ferr(LIB_ERR_SNMP,
+ "snmp[err]: %s", msg ? msg : slm->msg);
break;
case LOG_WARNING:
zlog_warn("snmp[warning]: %s", msg ? msg : slm->msg);
diff --git a/lib/lib_errors.c b/lib/lib_errors.c
index 0c36d801d..4ae69589a 100644
--- a/lib/lib_errors.c
+++ b/lib/lib_errors.c
@@ -71,6 +71,12 @@ static struct ferr_ref ferr_lib_err[] = {
.suggestion = "Ensure configuration file exists and has correct permissions for operations\nAdditionally ensure that all config lines are correct as well",
},
{
+ .code = LIB_ERR_SNMP,
+ .title = "SNMP subsystem Error",
+ .description = "FRR has detected a problem with the snmp library it uses\nA callback from this subsystem has indicated some error",
+ .suggestion = "Examine callback message and ensure snmp is properly setup and working"
+ },
+ {
.code = END_FERR,
}
};
diff --git a/lib/lib_errors.h b/lib/lib_errors.h
index 3b5eb577b..671c768eb 100644
--- a/lib/lib_errors.h
+++ b/lib/lib_errors.h
@@ -32,6 +32,7 @@ enum lib_ferr_refs {
LIB_ERR_ZAPI_SOCKET,
LIB_ERR_SYSTEM_CALL,
LIB_ERR_VTY,
+ LIB_ERR_SNMP,
};
extern void lib_error_init(void);