Here's how I did it. The repair_failed mnemonic doesn't really fit the "we detected there was less free disk space than you wanted" since it attempts no repair, but it seems to be the way to add a class as a result. It gives a perfectly fine explanation of the free disk space without the extra ohno class, but eventually I want to clear temp directories, vacuum databases, etc. as a reaction to the condition...
You can use the function diskfree that return the available space on the partition
Here is a simple example (yes, I have a lot of free space) :
body common control {
bundlesequence => { "test_free_space" };
}
bundle agent test_free_space {
vars:
"free" int => diskfree("/home");
"min_free_space" int => "200000000";
classes:
"not_enough_size" expression => isgreaterthan("$(min_free_space)", "$(free)");
reports:
not_enough_size::
"There is not enough space left on /home";
}
Here's how I did it. The
repair_failed
mnemonic doesn't really fit the "we detected there was less free disk space than you wanted" since it attempts no repair, but it seems to be the way to add a class as a result. It gives a perfectly fine explanation of the free disk space without the extraohno
class, but eventually I want to clear temp directories, vacuum databases, etc. as a reaction to the condition...You can use the function diskfree that return the available space on the partition
Here is a simple example (yes, I have a lot of free space) :
Regards