How to add Manually command in Nagiosxi

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
anguri.sudhakar
Posts: 22
Joined: Tue Dec 01, 2015 6:00 am

How to add Manually command in Nagiosxi

Post 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
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: How to add Manually command in Nagiosxi

Post 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.
Former Nagios Employee.
me.
gormank
Posts: 1114
Joined: Tue Dec 02, 2014 12:00 pm

Re: How to add Manually command in Nagiosxi

Post 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...
User avatar
hsmith
Agent Smith
Posts: 3539
Joined: Thu Jul 30, 2015 11:09 am
Location: 127.0.0.1
Contact:

Re: How to add Manually command in Nagiosxi

Post 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.
Former Nagios Employee.
me.
anguri.sudhakar
Posts: 22
Joined: Tue Dec 01, 2015 6:00 am

Re: How to add Manually command in Nagiosxi

Post by anguri.sudhakar »

Thanks you i will try and let know.....
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: How to add Manually command in Nagiosxi

Post by rkennedy »

I'll leave this open - let us know if you have any questions.
Former Nagios Employee
Locked