#level()
DESCRIPTION
returns the current alarm's severity level, 0 through 7
(representing EMERG, ALERT, CRIT, ERR, WARNING, NOTICE, INFO, DEBUG)
SYNOPSIS
#level()
ARGUMENTS
none
EXAMPLES
begin
if #level() > 1
=checkpoint(=lalim)
fi
doexec wait "=dmesg | =uniq > =hstdir/log/dmesg=piktalert"
rule
if #level() <= 1 // alert == urgent
&& $inlin =~~ "=redflags"
leave
elsif #level() == 2
&& $inlin =~~ "=yellowflags"
leave
elsif $alarm() eq "ScanDmesg"
&& $inlin =~~ "=redflags|=yellowflags"
leave
else
next
fi
rule
// set the reporting period
#if missioncritical
if #level() == 0
set #period = 60 // every 60 minutes
elsif #level() == 1
set #period = 120 // every 120 minutes
else
set #period = 240 // every 240 minutes
fi
#else
if #level() == 0
set #period = 120 // every 120 minutes
elsif #level() == 1
set #period = 240 // every 240 minutes
else
set #period = 24*60 // once daily
fi
#endif
...
rule
=periodically(=psheader output mail $inlin, , #period)
SEE ALSO
$level()
Numerical Functions
String Functions