$alarm(), $script()
(NOTE: Some of the techniques shown or described on this page--marked in purple--require new features in the latest official PIKT 1.19.0 release (pikt-current.tar.gz) that are unavailable in any previous version.)
DESCRIPTION
returns the name of the currently executing alarm script
SYNOPSIS
$alarm()
$script()
ARGUMENTS
none
EXAMPLES
rule // log anything not bypassed
if $alarm() =~~ "critical|kernel"
=output_alarm_log($il)
endif
...
elsif $script() eq "ScanDmesg"
&& $inlin =~~ "=redflags|=yellowflags"
leave
else
rule // report and log any root-related stuff
if $alarm() =~~ "critical|kernel"
if $il =~ "root"
output mail $il
=output_alarm_log($il)
next
endif
// but for cron, just bypass root stuff
elsif $alarm() =~~ "cron"
if $il =~ "root"
next
endif
endif
output log "=logdir/" . $proc . $script() . "=piktalert=_.log"
"$inlin $text(#cpudur - %cpudur, 0) $text(#cpucpr, 5)"
end
...
output mail =newline
=outputfile(mail, "=hstdir/log/top." . $alarm())
output mail =newline
=outputfile(mail, "=hstdir/log/ps." . $alarm())
SEE ALSO
$alert()
$level()
$status()
$task()
$lpcmd()
$mailcmd()
String Functions
Numerical Functions