need help customizing the file system capacity rule from the infrastructure cartridge

I been requested to create a customized rule based on the file system capacity rule

currently this rule monitors all filesystem

We want to filter out all filesystems related to the OS like /var., /boot,/tmp or /opt for example

what should I add the this code that shows all filesystems

LogicalDisk : host.hostType != null and host.hostType.name = 'Physical' and host.detail.topologyTypeName != 'HPVServer' and host.detail.topologyTypeName != 'VMWESXServer'

thank you

PC

Parents
  • Hi Philippe,

    You can do something like the highlighted bit below. The rule is scoped to LogicalDisk and every object in Foglight has a property called "name".

    So you can add -    and name != '/filesystem1' and name != '/filesystem2'

    etc..

    If it's Windows with a "\" in the object name (eg. C:\), you need to escape with the \ character so it would be   name != 'C:\\'

  • Hi Darren,

    Long time
    Thank you for the info
    I also found another way but very similar

    test = true;
    for (obj in scope.detail) {
      if (obj.topologyTypeName.equals("AccessInformation")) {
       test = obj.writable;
    }
    }
    if (test && ( scope.get("name").equals("/home") || scope.get("name").equals("/var") || scope.get("name").equals("/boot") || scope.get("name").contains("/opt/")|| scope.get("name").equals("/boot") || scope.get("name").contains("/usr/"))) {
    return "";
    }
    else
    {
    return #capacityUsed# >= registry("INF_FileSystemCapacityFatal");
    }
    return false;
    Thank you
    Regards
    Pc
Reply
  • Hi Darren,

    Long time
    Thank you for the info
    I also found another way but very similar

    test = true;
    for (obj in scope.detail) {
      if (obj.topologyTypeName.equals("AccessInformation")) {
       test = obj.writable;
    }
    }
    if (test && ( scope.get("name").equals("/home") || scope.get("name").equals("/var") || scope.get("name").equals("/boot") || scope.get("name").contains("/opt/")|| scope.get("name").equals("/boot") || scope.get("name").contains("/usr/"))) {
    return "";
    }
    else
    {
    return #capacityUsed# >= registry("INF_FileSystemCapacityFatal");
    }
    return false;
    Thank you
    Regards
    Pc
Children