if ($time =~ /^[01]?\d\./) { # time is 0-9 seconds or 10-19 seconds
$status = "OK";
}
elsif ($time =~ /^(2\d|30)\./) { # time is 20-30 seconds
$status = "WARNING";
}
else { # any other time is critical
$status = "CRITICAL";
}
在上面的代码中,我有一些阈值。 我需要的是改变0-10到OK
,10-30到WARNING
和其他所有的是CRITICAL
。 该字符串是类似于1.0
,1.11
,13.51
或2:13.52
的时间。在Perl中匹配字符串
是''10' OK'或'WARNING'? –
可以时间消极吗? – TLP