How to configure cfengine3 to e-mail me when / has less than 10GB free

cfenginemonitoring

I'd like to get a notification when my server's free disk space drops below 10GB. How do I configure cfengine3 to tell me when / has less than 10GB of free space?

Best Answer

This question looks a lot like that question

To receive an email with cfengine 3, you need to use the cf-execd rather than the cf-agent, and define somewhere where to send the email :

body executor control
{
    mailfrom => "from@adress.org";
    mailto => "to@adress.org";
    smtpserver => "smtp.example.org";
    exec_command => "$(sys.workdir)/bin/cf-agent -f failsafe.cf && $(sys.workdir)/bin/cf-agent";
    schedule   => { "Min00_05", "Min30_35" }
}

Reference : cfengine documentation

So the daemon will send any new output from the agent to the email adress you specified.

Hope this will help

Related Topic