Not Information where displayed

Information and discussions relating to the Nagios Mobile addon.

Not Information where displayed

Postby icke » Fri May 04, 2012 5:09 am

Hi everyone,

I try to implement the nagios mobile in a groundwork/nagios solution. I can access the webpage succesfully but no host/service informtion are shown. In the php log I can examine such messages:

[04-May-2012 11:32:26] PHP Warning: Variable passed to each() is not an array or object in /usr/local/groundwork/nagiosmobile/includes/functions.inc.php on line 187
[04-May-2012 11:32:26] PHP Warning: Invalid argument supplied for foreach() in /usr/local/groundwork/nagiosmobile/includes/displayfunctions.inc.php on line 394
[04-May-2012 11:32:34] PHP Warning: Variable passed to each() is not an array or object in /usr/local/groundwork/nagiosmobile/includes/functions.inc.php on line 187
[04-May-2012 11:32:38] PHP Warning: Variable passed to each() is not an array or object in /usr/local/groundwork/nagiosmobile/includes/functions.inc.php on line 187
[04-May-2012 11:32:38] PHP Warning: Invalid argument supplied for foreach() in /usr/local/groundwork/nagiosmobile/includes/displayfunctions.inc.php on line 320
[04-May-2012 11:32:43] PHP Warning: Variable passed to each() is not an array or object in /usr/local/groundwork/nagiosmobile/includes/functions.inc.php on line 187
[04-May-2012 11:32:46] PHP Warning: Variable passed to each() is not an array or object in /usr/local/groundwork/nagiosmobile/includes/functions.inc.php on line 187
[04-May-2012 11:32:46] PHP Warning: Invalid argument supplied for foreach() in /usr/local/groundwork/nagiosmobile/includes/displayfunctions.inc.php on line 394
[04-May-2012 11:37:00] PHP Warning: Variable passed to each() is not an array or object in /usr/local/groundwork/nagiosmobile/includes/functions.inc.php on line 187
[04-May-2012 11:40:34] PHP Warning: Variable passed to each() is not an array or object in /usr/local/groundwork/nagiosmobile/includes/functions.inc.php on line 187

My include.inc.php looks like:
$STATUS_FILE = "/usr/local/groundwork/nagios/var/status.dat";
$COMMAND_FILE = "/usr/local/groundwork/nagios/var/spool/nagios.cmd";
$CGI_FILE = "/usr/local/groundwork/nagios/etc/cgi.cfg";
$OBJECTS_FILE = "/usr/local/groundwork/nagios/var/objects.cache";
$BASE_URL = '/mobile';
$TTL = 30; //Time to live for cached data parsed from status and objects file
$USER = ''; //you can hard-code the 'nagiosadmin' if you don't want any authentication: NOT RECOMMENDED!!

My someone can help me.

With best regards from germany... :)
icke
 
Posts: 2
Joined: Fri May 04, 2012 5:02 am

Re: Not Information where displayed

Postby mguthrie » Fri May 04, 2012 9:46 am

From looking at the error messages, it seems like Nagios Mobile wasn't able to read any of the status data. Maybe a permissions issue?

Also, we haven't tested in a groundwork environment, and I don't know if they've changed any formatting in either the status.dat or objects.cache file, but if they have it would definitely throw off the data parser.
User avatar
mguthrie
 
Posts: 4379
Joined: Mon Jun 14, 2010 10:21 am

Re: Not Information where displayed

Postby icke » Mon May 07, 2012 4:57 am

The format of the status.dat and objects.cache files are the same like the one in a normal nagios installation. I have compared the files. The groundwork nagios instance such a normal standard installation of nagios.
Permissions are correct, too:
-rw-r--r--. 1 nagios nagios 65089 7. Mai 10:41 objects.cache
-rw-rw-r--. 1 nagios nagios 45477 7. Mai 11:46 status.dat

