Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does one change nagios default url to custom url?

Tags:

nagios

I am running Nagios Core 4.0.8 in my environment and I am looking to find a way to change the default url from https://example.com/nagios to https://example.com. Is there a way one can do that?

like image 863
Ura718 Avatar asked Jan 08 '23 23:01

Ura718


1 Answers

You will need to edit the cgi.cfg file for Nagios.

  1. vim /usr/local/nagios/etc/cgi.cfg

    Change url_html_path=/nagios to url_html_path=/

  2. Edit nagios.conf:

    Change ScriptAlias /nagios/cgi-bin "/usr/local/nagios/sbin" to ScriptAlias /cgi-bin "/usr/local/nagios/sbin"

    Comment out the line Alias /nagios "/usr/local/nagios/share" and then add below

    DocumentRoot /usr/local/nagios/share

    Add the following at top of the configuration:

    <VirtualHost *:80> ServerName status.example.com

    and add </VirtualHost> at the bottom.

  3. Edit your /usr/local/nagios/share/config.inc.php file:

    Change $cfg['cgi_base_url']='/nagios/cgi-bin'; to $cfg['cgi_base_url']='/cgi-bin';

  4. Restart Apache and Nagios

like image 70
George Ulahannan Avatar answered Feb 12 '23 09:02

George Ulahannan