Solved

How to monitor print serives - Sol 10

Posted on 2010-08-13
1
444 Views
Last Modified: 2013-12-27
I recently had an issue where all printing stopped.  The scheduler was up and jobs were in the queues.  Nothing was flowing and there were no errors in the message logs or print logs.  The scheduler had to be restarted twice and voila, all jobs were printed.

I am looking for some scripts and or ideas to monitor the printing services.  I need first alert so my users are not the ones notifying my team of a print issue.

0
Comment
Question by:Craig Sharp
1 Comment
 
LVL 11

Accepted Solution

by:
Pieter Jordaan earned 500 total points
ID: 33439852
Hi

Depending on your print configuration, you can add a cronjob to count the amount of files in /var/spool/print or /var/spool/lp and alert you if the amount of files exceeds a preset amount.

You will have to play with QUEUEMAX, and increase it to a number that will work with your environment.
Make sure the bash path is correct. this is usually /bin/bash
Also change the SPOOLDIR to your print spool directory.

I hope that helps.
#!/bin/bash
QUEUEMAX=20
SPOOLDIR=/var/spool/print
CNT=`ls -l $SPOOLDIR | wc -l`

if [ $CNT -gt $QUEUEMAX ]
   then
      #Alert the sysadmins
      ls -lh $SPOOLDIR | mailx -s "Print queue size exceeds $QUEUEMAX" sysadmin@mycompany.com
   fi

Open in new window

0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn how to navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.

816 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now