Any issues with relocating /usr/local/nagios/share/perfdata?

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
atc0005
Posts: 26
Joined: Thu Oct 28, 2021 2:03 pm

Any issues with relocating /usr/local/nagios/share/perfdata?

Post by atc0005 »

We received a disk space alert for "/" on our Nagios XI box.

When we migrated Dec 2021 from an older system we sized the system somewhat conservatively, with plans to increase volumes where needed and relocate content to dedicated volumes where safe (and where it made sense) to do so.

Our instance has 6.9 GB of content in "/usr/local/nagios/share/perfdata". Is it safe to move that content to a separate logical volume and mount it to /usr/local/nagios/share/perfdata, provided that permissions remain the same? Is there a better option?

On a related note, I noticed that the /usr/local/nagiosxi/var/sysstat.log log file is about 1.8 GB. Is there log rotation in place to handle this by the Nagios XI tooling, or should I setup a logrotate config file to handle rotating this file? If I need to setup a logrotate config file, do I need to reload/restart Nagios services as a pre or post rotate command?

I've looked over the "Nagios XI Log Locations and Descriptions" doc and found these notes:
This file logs the reporting of Nagios XI component statuses run by the sysstat cron, which will
subsequently update the Nagios engine and component statistics dashlet in the Nagios XI interface.
Logs Located In /usr/local/nagiosxi/var
Most of these logs are overwritten by crond at the top of the minute. They are stream-style logs, so a running tail ( tail -f xxx ) is usually the best way to watch them. As they are managed by cron, and not rsyslog, changing the logging would require editing the nagiosxi cron scripts. It is recommended that you do not alter the crons though, as certain Nagios XI components rely on these crons/logs.
Before I changed/implemented anything I wanted to reach out and make sure I understood the needed next steps.

Thanks in advance for your help.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Any issues with relocating /usr/local/nagios/share/perfd

Post by pbroste »

Hello @atc0005

Thanks for reaching out, I checked on the config's and there is many that reference that path "/usr/local/nagios/share/perfdata". You would want to mount the /usr/ directory to its own partition so you maintain the same path.

On the second inquiry on '/usr/local/nagiosxi/var/sysstat.log' growth issue. You will want to make sure that this is added to the /etc/logrotate.d/nagiosxi.

Thanks,
Perry
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Any issues with relocating /usr/local/nagios/share/perfd

Post by pbroste »

Actually, to follow up further we see that Nagios XI is setting the path in the following config's. If you want to test this you can go edit the config's to your new path and restart the services:
/usr/local/nagios/etc/pnp/config.php:$conf['rrdbase'] = "/usr/local/nagios/share/perfdata/";

/usr/local/nagios/etc/pnp/process_perfdata.cfg:RRDPATH = /usr/local/nagios/share/perfdata
Then restart service by bouncing:

Code: Select all

systemctl restart npcd nagios httpd
Thanks,
Perry
atc0005
Posts: 26
Joined: Thu Oct 28, 2021 2:03 pm

Re: Any issues with relocating /usr/local/nagios/share/perfd

Post by atc0005 »

Hi @pbroste,

Thanks for the feedback.
On the second inquiry on '/usr/local/nagiosxi/var/sysstat.log' growth issue. You will want to make sure that this is added to the /etc/logrotate.d/nagiosxi.
Thanks for mentioning that file. If I manually modify the file as suggested, will it be overwritten by future upgrades?

I checked just now and I see this block within:

Code: Select all

