Icinga2 - change location of replay log

Description

Hi, I’m running an icinga2 HA cluster master zone, and when one of the master nodes dies, (i.e OOM Kill) , the other master node stores the replay log on the documented location:

/var/lib/icinga2/api/log

since available space on ‘/’ partition of each one of my “icinga2 master” nodes barely enough to cover 25 minutes of downtime, I was wondering if there is a way to configure the application to use a different path for the replication logs?

i.e. /MyVeryLargePartigion

I know that I can (and probably will) mount a LVM partition under /var/lib/icinga2/api/logs , but wanted to save some time in reconfiguring the filesystem shall this software change be supported ?

/dev/vda1 8.0G 4.4G 3.7G 55% /
/dev/mapper/VolGroup01Logs_volume 12G 1.6G 9.6G 15% /customlogs

Information

  • Version used (icinga2 --version)

~# icinga2 --version
icinga2 - The Icinga 2 network monitoring daemon (version: 2.13.2-1)

Copyright (c) 2012-2022 Icinga GmbH (https://icinga.com/)
License GPLv2+: GNU GPL version 2 or later <https://gnu.org/licenses/gpl2.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.

System information:
  Platform: CentOS Linux
  Platform version: 7 (Core)
  Kernel: Linux
  Kernel version: 3.10.0-1160.76.1.el7.x86_64
  Architecture: x86_64

Build information:
  Compiler: GNU 4.8.5
  Build host: runner-hh8q3bz2-project-322-concurrent-0
  OpenSSL version: OpenSSL 1.0.2k-fips  26 Jan 2017

Application information:

General paths:
  Config directory: /etc/icinga2
  Data directory: /var/lib/icinga2
  Log directory: /var/log/icinga2
  Cache directory: /var/cache/icinga2
  Spool directory: /var/spool/icinga2
  Run directory: /run/icinga2

Old paths (deprecated):
  Installation root: /usr
  Sysconf directory: /etc
  Run directory (base): /run
  Local state directory: /var

Internal paths:
  Package data directory: /usr/share/icinga2
  State path: /var/lib/icinga2/icinga2.state
  Modified attributes path: /var/lib/icinga2/modified-attributes.conf
  Objects path: /var/cache/icinga2/icinga2.debug
  Vars path: /var/cache/icinga2/icinga2.vars
  PID path: /run/icinga2/icinga2.pid
  • Operating System and version
~# cat /etc/centos-release
CentOS Linux release 7.9.2009 (Core)
~# uname -a
Linux icinga-master-1.somedomain.internal 3.10.0-1160.76.1.el7.x86_64 #1 SMP Wed Aug 10 16:21:17 UTC 2022 x86_64 x86_64 x86_64 GNU/Linux
  • Enabled features (icinga2 feature list)
~# icinga2 feature list
Disabled features: command compatlog debuglog elasticsearch gelf graphite icingadb influxdb2 livestatus opentsdb perfdata statusdata syslog
Enabled features: api checker ido-mysql influxdb mainlog notification
  • Icinga Web 2 version and modules (System - About)
    — not relevant. on demand
  • Config validation (icinga2 daemon -C)
    — not relevant. on demand
  • If you run multiple Icinga 2 instances, the zones.conf file (or icinga2 object list --type Endpoint and icinga2 object list --type Zone) from all affected nodes
    — not relevant, on demand.

why dont you mount a different partition with enough space over /var/lib/icinga2/api/log ?

You could create a symlink from /var/lib/icinga2/api/log to anywhere in your
filesystem which has sufficient space, if you don’t want to mount a new partition
there.

Antony.

1 Like

I just wanted to confirm if this was a parameter that could be configured somewhere else, like .ie. on systemd defaults file, hence avoiding most of administrative load for reconfiguring the puppet/volumes/partitions, etc.
as last resource, yes, mounting or symlinks can be made