Page 1 of 2

Upgrade Nagios Core

Posted: Fri Sep 09, 2016 11:36 pm
by rlinux57
How can i upgrade nagios core Version 4.1.1 to nagios core Version 4.2.1 ?

Re: Upgrade Nagios Core

Posted: Mon Sep 12, 2016 2:54 pm
by tmcdonald
Pretty simple really, you'll want to back up your configs and then grab the latest source:

https://github.com/NagiosEnterprises/na ... master.zip

Unzip on your server, enter directory, and run:

Code: Select all

./configure
make
make install
with whatever options you might have passed when initially installing.

Re: Upgrade Nagios Core

Posted: Sat Sep 17, 2016 1:21 am
by rlinux57
Upgraded successfully, thanks for your cooperation. Kindly let me know how to upgrade nrpe as well ?

Re: Upgrade Nagios Core

Posted: Sun Sep 18, 2016 10:36 pm
by Box293

Re: Upgrade Nagios Core

Posted: Mon Sep 26, 2016 7:35 am
by rlinux57
After upgradation i have frequently getting an error, please find screenshot.
During this error all critical and warning services goes green.

Below are the logs:

Code: Select all

tailf /usr/local/nagios/var/nagios.log
[1474892687] Error: Unable to create temp file '/usr/local/nagios/var/nagios.tmprmTdMW' for writing status data: No space left on device
[1474892697] Error: Unable to create temp file '/usr/local/nagios/var/nagios.tmpoBHSf1' for writing status data: No space left on device
[1474892699] Warning: File '/tmp/perfdata.log' could not be opened - service performance data will not be written to file!
[1474892707] Error: Unable to create temp file '/usr/local/nagios/var/nagios.tmpfQ2BQG' for writing status data: No space left on device
[1474892717] Error: Unable to create temp file '/usr/local/nagios/var/nagios.tmp0lbqyX' for writing status data: No space left on device
[1474892727] Error: Unable to create temp file '/usr/local/nagios/var/nagios.tmpz8bgnP' for writing status data: No space left on device
[1474892729] Warning: File '/tmp/perfdata.log' could not be opened - service performance data will not be written to file!
[1474892737] Error: Unable to create temp file '/usr/local/nagios/var/nagios.tmp62dYii' for writing status data: No space left on device
[1474892746] SERVICE ALERT: Webs02;Total Processes;OK;HARD;3;PROCS OK: 736 processes
[1474892747] Error: Unable to create temp file '/usr/local/nagios/var/nagios.tmpZaMHlm' for writing status data: No space left on device
[1474892757] Error: Unable to create temp file '/usr/local/nagios/var/nagios.tmpKrsrv1' for writing status data: No space left on device
[1474892759] Warning: File '/tmp/perfdata.log' could not be opened - service performance data will not be written to file!

Code: Select all

ll /usr/local/nagios/var/
total 2516
drwxrwxr-x 2 nagios nagios  20480 Sep 25 23:59 archives
-rw-r--r-- 1 nagios nagios     34 Sep 22 07:28 nagios.configtest
-rw-r--r-- 1 apache root        0 Dec  4  2015 nagiosgraph-cgi.log
-rw-r--r-- 1 nagios root    10164 Dec  4  2015 nagiosgraph.log
-rw-r--r-- 1 nagios nagios      6 Sep 22 07:28 nagios.lock
-rw-r--r-- 1 nagios nagios 220911 Sep 26 08:26 nagios.log
-rw-r--r-- 1 nagios nagios 468922 Sep 22 07:28 objects.cache
-rw-r--r-- 1 nagios nagios 468922 Sep 22 07:28 objects.precache
-rw------- 1 nagios nagios 677727 Sep 26 07:28 retention.dat
drwxr-xr-x 2 nagios apache   4096 Dec  4  2015 rrd
drwxrwsr-x 2 nagios nagcmd   4096 Sep 22 07:28 rw
drwxr-xr-x 3 root   root     4096 Nov 17  2015 spool
-rw-rw-r-- 1 nagios nagios 674606 Sep 26 08:26 status.dat
*Note: there's a lot of space left on server.

Re: Upgrade Nagios Core

Posted: Mon Sep 26, 2016 3:06 pm
by tgriep
It may be a permission problem for those files / folder and not a space issue causing the errors.
Can you login as root, run the following and post the output?

Code: Select all

ls -l /usr/local/nagios/
ls -l /tmp
df -h
df -i
Thanks

Re: Upgrade Nagios Core

Posted: Tue Sep 27, 2016 5:38 am
by rlinux57
Below is the required output:

Code: Select all

ls -l /usr/local/nagios/
total 40
drwxrwxr-x  2 nagios nagios 4096 Sep 16 09:30 bin
drwxr-xr-x  6 nagios nagios 4096 Apr 25 09:12 etc
drwxrwxr-x  3 nagios nagios 4096 Nov 17  2015 etc.bak
drwxr-xr-x  6 root   root   4096 Apr 25 09:14 etc.new
drwxr-xr-x  2 root   root   4096 Nov 17  2015 include
drwxrwxr-x  4 nagios nagios 4096 Aug 29 02:08 libexec
drwxrwxr-x  2 nagios nagios 4096 Sep 16 09:30 sbin
drwxrwxr-x 15 nagios nagios 4096 Sep 16 09:30 share
drwxr-xr-x  2 nagios nagios 4096 Mar 11  2016 sms
drwxrwxr-x  6 nagios nagios 4096 Sep 27 06:24 var

