In this example, we report group file problems as found by the standard grpck program. Although you might use other means to monitor and report problems with the /etc/group file--for example, utilize the Pikt script GroupFileProblems--you might also want to consult grpck for added reassurance.
The Grpck script might send an alert message like the following:
PIKT ALERT Fri Jul 25 02:26:30 2003 montreal WARNING: Grpck Report /etc/group file problems as found by grpck group users: no user gflynn delete member `gflynn'? No
The script follows.
Grpck init status =piktstatus level =piktlevel task "Report /etc/group file problems as found by grpck" input proc "=grpck -r 2>&1 | =egrep -v 'no changes'" rule output mail $inlin
In this script, the grpck program does the real work. We wrap grpck within the Grpck Pikt script to take advantage of PIKT's scheduling, reporting, and logging facilities.
For more examples, see Samples.