nagiosmobile

Support forum for Nagios Core, Nagios Plugins, NCPA, NRPE, NSCA, NDOUtils and more. Engage with the community of users including those using the open source solutions.
rglong9
Posts: 4
Joined: Tue Jan 10, 2012 11:41 am

nagiosmobile

Post by rglong9 »

Has anyone had the problem that none of my servers that show in Nagios Core are showing in nagiosmobile?

I have verified all the configuration files in my /usr/local/nagiosmobile/include.inc.php are where they should be. I also get prompted for a username and password, but I see 0 servers or services where in Core I see all.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: nagiosmobile

Post by mguthrie »

Do you have any errors in the apache log that are being generated from the nagiosmobile php scripts?

Is the the user that you're logged in with defined either as a contact or defined in the cgi.cfg file?
rglong9
Posts: 4
Joined: Tue Jan 10, 2012 11:41 am

Re: nagiosmobile

Post by rglong9 »

I saw no erors in the logs, and the login I am using is the same that I use for the Core
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: nagiosmobile

Post by mguthrie »

I'll do some looking on this and see if I can find anything that might cause this.

What browser and platform are you viewing it on? (iphone, android, etc).
rglong9
Posts: 4
Joined: Tue Jan 10, 2012 11:41 am

Re: nagiosmobile

Post by rglong9 »

webOS using the standard WebKit based browser.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: nagiosmobile

Post by mguthrie »

Hey are you using either basic authentication or digest authentication? Or are you using something like LDAP or a different type of apache authentication?

Also, what version of PHP are you running?
swordfish
Posts: 5
Joined: Wed Jan 11, 2012 1:59 am

Re: nagiosmobile

Post by swordfish »

Hello, Can I piggy back on this thread...

I've just installed nagiosmobile to our Nagios 3.0.6 RHEL 5.7 x64 server and get nothing to the browser.

Authentication is ok (checked the logs with positive message)
Apache is ok (browsed to nagios.png and the logo showed).

The apache error log shows:

Code: Select all

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 93 bytes) in /usr/share/nagiosmobile/includes/parse_objects_file.inc.php on line 131
The include.inc.php relevant parts are:

Code: Select all

//////////////////FILE LOCATIONS:  EDIT THESE TO MATCH YOUR NAGIOS INSTALLATION//////
////////////////////////////////////////////////////////////////////////////////////
$STATUS_FILE  = "/var/nagios/status.dat";
$COMMAND_FILE = "/var/nagios/rw/nagios.cmd";
$CGI_FILE = "/etc/nagios/cgi.cfg";
$OBJECTS_FILE = "/var/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!! 
///////////////////////////////////////////////////////////////////////////////////
And these are verified to match the actual file locations.

So in summary, I think the install is ok, but the application is failing due to the number of objects we have.

Nagios Stats:

Code: Select all

Service Check Execution Time:   0.00 / 1158.11 / 1093.575 sec
Service Check Latency:          0.00 / 6.67 / 0.139 sec
Host Check Execution Time:      0.00 / 11.13 / 0.534 sec
Host Check Latency:             0.00 / 15.62 / 0.016 sec
Active Host / Service Checks:   2340 / 12761
Passive Host / Service Checks:  32 / 373
We could increase the PHP memory allocation, but if Nagios Core doesn't need it, I figure nagiosmobile probably doesn't.
It might just need a tweak to be more efficient.

Please advise. Thanks.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: nagiosmobile

Post by mguthrie »

Oh, I see what it is. The php-apc caching is hitting the memory limit because of your larger environment. So you'll want to increase the memory limit in the /etc/php.ini file on your system. OR, you can also just disable the apc extention in the php.ini file, but the page load times will increase. It all depends on what your system's needs are for memory usage.
swordfish
Posts: 5
Joined: Wed Jan 11, 2012 1:59 am

Re: nagiosmobile

Post by swordfish »

Hi, thanks for that.

I first set $APC=false; but it made no difference. I'm not even sure I have APC available. (That's a different question).

The PHP.ini memory was 128M, so I made it 256M and restarted httpd.

That has worked.

Thanks.
mguthrie
Posts: 4380
Joined: Mon Jun 14, 2010 10:21 am

Re: nagiosmobile

Post by mguthrie »

Good deal!

APC can be installed from the package php-apc or php53-apc depending on your PHP version. After installing it you would just have to add the line:

Code: Select all

apc.enabled=1
to your php.ini file and restart apache.
It caches some of the data so that Nagios Mobile doesn't have to parse the status.dat and the objects.cache file on every page load.
Locked