Strange notice after nagios upgrade to version 3.3.1

Hello everybody.

I’ve just upgraded nagios to version 3.3.1 and when I load the home page of the nagios web interface I can see this:
%between%http://i.imgur.com/9ucri.png

The suspicious message is: Notice: Undefined index: link in /usr/share/nagios/htdocs/main.php on line 94

I don’t understand how to fix it and if it is a real problem. The code to define such “index” is the following:

<?php $url="http://www.nagios.org/backend/feeds/corepromo"; $rss=fetch_rss($url); $x=0; foreach ($rss->items as $item){ $x++; if($x>3) break; $href = $item'link']; $title = $item'title']; $desc = $item'description']; //echo "<li><a href='$href' target='_blank'>$title</a></li>"; echo "<li>$desc</li>"; } ?>

The line is the following:
$href = $item’link’];

Any idea?

yes, disable php error notifications on a production server :slight_smile:

It’s a notice level error notification, they SHOULDN’T be there… but you shouldn’t even be showing them :slight_smile: i suppose it will be fixed in the next version.

Thank you luca!
:slight_smile:

Hi,

I’m new user on nagios and apache and *nix :slight_smile:

How can i do it?

this may help as a starting point:

php-mysql-tutorial.com/wikis … mysql.aspx

Yes, just comment out the line with error_reporting in the /etc/php/apache2-php{version}/php.ini file or set it to error_reporting = E_ALL & ~E_NOTICE that is the default behaviour.