define custom service

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
xzer
Posts: 3
Joined: Fri Aug 24, 2012 9:46 am

define custom service

Post by xzer »

Hello,

I am trying to actively monitor webserver behind the load balancer. The one is listening on default: 5666 and other on 15666 port. I am using nagiosXI. The monitoring on defaul port is running. Currently I am having difficulty to set up the one with port 15666.

via command line: /usr/local/nagios/libexec/check_nrpe -H your.domain.com -p 15666 -t 30 -c check_init_service -a http everything is working, but I am not able to add custom command to listen on 15666.

I have tried to edit the commands.cfg

define command {
command_name check_nrpe15666
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p 15666 -t 30 -c $ARG1$ $ARG2$
}

after restart or service re-configuration the commands.cfg will be rewritten to last snapshot or loaded from DB and my custom command is not there anymore. I also modified nagios.cfg, but did not help.

Q1: Can I configure monitoring server to listen/comunicate with to both 5666 and 15666.
Q2: If not, how do I add custom service command?
Q3: What is the approach to monitor webservers behind the loadbalancer?

Thanks.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: define custom service

Post by scottwilkerson »

In XI you need to add the command through Configure -> CCM -> Commands because the commands file is overwritten every time the configuration is applied or a wizard is run.

Easiest would be to make your new command look something like this, and you could use the same command for all of these, specifying the port in $ARG3$

Code: Select all

command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p $ARG3$ -t 30 -c $ARG1$ $ARG2$
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
xzer
Posts: 3
Joined: Fri Aug 24, 2012 9:46 am

Re: define custom service

Post by xzer »

Thanks. It works.
Locked