Page 1 of 2

Change port nagios webadmin

Posted: Mon Oct 08, 2012 9:39 am
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

Re: Change port nagios webadmin

Posted: Mon Oct 08, 2012 11:47 am
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";

Re: Change port nagios webadmin

Posted: Mon Oct 08, 2012 2:48 pm
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.

Re: Change port nagios webadmin

Posted: Tue Oct 09, 2012 11:16 am
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

Re: Change port nagios webadmin

Posted: Tue Oct 09, 2012 1:56 pm
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

Re: Change port nagios webadmin

Posted: Tue Oct 09, 2012 2:37 pm
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.

Re: Change port nagios webadmin

Posted: Wed Oct 10, 2012 11:33 am
by h2per
Hi

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

Any ideas

Thanks

Re: Change port nagios webadmin

Posted: Wed Oct 10, 2012 12:36 pm
by scottwilkerson
What do yo have in iptables? Are you allowing access to 8080?

Code: Select all

iptables -L

Re: Change port nagios webadmin

Posted: Wed Oct 10, 2012 3:40 pm
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.

Re: Change port nagios webadmin

Posted: Wed Oct 10, 2012 3:48 pm
by slansing
Glad you got it all figured out, sometimes the simple fixes are the ones that get overlooked, for all of us ;)