{
int notif_severity = -1;
- if (strcasecmp (severity, "FAILURE"))
+ if (strcasecmp (severity, "FAILURE") == 0)
notif_severity = NOTIF_FAILURE;
- else if (strcmp (severity, "OKAY"))
+ else if (strcmp (severity, "OKAY") == 0)
notif_severity = NOTIF_OKAY;
- else if ((strcmp (severity, "WARNING"))
- || (strcmp (severity, "WARN")))
+ else if ((strcmp (severity, "WARNING") == 0)
+ || (strcmp (severity, "WARN") == 0))
notif_severity = NOTIF_WARNING;
return (notif_severity);
void plugin_log (int level, const char *format, ...)
__attribute__ ((format(printf,2,3)));
+
+/* These functions return the parsed severity or less than zero on failure. */
int parse_log_severity (const char *severity);
int parse_notif_severity (const char *severity);