1825662 Members
3425 Online
109686 Solutions
New Discussion

queues logs ...

 
psalm139
Occasional Contributor

queues logs ...

what logs can indicate me the printer queues are down ...

if i type lpstat -p i can not see what printers are down ... please your suport  :smileywink:

3 REPLIES 3
Steven E. Protter
Exalted Contributor

Re: queues logs ...

Shalom,

gave you tried:
lpstat -r
lpstat -s
lpstat -v

Off the man page

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
psalm139
Occasional Contributor

Re: queues logs ...

it is strange my case .. let me explain you ...  i have  a script that enable the queues in case they are down:

lpstat -p | grep printer | grep -v enabled > ${ruta}/${h}_p0
lpstat -p | grep printer |  grep -v enabled | grep since | cut -d" " -f2 > ${ruta}/${h}_p1
   if [[ -s ${ruta}/${h}_p1 ]]
   then
        for i in `cat ${ruta}/${h}_p1`
        do
          enable $i
          lpstat -p | grep $i >> ${ruta}/${h}_enabled.txt
        done
   fi
   if [[ ! -s ${ruta}/queueSTATUS.log ]]
   then
      echo "HOSTNAME  CURRENT DATE     QUEUE       DISABLED SINCE      ENABLED SINCE " >> ${ruta}/queueSTATUS.log
   fi

   if [[ -s ${ruta}/${h}_p1 ]]
   then
        for i in `cat ${ruta}/${h}_p1`
        do
          dis=`cat ${ruta}/${h}_p0 | grep $i | grep disabled | awk 'BEGIN { FS="since"} ; {print $2}'`
          ena=`cat ${ruta}/${h}_enabled.txt | grep $i | grep enabled | awk 'BEGIN { FS="since"} ; {print $2}'`
          if [[ -z $ena ]]
          then
             ena="Still disabled"
          fi
          echo "`hostname`   $f   $i    $dis    $ena" >> ${ruta}/queueSTATUS.log
       done
   fi

 

THE below value "DISABLED SINCE" May 25 was taken from the first line

the result of the script is:

 

HOSTNAME  CURRENT DATE     QUEUE       DISABLED SINCE      ENABLED SINCE
server1              07/20/11_03:05     Printer1         May 25 04:24 -              Jul 20 03:05

 

immediatly i typed:

server1:user1 141> lpstat -p | grep Printer1
printer Printer1 is idle.  enabled since May  5 05:18

 

why lpsat -p is saying the last time enambed was May 5 when the printer was reported on May 25 seconds ago?  why? Why is happening this if  the script typed the same command:

lpstat -p | grep printer | grep -v enabled > ${ruta}/${h}_p0    this shows:


$ lpstat -p | grep printer | grep -v enabled
printer Printer1 disabled since May  5 05:18-

 

why i got two different dates??? please let me know.

 

 

 

psalm139
Occasional Contributor

Re: queues logs ...

LET me tell you something,

i had an error ...  was in other server ,   that is why i was seeing an icorrect date .. my aplogies ......

 

 $HN $IV${PWD##*/}$EE $ lpstat -p | grep Printer1

printer  Printer1 is idle.  enabled since Jul 20 03:05

 

I HAVE ANOTHER QUESTION OF THE SAME SITUATION:

 

Now ... my question here is  why the script detected the queue was disabled last May 25 if this script runs everyday since 1 month ago?   i think the script had to report 30 days ago  the queue was disabled since May 25 ... why it was reported until today?  ....   would have an network issue? .... please let me know some ideas ....

 

 

thanks in advance.