how to change nagios default port

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.
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: how to change nagios default port

Post by rkennedy »

Then the above instructions should work for you fine, you will have to change the directories according to how they're set in Ubuntu.
Former Nagios Employee
harsha.s.aryan
Posts: 52
Joined: Fri Nov 13, 2015 9:05 am

Re: how to change nagios default port

Post by harsha.s.aryan »

hi,

i have added the below string in /usr/local/nagios/share/config.inc.php file but still i am unable to connect nagios using http://localhost:8081 url
$cfg['port_number'] =8081
Regards,
Harsha
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: how to change nagios default port

Post by rkennedy »

File - /etc/httpd/conf/httpd.conf
Look for Listen 80 change to Listen 8081
Did you look for that file and modify it as well? Both need to be modified, followed by restarts of both services. (apache and nagios)
Former Nagios Employee
harsha.s.aryan
Posts: 52
Joined: Fri Nov 13, 2015 9:05 am

Re: how to change nagios default port

Post by harsha.s.aryan »

hi if i

add below thing in httpd.conf also i am getting error

File - /etc/httpd/conf/httpd.conf
Look for Listen 80 change to Listen 8081


i have to usee like :- http://localhost:8081/nagios

i am looking like http://localhost:8081/

Without any /nagios i want to access.
Regards,
Harsha
rkennedy
Posts: 6579
Joined: Mon Oct 05, 2015 11:45 am

Re: how to change nagios default port

Post by rkennedy »

Do you have it working by accessing http://localhost:8081 ?

As for taking the /nagios out, there are many changes that would need to be done for this. Are you trying to do this for a specific reason?

Alternatively, you could just create a file called index.php located at the base of your www directory. From there fill it with following -

Code: Select all

<?php
header("Location: http://localhost:8081/nagios")
?>

This will redirect all traffic that hits http://localhost:8081 to your nagios install.
Former Nagios Employee
Locked