7

Ever since I updated to nagios 3.2.1 from 3.0.6 I can no longer refresh any status pages. When I refresh, it just goes back to the "home" page of nagios, forcing me to drill back down to whatever I was looking at. With 3.0.6 I was able to refresh pages just fine to see updated statuses.

Obviously this is related to the way nagios uses a frame to display all the different pages and keep the navigation on the left, and it probably has to do with how nagios hides the full url in the address bar and just shows http://hostname/nagios no matter what page you're on. The change in behavior from 3.0.6 to 3.2 probably has everything to do with the change from html to php files for the left-hand side navigation.

All of these things I know, the question is how do I get it to work how I want it to. Is there some option somewhere that I'm not finding to show the full URL in the address bar or to refresh only the frame?

7 Answers 7

9

Rightclick the frame, reload frame

modify your template and put

<a href="#">refresh</a>

You can fix this by adding

header("Cache-Control: max-age=7200, public");

to the beginning of the PHP code section of share/index.php (NOT in the if-clause!).

Your browser does not know if it should cache the current frame, so defaults to not doing so. This causes it to reload to main.php instead. (Appreciated Source in German: https://checkmk.de/lw_nagios_frameset_f5.html)

3
  • 2
    That does the trick. Adding the refresh link in every page is a bit too much work for my tastes, but hitting alt+f5 instead of f5 is just fine with me.
    – Matt
    Jul 2, 2010 at 19:08
  • 3
    it is a single template modification. common-footer.ssi in htdocs/ssi (must be executable, appends to the footer of any cgi generated page)
    – karmawhore
    Jul 2, 2010 at 19:20
  • Thanks, the SSI information is the critical piece of information for me.
    – Jay Taylor
    Oct 29, 2012 at 21:04
1

You can bypass the left side frame and open a status only window.

Try right clicking on the status link you want to refresh and open just that frame in a new window. (that's what I normally do)

1
  • That's already how I have our "dashboard" wall-mounted computer set up, for this question I'm more interested in it while I'm actively moving around and looking at stuff, so I still need the left bar for navigation.
    – Matt
    Jul 2, 2010 at 19:07
1

I know this may be a little late, but...

It has to do with the frameset page itself now being a php file (instead of html). There is a little bit of php code in that file to handle the "corewindow" parameter/feature. If you do not use that feature, you could remove the block of php code from index.php, change the second frame src attribute to main.php and rename index.php to index.html.

1
  • 4
    A little late indeed! The answer now would include either hacking into my old employer's network, or convincing my current employer to drop solarwinds in favor of nagios.
    – Matt
    Jun 24, 2011 at 5:12
1

I solved it by deleting all php code from index.php and placing instead of

<frame src="<?php echo $corewindow;?>" name="main" frameborder="0">

this

<frame src="main.php" name="main" frameborder="0">

and then move index.php to index.html

Here is my index.html

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN" "http://www.w3.org/TR/html4/frameset.dtd">

<html>
<head>
<meta name="ROBOTS" content="NOINDEX, NOFOLLOW">
<title>Nagios Core</title>
<link rel="shortcut icon" href="images/favicon.ico" type="image/ico">
</head>


<frameset cols="180,*">
<frame src="side.php" name="side" frameborder="0">
<frame src="main.php" name="main" frameborder="0">

<noframes>
<!-- This page requires a web browser which supports frames. -->
<h2>Nagios Core</h2>
<p align="center">
<a href="http://www.nagios.org/">www.nagios.org</a><br>
Copyright &copy; 2010-2011 Nagios Core Development Team and Community Contributors.
Copyright &copy; 1999-2010 Ethan Galstad<br>
</p>
<p>
<i>Note: These pages require a browser which supports frames</i>
</p>
</noframes>

</frameset>

</html>
1

@Karmawhore's accepted answer didn't actually force the refresh it just kept me on the cached page. So I just added a Nagios CGI Custom Header by creating a common-header.ssi file under /usr/share/nagios3/htdocs/ssi/ containing:

<div align="right"><a href="#" onclick="location.reload(true)">refresh</a></div>

Which adds a little refresh link to the upper right hand corner of every cgi page like so: nagios interface with refresh link

0

Arcadius's answer is a good solution that could get adopted by nagios itself. don't know why it's been voted down, apart from missing where reload.png comes from.

for reload.png. cp /usr/share/icons/gnome/32x32/actions/reload.png /usr/share/nagios/images/ reload.png (at this location) comes from gnome-icon-theme (rpm -qf /usr/share/icons/gnome/32x32/actions/reload.png)

there are other sizes available, if you like.

Hiney

-1
  1. Place reload.png into nagios/images, give ≽ 555,
  2. Replace in nagios/index.php:
<frame src="<?php echo $corewindow;?>" name="main" frameborder="0" style="">

.. by

<frame src="<?php echo $corewindow;?>" name="main" frameborder="0" style=""
    onload="this.contentWindow.document.body.innerHTML+='<a href=\'#\' onclick=\'location.reload()\'><img src=\'/nagios/images/reload.png\' alt=\'Refresh\' style=\'position:fixed; top:20px; right:20px; z-index:10000\'></a>'">
1
  • (1) this is SO much more work than any of the other options. (2) I see no reload.png here...
    – voretaq7
    Nov 11, 2013 at 18:24

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .