nagios vpn hosts

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.
niccoX
Posts: 9
Joined: Mon Oct 29, 2018 10:51 am

nagios vpn hosts

Post by niccoX »

I have a server which I now run through a VPN, ever since, it has lost the connection with the Nagios server.

Code: Select all

root@monitor:/usr/lib/nagios/plugins$ ./check_nrpe -H 89.160.16.2 -p2222
Connection refused by host
I don't know where to begin to allow the host to be able to be checked by the nagios server again.

#Nagios Core 3.4.1
User avatar
cdienger
Support Tech
Posts: 5045
Joined: Tue Feb 07, 2017 11:26 am

Re: nagios vpn hosts

Post by cdienger »

The requests from the XI machine could be getting natted and appear to be coming from a different IP address. In which case you'll want to edit the nsclient.ini or nrpe.cfg and update the allowed_hosts or "allowed host" configurations to allow it. You could also check /var/log/messages or nsclient.log on the remote machine to see if it gives any more detail as to why the connection is refused.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
niccoX
Posts: 9
Joined: Mon Oct 29, 2018 10:51 am

Re: nagios vpn hosts

Post by niccoX »

I have neither of these files. I have nagios.cfg and cgi.cfg[.

Should I add an entry in nagios.cfg as:

allowed_hosts=127.0.0.1,192.168.0.140

If I add one IP would I need to add all clients that are monitored, those with no VPN as well?
Last edited by niccoX on Wed Oct 31, 2018 10:13 am, edited 2 times in total.
niccoX
Posts: 9
Joined: Mon Oct 29, 2018 10:51 am

Re: nagios vpn hosts

Post by niccoX »

He, of course on the client...
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nagios vpn hosts

Post by scottwilkerson »

Is the client a Linux or Windows host?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
niccoX
Posts: 9
Joined: Mon Oct 29, 2018 10:51 am

Re: nagios vpn hosts

Post by niccoX »

scottwilkerson wrote:Is the client a Linux or Windows host?
We have both, this in particular I'm testing with is a Linux client, it's on the same IP as the Core server, but on a different port.

npre.cfg has it as an allowed host already:

Code: Select all

allowed_hosts=127.0.0.1, monitor.net.o-xxx.xx
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nagios vpn hosts

Post by scottwilkerson »

Ok, on this remote server can you see if any of the requests are getting there by looking at the system log?

with a command such as

Code: Select all

grep nrpe /var/log/messages
Also, is this nrpe daemon running under initd, systemd, or xinetd? And is the port you are checking somehow mapped to port 5666 on this remote server?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
niccoX
Posts: 9
Joined: Mon Oct 29, 2018 10:51 am

Re: nagios vpn hosts

Post by niccoX »

scottwilkerson wrote:Ok, on this remote server can you see if any of the requests are getting there by looking at the system log?

with a command such as

Code: Select all

grep nrpe /var/log/messages
Also, is this nrpe daemon running under initd, systemd, or xinetd? And is the port you are checking somehow mapped to port 5666 on this remote server?
It's not going through.

We run initd.

Even with disabled firewall, it won't work.

Code: Select all

root@monitor:/usr/lib/nagios/plugins$ ./check_nrpe -H 89.160.16.2
CHECK_NRPE: Error - Could not complete SSL handshake.
root@monitor:/usr/lib/nagios/plugins$ ./check_nrpe -H 89.160.16.2 -pxxxx
Connection refused by host
Out env is little complicated though, we have a proxy that handles server to server communication and apart from it user to server, restricting access for a user to access a specific server, but accepting access for a server to communicate with another...
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: nagios vpn hosts

Post by scottwilkerson »

Could you share the nrpe.cfg from the client?
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
niccoX
Posts: 9
Joined: Mon Oct 29, 2018 10:51 am

Re: nagios vpn hosts

Post by niccoX »

Code: Select all

log_facility=daemon
pid_file=/var/run/nagios/nrpe.pid
server_port=5666
nrpe_user=nagios
nrpe_group=nagios
allowed_hosts=127.0.0.1, monitor.net.x-xxx.xx
dont_blame_nrpe=0
debug=1
command_timeout=60
connection_timeout=300

# webchecker for external websites

include=/etc/nagios/nrpe_local.cfg
include_dir=/etc/nagios/nrpe.d/
command[check_db_dump]=sudo /usr/lib/nagios/plugins/check_db_dump
Locked