Code: Select all

ls -l /tmp
total 13428
drwxrwxr-x 18 root   root       4096 Nov 17  2015 nagios-4.1.1
-rw-r--r--  1 root   root   11206656 Aug 19  2015 nagios-4.1.1.tar.gz
drwxr-xr-x 15 root   root       4096 Nov 17  2015 nagios-plugins-2.0
-rw-r--r--  1 root   root    2501847 Mar  4  2014 nagios-plugins-2.0.tar.gz
-rw-r--r--  1 nagios nagios      400 Sep 27 06:25 perfdata.log
-rw-r--r--  1 nagios nagios     9968 Mar 11  2016 php_errors.log
-rw-r--r--  1 nagios nagios      193 Mar 11  2016 url?id=admin&pass=souls93&mask=admin&to=9236999001&lang=English&msg=** ACKNOWLEDGEMENT Service Alert: N700%2FHome Partition is WARNING **
-rw-r--r--  1 nagios nagios      193 Mar 11  2016 url?id=admin&pass=souls93&mask=admin&to=9236999001&lang=English&msg=%b
-rw-r--r--  1 nagios nagios      193 Mar 11  2016 url?id=admin&pass=souls93&mask=admin&to=92356999001&lang=English&msg=** CUSTOM Service Alert: 700rdns2%2FBlack List Alert is OK **
-rw-r--r--  1 nagios nagios      193 Mar 11  2016 url?id=admin&pass=souls93&mask=admin&to=9236999001&lang=English&msg=** CUSTOM Service Alert: N700%2FHome Partition is WARNING **

Code: Select all

df -h
Filesystem         Size  Used Avail Use% Mounted on
/dev/ploop14896p1  118G  2.5G  110G   3% /
none               1.5G  4.0K  1.5G   1% /dev
none               1.5G     0  1.5G   0% /dev/shm

Code: Select all

df -i
Filesystem         Inodes IUsed   IFree IUse% Mounted on
/dev/ploop14896p1 7864320 43077 7821243    1% /
none               393216   158  393058    1% /dev
none               393216     1  393215    1% /dev/shm

Re: Upgrade Nagios Core

Posted: Tue Sep 27, 2016 12:42 pm
by tgriep
The permissions for the spool folder isn't correct. To fix that, run this command as root on the Nagios server.

Code: Select all

chown -r nagios.nagios /usr/local/nagios/var/spool
Then, can you run the following and post the output?

Code: Select all

ll /usr/local/nagios/
chage -l nagios
grep nag /etc/passwd
grep nag /etc/group

Re: Upgrade Nagios Core

Posted: Thu Sep 29, 2016 5:33 am
by rlinux57
Yes i have run that command to fixed the permission of spool and its child folders and restart nagios service. But still getting same error.

Please check given commands output.

Code: Select all

ll /usr/local/nagios/
total 40
drwxrwxr-x  2 nagios nagios 4096 Sep 16 09:30 bin
drwxr-xr-x  6 nagios nagios 4096 Apr 25 09:12 etc
drwxrwxr-x  3 nagios nagios 4096 Nov 17  2015 etc.bak
drwxr-xr-x  6 root   root   4096 Apr 25 09:14 etc.new
drwxr-xr-x  2 root   root   4096 Nov 17  2015 include
drwxrwxr-x  4 nagios nagios 4096 Aug 29 02:08 libexec
drwxrwxr-x  2 nagios nagios 4096 Sep 16 09:30 sbin
drwxrwxr-x 15 nagios nagios 4096 Sep 16 09:30 share
drwxr-xr-x  2 nagios nagios 4096 Mar 11  2016 sms
drwxrwxr-x  6 nagios nagios 4096 Sep 29 06:25 var

Code: Select all

chage -l nagios
Last password change					: Nov 17, 2015
Password expires					: never
Password inactive					: never
Account expires						: never
Minimum number of days between password change		: 0
Maximum number of days between password change		: 99999
Number of days of warning before password expires	: 7

Code: Select all

grep nag /etc/passwd
nagios:x:500:500::/home/nagios:/bin/bash

Code: Select all

grep nag /etc/group
nagios:x:500:apache
nagcmd:x:501:nagios,apache

Re: Upgrade Nagios Core

Posted: Thu Sep 29, 2016 4:18 pm
by tgriep
The nagios user account is not in the nagios group.
Edit the /etc/group file
Change this line from

Code: Select all

nagios:x:500:apache
to

Code: Select all

nagios:x:500:apache,nagios
Save it out and see if that helps.
If it still fails, run this command to verify the nagios software will load. Post the output

Code: Select all

/usr/local/nagios/bin/nagios -vv /usr/local/nagios/etc/nagios.cfg