/usr/local/nagiosxi/var/*log {
    missingok
    notifempty
    size 5M
    rotate 1
    compress
}
If I use the provided pattern, it seems like it matches?

Code: Select all

$ ls -larth /usr/local/nagiosxi/var/*log
-rw-r--r-- 1 nagios nagios 2.0M Aug  5  2020 /usr/local/nagiosxi/var/snmptt_service_results.log
-rw-r--r-- 1 nagios nagios 2.7M Aug  5  2020 /usr/local/nagiosxi/var/reportengine.log
-rw-r--r-- 1 nagios nagios  918 Jul 11  2021 /usr/local/nagiosxi/var/load_url.log
-rw-r--r-- 1 nagios nagios 1.1M Mar  3 16:50 /usr/local/nagiosxi/var/nom.log
-rw-rw-r-- 1 nagios nagios  18K Mar  4 07:00 /usr/local/nagiosxi/var/wkhtmltox.log
-rw-rw-r-- 1 nagios nagios 1.6M Mar  4 07:00 /usr/local/nagiosxi/var/scheduledreporting.log
-rw-r--r-- 1 nagios nagios 5.6M Mar  4 08:01 /usr/local/nagiosxi/var/recurringdowntime.log
-rw-r--r-- 1 nagios nagios  88M Mar  4 08:05 /usr/local/nagiosxi/var/dbmaint.log
-rw-r--r-- 1 nagios nagios  11M Mar  4 08:07 /usr/local/nagiosxi/var/perfdataproc.log
-rw-r--r-- 1 nagios nagios  58M Mar  4 08:07 /usr/local/nagiosxi/var/cleaner.log
-rw-r--r-- 1 nagios nagios  14M Mar  4 08:07 /usr/local/nagiosxi/var/deadpool.log
-rw-r--r-- 1 nagios nagios 266M Mar  4 08:07 /usr/local/nagiosxi/var/event_handler.log
-rw-r--r-- 1 nagios nagios 6.2M Mar  4 08:07 /usr/local/nagiosxi/var/feedproc.log
-rw-r--r-- 1 nagios nagios 2.0G Mar  4 08:07 /usr/local/nagiosxi/var/sysstat.log
-rw-r--r-- 1 nagios nagios 808M Mar  4 08:07 /usr/local/nagiosxi/var/eventman.log
-rw-r--r-- 1 nagios nagios  37M Mar  4 08:07 /usr/local/nagiosxi/var/cmdsubsys.log
This suggests that perhaps the file is already matched?

Code: Select all

$ ls -larth /usr/local/nagiosxi/var/*.gz
-rw-r--r-- 1 nagios nagios  18K Jul 18  2020 /usr/local/nagiosxi/var/reportengine.log-20200718.gz
-rw-r--r-- 1 nagios nagios  18K Jul 23  2020 /usr/local/nagiosxi/var/snmptt_service_results.log-20200723.gz
-rw-r--r-- 1 nagios nagios  29K Aug  3  2020 /usr/local/nagiosxi/var/nom.log-20200803.gz
-rw-r--r-- 1 nagios nagios  67K Sep  5 03:40 /usr/local/nagiosxi/var/feedproc.log-20210905.gz
-rw-r--r-- 1 nagios nagios 211K Sep 25 03:39 /usr/local/nagiosxi/var/scheduledreporting.log-20210925.gz
-rw-r--r-- 1 nagios nagios  18K Oct 27 03:48 /usr/local/nagiosxi/var/deadpool.log-20211027.gz
-rw-r--r-- 1 nagios nagios 227K Dec  4 03:34 /usr/local/nagiosxi/var/perfdataproc.log-20211204.gz
-rw-r--r-- 1 nagios nagios 121K Dec  4 03:34 /usr/local/nagiosxi/var/cmdsubsys.log-20211204.gz
-rw-r--r-- 1 nagios nagios  58K Dec  8 03:14 /usr/local/nagiosxi/var/recurringdowntime.log-20211208.gz
-rw-r--r-- 1 nagios nagios 278K Dec  9 03:47 /usr/local/nagiosxi/var/dbmaint.log-20211209.gz
-rw-r--r-- 1 nagios nagios 225K Dec 13 03:46 /usr/local/nagiosxi/var/eventman.log-20211213.gz
-rw-r--r-- 1 nagios nagios 356K Dec 13 03:46 /usr/local/nagiosxi/var/event_handler.log-20211213.gz
-rw-r--r-- 1 nagios nagios  26K Dec 13 03:46 /usr/local/nagiosxi/var/cleaner.log-20211213.gz
-rw-r--r-- 1 nagios nagios 462K Dec 14 03:50 /usr/local/nagiosxi/var/sysstat.log-20211214.gz
I'll dig further on this end. Perhaps I've got a permission wrong somewhere and logrotate is not rotating log files like it is supposed to because of that.
I checked on the config's and there is many that reference that path "/usr/local/nagios/share/perfdata". You would want to mount the /usr/ directory to its own partition so you maintain the same path.
If I mount a logical volume directly into "/usr/local/nagios/share/perfdata" do you believe that this would cause issues? I would temorarily mount the new volume elsewhere so that I could move the content currently at "/usr/local/nagios/share/perfdata" over before mounting the logical volume to that directory.

Thanks for your help.

On a different note, I'm subscribed to email notifications when this thread is updated and I didn't receive them when you responded. It could be something on our end, but wanted to mention it just in case others are also not seeing them.
atc0005
Posts: 26
Joined: Thu Oct 28, 2021 2:03 pm

Re: Any issues with relocating /usr/local/nagios/share/perfd

Post by atc0005 »

atc0005 wrote:I'll dig further on this end. Perhaps I've got a permission wrong somewhere and logrotate is not rotating log files like it is supposed to because of that.
I ran:

Code: Select all

sudo logrotate --debug --verbose /etc/logrotate.conf
and found this in the output:

Code: Select all

rotating pattern: /usr/local/nagiosxi/var/*log  5242880 bytes (1 rotations)
empty log files are not rotated, old logs are removed
considering log /usr/local/nagiosxi/var/cleaner.log
error: skipping "/usr/local/nagiosxi/var/cleaner.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/cmdsubsys.log
error: skipping "/usr/local/nagiosxi/var/cmdsubsys.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/dbmaint.log
error: skipping "/usr/local/nagiosxi/var/dbmaint.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/deadpool.log
error: skipping "/usr/local/nagiosxi/var/deadpool.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/event_handler.log
error: skipping "/usr/local/nagiosxi/var/event_handler.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/eventman.log
error: skipping "/usr/local/nagiosxi/var/eventman.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/feedproc.log
error: skipping "/usr/local/nagiosxi/var/feedproc.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/load_url.log
error: skipping "/usr/local/nagiosxi/var/load_url.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/nom.log
error: skipping "/usr/local/nagiosxi/var/nom.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/perfdataproc.log
error: skipping "/usr/local/nagiosxi/var/perfdataproc.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/recurringdowntime.log
error: skipping "/usr/local/nagiosxi/var/recurringdowntime.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/reportengine.log
error: skipping "/usr/local/nagiosxi/var/reportengine.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/scheduledreporting.log
error: skipping "/usr/local/nagiosxi/var/scheduledreporting.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/snmptt_service_results.log
error: skipping "/usr/local/nagiosxi/var/snmptt_service_results.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/sysstat.log
error: skipping "/usr/local/nagiosxi/var/sysstat.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.
considering log /usr/local/nagiosxi/var/wkhtmltox.log
error: skipping "/usr/local/nagiosxi/var/wkhtmltox.log" because parent directory has insecure permissions (It's world writable or writable by group which is not "root") Set "su" directive in config file to tell logrotate which user/group should be used for rotation.

Code: Select all

$ cat /etc/logrotate.d/nagiosxi
/usr/local/nagiosxi/var/*log {
    missingok
    notifempty
    size 5M
    rotate 1
    compress
}

/usr/local/nagiosxi/var/xidebug.log {
    missingok
    notifempty
    size 100M
    create 0660 apache nagios
    su apache nagios
    rotate 1
    compress
}

/usr/local/nagiosxi/var/xidebug.log.backtrace {
    missingok
    notifempty
    size 100M
    create 0660 apache nagios
    su apache nagios
    rotate 1
    compress
Looks like the "su" directive is missing from the applicable block.

I'm assuming that the user/group & perms are correct as I do not recall directly modifying them (relying on installer/update scripts to handle that):

Code: Select all

$ getfacl /usr/local/nagiosxi/var/
getfacl: Removing leading '/' from absolute path names
# file: usr/local/nagiosxi/var/
# owner: nagios
# group: nagios
user::rwx
group::rwx
other::r-x
Will test directly modifying the /etc/logrotate.d/nagiosxi file to include the missing su directive.
atc0005
Posts: 26
Joined: Thu Oct 28, 2021 2:03 pm

Re: Any issues with relocating /usr/local/nagios/share/perfd

Post by atc0005 »

atc0005 wrote: Will test directly modifying the /etc/logrotate.d/nagiosxi file to include the missing su directive.
I added this line:

Code: Select all

su nagios nagios
which puts the file in this state:

Code: Select all

/usr/local/nagiosxi/var/*log {
    missingok
    notifempty
    size 5M
    su nagios nagios
    rotate 1
    compress
}

/usr/local/nagiosxi/var/xidebug.log {
    missingok
    notifempty
    size 100M
    create 0660 apache nagios
    su apache nagios
    rotate 1
    compress
}

/usr/local/nagiosxi/var/xidebug.log.backtrace {
    missingok
    notifempty
    size 100M
    create 0660 apache nagios
    su apache nagios
    rotate 1
    compress
}
Now when running:

Code: Select all

sudo logrotate --debug --verbose /etc/logrotate.conf
I see this:

Code: Select all

rotating pattern: /usr/local/nagiosxi/var/*log  5242880 bytes (1 rotations)
empty log files are not rotated, old logs are removed
switching euid to 1004 and egid to 1008
considering log /usr/local/nagiosxi/var/cleaner.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-12-02 03:40
  log needs rotating
considering log /usr/local/nagiosxi/var/cmdsubsys.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log needs rotating
considering log /usr/local/nagiosxi/var/dbmaint.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-12-06 03:30
  log needs rotating
considering log /usr/local/nagiosxi/var/deadpool.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log needs rotating
considering log /usr/local/nagiosxi/var/event_handler.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log needs rotating
considering log /usr/local/nagiosxi/var/eventman.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log needs rotating
considering log /usr/local/nagiosxi/var/feedproc.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log needs rotating
considering log /usr/local/nagiosxi/var/load_url.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-12-07 03:00
  log does not need rotating (log size is below the 'size' threshold)
considering log /usr/local/nagiosxi/var/nom.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log does not need rotating (log size is below the 'size' threshold)
considering log /usr/local/nagiosxi/var/perfdataproc.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log needs rotating
considering log /usr/local/nagiosxi/var/recurringdowntime.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log needs rotating
considering log /usr/local/nagiosxi/var/reportengine.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log does not need rotating (log size is below the 'size' threshold)
considering log /usr/local/nagiosxi/var/scheduledreporting.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log does not need rotating (log size is below the 'size' threshold)
considering log /usr/local/nagiosxi/var/snmptt_service_results.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log does not need rotating (log size is below the 'size' threshold)
considering log /usr/local/nagiosxi/var/sysstat.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-12-06 03:30
  log needs rotating
considering log /usr/local/nagiosxi/var/wkhtmltox.log
  Now: 2022-03-04 08:47
  Last rotated at 2021-11-16 03:00
  log does not need rotating (log size is below the 'size' threshold)
rotating log /usr/local/nagiosxi/var/cleaner.log, log->rotateCount is 1
dateext suffix '-20220304'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/local/nagiosxi/var/cleaner.log to /usr/local/nagiosxi/var/cleaner.log-20220304
creating new /usr/local/nagiosxi/var/cleaner.log mode = 0644 uid = 1004 gid = 1008
compressing log with: /bin/gzip
removing old log /usr/local/nagiosxi/var/cleaner.log-20211213.gz
rotating log /usr/local/nagiosxi/var/cmdsubsys.log, log->rotateCount is 1
dateext suffix '-20220304'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/local/nagiosxi/var/cmdsubsys.log to /usr/local/nagiosxi/var/cmdsubsys.log-20220304
creating new /usr/local/nagiosxi/var/cmdsubsys.log mode = 0644 uid = 1004 gid = 1008
compressing log with: /bin/gzip
removing old log /usr/local/nagiosxi/var/cmdsubsys.log-20211204.gz
rotating log /usr/local/nagiosxi/var/dbmaint.log, log->rotateCount is 1
dateext suffix '-20220304'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/local/nagiosxi/var/dbmaint.log to /usr/local/nagiosxi/var/dbmaint.log-20220304
creating new /usr/local/nagiosxi/var/dbmaint.log mode = 0644 uid = 1004 gid = 1008
compressing log with: /bin/gzip
removing old log /usr/local/nagiosxi/var/dbmaint.log-20211209.gz
rotating log /usr/local/nagiosxi/var/deadpool.log, log->rotateCount is 1
dateext suffix '-20220304'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/local/nagiosxi/var/deadpool.log to /usr/local/nagiosxi/var/deadpool.log-20220304
creating new /usr/local/nagiosxi/var/deadpool.log mode = 0644 uid = 1004 gid = 1008
compressing log with: /bin/gzip
removing old log /usr/local/nagiosxi/var/deadpool.log-20211027.gz
rotating log /usr/local/nagiosxi/var/event_handler.log, log->rotateCount is 1
dateext suffix '-20220304'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/local/nagiosxi/var/event_handler.log to /usr/local/nagiosxi/var/event_handler.log-20220304
creating new /usr/local/nagiosxi/var/event_handler.log mode = 0644 uid = 1004 gid = 1008
compressing log with: /bin/gzip
removing old log /usr/local/nagiosxi/var/event_handler.log-20211213.gz
rotating log /usr/local/nagiosxi/var/eventman.log, log->rotateCount is 1
dateext suffix '-20220304'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/local/nagiosxi/var/eventman.log to /usr/local/nagiosxi/var/eventman.log-20220304
creating new /usr/local/nagiosxi/var/eventman.log mode = 0644 uid = 1004 gid = 1008
compressing log with: /bin/gzip
removing old log /usr/local/nagiosxi/var/eventman.log-20211213.gz
rotating log /usr/local/nagiosxi/var/feedproc.log, log->rotateCount is 1
dateext suffix '-20220304'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/local/nagiosxi/var/feedproc.log to /usr/local/nagiosxi/var/feedproc.log-20220304
creating new /usr/local/nagiosxi/var/feedproc.log mode = 0644 uid = 1004 gid = 1008
compressing log with: /bin/gzip
removing old log /usr/local/nagiosxi/var/feedproc.log-20210905.gz
rotating log /usr/local/nagiosxi/var/perfdataproc.log, log->rotateCount is 1
dateext suffix '-20220304'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/local/nagiosxi/var/perfdataproc.log to /usr/local/nagiosxi/var/perfdataproc.log-20220304
creating new /usr/local/nagiosxi/var/perfdataproc.log mode = 0644 uid = 1004 gid = 1008
compressing log with: /bin/gzip
removing old log /usr/local/nagiosxi/var/perfdataproc.log-20211204.gz
rotating log /usr/local/nagiosxi/var/recurringdowntime.log, log->rotateCount is 1
dateext suffix '-20220304'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/local/nagiosxi/var/recurringdowntime.log to /usr/local/nagiosxi/var/recurringdowntime.log-20220304
creating new /usr/local/nagiosxi/var/recurringdowntime.log mode = 0644 uid = 1004 gid = 1008
compressing log with: /bin/gzip
removing old log /usr/local/nagiosxi/var/recurringdowntime.log-20211208.gz
rotating log /usr/local/nagiosxi/var/sysstat.log, log->rotateCount is 1
dateext suffix '-20220304'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
renaming /usr/local/nagiosxi/var/sysstat.log to /usr/local/nagiosxi/var/sysstat.log-20220304
creating new /usr/local/nagiosxi/var/sysstat.log mode = 0644 uid = 1004 gid = 1008
compressing log with: /bin/gzip
removing old log /usr/local/nagiosxi/var/sysstat.log-20211214.gz
switching euid to 0 and egid to 0
This seems to suggest that this hotfix will resolve the overly large log file (and lack of rotation) situation. I should know for sure after this Sunday's logrotate (weekly) job completes.

Maybe adding that line for RHEL 8 systems (maybe RHEL 7 too?) could be handled by a future Nagios XI update? It might be that other Nagios XI installations have the same missing line.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Any issues with relocating /usr/local/nagios/share/perfd

Post by pbroste »

Hello @atc0005

You are correct that the '/usr/local/nagiosxi/var/sysstat.log' will be picked up by '/usr/local/nagiosxi/var/*log'

You can also run a logrotation with:

Code: Select all

logrotate --force /etc/logrotate.conf
Let me know how things go, and attached is the copy of the appended sudoers conf's that should be listed in your '/etc/sudoers'.

Thanks,
Perry
You do not have the required permissions to view the files attached to this post.
atc0005
Posts: 26
Joined: Thu Oct 28, 2021 2:03 pm

Re: Any issues with relocating /usr/local/nagios/share/perfd

Post by atc0005 »

Hi @pbroste,
pbroste wrote:You are correct that the '/usr/local/nagiosxi/var/sysstat.log' will be picked up by '/usr/local/nagiosxi/var/*log'
It was and disk space is within tolerance at the moment.
pbroste wrote:attached is the copy of the appended sudoers conf's that should be listed in your '/etc/sudoers'
I checked and all of those entries are present in the /etc/sudoers file.

The problem appears to be limited to this line:

Code: Select all

su nagios nagios
which was missing from the /etc/logrotate.d/nagiosxi file as noted previously. With that line added to this block:

Code: Select all

/usr/local/nagiosxi/var/*log {
    # ...
    su nagios nagios
    # ...
}
The files are rotated properly.
atc0005 wrote:Maybe adding that line for RHEL 8 systems (maybe RHEL 7 too?) could be handled by a future Nagios XI update? It might be that other Nagios XI installations have the same missing line.
I'm not sure if this discussion is how a bug report is filed, but please consider filing one. Since not having that line in the file led to log files not being rotated it would be nice to ensure that future updates either check for the entry in the file or deploy a version of the file which contain the needed line.
atc0005 wrote:If I mount a logical volume directly into "/usr/local/nagios/share/perfdata" do you believe that this would cause issues? I would temporarily mount the new volume elsewhere so that I could move the content currently at "/usr/local/nagios/share/perfdata" over before mounting the logical volume to that directory.
I wanted to circle back to this. Does Nagios XI support mounting volumes within these paths?
  • /usr/local/nagios
  • /usr/local/nagiosxi
  • /usr/local/nagvis
  • /usr/local/nrdp
  • /usr/local/nsis
In particular, I am interested in mounting a logical volume at /usr/local/nagios/share/perfdata and want to make sure that this will not interfere with backup or upgrade functionality.

Thanks.
User avatar
pbroste
Posts: 1288
Joined: Tue Jun 01, 2021 1:27 pm

Re: Any issues with relocating /usr/local/nagios/share/perfd

Post by pbroste »

Hello @atc0005

This is not really supported. Even if you manage to move nagiosxi folders to different partitions with and/or with symlinks, you may still encounter problems in the future when it comes to upgrading XI.

We do have a tutorial on resizing VM based NagiosXI partitions(that is the recommended way of space management):
https://support.nagios.com/kb/article.php?id=266

Thanks,
Perry
Locked