check_cups: Add some verbose output
This commit is contained in:
parent
2e4754e1ac
commit
c477c82587
|
@ -83,16 +83,19 @@ Printer_Two-1234 username 12345 %s''' % time.strftime('%a %d %b %Y %I:%M:%S %p %
|
|||
##############################################################################
|
||||
|
||||
def check_printer_queue(output_printer_queue):
|
||||
plugin.verbose(1, 'Checking printers')
|
||||
lidx = 0
|
||||
printers = []
|
||||
printers_bad = []
|
||||
|
||||
while lidx < len(output_printer_queue):
|
||||
printer = output_printer_queue[lidx].split(' ')[0]
|
||||
plugin.verbose(2, 'Printer "%s"' % printer)
|
||||
if output_printer_queue[lidx].find('not accepting') > 0:
|
||||
reason = output_printer_queue[(lidx+1)].replace('\t', '').lstrip().rstrip()
|
||||
printers_bad.append( (printer, reason,) )
|
||||
lidx += 1
|
||||
plugin.verbose(3, 'Problem: printer "%s", problem "%s"' % (printer, reason) )
|
||||
|
||||
printers.append( printer )
|
||||
lidx += 1
|
||||
|
@ -102,10 +105,10 @@ def check_printer_queue(output_printer_queue):
|
|||
for p in printers_bad:
|
||||
plugin.remember_check('%s' % p[0], 1, p[1])
|
||||
|
||||
|
||||
##############################################################################
|
||||
|
||||
def check_job_queue(output_job_queue):
|
||||
plugin.verbose(1, 'Checking job queue')
|
||||
m = re.compile('(\w{3} \d\d \w{3} \d{4} \d\d:\d\d:\d\d (AM|PM) \w{3,5})')
|
||||
nowsecs = long( time.time() )
|
||||
|
||||
|
|
Loading…
Reference in a new issue