Page 1 of 1

nagios.log and perfdata

Posted: Wed Mar 16, 2016 11:06 am
by xlin125
We have Nagios XI 2014R2.7 running on RHEL 6.x. I noticed that Nagios XI server logs the measurement/polling data into /usr/local/nagios/var/nagios.log, and at the end of day, it copies nagios.log to /usr/local/nagios/var/archives. However, this nagios.log does not have all the measurement/polling data. I thought the two files service-perfdata and host-perfdata would be appended to nagios.log so that nagios.log would contain all the polling data for the day, then gets moved to archives directory. But this is not what I observed. Is there a log file that contains all measurement/polling data for the day? In addition, it looks like service-perfdata and host-perfdata are copied to /usr/local/nagios/var/spool/perfdata directory, and then removed, as indicated in perfdata.log file. I think it is configurable to keep these two files with time stamp in /usr/local/nagios/var/spool/perfdata directory. I saw it in one of my Nagios XI servers, but was not sure how it was setup at the beginning. The issue is that we have to clean up those old files to avoid running out of inodes because there are so many service-perfdata and host-perfdata files copied to /usr/local/nagios/var/spool/perfdata directory per day, if it is enabled! Any help for these questions will be greatly appreciated. Thanks!

Re: nagios.log and perfdata

Posted: Wed Mar 16, 2016 3:48 pm
by rkennedy
The folder /usr/local/nagios/var/spool/perfdata is used process performance data, which then adds it to the .rrd file. Once it's processed, the files are removed.

What kind of disk(s) are you running on this system, and what kind of specs do you have allocated to this machine? How many host / service checks are running?

Is creating a ramdisk an option for you? This would take some load off of your disk. See this link -
https://assets.nagios.com/downloads/nag ... giosXI.pdf

Re: nagios.log and perfdata

Posted: Thu Mar 17, 2016 3:33 pm
by xlin125
Thanks for the response.

Out of 8 Nagios XI servers, only one does not remove these files from /usr/local/nagios/var/spool/perfdata directory (see below). It grows faster, and the inodes will run out eventually, if we do not remove them manually. I understand it. Other Nagios XI servers will remove them, as you indicated. I am not sure how to "turn" it on (like the one Nagios XI server) or off (like others). Can you let us know?

The main purpose of posting this question is that we are looking for the data for each polling (host and service check) of the day for performance analysis and reporting . Where can we find this log? As I said that before, /usr/local/nagios/var/nagios.log does not contain all the host/service checks. Any help will be appreciated. Thanks.

Under /usr/local/nagios/var/spool/perfdata directory:
-rw-r--r-- 1 nagios nagios 1524 Feb 20 15:26 1456000001.perfdata.host
-rw-r--r-- 1 nagios nagios 6705 Feb 20 15:26 1456000001.perfdata.service
-rw-r--r-- 1 nagios nagios 2112 Feb 20 15:26 1456000016.perfdata.host
-rw-r--r-- 1 nagios nagios 7761 Feb 20 15:26 1456000016.perfdata.service
-rw-r--r-- 1 nagios nagios 10020 Feb 20 15:27 1456000031.perfdata.service
-rw-r--r-- 1 nagios nagios 2395 Feb 20 15:27 1456000032.perfdata.host
-rw-r--r-- 1 nagios nagios 2113 Feb 20 15:27 1456000046.perfdata.host
-rw-r--r-- 1 nagios nagios 7399 Feb 20 15:27 1456000046.perfdata.service
-rw-r--r-- 1 nagios nagios 1804 Feb 20 15:27 1456000062.perfdata.host
-rw-r--r-- 1 nagios nagios 7520 Feb 20 15:27 1456000062.perfdata.service
-rw-r--r-- 1 nagios nagios 2426 Feb 20 15:27 1456000076.perfdata.host
-rw-r--r-- 1 nagios nagios 7094 Feb 20 15:27 1456000076.perfdata.service

Re: nagios.log and perfdata

Posted: Thu Mar 17, 2016 7:37 pm
by Box293
xlin125 wrote:Out of 8 Nagios XI servers, only one does not remove these files from /usr/local/nagios/var/spool/perfdata directory (see below).
From that server, can you provide us with:

/usr/local/nagios/etc/nagios.cfg
/usr/local/nagios/etc/commands.cfg
/usr/local/nagios/etc/pnp/npcd.cfg
/usr/local/nagios/etc/pnp/process_perfdata.cfg

Re: nagios.log and perfdata

Posted: Thu Mar 24, 2016 11:32 am
by xlin125
The following configuration files on that Nagios XI server are attached (process_perfdata.cfg will be attached in a separate post since 3 is the maximum) as per request:
/usr/local/nagios/etc/nagios.cfg
/usr/local/nagios/etc/commands.cfg
/usr/local/nagios/etc/pnp/npcd.cfg
/usr/local/nagios/etc/pnp/process_perfdata.cfg

I just took a look at the files in /usr/local/nagios/var/spool/perfdata directory on this server. I saw the earlier *.perfdata.host files and *.perfdata.service files are dated back to 2/20/2016. I normally periodically clean them up manually. Since these files are copied/moved to perfdata, then processed and then removed, can these files are logged into a single file of that day so that we can have a daily log file for report/analysis purpose? How to set it up? Thanks!

Re: nagios.log and perfdata

Posted: Thu Mar 24, 2016 12:10 pm
by xlin125
process_perfdata.cfg is attached.

Re: nagios.log and perfdata

Posted: Thu Mar 24, 2016 3:48 pm
by ssax
The files look fine to me.

Are you seeing any errors in your /usr/local/nagios/var/npcd.log or in your /usr/local/nagiosxi/var/perfdataproc.log?

Maybe you're hitting a threshold or something.