diskfree

Table of Contents

Prototype: diskfree(path)

Return type: int

Descriptions: Return the free space (in KB) available on the current partition of path.

If path is not found, this function returns 0.

Arguments:

  • path: string, in the range: "?(/.*)

Example:

body common control
{
      bundlesequence => { "example" };
}

bundle agent example
{
  classes:
      "has_space" expression => isgreaterthan($(free), 0);

  vars:
      "free" int => diskfree("/tmp");

  reports:
    has_space::
      "The filesystem has free space";
    !has_space::
      "The filesystem has NO free space";
}

Output:

R: The filesystem has free space