I'm trying to monitor an MSMQ queue counter using Nagios (3.0.1). The remote server is running NC_Net. The check_command config looks like this:
check_command check_nt!COUNTER!-l "\\MSMQ Queue(servername\\private$\\queuename)\\Messages in Queue","%.f messages in MSMQ queue" -w 5 -c 10
This doesn't work. I believe that the dollar symbol needs to be escaped and I'm having trouble working out how.
This article suggests "$$" ie.
check_command check_nt!COUNTER!-l "\\MSMQ Queue(servername\\private"$$"\\queuename)\\Messages in Queue","%.f messages in MSMQ queue" -w 5 -c 10
but that doesn't work. I've tried a few other methods (backslash, single quotes etc).
Any suggestions?
EDIT:
I've been doing some testing via the command line which is one reason I believe it's the $ causing the problem. The following works:
./check_nt -H hostip -v COUNTER -l "\\MSMQ Queue(Computer Queues)\\Messages in Queue","%.f messages in MSMQ queue" -w 5 -c 10
but this doesn't:
./check_nt -H hostip -v COUNTER -l "\\MSMQ Queue(servername\\private$\\queuename)\\Messages in Queue","%.f messages in MSMQ queue" -w 5 -c 10
I've also used ECHO to see how those commands expand but that hasn't helped me.
EDIT:
Turns out it wasn't the dollar symbol. See below.