[collectd] Notification issues

Sebastiano Pilla sebastiano at datafaber.net
Tue Jul 19 12:20:57 CEST 2011


Trent W. Buck wrote:
>> 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

Hi Trent,

I have tried copying your configuration and your notification script 
verbatim, but unfortunately it didn't work, the logger executable didn't 
write anything and I could not even determine if it was called at all.

I'm probably doing something very wrong but I cannot figure it out. For 
the moment I'll go back to a simple shell script for disk space 
notifications.

Thank you very much for your help.
Sebastiano Pilla



More information about the collectd mailing list