Inode Shortages
In this example, we report worrisome inode shortages.
The DiskInode script might send an alert message like the following:
PIKT ALERT Thu Jan 14 12:21:07 2002 paris7 WARNING: DiskInode Report worrisome inode shortages Filesystem /usr on /dev/dsk/c0t2d0s5 has used 96% of inodes, 54892 inodes left
The script follows.
DiskInode init status =piktstatus level =piktlevel task "Report worrisome inode shortages" input proc "=dfi | =behead(1) | =grep '^/'" =dffilter =dfidata keys $fsname rule if #used >= 90% && =increased(used, 90%, 0%) output mail "Filesystem $mount on $fsname has used $text(#used*100,0)% of inodes, $text(#free) inodes left" endif
This is just one program example. You could add rules, or write new scripts, for example to: report hardware failures, report network cross-mounted disks going off-line, report problems with the RAID setup, clear /tmp files, log I/O stats, etc.
For more examples, see Samples.