Page 1 of 1

How to add Manually command in Nagiosxi

Posted: Thu Feb 25, 2016 7:17 am
by anguri.sudhakar
Hi,


i have below customized command, when i add this command manually in /usr/local/nagios/etc/commands.cfg, After i restart nagios service the command will disappearing. Could you please let me know where i should add this command..?

define command {
command_name check_ws_jmxTC88
command_line $USER1$/check_jmx -U service:jmx:rmi:///jndi/rmi://x.x.x.x:9192/jmxrmi -O "java.lang:type=Threading" -A ThreadCount
}


Thanks,
Sudhakar Aguri

Re: How to add Manually command in Nagiosxi

Posted: Thu Feb 25, 2016 10:26 am
by hsmith
You should be adding it inside of the core configuration manager instead of interacting with the flat files directly. The flat files get overwritten every time a configuration is applied.

Re: How to add Manually command in Nagiosxi

Posted: Thu Feb 25, 2016 2:51 pm
by gormank
You should be able to create a file with the new command in the import dir, and run the reconfig script, or click reconfig in CCM and Nagios will import it...

Re: How to add Manually command in Nagiosxi

Posted: Thu Feb 25, 2016 3:15 pm
by hsmith
To expand on what @gormank is saying, we have a document detailing this here. Probably a little more information than you need in that document, but still nice to be aware of.

Re: How to add Manually command in Nagiosxi

Posted: Mon Feb 29, 2016 3:36 am
by anguri.sudhakar
Thanks you i will try and let know.....

Re: How to add Manually command in Nagiosxi

Posted: Mon Feb 29, 2016 10:54 am
by rkennedy
I'll leave this open - let us know if you have any questions.