$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
 
Home | FAQ | News | Intro | Samples | Tutorial | Reference | Software
Developer's Notes | Licensing | Authors | Pikt-Users | Pikt-Workers | Related Projects | Site Index | Privacy Policy | Contact Us
Page best viewed at 1024x768 or greater.   Page last updated 2019-01-12.   This site is PIKT® powered.
Copyright © 1998-2019 Robert Osterlund. All rights reserved.
Home FAQ News Intro Samples Tutorial Reference Software
PIKT Logo
PIKT Page Title
Learn about the
pikt
program