Nagios Core (FAN) - monitoring clients behind NAT

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
Locked
User avatar
STELLANOVA
Posts: 5
Joined: Fri May 03, 2013 2:46 pm
Location: San Francisco

Nagios Core (FAN) - monitoring clients behind NAT

Post by STELLANOVA »

Hello everyone,

I am new in Nagios and I have one tricky situation where I need to monitor 10 client machines which are connected on one router with one static IP address. How to target Nagios server to that machines as they have all same IP on router? In windows.cfg file I can target hosts only with IP. Nagios server is in office outside data center where are clients...

Thanks in advance!
User avatar
STELLANOVA
Posts: 5
Joined: Fri May 03, 2013 2:46 pm
Location: San Francisco

Re: Nagios Core (FAN) - monitoring clients behind NAT

Post by STELLANOVA »

I know that I have to forward ports on router but how to configure nagios?

All clients are Windows 8 machines.
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core (FAN) - monitoring clients behind NAT

Post by scottwilkerson »

Most people create the command for this check so that can pass the port the want to make the connection to as an $ARGn$

Code: Select all

define command {
       command_name                  		check_service_nsclient
       command_line                  		$USER1$/check_nt -H $HOSTADDRESS$ -s "$ARG1$" -p $ARG2$ -v $ARG3$ $ARG4$
}
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
STELLANOVA
Posts: 5
Joined: Fri May 03, 2013 2:46 pm
Location: San Francisco

Re: Nagios Core (FAN) - monitoring clients behind NAT

Post by STELLANOVA »

Thanks for reply. I am really new in Nagios and Linux world so it's little bit tricky for me to understand everything that quick. Can you explain me where I have to change port? How to make it work? :(

This is host definition:

Code: Select all

define host{
	use		windows-server	; Inherit default values from a template
	host_name	PC3	; The name we're giving to this host
	alias		PC3 - Office	; A longer name associated with the host
	address		xx.xx.xx.xx ; IP address of the host
        
	}
How to define host and target Nagios to specific machine as they all have same IP?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core (FAN) - monitoring clients behind NAT

Post by scottwilkerson »

Maybe I'm mistaken on what type of monitoring you want to do... Are you just pinging the hosts? If so disregard my previous post. Th was assuming you were going to be using the NSClient++ Agent on the Windows machine.

You really need to decide what you are going to monitor, then what ports will need to be mapped to what server on your firewall, etc.
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
STELLANOVA
Posts: 5
Joined: Fri May 03, 2013 2:46 pm
Location: San Francisco

Re: Nagios Core (FAN) - monitoring clients behind NAT

Post by STELLANOVA »

I installed NSClient++ on all clients (hosts) and target them on Nagios server IP. I already monitor one host, for others I suppose I need to forward ports on router as they have same IP as host that I already manage to monitor...

I want to monitor host, CPU load, Memory, Hard drive and Uptime.

Can I simple add more ports in nrpe.cfg?

Now is by default like this:

Code: Select all

# PORT NUMBER
# Port number we should wait for connections on.
# NOTE: This must be a non-priviledged port (i.e. > 1024).
# NOTE: This option is ignored if NRPE is running under either inetd or xinetd

server_port=5666
Can I simpli add more ports like 5666,5665,5664....?
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core (FAN) - monitoring clients behind NAT

Post by scottwilkerson »

STELLANOVA wrote:I installed NSClient++ on all clients (hosts) and target them on Nagios server IP. I already monitor one host, for others I suppose I need to forward ports on router as they have same IP as host that I already manage to monitor...

I want to monitor host, CPU load, Memory, Hard drive and Uptime.
Ok, so lets say for example you setup the firewall to pass port 15003 to port 12489 on host 192.168.5.3 you can use the command I gave above (or something similar) and then setup your services something like

Code: Select all

define service {
	host_name				192.168.5.3
	service_description	CPU Usage
	use						generic-service
	check_command			check_service_nsclient!welcome!15003|CPULOAD -l 5,80,90!!!!!
	max_check_attempts		5
	check_interval			5
	retry_interval			1
	check_period			24x7
	notification_interval	60
	notification_period	24x7
	register			1
	}
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
User avatar
STELLANOVA
Posts: 5
Joined: Fri May 03, 2013 2:46 pm
Location: San Francisco

Re: Nagios Core (FAN) - monitoring clients behind NAT

Post by STELLANOVA »

I got this error:

Code: Select all

(Return code of 127 is out of bounds - plugin may be missing)
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Nagios Core (FAN) - monitoring clients behind NAT

Post by scottwilkerson »

Have you installed Nagios Plugins on the machine?
http://nagiosplugins.org/
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
Locked