summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5e77bd6)
raw | patch | inline | side by side (parent: 5e77bd6)
author | Vincent Bernat <vincent@bernat.im> | |
Mon, 10 Nov 2014 10:36:58 +0000 (11:36 +0100) | ||
committer | Vincent Bernat <Vincent.Bernat@exoscale.ch> | |
Mon, 10 Nov 2014 21:14:05 +0000 (22:14 +0100) |
src/smart.c | patch | blob | history |
diff --git a/src/smart.c b/src/smart.c
index 6c01e677d94b8ac4647b99ab95263a5648f0525f..f0c189e9e01422de492dc9de9468968df47f3882 100644 (file)
--- a/src/smart.c
+++ b/src/smart.c
@@ -108,6 +108,25 @@ static void smart_handle_disk_attribute(SkDisk *d, const SkSmartAttributeParsedD
sstrncpy (vl.type_instance, a->name, sizeof (vl.type_instance));
plugin_dispatch_values (&vl);
+
+ if (a->threshold_valid && a->current_value < a->threshold)
+ {
+ notification_t notif = { NOTIF_WARNING,
+ cdtime (),
+ "",
+ "",
+ "smart", "",
+ "smart_attribute",
+ "",
+ NULL };
+ sstrncpy (notif.host, hostname_g, sizeof (notif.host));
+ sstrncpy (notif.plugin_instance, dev, sizeof (notif.plugin_instance));
+ sstrncpy (notif.type_instance, a->name, sizeof (notif.type_instance));
+ ssnprintf (notif.message, sizeof (notif.message),
+ "attribute %s is below allowed threshold (%d < %d)",
+ a->name, a->current_value, a->threshold);
+ plugin_dispatch_notification (¬if);
+ }
}
static void smart_handle_disk (const char *dev)