[collectd] Notification issues

Trent W. Buck twb-mailman-collectd at cyber.com.au
Tue Jul 19 09:32:56 CEST 2011


> LoadPlugin df
> <Plugin "df">
>   MountPoint "/"
>   MountPoint "/boot"
> </Plugin>
> LoadPlugin exec
> <Plugin exec>
>   NotificationExec root "/etc/collectd/collectd-notify.sh"
> </Plugin>
> LoadPlugin threshold
> <Threshold>
> ...
> </Threshold>

Well, you can't run Exec's as root IIRC.  Here is what I have:

    <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 my .sh is

    #!/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



More information about the collectd mailing list