Tuesday, July 8, 2025

Network Printers in RHEL with CUPS Troubleshooting

 When users report printing issues, having a clear troubleshooting workflow can save a lot of time. Below is a concise guide with essential commands to investigate and resolve common printer problems.


🔍 Step-by-Step Diagnostic Guide

1. Check Printer Status

lpstat -p officeprinter1 lpq -P officeprinter1

This shows whether the printer is enabled, actively printing, or unreachable.

2. Check Recently Completed Jobs

lpstat -W completed -P officeprinter1

Helps confirm whether jobs were properly processed by CUPS.

3. Verify Device URI

lpstat -v officeprinter1

Displays the configured connection, e.g., socket://192.168.1.150:9100.

4. Test Network Connectivity

ping -c 4 192.168.1.150

No response may indicate the printer is powered off, disconnected, or blocked by a firewall.

5. Check if Print Port is Reachable

nc -zv 192.168.1.150 9100

Confirms whether the raw print port is open (9100 is standard for many network printers).

6. Check DNS Resolution

getent hosts officeprinter1

Validates whether the printer hostname resolves to an IP address.

7. Send a Test Page

lp -d officeprinter1 /usr/share/cups/data/testprint

Used to verify if the queue is functional and printing.


🛠️ Reset the Print Queue (if stuck)

cancel -a officeprinter1 cupsdisable officeprinter1 cupsenable officeprinter1

Cancels all jobs and restarts the print queue.


⚙️ Reconfigure Printer Using Direct IP


lpadmin -p officeprinter1 -v socket://192.168.1.150:9100

Useful if the hostname no longer resolves or the IP/port has changed.

✅ Conclusion

These commands allow you to quickly diagnose whether an issue is caused by network failure, misconfiguration, or a printer-side error. This workflow is applicable for both standard network printers and custom printing setups in RHEL environments.