BUG: Plugin mk_cups_queues doesn't show queues with dashes in the name

Checkmk Enterprise Edition 2.0.0p12
If you have CUPS queues with dashes in the name, like “Cups-PDF”, they will not be reported by mk_cups_queues. The reason is the Perl expression in line 19: “\w+” doesn’t match dashes. It only matches [A-Za-z0-9_].
Please change the expression to “[A-Za-z0-9_-]+”.
You can apply the following patch:

--- old/mk_cups_queues        2022-01-13 13:29:01.000000000 +0100
+++ mk_cups_queues      2022-01-13 14:07:03.505227248 +0100
@@ -16,7 +16,7 @@
     echo "<<<cups_queues>>>"
     if  [ -r "$CPRINTCONF" ] ; then
-        LOCAL_PRINTERS=$(perl -ne '/<(?:Default)?Printer (\w+)>/ && print "$1\n"' $CPRINTCONF)
+        LOCAL_PRINTERS=$(perl -ne '/<(?:Default)?Printer ([A-Za-z0-9_-]+)>/ && print "$1\n"' $CPRINTCONF)
         lpstat -h localhost -p | while read LINE
             PRINTER=$(echo "$LINE" | awk '{print $2}')

Hi @omosvc,

we had a similar topic a few days ago about dots in printer names. As far i could trace the problem it seems already fixed for hyphens in newer versions:

12240 mk_cups_queues: Accept printer names with hyphens ("-") · tribe29/checkmk@c5be459 (github.com)

1 Like

That’s Werk #12240, included in Checkmk 2.0.0p16:


@tosch @martin.schwarz Thank you very much! Seems like I should first parse through the werks and git commits before posting bug reports. :frowning:

No prob. But I’d recommend an update to the latest patch release anyway.
Perhaps track the Announcements category here in the forum or subscribe to the checkmk-announce mailing list to get notified about new releases.

2.0.0p12 was released in early Oct 2021, so lots of changes/fixes since then.