Change port nagios webadmin

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
h2per
Posts: 9
Joined: Mon Oct 08, 2012 9:29 am

Change port nagios webadmin

Post by h2per »

Hi everyone,

For personal reasons i need to change the default port of nagios webadmin, but i dont know which files i need to change...


Default port is: 80... i need change to 8080


Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Change port nagios webadmin

Post by scottwilkerson »

You would need to change it in /etc/httpd/conf/httpd.conf
change

Code: Select all

Listen 80
to

Code: Select all

Listen 8080
Also, you will need to change the program URL in Admin -> Manage System Config

Also, you will need to edit /usr/local/nagiosxi/html/config.inc.php
change

Code: Select all

// allow for different http port for subsystem calls
$cfg['port_number'] = false;
to

Code: Select all

// allow for different http port for subsystem calls
$cfg['port_number'] = "8080";
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
h2per
Posts: 9
Joined: Mon Oct 08, 2012 9:29 am

Re: Change port nagios webadmin

Post by h2per »

Hi Again!!

I change the files, but i cant login to nagios now, and i receive an alert:

nagios has detected a problem with this service.

Notification Type: PROBLEM

Service: HTTP
Host: localhost
Address: 127.0.0.1
State: CRITICAL
Info:
Connection refused
Date/Time: 2012-10-08 14:41:59

May be i need to change something more.


Thanks.
User avatar
lmiltchev
Bugs find me
Posts: 13589
Joined: Mon May 23, 2011 12:15 pm

Re: Change port nagios webadmin

Post by lmiltchev »

What page are you trying to log into? Can you show a screenshot?

Regarding the check_http - it uses port 80 by default. If you are changing the port, you should modify the command by adding the "-p" flag. You can view the usage of check_http by running in terminal:

Code: Select all

/usr/local/nagios/libexec/check_http -h
Be sure to check out our Knowledgebase for helpful articles and solutions!
h2per
Posts: 9
Joined: Mon Oct 08, 2012 9:29 am

Re: Change port nagios webadmin

Post by h2per »

Hi everyone,

The page that im trying to login is http://192.168.1.99:8080/nagiosxi

This is all...

When i change the port to 80 and test again, the issue gone.... but i need change the default port.


Thanks
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Change port nagios webadmin

Post by slansing »

Are you receiving a error on the page? Like it can not be displayed? Or are you trying to log in with your credentials and it will not let you. I changed my Listen port to 8080 here and it went through but not without :8080 on the end of the IP.
h2per
Posts: 9
Joined: Mon Oct 08, 2012 9:29 am

Re: Change port nagios webadmin

Post by h2per »

Hi

Im receiving a error on the page? Like it can not be displayed!!

Any ideas

Thanks
scottwilkerson
DevOps Engineer
Posts: 19396
Joined: Tue Nov 15, 2011 3:11 pm
Location: Nagios Enterprises
Contact:

Re: Change port nagios webadmin

Post by scottwilkerson »

What do yo have in iptables? Are you allowing access to 8080?

Code: Select all

iptables -L
Former Nagios employee
Creator:
Human Design Website
Get Your Human Design Chart
h2per
Posts: 9
Joined: Mon Oct 08, 2012 9:29 am

Re: Change port nagios webadmin

Post by h2per »

Hi Again!!


That was the prob, i run next command and now the page is ok,

iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport 8080 -j ACCEPT}

Thanks for all..


Best Regards.
slansing
Posts: 7698
Joined: Mon Apr 23, 2012 4:28 pm
Location: Travelling through time and space...

Re: Change port nagios webadmin

Post by slansing »

Glad you got it all figured out, sometimes the simple fixes are the ones that get overlooked, for all of us ;)
Locked