$status()

(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 current script's status
SYNOPSIS
    $status()
ARGUMENTS
    none
EXAMPLES
        rule
                if $status() eq "debugging"
                        output piktlog "$text(#cpu,1) $text(#mem,1) $prc"
                endif
        rule
                if $status() eq "testing"
                        =output_alarm_log($inlin)
                endif
        begin
                if $status() eq "testing"
                        set #maillim[1] = 72
                        set #pagelim[1] = 75
                        set #maillim[2] = 77
                        set #pagelim[2] = 80
                else
                        set #maillim[1] =  75   // email if AC1 temp >=  75 deg
                        set #pagelim[1] =  80   // page  if AC1 temp >=  80 deg
                        set #maillim[2] =  85   // email if AC2 temp >=  85 deg
                        set #pagelim[2] = 100   // page  if AC2 temp >= 100 deg
                fi
        rule
                if $status() eq "debugging"
                        set #norun = #true()
                fi

        rule    // report that proc is down
                if #norun
                        // for all procs, always report new downages
                        if $state ne %state
                                output mail "process '$pr1' is not running"
                        // else for essential procs, report anew but just
                        // periodically
                        elsif #ess
#if missioncritical
                                =hourly(output mail $norunmsg, )
#else
                                =daily(output mail $norunmsg, )
#endif
                        endif
                endif
SEE ALSO
    $alert()
    $alarm()
    $level()
    $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 script
init section