title: Check state of CUPS Printer Queues
agents: linux
author: Lars Michelsen <lm@mathias-kettner.de>
license: GPL
distribution: check_mk
description:
 This check uses the output of {lpstat -p} and {lpstat -o} as sent by the
 Check_MK linux agent. It lists the general state of a queue and the jobs
 in the printer queue of the CUPS printing system.

 The check analyzes the overall state of a printer using the first words in
 each line of {lpstat -p}. The words "is idle", "disabled since", "now printing"
 trigger the resulting state.
 The resulting state also depends on the number of jobs in the queue and
 the age of the oldest job in the queue.

item:
 The name of the printer in CUPS as printed by {lpstat -p}.

examples:
 # Set number of minimum jobs to 5 to result in a warning state and 10 to result in a critical state
 # Set the maximum age of a job to 5 minutes to result in a warning state and 10 minutes to result in
 # a critical state. The age is given in seconds.
 cups_queues_default_levels = (5, 10, 360, 720)

perfdata:
 It contains the current number of jobs in the queue in the {jobs} value.

inventory:
 Checks are created for all available printers in {lpstat -p} output.

[parameters]
warning_count (int): Number of jobs to result in a warning state
critical_count (int): Number of jobs to result in a critical state
warning_age (int): Age of oldest job to result in a warning state
critical_age (int): Age of oldest job to result in a critical state

[configuration]
cups_queues_default_levels (int, int, int, int): The global default levels for
 all checks of this type. This is {(5, 10, 360, 720)}.
