From 936dc728dd8495c4603693dc834260e6c8bd2b8f Mon Sep 17 00:00:00 2001 From: "ismael.moreno" Date: Tue, 19 Nov 2019 17:24:40 +0100 Subject: [PATCH] Added regexp --- pandora_agents/unix/plugins/pandora_df_used | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/pandora_agents/unix/plugins/pandora_df_used b/pandora_agents/unix/plugins/pandora_df_used index dcddd7f65d..a5a7842a90 100755 --- a/pandora_agents/unix/plugins/pandora_df_used +++ b/pandora_agents/unix/plugins/pandora_df_used @@ -49,7 +49,7 @@ else # Store all "ext" fstypes in @lines array my @lines = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1";"\$2";"\$(NF-1)";"\$NF}' | grep -i "adfs\\|affs\\|autofs\\|btrfs\\|cifs\\|coda\\|coherent\\|efs\\|ext\\|hfs\\|hfsplus\\|hpfs\\|jfs\\|minix\\|msdos\\|ncpfs\\|nfs\\|nfs4\\|ntfs\\|proc\\|qnx4\\|reiserfs\\|smbfs\\|sysv\\|ubifs\\|udf\\|ufs\\|umsdos\\|usbfs\\|vfat\\|xenix\\|xfs\\|xiafs"`; - + chomp (@lines); # To skip indicated filesystems @@ -57,12 +57,16 @@ else { if (substr($fs,0,1) eq '-') { - $excluded_filesystems{substr($fs,1,)} = '-1%'; + my $mount_name=substr($fs,1,); + my @mount_all= split /\n/, `df -khTP | tail -n +2 | awk '{print \$7}'| grep -i "$mount_name"`; + foreach (@mount_all){ + $excluded_filesystems{$_} = '-1%'; + } } else { my @linesmanual = split /\n/, `df -khTP | tail -n +2 | awk '{print \$1";"\$2";"\$(NF-1)";"\$NF}' | grep -i $fs`; - + chomp (@linesmanual); $filesystems{$fs} = '-1%';