Leading dash in checkwmi username

#1

Hi,

Does anybody know if checkwmi supports a leading dash in a username? Our service accounts in AD all have leading dashes, for better or for worse, and I would like to figure out a way to pass this to checkwmi appropriately. Here is the error I see with a check command:

[ibarrere@mon1 ~] /opt/opennms/bin/checkwmi -matchType all -wmiClass Win32_BIOS -wmiObject Status -op EQ -value OK -domain TEST dc1.test.local '-svc-mon-user' <password> Exception in thread "main" org.apache.commons.cli.UnrecognizedOptionException: Unrecognized option: -svc-mon-user at org.apache.commons.cli.Parser.processOption(Parser.java:363) at org.apache.commons.cli.Parser.parse(Parser.java:199) at org.apache.commons.cli.Parser.parse(Parser.java:85) at org.opennms.protocols.wmi.CheckWmi.main(CheckWmi.java:67) [ibarrere@mon1 ~]

I’ve tried various ways of escaping it, like with quotes and backslashes and such, but nothing seems to work. Any ideas (other than changing the username… WMI access has already been provisioned with this username for quite some time, and it’s not the easiest to change that)?