Page 1 of 1

NagiosMobile is empty!

PostPosted: Fri Apr 12, 2013 8:05 am
by ruffsense
I followed your tutorial but still ended empty.

I can see the Web Ui but i can't see any host. I only have my localhost but even that i can't see.
I checked the include file and eveything is there.

There where no errors.
I use nagios 3.5.0 on Centos 6.4

$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';
$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!!

more information:
-rw-rw-r-- 1 nagios nagios 12732 Apr 12 16:39 status.dat

changed the owner (didn't help me)
drwxr-xr-x 6 root root 4096 Apr 12 14:42 nagiosmobile
---------------------------------------------------------------------
total 60
-rwxr-xr-x 1 nagios nagios 493 Apr 12 14:42 CHANGES
drwxr-xr-x 2 nagios nagios 4096 Apr 12 14:42 class
-rwxr-xr-x 1 nagios nagios 68 Apr 12 14:42 footer.inc.php
-rwxr-xr-x 1 nagios nagios 4978 Apr 12 14:42 header.inc.php
-rwxr-xr-x 1 nagios nagios 4448 Apr 12 14:42 include.inc.php
drwxr-xr-x 2 root root 4096 Apr 12 14:42 includes
-rwxr-xr-x 1 nagios nagios 5385 Apr 12 14:42 index.php
drwxr-xr-x 3 nagios nagios 4096 Apr 12 14:42 jquery.mobile-1.0
drwxr-xr-x 2 nagios nagios 4096 Apr 12 14:42 js
-rwxr-xr-x 1 nagios nagios 1423 Apr 12 14:42 nagiosmobile.css
-rwxr-xr-x 1 nagios nagios 3631 Apr 12 14:42 nagios.png
-rwxr-xr-x 1 nagios nagios 2984 Apr 12 14:42 TODO.txt
-------------------------------------------------------------------
error:
PHP Warning: Invalid argument supplied for foreach() in /usr/local/nagiosmobile/includes/displayfunctions.inc.php on line 320, referer: http://nagios01/nagiosmobile/
PHP Warning: Variable passed to each() is not an array or object in /usr/local/nagiosmobile/includes/functions.inc.php on line 187

Am i missin' something? Are how can i solve this problem?

Re: NagiosMobile is empty!

PostPosted: Sat Apr 13, 2013 12:03 pm
by ruffsense
Can anyone help me out or point me in the Wright direction.

Re: NagiosMobile is empty!

PostPosted: Tue Apr 16, 2013 9:25 am
by mguthrie
The only time I've ever seen this is when one of the directory locations for status.dat, cgi.cfg, or object.cache are incorrect. Is this a source install of Nagios Core 3.5.0?

Re: NagiosMobile is empty!

PostPosted: Tue Apr 16, 2013 11:29 pm
by ruffsense
Yes it is.

Re: NagiosMobile is empty!

PostPosted: Wed Apr 17, 2013 9:31 am
by mguthrie
If you can zip up your status.dat, objects.cache, and cgi.cfg files I can run a local test and see if there's a bug in the parser somewhere. Send them in a PM for privacy.

Re: NagiosMobile is empty!

PostPosted: Thu Apr 18, 2013 12:52 pm
by mguthrie
I loaded up your objects and status files, and logged in as nagiosadmin. Everything worked correctly. One thing I just thought of, can you make sure that SELinux is disabled? That has a way of silently breaking things on web apps.

Re: NagiosMobile is empty!

PostPosted: Fri Apr 26, 2013 7:20 am
by hrwang
I have the same error, can't see anything on nagiosmobile web page.
suse10sp2 + Nagios 3.2.0

include.inc.php
Code: Select all
//////////////////FILE LOCATIONS:  EDIT THESE TO MATCH YOUR NAGIOS INSTALLATION//////
////////////////////////////////////////////////////////////////////////////////////
$STATUS_FILE  = "/usr/local/nagios/var/retention.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';
$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 RECOMMEND
ED!!
//////


#ls -l /usr/local/nagios/var
drwxrwxr-x 2 nagios nagios 288 2014-08-27 00:00 archives
-rw-r--r-- 1 nagios nagios 2416 2014-10-11 16:23 livestatus.log
-rw-r--r-- 1 nagios nagios 5 2014-10-11 16:23 nagios.lock
-rw-r--r-- 1 nagios nagios 52183 2014-10-11 16:23 nagios.log
-rw-rw-r-- 1 nagios nagios 0 2014-08-26 20:40 ndomod.tmp
srwxr-xr-x 1 nagios nagios 0 2012-08-13 12:47 ndo.sock
-rw-r--r-- 1 nagios nagios 15332 2014-10-11 16:23 objects.cache
-rw-rw-rw- 1 nagios nagios 8129 2014-10-11 16:23 retention.dat
drwxrwsr-x 2 nagios nagios 104 2014-10-11 16:23 rw
-rw-r--r-- 1 nagios nagios 7797 2014-10-11 16:34 service-perfdata
drwxrwxr-x 3 nagios nagios 80 2010-03-26 09:05 spool
-rw-rw-r-- 1 nagios nagios 8781 2014-10-11 16:35 status.log

#ls -l /usr/local/nagios/var/rw
srw-rw---- 1 nagios nagios 0 2014-10-11 16:23 live
prw-rw---- 1 nagios nagios 0 2014-10-11 16:23 nagios.cmd


#tail /var/log/apache2/error_log
[Sat Oct 11 16:23:40 2014] [error] [client 192.168.254.1] PHP Warning: Variable passed to each() is not an array or object in /usr/local/nagiosmobile/includes/functions.inc.php on line 187
[Sat Oct 11 16:23:42 2014] [error] [client 192.168.254.1] PHP Warning: Variable passed to each() is not an array or object in /usr/local/nagiosmobile/includes/functions.inc.php on line 187
[Sat Oct 11 16:23:50 2014] [error] [client 192.168.254.1] PHP Warning: Variable passed to each() is not an array or object in /usr/local/nagiosmobile/includes/functions.inc.php on line 187
[Sat Oct 11 16:23:52 2014] [error] [client 192.168.254.1] PHP Warning: Variable passed to each() is not an array or object in /usr/local/nagiosmobile/includes/functions.inc.php on line 187, referer: http://192.168.254.155/nagiosmobile/index.php

Any idear?

Best Regards!

hrwang

Re: NagiosMobile is empty!

PostPosted: Fri Apr 26, 2013 7:35 am
by scottwilkerson
One thing I see is that these files are dated over a year in the future. Do you have the date and timezones setup correctly on the server? also, the status.dat is setup to go to the retention.dat instead of the status.dat, and in your directory the status.dat seems missing...