Nagios Log Archive error

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.
Locked
harsha.s.aryan
Posts: 52
Joined: Fri Nov 13, 2015 9:05 am

Nagios Log Archive error

Post by harsha.s.aryan »

Hi,

Nagios Log is not getting archive

Please let me know how to resolve

there is no archives directory created under /usr/local/nagios/var/
Attachments
nag error.PNG
Regards,
Harsha
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Log Archive error

Post by tgriep »

Can you run the following commands and post the output here?

Code: Select all

ls -l /usr/local/nagios/var/
ls -l /usr/local/nagios/var/archives
Can you post your nagios.cfg file so we can check the log rotation settings?
Be sure to check out our Knowledgebase for helpful articles and solutions!
harsha.s.aryan
Posts: 52
Joined: Fri Nov 13, 2015 9:05 am

Re: Nagios Log Archive error

Post by harsha.s.aryan »

root@Nagios:~# ls -l /usr/local/nagios/var/
total 41060
-rw-r--r-- 1 nagios nagios 34 Jul 1 01:59 nagios.configtest
-rw-r--r-- 1 nagios nagios 6 Jul 1 00:03 nagios.lock
-rw-r--r-- 1 nagios nagios 40538731 Jul 1 01:59 nagios.log
-rw-rw-r-- 1 nagios nagios 13460 Sep 10 2015 nagios.tmp5f4sAZ
-rw-rw-r-- 1 nagios nagios 13468 Sep 14 2015 nagios.tmpZBA7pf
-rw-r--r-- 1 nagios nagios 312362 Jul 1 01:59 objects.cache
-rw-r--r-- 1 nagios nagios 312362 Jul 1 01:59 objects.precache
-rw------- 1 nagios nagios 409496 Jul 1 01:59 retention.dat
drwxrwsr-x 2 nagios nagcmd 4096 Jul 1 01:59 rw
drwxrwxrwx 3 nagios nagios 4096 Sep 10 2015 spool
-rw-rw-r-- 1 nagios nagios 407353 Jul 1 02:51 status.dat
root@Nagios:~#


and


root@Nagios:~# ls -l /usr/local/nagios/var/archives
ls: cannot access /usr/local/nagios/var/archives: No such file or directory
root@Nagios:~#
Regards,
Harsha
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Log Archive error

Post by tgriep »

The archive folder is gone for sure.
Run this to create is and set the permissions.

Code: Select all

mkdir /usr/local/nagios/var/archives 
chown  nagios.nagios  /usr/local/nagios/var/archives 
chmod 775  /usr/local/nagios/var/archives 
Check these settings in the nagios.cfg file for the archive folder and to setup daily log rotation.

Code: Select all

log_archive_path=/usr/local/nagios/var/archives
log_rotation_method=d
If you have to change these settings, restart nagios by running

Code: Select all

service nagios restart
Be sure to check out our Knowledgebase for helpful articles and solutions!
harsha.s.aryan
Posts: 52
Joined: Fri Nov 13, 2015 9:05 am

Re: Nagios Log Archive error

Post by harsha.s.aryan »

Still i am getting same error
Regards,
Harsha
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Log Archive error

Post by tgriep »

The archives get created at midnight so you will have to wait until tomorrow for the first archive file to be created.
Be sure to check out our Knowledgebase for helpful articles and solutions!
harsha.s.aryan
Posts: 52
Joined: Fri Nov 13, 2015 9:05 am

Re: Nagios Log Archive error

Post by harsha.s.aryan »

is there any option to separate log file manually
Regards,
Harsha
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Log Archive error

Post by tgriep »

Do you mean that your nagios.log file has all of the data in it since the server was running?
Be sure to check out our Knowledgebase for helpful articles and solutions!
harsha.s.aryan
Posts: 52
Joined: Fri Nov 13, 2015 9:05 am

Re: Nagios Log Archive error

Post by harsha.s.aryan »

yes
Regards,
Harsha
User avatar
tgriep
Madmin
Posts: 9190
Joined: Thu Oct 30, 2014 9:02 am

Re: Nagios Log Archive error

Post by tgriep »

I found this example that you can try out for splitting the file.
http://stackoverflow.com/questions/2667 ... s-log-file
Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked