Using the Test Check Command button is not always accurate for 2 reasons:
1.) Being a PHP page, some characters will be interpreted as control characters (such as the $) and can mess up results.
2.) The command is run as apache, and you are running it as root in your testing. Not usually a problem but there are some plugins that definitely need to be run as nagios.
My advice would be to save the config however you have it and let it run naturally. Check the results there (you can do a forced immediate check if you'd like) and see what it comes up with.
From the Nagios XI web UI, click on "Service Detail", go to the service in question, click on "Configure"->"Re-configure this service" and compare the command that is listed there to the actual command that you run from the CLI (that works). Is it different? Does it work if you modify it to look like the "working" command, and scheduled a forced immediate check? Have you tried using double quotes instead of """ in your command?
Be sure to check out our Knowledgebase for helpful articles and solutions!
hey lmiltchev,
I have tried you suggestion also, but the result is still the same. As you can see in the picture it's the same command use for the CLI. And I've also tried with double quotes too