Nagios3 – multiple servers at one WAN IP address

You need to create a new check_nt since the default port 12489 is used. Command which is found in “commands.cfg” (towards the bottom). In my case /etc/nagios-plugins/config/nt.cfg.

Add this:

# ‚check_nt2′ command definition
define command{
command_name check_nt2
command_line /usr/lib/nagios/plugins/check_nt -H ‚$HOSTADDRESS$‘ -p 12490 -v ‚$ARG1$‘
}

# ‚check_nt3′ command definition
define command{
command_name check_nt3
command_line /usr/lib/nagios/plugins/check_nt -H ‚$HOSTADDRESS$‘ -p 12491 -v ‚$ARG1$‘
}

 

Try it by:

cd /usr/lib/nagios/plugins

./check_nt -H xxx.xxx.xxx.xxx -p 12490 -v CPULOAD -w 80 -c 90 -l 5,80,90,10,80,90

RESULT:

CPU Load 1% (5 min average) 0% (10 min average) |   ‚5 min avg Load’=1%;80;90;0;100 ’10 min avg Load’=0%;80;90;0;100

After the test, add to server template:

define service{
use generic-service
host_name TEST
service_description Uptime
check_command check_nt2!’UPTIME‘
}

define service{
use generic-service
host_name TEST
service_description CPU Load
check_command check_nt2!’CPULOAD -l 5,100,100′
}

On client site set firewall 12490 to IP server.


Tags:

Have your say