The httpd deamon in running with 'nagios' user privileges.
Could it be some php restrictions? Running php version is 5.2.6. I have attached the php.ini.

Maybe some can give me a tip.

Thanks and best regards
Attachments
php.ini
(41.75 KiB) Downloaded 82 times
icke
 
Posts: 2
Joined: Fri May 04, 2012 5:02 am

Re: Not Information where displayed

Postby mguthrie » Mon May 07, 2012 9:53 am

Hmm, try changing the ownership of the Nagios Mobile scripts to nagios.nagios. Also,if you've got SELinux enabled, try disabling it and see if that makes a difference.
User avatar
mguthrie
 
Posts: 4379
Joined: Mon Jun 14, 2010 10:21 am

Re: Not Information where displayed

Postby mendonca » Thu Oct 25, 2012 10:03 am

Hello All,

I also have the same issue, i'm not able to see any information. I have nagios nagios for permissions set on the directories. Please see sreenshot attached.

Thank you for your time!

Thanks,
Nando
Attachments
nagiosmobile.PNG
mendonca
 
Posts: 3
Joined: Thu Oct 25, 2012 9:58 am

Re: Not Information where displayed

Postby mguthrie » Fri Oct 26, 2012 9:55 am

Can you verify the directory locations of the following files?

objects.cache
status.dat
cgi.cfg

and verify that these math the locations in the include.inc.php file:
Code: Select all
$STATUS_FILE  = "/usr/local/nagios/var/status.dat";
$COMMAND_FILE = "/usr/local/nagios/var/rw/nagios.cmd";
$CGI_FILE = "/usr/local/nagios/etc/cgi.cfg";
$OBJECTS_FILE = "/usr/local/nagios/var/objects.cache";
$BASE_URL = '/nagiosmobile';
User avatar
mguthrie
 
Posts: 4379
Joined: Mon Jun 14, 2010 10:21 am

Re: Not Information where displayed

Postby mendonca » Thu Nov 01, 2012 12:25 pm

Here's what i have for include.inc.php. I've verifed that these file locations are correct. I'm running an older version of Nagios (Nagios 2.11) would that make a
difference? Also, i've verified that SELinux is disabled.

$STATUS_FILE = "/var/log/nagios/status.dat";
$COMMAND_FILE = "/var/log/nagios/rw/nagios.cmd";
$CGI_FILE = "/etc/nagios/cgi.cfg";
$OBJECTS_FILE = "/var/log/nagios/objects.cache";
$BASE_URL = '/nagiosmobile';
$TTL = 30; //Time to live for cached data parsed from status and objects file
$USER = ''; //you can hard-code the 'nagiosadmin' if you don't want any authentication: NOT RECOMMENDED!!
mendonca
 
Posts: 3
Joined: Thu Oct 25, 2012 9:58 am

Re: Not Information where displayed

Postby scottwilkerson » Sat Nov 03, 2012 8:30 pm

Is apache part of your nagios group?

Code: Select all
cat /etc/group|grep nagios
User avatar
scottwilkerson
 
Posts: 4858
Joined: Tue Nov 15, 2011 3:11 pm

Re: Not Information where displayed

Postby mendonca » Sat Nov 03, 2012 9:47 pm

Yes, Apache is apart of the Nagios group.

Thanks!
mendonca
 
Posts: 3
Joined: Thu Oct 25, 2012 9:58 am

Re: Not Information where displayed

Postby mguthrie » Thu Nov 08, 2012 4:32 pm

I'm running an older version of Nagios (Nagios 2.11) would that make a
difference?

I just caught this now. Nagios Mobile has never been tested against a Nagios 2.x install. I'm pretty sure the status and object data formats changed from Nagios 2-3, so that's likely the cause.
User avatar
mguthrie
 
Posts: 4379
Joined: Mon Jun 14, 2010 10:21 am


Return to Nagios Mobile

Who is online

Users browsing this forum: No registered users and 0 guests