System Patches
In this example, we report failures to apply system patches.
The PatchesSystemNotExist script might send an alert message like the following example:
PIKT ALERT
Fri Mar 8 08:40:01 2002
athens2
WARNING:
PatchesSystemNotExist
Report the absence of critical system patches
patch 109320-04 not installed!
patch 108869-12 not installed!
PatchesSystemNotExist makes reference to the =patches_system_obj macro, which resolves to the name of the PatchesSystem.obj file. The script follows.
#if solaris
PatchesSystemNotExist
init
status =piktstatus
level =piktlevel
task "Report the absence of critical system patches"
input file "=patches_system_obj"
dat $patch 1
keys $patch
rule // bypass placeholder
if $patch eq "000000-00"
next
endif
rule
set $log = "/var/sadm/patch/$patch/log"
rule // initialize state
set $state = "-"
rule // look for evidence of successful patch
if -e $log
&& #val($command("=grep -c 'was successful' $log"))
set $state = "+"
endif
rule // report if not found or unsuccessful
if $state eq "-"
if $state ne %state
=weekly(output mail "patch $patch not installed!", )
endif
endif
#endif // solaris
For more examples, see Samples.