Page 2 of 3

Re: Not getting data in Nagios mobile

PostPosted: Wed Feb 26, 2014 6:42 pm
by balothia
sreinhardt wrote:Since both issues revolve around issues with parsing status.dat or are at least generated by an array object that is not being created properly, but relies on status.dat, I think we should look there first. Could you return the following output please.

Code: Select all
grep -i 'nag' /etc/group
ls -lvad /usr/local/nagios/var
ls -lvad /usr/local/nagios


Could you also show us the /usr/local/nagiosmobile/include.inc.php file please.


Hi,

Please find the requested output below.

Code: Select all
[root@ ~]# grep -i 'nag' /etc/group
nagios:x:500:apache,nagios
nagcmd:x:501:apache,nagios
shutdowngroup:x:503:nagios
[root@ ~]#

[root@ ~]# ls -lvad /usr/local/nagios/var
drwxrwxr-x. 6 nagios nagios 4096 Feb 26 17:39 /usr/local/nagios/var

[root@ ~]# ls -lvad /usr/local/nagios
drwxr-xr-x. 8 root root 4096 Jun  6  2012 /usr/local/nagios


Code: Select all
[root@ ~]# cat /usr/local/nagiosmobile/include.inc.php
<?php
// include.inc.php
// main include file for all global variables, constants, and script includes
// @author Mike Guthrie
// @author Hirose Masaaki


//////////////////FILE LOCATIONS:  EDIT THESE TO MATCH YOUR NAGIOS INSTALLATION//////
////////////////////////////////////////////////////////////////////////////////////
$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!!
///////////////////////////////////////////////////////////////////////////////////
////////////////////DO NOT MAKE CHANGES BELOW THIS LINE/////////////////////////////


// Nagios Mobile 1.0
// Copyright (c) 2011 Nagios Enterprises, LLC
// Web: http://www.nagios.com/products/nagiosmobile
// Developed by Mike Guthrie and Wesley Zhao. 
// Based on Teeny Nagios by HIROSE Masaaki.

// LICENSE:
//
// This work is made available to you under the terms of Version 2 of
// the GNU General Public License. A copy of that license should have
// been provided with this software, but in any event can be obtained
// from http://www.fsf.org.
//
// This work is distributed in the hope that it will be useful, but
// WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
// General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program; if not, write to the Free Software
// Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
// 02110-1301 or visit their web page on the internet at
// http://www.fsf.org.
//
//
// CONTRIBUTION POLICY:
//
// (The following paragraph is not intended to limit the rights granted
// to you to modify and distribute this software under the terms of
// licenses that may apply to the software.)
//
// Contributions to this software are subject to your understanding and acceptance of
// the terms and conditions of the Nagios Contributor Agreement, which can be found
// online at:
//
// http://www.nagios.com/legal/contributoragreement/
//
//
// DISCLAIMER:
//
// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
// INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
// PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
// HOLDERS BE LIABLE FOR ANY CLAIM FOR DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY,
// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
// GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) OR OTHER
// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, STRICT LIABILITY, TORT (INCLUDING
// NEGLIGENCE OR OTHERWISE) OR OTHER ACTION, ARISING FROM, OUT OF OR IN CONNECTION
// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


//////////INCLUDES
require_once('includes/functions.inc.php');
require_once('includes/displayfunctions.inc.php');
require_once('includes/parse_cgi_file.inc.php');
require_once('includes/parse_objects_file.inc.php');
require_once('includes/parse_status_file.inc.php');
require_once('class/NagiosUser.php');
require_once('class/NagiosData.php');

///////////CONSTANTS
define("TN_VERSION", "1.03");
define("HOST_UP",          0);
define("HOST_DOWN",        1);
define("HOST_UNREACHABLE", 2);
define("STATE_OK",       0);
define("STATE_WARNING",  1);
define("STATE_CRITICAL", 2);
define("STATE_UNKNOWN",  3);
define("CHILD_PROBLEM", 99);

$HOST_STATUS_BY = array(
                        HOST_UP          => "Up",
                        HOST_DOWN        => "Down",
                        HOST_UNREACHABLE => "Unreachable",
                        );
$SERVICE_STATUS_BY = array(
                           STATE_OK       => "OK",
                           STATE_WARNING  => "Warning",
                           STATE_CRITICAL => "Critical",
                           STATE_UNKNOWN  => "Unknown",
                           );

//////APC
//use apc if we've got it
$APC = (function_exists('apc_add') && function_exists('apc_fetch') && function_exists('apc_exists')) ? true : false;



?>[root@ ~]#



Thanks,
Gautam

Please use [code] [/code ] tags when submitting large amounts of text

Re: Not getting data in Nagios mobile

PostPosted: Thu Feb 27, 2014 3:06 pm
by scottwilkerson
And finally, what is the output of the following
Code: Select all
ls -la /usr/local/nagios/var/status.dat

Re: Not getting data in Nagios mobile

PostPosted: Thu Feb 27, 2014 7:43 pm
by balothia
scottwilkerson wrote:And finally, what is the output of the following
Code: Select all
ls -la /usr/local/nagios/var/status.dat


Below is the output.
Code: Select all
[root@ ~]# ls -la /usr/local/nagios/var/status.dat
-rw-rw-r-- 1 nagios nagios 789781 Feb 27 18:40 /usr/local/nagios/var/status.dat
[root@ ~]#


Thanks,
Gautam

Re: Not getting data in Nagios mobile

