Upgrade Nagios Core

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.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Upgrade Nagios Core

Post by rlinux57 »

How can i upgrade nagios core Version 4.1.1 to nagios core Version 4.2.1 ?
tmcdonald
Posts: 9117
Joined: Mon Sep 23, 2013 8:40 am

Re: Upgrade Nagios Core

Post 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.
Former Nagios employee
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Upgrade Nagios Core

Post by rlinux57 »

Upgraded successfully, thanks for your cooperation. Kindly let me know how to upgrade nrpe as well ?
User avatar
Box293
Too Basu
Posts: 5126
Joined: Sun Feb 07, 2010 10:55 pm
Location: Deniliquin, Australia
Contact:

Re: Upgrade Nagios Core

Post by Box293 »

As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Upgrade Nagios Core

Post 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.
Attachments
Screenshot from 2016-09-24 15-21-26.jpg
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Upgrade Nagios Core

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Upgrade Nagios Core

Post 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
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Upgrade Nagios Core

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
rlinux57
Posts: 324
Joined: Mon Dec 08, 2014 12:03 am

Re: Upgrade Nagios Core

Post 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
User avatar
tgriep
Madmin
Posts: 9177
Joined: Thu Oct 30, 2014 9:02 am

Re: Upgrade Nagios Core

Post 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
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked