Hi I'm trying to change the default NRPE port from 5666 to something else. However everytime I try to use check_nrpe it still uses the default 5666 port.
I'm not sure which file I should be changing, but I've changed the nrpe.cfg file to have server_port=#### on both the client and server. Not sure where else I have to go to change the port settings.
Custom NRPE Port
Re: Custom NRPE Port
On your check_nrpe command on the XI system, did you edit the command to add the switch -p <port> and add the port that you want to use for that specific host?
Is the port open on the remote system?
Is the port open on the remote system?
Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Custom NRPE Port
Are you running NRPE under xinetd or as a "standalone" daemon? If you are running it under xinetd, you may need to change the port number in "/etc/xinetd.d/nrpe" file.
Did you make sure the port is not blocked by your firewall?
Code: Select all
port = <new port number>Code: Select all
iptables -nL | grep <new port number>Be sure to check out our Knowledgebase for helpful articles and solutions!
Re: Custom NRPE Port
Depending on how secure your Nagios server is, you may also be blocking outbound servers. You can check by expanding the iptables command and checking for the IP address of your destination host that you're checking:
Code: Select all
iptables -Lvn | grep <ip address>
Eric Loyd • http://everwatch.global • 844.240.EVER • @EricLoyd
I'm a Nagios Fanatic! • Join our public Nagios Discord Server!
Re: Custom NRPE Port
I've opened the port on the remote system via iptables, I don't believe I edited the command to add the switch; is that under commands.cfg?tgriep wrote:On your check_nrpe command on the XI system, did you edit the command to add the switch -p <port> and add the port that you want to use for that specific host?
Is the port open on the remote system?
Code: Select all
#'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -c $ARG1$
}
Re: Custom NRPE Port
Exactly. Change your command to match the following (replace <custom port> with your desired port):
Code: Select all
#'check_nrpe' command definition
define command{
command_name check_nrpe
command_line $USER1$/check_nrpe -H $HOSTADDRESS$ -p <custom port> -c $ARG1$
}Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
Re: Custom NRPE Port
Awesome that fixed it. Thank you all.
Re: Custom NRPE Port
Don't mention it. Cheers!
Former Nagios employee
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.
"It is turtles. All. The. Way. Down. . . .and maybe an elephant or two."
VI VI VI - The editor of the Beast!
Come to the Dark Side.