PostPosted: Fri Feb 28, 2014 12:45 pm
by lmiltchev
-rw-rw-r-- 1 nagios nagios 789781 Feb 27 18:40 /usr/local/nagios/var/status.dat


These permissions are correct...

I am able to login to Nagios mobile but not getting any data.


Is this on your mobile device or in a browser? Have you tried a few different browsers - Firefox, IE, Chrome, etc.?

Re: Not getting data in Nagios mobile

PostPosted: Sat Mar 01, 2014 11:27 am
by balothia
lmiltchev wrote:
-rw-rw-r-- 1 nagios nagios 789781 Feb 27 18:40 /usr/local/nagios/var/status.dat


These permissions are correct...

I am able to login to Nagios mobile but not getting any data.


Is this on your mobile device or in a browser? Have you tried a few different browsers - Firefox, IE, Chrome, etc.?


I tried with Moziall, IE & Chrome on laptop. In iPad i tried with Mozilla, Safari and Chrome as well. But didnt worked at all.

Thanks,
Gautam

Re: Not getting data in Nagios mobile

PostPosted: Mon Mar 03, 2014 11:03 am
by slansing
Can we get an updated apache error log tail, first, try to access the web interface from your mobile device, then run the following on the nagios server:

Code: Select all
tail -25 /var/log/httpd/error_log


And post the output here "in code tags."

Re: Not getting data in Nagios mobile

PostPosted: Mon Mar 03, 2014 5:39 pm
by balothia
Below are the logs when i accessed the nagiosmobile from my Blackberry.
Code: Select all
[Mon Mar 03 16:21:20 2014] [error] [client x.x.x.x] PHP Notice:  Undefined index: hosts in /usr/local/nagiosmobile/includes/displayfunctions.inc.php on line 320, referer:
[Mon Mar 03 16:30:41 2014] [error] [client x.x.x.x] PHP Warning:  Variable passed to each() is not an array or object in /usr/local/nagiosmobile/includes/functions.inc.php on line 187
[Mon Mar 03 16:30:47 2014] [error] [client x.x.x.x] 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://x.x.x.x/nagiosmobile/
[Mon Mar 03 16:30:47 2014] [error] [client x.x.x.x] PHP Notice:  Undefined index: hosts in /usr/local/nagiosmobile/includes/displayfunctions.inc.php on line 320, referer: http://x.x.x.x/nagiosmobile/
[Mon Mar 03 16:30:47 2014] [error] [client x.x.x.x] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosmobile/includes/displayfunctions.inc.php on line 320, referer: http://x.x.x.x/nagiosmobile/
[Mon Mar 03 16:32:51 2014] [error] [client x.x.x.x] PHP Warning:  Variable passed to each() is not an array or object in /usr/local/nagiosmobile/includes/functions.inc.php on line 187
[Mon Mar 03 16:32:56 2014] [error] [client x.x.x.x] 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://x.x.x.x/nagiosmobile/
[Mon Mar 03 16:32:56 2014] [error] [client x.x.x.x] PHP Notice:  Undefined index: hosts in /usr/local/nagiosmobile/includes/displayfunctions.inc.php on line 320, referer: http://x.x.x.x/nagiosmobile/
[Mon Mar 03 16:32:56 2014] [error] [client x.x.x.x] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosmobile/includes/displayfunctions.inc.php on line 320, referer: http://x.x.x.x/nagiosmobile/
[Mon Mar 03 16:34:36 2014] [error] [client x.x.x.x] PHP Warning:  Variable passed to each() is not an array or object in /usr/local/nagiosmobile/includes/functions.inc.php on line 187
[Mon Mar 03 16:34:42 2014] [error] [client x.x.x.x] 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://x.x.x.x/nagiosmobile/
[Mon Mar 03 16:34:42 2014] [error] [client x.x.x.x] PHP Notice:  Undefined index: hosts in /usr/local/nagiosmobile/includes/displayfunctions.inc.php on line 320, referer: http://x.x.x.x/nagiosmobile/
[Mon Mar 03 16:34:42 2014] [error] [client x.x.x.x] PHP Warning:  Invalid argument supplied for foreach() in /usr/local/nagiosmobile/includes/displayfunctions.inc.php on line 320, referer: http://x.x.x.x/nagiosmobile/


Thanks,
Gautam

Re: Not getting data in Nagios mobile

PostPosted: Tue Mar 04, 2014 11:30 am
by slansing
Did you install Nagios from source, or via a package manager. Not sure if we got this, but what distro are you running Nagios on?

Re: Not getting data in Nagios mobile

PostPosted: Wed Mar 05, 2014 6:18 pm
by balothia
slansing wrote:Did you install Nagios from source, or via a package manager. Not sure if we got this, but what distro are you running Nagios on?


If i remember correctly this is a pre-installed VM CentOS 6.x with Nagios XI 2012 installed, though Nagios upgraded later on. We got this pre-build downloaded from NagiosXI download.

Thanks,
Gautam

Re: Not getting data in Nagios mobile

PostPosted: Thu Mar 06, 2014 12:07 pm
by lmiltchev
If i remember correctly this is a pre-installed VM CentOS 6.x with Nagios XI 2012 installed, though Nagios upgraded later on. We got this pre-build downloaded from NagiosXI download.

Was this a 32 or 64-bit VM?

Run the following commands:

Code: Select all
cd /tmp
tar zcvf nagiosmobile.tar.gz /usr/local/nagiosmobile/


and PM me the "nagiosmobile.tar.gz".