Print Spooling
[posted 2000/06/19]
Moving on, I added another simple script yesterday for monitoring our Solaris systems' print spooling directories:
#if solaris PrintSpoolChkWarning init status active level warning task "Check various aspects of print spooling" input proc "=find =printspool -type f -mtime +2 -exec =ll {} \\; 2>/dev/null" =lldata rule =set_fa rule if $name =~ "\\.SEQF" next endif rule if #fa > 2 output mail "orphaned: $inlin" endif rule if #fa > 3 =execwait "=rm $name" endif #endif // solaris
=printspool is defined in macros.cfg as:
#if solaris printspool /var/spool/lp/requests /usr/lp/tmp /var/lp/tmp #endif
Sure enough, in the overnight run, this script detected and cleaned out quite a few orphaned data files on a couple of our print servers.
PrintSpoolChkWarning (which will be improved and extended over time) is not rocket science. It's another one of those simple alarm scripts that I've seen the need for occasionally but just never got around to doing. Usually, I spend too much time on the "hard" PIKT stuff (coding the binaries) at the expense of not enough time devoted to the "soft" PIKT stuff (writing alarm scripts, fleshing out objects sets, etc.).
I would be astonished if none of you had developed your own version of PrintSpoolChkWarning. There have to be dozens of things you have done, things that if only you would share them, I and others could benefit from your effort.
For more examples, see Developer's Notes.