$alert()
DESCRIPTION
returns the current script's alert name
SYNOPSIS
$alert()
ARGUMENTS
none
EXAMPLES
rule
if $alert() =~~ "red|emergency"
=hourly(output mail $inlin, )
else
=every_four_hours(output mail $inlin, )
fi
if $alert() =~ "EMERGENCY"
set #procnumlim = 400
elsif $alert() =~ "Urgent"
set #procnumlim = 300
else // if $alert() =~ "ProcessCounts"
set #procnumlim = 250
endif
begin
#if server
// on production servers, only process non-emergency pikt
// log files in the early morning, during production downtime
if $alert() !~~ "red|emergency"
if #hour() > 6 // i.e., between 6 AM and midnight
quit
fi
fi
#endif
[... otherwise continue the log file scanning script ...]
[macro defs in macros.cfg:]
highestlevelalert $alert() =~~ "red"
highlevelalert $alert() =~~ "red|emergency|server"
[macro references in alarms.cfg:]
rule // if high-level alert, bypass non mission-critical systems
if =highlevelalert
if ! #misscrit
set $state = %state
next
fi
fi
rule // if low-level alert, bypass mission-critical systems
if ! =highlevelalert
if #misscrit
set $state = %state
next
fi
fi
...
rule // page, but only periodically, if highest-level alert
if =highestlevelalert
=hourly(=page($dnmsg, =pageaddr, =allhours(#now())), )
fi
...
rule
if $state eq "+"
#ifdef verbose
// for high-level alerts, report if systems back up
if =highlevelalert
// if state was "-", is now "+", report change
if #defined(%state) && $state ne %state
output mail $upmsg
fi
fi
#endifdef
next
fi
SEE ALSO
$alarm()
$level()
$status()
$task()
$lpcmd()
$mailcmd()
String Functions
Numerical Functions