#true()

DESCRIPTION
    returns TRUE (1)
SYNOPSIS
    #true()
ARGUMENTS
    none
EXAMPLES
# pikt +C 'output $text(#true())'
1
        rule
                set #doheader = #true()
        begin
                =initmisscrit
                if $alert() =~ "DownSystems|DownServers|DownClients"
                        set #interactive = #true()
                else
                        set #interactive = #false()
                fi
        rule    // report unusually high cpu usage
                if #cpuid <= #cpuidlim
#if missioncritical
                        =hourly(output mail $inlin set #dotopps = #true(), )
#else
                        =every_four_hours(output mail $inlin set #dotopps = #true(), )
#endif
                endif

        end
                if    #dotopps
                   && $alert() ne "CPUUsage"
                        output mail =newline
                        =outputfile(mail, "=hstdir/log/top.CPUUsage")
                        output mail =newline
                        =outputfile(mail, "=hstdir/log/ps.CPUUsage")
                fi
        rule
                if    #length($password) == 0
                   && $left($user,1) ne "+"
                        output mail "User $user has NO PASSWORD!"
                        if $user eq "root"
                                set #crisis = #true()
                        endif
                endif

#  ifdef page
#    if missioncritical
        end
                if #crisis
                        =page($hostname() urgent shadow problem (see alert email),
                              =pagesysadmins, =allhours(#now()))
                endif
#    endif
#  endifdef
        rule
                set #mounted[$filesys] = #true()

        end
                if #fopen(FSTAB, "=fstab", "r") == #err()
                        output mail "Missing =fstab!"
                        quit
                endif
                while #read(FSTAB) > 0
                        if    $rdlin =~ "^[[:space:]]*#+"
                           || $rdlin =~ "^/dev/(fd|cdrom)"
                                cont    // bypass comments and others
                        fi
                        set #n = #split($f, $rdlin, "   ")
                        if $f[3] =~ "ext2"
                                set $mntpt = $f[2]
                        else    // is swap, nfs, procfs, floppy, cdrom, etc.
                                cont
                        fi
                        if #mounted[$mntpt] != #true()
                                // if =offhours(#now()) || =weekend
                                //      =exec "=mount $f[1] $mntpt"
                                // else
                                        output mail "not mounted: $rdlin"
                                // fi
                        fi
                endwhile
                do #fclose(FSTAB)
SEE ALSO
    #and()
    #or()
    #false()
    #not()
    #if()

    Numerical Functions
    String 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
View sample
script change
script macro