Saturday, July 7, 2012

Change Nagios' Default Home Page

My last install of Nagios on CentOS went all fine except the home page of Nagios was not loading the main container with welcome page. It was blank. I had to change default home page to something meaningful. I changed it to "tactical overview" page.

In /usr/local/nagios/share/index.php or /usr/share/nagios/htdocs/index.php file, change this line
If you do not find your index.php in above two locations, try using this command to locate it on your disc:
locate index.php | grep nagios

Here are a couple of paths that you may be interested in
"Tactical Summary": cgi-bin/tac.cgi
"Map"             : cgi-bin/statusmap.cgi?host=all
"Hosts"           : cgi-bin/status.cgi?hostgroup=all&style=hostdetail
"Services"        : cgi-bin/status.cgi?host=all
"Summary"         : cgi-bin/status.cgi?hostgroup=all&style=summary
"Problems"        : cgi-bin/status.cgi?host=all&servicestatustypes=28
"Availability"    : cgi-bin/avail.cgi
"Trends"          : cgi-bin/trends.cgi
"Summary"         : cgi-bin/summary.cgi


  1. This was a great hack in versions up to 4.0.5 or 4.0.6. Unfortunately, it no longer works in 4.0.7 :(
    $corewindow isn't defined anyhere in index.php or main.php. Sadness.

    1. Hi ! In Nagios 4.0.7 you have a $url variable at the top of your index.php.
      By default it is set as following: $url = 'main.php', but you can change it for others paths listed in the article above and the Hack will work for 4.0.7 ! ;)

      (And sorry if I made some mistakes, I'm a french Nagios user and I have to perfect my english speaking)

    2. Great Article android based projects

      Java Training in Chennai Project Center in Chennai Java Training in Chennai projects for cse The Angular Training covers a wide range of topics including Components, Angular Directives, Angular Services, Pipes, security fundamentals, Routing, and Angular programmability. The new Angular TRaining will lay the foundation you need to specialise in Single Page Application developer. Angular Training

  2. This hack doesn't work for Nagios 4.1.1: it seems that the new Apache configuration doesn't allow to touch the .cgi.

  3. This comment has been removed by the author.

  4. For 4.1.1 :
    1 - Create a copy of main.php and call it main2.php
    2 - Edit main2.php and insert the following (Replace [IP] with Nagios server ip or hostname):
    Between php tags: header("Location: http://[IP]/nagios/cgi-bin/status.cgi?hostgroup=all&style=overview");

    3 - Edit index.php : $url = 'main2.php'

    Done :D

  5. Hi VDamas,

    We are using Nagios Core 4.0.8 version & i want to put our company logo instead of Nagios logo & also i want to enable Tactical Overview as default. Can you please help me on this as well


  6. I have identified the cause & resolved it

  7. hi,

    how i can set login and logout button in nagios core in different index.html/index.php file

  8. I like the post format as you create user engagement in the complete article. It seems round up of all published posts. Thanks for gauging the informative posts.
    cara menggugurkan kandungan
    obat aborsi
    kalkulator kehamilan
    tanda tanda kehamilan