Quantcast
Channel: UNIX and Linux Forums
Viewing all articles
Browse latest Browse all 16232

Allowing Connections to a Specific Port

$
0
0
Hello All,

I've come here as a last resort. I've been messing around with this for the last few days now and can't figure out
what is going on, and why it isn't working...

I have NRPE Running on a OpenSuSE 11.4 Virtual Machine on my Laptop for testing. The VM uses a "Bridged" Connection in
order to give it it's own IP Address on the network. I definitely have the nrpe.cfg Config File configured correctly
because I've setup NRPE on a TON of other servers on the network with no problems.

FYI: I'm running NRPE in Daemon mode...

I can see in the syslog that it says, it is LISTENING on port 5666 and that it is allowing from the correct server IP.
But when I try to run "check_nrpe" command from my Nagios Server I get "Connection Refused by Host".

Here's what's in "/var/log/messages":
*I've added some test commands to the config as well. I.e. to be run with "check_nrpe -H <ip_address> -t 10 -c "test_check_command"
Code:

Oct 10 12:42:10 Matt-suse-vm nrpe[22346]: INFO: SSL/TLS initialized. All network traffic will be encrypted.
Oct 10 12:42:10 Matt-suse-vm nrpe[22347]: Starting up daemon
Oct 10 12:42:10 Matt-suse-vm nrpe[22347]: Listening for connections on port 5666
Oct 10 12:42:10 Matt-suse-vm nrpe[22347]: Allowing connections from: 192.168.2.223,192.168.5.150
Oct 10 12:50:01 Matt-suse-vm nrpe[22704]: Added command[check_firefox]=/usr/local/nagios/libexec/check_process -p "/usr/lib/firefox/firefox-bin" -w 10 -c 20 -t cpu
Oct 10 12:50:01 Matt-suse-vm nrpe[22704]: Added command[check_load]=/usr/local/nagios/libexec/check_load -w 15,10,5 -c 30,25,20
Oct 10 12:50:01 Matt-suse-vm nrpe[22704]: Added command[check_Xorg]=/usr/local/nagios/libexec/check_process -w 5 -c 10 -t cpu
Oct 10 12:50:01 Matt-suse-vm nrpe[22704]: Added command[check_checkNRPE]=/usr/local/nagios/libexec/check_nrpeDaemon --check
Oct 10 12:50:01 Matt-suse-vm nrpe[22704]: Added command[check_killNRPE]=/usr/local/nagios/libexec/check_nrpeDaemon --kill-nrpe $ARG1$
Oct 10 12:50:01 Matt-suse-vm nrpe[22704]: Added command[check_users]=/usr/local/nagios/libexec/check_users -w 2 -c 5

Where it says "Allowing connections from...", the first one listed is the Nagios Server and the 2nd one
is MY local machine (i.e. not the "guest" VM's IP, but my "host" IP) so I could try testing from my machine as well...

I am able to SSH to the Virtual Machine from ANY computer on the local network so I know the machines
can talk to one another... I've tried adding "nrpe tcp/5666" to "/etc/services" but I don't think that means anything
since it's running as a Daemon and not with xinetd...

Here's the Output from 'netstat':
Code:

# netstat -tulpen | grep -i nrpe
tcp    0  0 127.0.0.1:5666      0.0.0.0:*    LISTEN    1002  87259      22347/nrpe         

# netstat -at | grep nrpe
tcp        0      0 localhost:nrpe          *:*        LISTEN

I'm not positive but I don't think those netstat outputs are shwoing that it is setup correctly? I.e. in terms of what
'address' they are showing... i.e. I don't think it should be showing "127.0.0.1"???

Also, I've turned the Firewall Completely off and tried again and still nothing...

Lastly, here's the Output from 'check_nrpe': (* 192.168.5.196 is the address of the VM)
Code:

NagiosSrv:/usr/local/nagios/libexec # ./check_nrpe -H 192.168.5.196
Connection refused by host

Sorry for the LONG post, but I wanted to give as much detail as possible...
If anyone has ANY suggestions please feel free... I am at a loss here! :wall: --> EXACTLY HOW I FEEL haha

Thanks in Advance,
Matt

---------- Post updated at 03:08 PM ---------- Previous update was at 01:46 PM ----------

UPDATE:

Ughhh...... Found the Problem!!!!

Boy do I feel dumb...
Basically in the nrpe.cfg file for the "server_address=..." directive apparently you can't use the "loopback" interface ip
which I thought was just another way of writing the Localhost's IP Address but I guess it's NOT??

I wanted to use that (i.e. 127.0.0.1), because everytime I boot up my Virtual Machine (almost everytime), I get a new
IP Address. Which is a real pain in the you know what because I would have to edit the Config file just about everytime
start NRPE...

Maybe I'll write a little script to check "ifconfig" and change the IP Address in the nrpe.cfg file if it's different from the
one currently in the Config...


Thanks,
Matt

Viewing all articles
Browse latest Browse all 16232

Trending Articles