Package: collectd-core
Severity: wishlist
collectd generates "notifications" internally, and its notify_email
plugin provides a notification handler that will send an email for
each one.
I prefer notifications to turn into syslog entries, so that even if
there are a hundred notifications all at once, I'll only get one email
from logcheck at the end of the hour.
This can be done by hand using NotificationExec, but I think this
functionality would be useful to be built-in as a C plugin.
FYI, here's what I'm doing now:
<Threshold>
<Type "df">
DataSource "used"
WarningMax 80
FailureMax 90
Percentage true
</Type>
</Threshold>
LoadPlugin exec
<Plugin exec>
NotificationExec "nobody:nogroup" "/etc/collectd/notify-syslog.sh"
</Plugin>
where the wrapper script exists mainly to discard the "headers" and
log only the "message" part:
#!/bin/sh
while read x y
do case "$x$y" in
'') exec logger -t collectd${severity+" $severity" -p
user."$severity"};;
Severity:WARNING) severity=warning;;
Severity:OKAY) severity=notice;;
Severity:FAILURE) severity=err;;
esac
done
The result is servicable, if suboptimal:
2011-07-07T17:41:33.555808+10:00 hugin collectd warning: Host
omega.cyber.com.au, plugin df type df (instance srv-lxc-alamo): Data source
"used" is currently 852054016.000000. That is above the warning threshold of
80.000000%.
2011-07-07T17:41:33.557689+10:00 hugin collectd warning: Host
omega.cyber.com.au, plugin df type df (instance srv-apt): Data source "used" is
currently 232933896192.000000. That is above the warning threshold of
80.000000%.
-- System Information:
Debian Release: wheezy/sid
APT prefers unstable
APT policy: (500, 'unstable'), (1, 'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 2.6.38-2-amd64 (SMP w/2 CPU cores)
Locale: LANG=en_AU.utf8, LC_CTYPE=en_AU.utf8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash
--
To UNSUBSCRIBE, email to [email protected]
with a subject of "unsubscribe". Trouble? Contact [email protected]