DCI filter script - how to ignore some filesystems when using {instance} ?

Started by hkusulja, May 07, 2014, 08:29:35 PM

Previous topic - Next topic

sharpspro

Does anyone have any ideas on what I'm doing wrong? I messed with it a little more and had no luck with my testing.

Thanks in advance guys!

Hanfelt

Im no programmer but this seemed to work for me.

type = AgentReadParameter($node, "FileSystem.Type(" . $1 . ")");
if ((type == null) || (type == "") || (type == "CDFS"))    
   return false;
if ($1 ~= "[:/]") {
  return true;
}

TOLeg

To filter CD/DVD and Volume in the "Instance Detection" section, I use this script:

type=AgentReadParameter($node, "FileSystem.Type(" . $1 . ")");
if ((type == null) || (type == "") || (type == "CDFS") || (type == "UDF"))
{
return false;
}

if (
type != null && (
type == "aufs" ||
type == "autofs" ||
type == "cgroup" ||
type == "configfs" ||
type == "debugfs" ||
type == "devpts" ||
type == "devtmpfs" ||
type == "fusectl" ||
type == "fuse.gvfsd-fuse" ||
type == "fuse.lxcfs" ||
type == "hugetlbfs" ||
type == "iso9660" ||
type == "mqueue" ||
type == "nfsd" ||
type == "overlay" ||
type == "proc" ||
type == "pstore" ||
type == "rpc_pipefs" ||
type == "securityfs" ||
type == "selinuxfs" ||
type == "squashfs" ||
type == "sysfs" ||
type == "tmpfs"
)) {
return false;
}

if (($1 == "/proc") ||
    ($1 like "/proc/*") ||
    ($1 == "/sys") ||
    ($1 like "/sys/*") ||
    ($1 == "/run") ||
    ($1 like "/run/*") ||
    ($1 == "/dev") ||
    ($1 like "*Volume*") ||
    ($1 like "/dev/*"))
  return false;
return true;