mirror of
https://github.com/pandorafms/pandorafms.git
synced 2025-07-28 08:14:38 +02:00
2011-12-14 Ramon Novoa <rnovoa@artica.es>
* pandora_agent: Do not display a warning if the output of a pre-condition is not numeric. git-svn-id: https://svn.code.sf.net/p/pandora/code/trunk@5258 c3f86ba8-e40f-0410-aaad-9ba5e7f4b01f
This commit is contained in:
parent
7f46470d32
commit
a8b8f6cb83
@ -1,3 +1,8 @@
|
|||||||
|
2011-12-14 Ramon Novoa <rnovoa@artica.es>
|
||||||
|
|
||||||
|
* pandora_agent: Do not display a warning if the output of a
|
||||||
|
pre-condition is not numeric.
|
||||||
|
|
||||||
2011-12-07 KIKUCHI Koichiro <koichiro@rworks.jp>
|
2011-12-07 KIKUCHI Koichiro <koichiro@rworks.jp>
|
||||||
|
|
||||||
* pandora_agent_installer: Removed duplicated lines and spaces to
|
* pandora_agent_installer: Removed duplicated lines and spaces to
|
||||||
|
@ -1332,7 +1332,6 @@ sub module_freepercentmemory ($) {
|
|||||||
################################################################################
|
################################################################################
|
||||||
sub evaluate_module_preconditions ($) {
|
sub evaluate_module_preconditions ($) {
|
||||||
my ($module) = @_;
|
my ($module) = @_;
|
||||||
my $exe = 1;
|
|
||||||
|
|
||||||
# Evaluate preconditions
|
# Evaluate preconditions
|
||||||
if ($module->{'precon'}){
|
if ($module->{'precon'}){
|
||||||
@ -1341,20 +1340,23 @@ sub evaluate_module_preconditions ($) {
|
|||||||
|
|
||||||
my $data = `$precondition->{'command'} 2> $DevNull`;
|
my $data = `$precondition->{'command'} 2> $DevNull`;
|
||||||
|
|
||||||
if (($precondition->{'operator'} eq '>' && $data > $precondition->{'value_1'}) ||
|
{
|
||||||
($precondition->{'operator'} eq '<' && $data < $precondition->{'value_1'}) ||
|
# Do not display a warning if the output of the command is not numeric
|
||||||
($precondition->{'operator'} eq '=' && $data == $precondition->{'value_1'}) ||
|
no warnings;
|
||||||
($precondition->{'operator'} eq '!=' && $data != $precondition->{'value_1'}) ||
|
if (($precondition->{'operator'} eq '>' && $data > $precondition->{'value_1'}) ||
|
||||||
($precondition->{'operator'} eq '=~' && $data =~ /$precondition->{'value_1'}/) ||
|
($precondition->{'operator'} eq '<' && $data < $precondition->{'value_1'}) ||
|
||||||
($precondition->{'operator'} eq '()' && $data > $precondition->{'value_1'} && $data < $precondition->{'value_2'})) {
|
($precondition->{'operator'} eq '=' && $data == $precondition->{'value_1'}) ||
|
||||||
$exe = 1;
|
($precondition->{'operator'} eq '!=' && $data != $precondition->{'value_1'}) ||
|
||||||
} else {
|
($precondition->{'operator'} eq '=~' && $data =~ /$precondition->{'value_1'}/) ||
|
||||||
$exe = 0;
|
($precondition->{'operator'} eq '()' && $data > $precondition->{'value_1'} && $data < $precondition->{'value_2'})) {
|
||||||
return $exe;
|
} else {
|
||||||
}
|
return 0;
|
||||||
|
}
|
||||||
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return $exe;
|
|
||||||
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user