1

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?

joeforker
  • 2,399
  • 4
  • 26
  • 35

1 Answers1

2

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

Nicolas Charles
  • 725
  • 5
  • 11
  • It is a lot like that other question. I got it to work, but it's a little confusing figuring out when it decides /not/ to send me an e-mail since it has a lock that prevents it from complaining too often about the same thing (seemingly even if I try to pass -K in cf-runagent). – joeforker Mar 19 '10 at 20:25
  • 2
    If you have the same output than at the previous run, then you'll receive no mail, to prevent being spammed by the daemon – Nicolas Charles Mar 19 '10 at 20:38