# OS Printer Queue Restart Automation

Printer queues refer to a list of print jobs waiting to be processed for printing. When a printer encounters an error, the printer queues get stuck, and when that happens, restarting usually helps resolve the problem. This process of restarting or clearing the printer queue on an operating system (OS) is called the OS Printer Queue Restart.

For tenants requiring constant use of printers for critical workflows, you can automate the process of restarting printer queues using IT-Conductor’s recovery action.

### Prerequisites <a href="#pre-requisite-requirements" id="pre-requisite-requirements"></a>

* The printer(s) should be registered in IT-Conductor for monitoring. See [OS Printer Monitoring](https://itconductor.atlassian.net/wiki/spaces/ITCKB/pages/3239805017) for more details.

### Automate OS Printer Queue Restart <a href="#how-to-automate-os-printer-queue-restart" id="how-to-automate-os-printer-queue-restart"></a>

When configuring printer alerts, the following command, as shown in the SSH tab, should handle the recovery action needed to restart a printer.

<figure><img src="/files/op0bQRjZm4Lif5MVWyl5" alt=""><figcaption><p>Figure 1: OS Printer Queue Restart Recovery Action</p></figcaption></figure>

The command in Figure 1 is a simple ssh script that runs as a recovery action when the condition configured is triggered.

<figure><img src="/files/yXoubc7OVtH3FD05ETGY" alt=""><figcaption><p>Figure 2: Alerting Configuration and Recovery Action based on Status</p></figcaption></figure>

In Figure 2, the recovery action will be triggered when the printer is “Disabled“. If the printer remains “Disabled“for 10 minutes, the restart recovery action is triggered again until the status changes to either “Idle” or “Printing”.

### Related Information

* [OS Printer Monitoring](/user-guide/monitoring/infrastructure/os/unix-linux-system/os-printer.md)


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.itconductor.com/user-guide/automation/os-printer-queue-restart.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
