From 7d633abe785a970a3df925bc10f998e0a0c5c438 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Tue, 22 Jan 2013 15:37:45 +0100 Subject: [PATCH] small update --- lib/fs.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lib/fs.pm b/lib/fs.pm index 7bb6856..2cb1b85 100644 --- a/lib/fs.pm +++ b/lib/fs.pm @@ -260,6 +260,7 @@ sub fs_init { } $config->{fs_hist} = (); + $config->{fs_hist_alert1} = 0; push(@{$config->{func_update}}, $package); logger("$myself: Ok") if $debug; } @@ -370,18 +371,18 @@ sub fs_update { # FS alert if($f eq "/" && lc($fs->{alerts}->{enabled}) eq "y") { if(!$fs->{alerts}->{rootfs_threshold} || $use < $fs->{alerts}->{rootfs_threshold}) { - $config->{fs_hist}->{rootalert} = 0; + $config->{fs_hist_alert1} = 0; } else { - if(!$config->{fs_hist}->{rootalert}) { - $config->{fs_hist}->{rootalert} = time; + if(!$config->{fs_hist_alert1}) { + $config->{fs_hist_alert1} = time; } - if($config->{fs_hist}->{rootalert} > 0 && (time - $config->{fs_hist}->{rootalert}) > $fs->{alerts}->{rootfs_timeintvl}) { + if($config->{fs_hist_alert1} > 0 && (time - $config->{fs_hist_alert1}) > $fs->{alerts}->{rootfs_timeintvl}) { if(-x $fs->{alerts}->{rootfs_script}) { system($fs->{alerts}->{rootfs_script} . " " . $fs->{alerts}->{rootfs_timeintvl} . " " . $fs->{alerts}->{rootfs_threshold} . " " . $use); } else { logger("$myself: ERROR: script '$fs->{alerts}->{rootfs_script}' doesn't exist or don't has execution permissions."); } - $config->{fs_hist}->{rootalert} = time; + $config->{fs_hist_alert1} = time; } } }