What I actually have is -u $USER8$ -p $USER9$ hardcoded into the check command. I try to avoid putting passwords into the service def. I think I have also put the single quotes around arguments in the past but in checking I didn't see any defined like this now. For example arg1 would be specified as '.' or '_FreeGB=:3'. The way you did it also works and might even be more readable when editing.
This will work from the GUI just fine. If however, you would like to run the same check from the CLI (and use the macros, defined in the "resource.cfg") your check would fail, because the macros won't be available in the shell. I was just trying to answer your question.
Another question on this: can i use -u $USER13$ -p $USER14$ in the commandline?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Just want to start by saying there really is no right and wrong here. If the check runs, doesn't crash, gives you valid results in a timely fashion then that is right. I just wanted to share how I do it. Since I use PNP charts, I use a different check command for each "mode", this allows me to have custom chart templates for specific check_wmi_plus modes. Another note, the $USER8$ and $USER9$ variables are not expanded when you click the Test Check Command. I click this button then copy the command and paste to a command prompt and then edit the $USER8$ and $USER9$ for testing.
Whatever works. Testing from within the CCM is not perfect - sometimes it fails, because of the escaping issues. I believe this is what is going on with macros, defined in the "resource.cfg". The CCM tries to escape the "$" and the check fails.
For this type of checks, you will be better off by clicking on the Service, and scheduling a "forced immediate check" to test it.
Be sure to check out our Knowledgebase for helpful articles and solutions!
ended up with a combination of both of your's advise's thank you!
This works for me.
What doesnt work:
Next, I'm still looking at this screen since yesterday: I'm looking into this, if i've resolved it ill post my solution.
Nagios XI Version : 2014R2.6
fqdn 2.6.32-431.17.1.el6.x86_64 x86_64
CentOS release 6.5 (Final)
Gnome is not installed
Proxy appears to be in use
VMware Image
Mod Gearman
On NagiosXI server (master):
service nagios stop
service mod_gearman_worker stop
service gearmand restart
service mod_gearman_worker start
service nagios start
On workers:
service nagios stop
service mod_gearman_worker restart
service nagios start
But i also suspect that the workers needed time to sync or something, i removed all resource.cfg files from the workers and copied exactly the same content from the master server to them.
This topic can close now everything works really good now: Time to fix the following problems thanks again for all the support.
Nagios XI Version : 2014R2.6
fqdn 2.6.32-431.17.1.el6.x86_64 x86_64
CentOS release 6.5 (Final)
Gnome is not installed
Proxy appears to be in use
VMware Image
Mod Gearman