Page 2 of 3
Re: POSTGRES_RELATION_SIZE WARNING: DB "nagiosxi"
Posted: Tue Jul 20, 2021 9:04 am
by TBT
After the previous adjustments, we're now starting to see a warning for Postgres Database Size: POSTGRES_DATABASE_SIZE WARNING: DB "nagiosxi" (host:127.0.0.1) nagiosxi: 715069200 (682 MB) template0: 5723920 (5590 kB) postgres: 5715728 (5582 kB) template1: 5715728 (5582 kB)
What is recommended for this particular check?
check_xi_postgres_db!-H 127.0.0.1 --port=5432 --dbuser=nagiosxi --dbname=nagiosxi --action=database_size --warning=500MB --critical=1GB
Additionally, I believe one of the other Administrators added these checks in response to an XI crash years ago. Should we even been monitoring Postgres or just put trust in the "cleaner" process to take care of things?
Re: POSTGRES_RELATION_SIZE WARNING: DB "nagiosxi"
Posted: Tue Jul 20, 2021 4:23 pm
by dchurch
The cleaner process should be taking care of any old log entries you have lying around, barring the cleaner process becoming stuck.
Can you login to the XI server as root, run the following commands and post the output?
Code: Select all
time /usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php
ll /usr/local/nagiosxi/var/
Re: POSTGRES_RELATION_SIZE WARNING: DB "nagiosxi"
Posted: Wed Jul 21, 2021 8:36 am
by TBT
Code: Select all
# time /usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php
Repair Complete: Removing Lock File
real 0m49.843s
user 0m0.149s
sys 0m0.041s
Code: Select all
# ll /usr/local/nagiosxi/var/
total 36668
drwxrwxr-x 2 nagios nagios 4096 Dec 4 2018 certs
-rw-r--r-- 1 nagios nagios 1198818 Jul 21 09:35 cleaner.log
-rw-r--r-- 1 nagios nagios 303 Jul 23 2017 cleaner.log-20170723
-rw-r--r-- 1 nagios nagios 303 Jul 30 2017 cleaner.log-20170730
-rw-r--r-- 1 nagios nagios 303 Aug 6 2017 cleaner.log-20170806
-rw-r--r-- 1 nagios nagios 303 Aug 13 2017 cleaner.log-20170813
-rw-r--r-- 1 nagios nagios 26062 Jul 19 03:50 cleaner.log-20210719.gz
-rw-r--r-- 1 nagios nagios 4725304 Jul 21 09:35 cmdsubsys.log
-rw-r--r-- 1 nagios nagios 82 Jul 23 2017 cmdsubsys.log-20170723
-rw-r--r-- 1 nagios nagios 82 Jul 30 2017 cmdsubsys.log-20170730
-rw-r--r-- 1 nagios nagios 82 Aug 6 2017 cmdsubsys.log-20170806
-rw-r--r-- 1 nagios nagios 82 Aug 13 2017 cmdsubsys.log-20170813
-rw-r--r-- 1 nagios nagios 616062 Jul 8 03:16 cmdsubsys.log-20210708.gz
drwsrwsr-x. 4 apache nagios 4096 Jun 15 14:06 components
-rw-r--r--. 1 nagios nagios 8 Jul 21 09:35 corelog.data
-rw-r--r--. 1 nagios nagios 0 Jul 21 09:35 corelog.diff
-rwxrwxr-x 1 nagios nagios 23351 Dec 4 2018 corelog.newobjects
-rw-r--r-- 1 nagios nagios 266335 Jul 21 09:35 dbmaint.log
-rw-r--r-- 1 nagios nagios 2693 Jul 23 2017 dbmaint.log-20170723
-rw-r--r-- 1 nagios nagios 2693 Jul 30 2017 dbmaint.log-20170730
-rw-r--r-- 1 nagios nagios 2693 Aug 6 2017 dbmaint.log-20170806
-rw-r--r-- 1 nagios nagios 2693 Aug 13 2017 dbmaint.log-20170813
-rw-r--r-- 1 nagios nagios 257162 Jul 21 03:36 dbmaint.log-20210721.gz
-rw-r--r-- 1 nagios nagios 4778925 Jul 21 09:35 deadpool.log
-rw-r--r-- 1 nagios nagios 75 Jul 23 2017 deadpool.log-20170723
-rw-r--r-- 1 nagios nagios 75 Jul 30 2017 deadpool.log-20170730
-rw-r--r-- 1 nagios nagios 75 Aug 6 2017 deadpool.log-20170806
-rw-r--r-- 1 nagios nagios 75 Aug 13 2017 deadpool.log-20170813
-rw-r--r-- 1 nagios nagios 18046 Jun 7 03:36 deadpool.log-20210607.gz
-rw-r--r-- 1 nagios users 0 Jul 21 09:35 event_handler.lock
-rw-r--r-- 1 nagios nagios 258687 Jul 21 09:35 event_handler.log
-rw-r--r-- 1 nagios nagios 146 Jul 23 2017 event_handler.log-20170723
-rw-r--r-- 1 nagios nagios 146 Jul 30 2017 event_handler.log-20170730
-rw-r--r-- 1 nagios nagios 146 Aug 6 2017 event_handler.log-20170806
-rw-r--r-- 1 nagios nagios 146 Aug 13 2017 event_handler.log-20170813
-rw-r--r-- 1 nagios nagios 396449 Jul 21 03:36 event_handler.log-20210721.gz
-rw-r--r-- 1 nagios nagios 4403822 Jul 21 09:35 eventman.log
-rw-r--r-- 1 nagios nagios 40 Jul 23 2017 eventman.log-20170723
-rw-r--r-- 1 nagios nagios 40 Jul 30 2017 eventman.log-20170730
-rw-r--r-- 1 nagios nagios 40 Aug 6 2017 eventman.log-20170806
-rw-r--r-- 1 nagios nagios 40 Aug 13 2017 eventman.log-20170813
-rw-r--r-- 1 nagios nagios 358863 Jul 20 03:39 eventman.log-20210720.gz
-rw-r--r-- 1 nagios nagios 2132950 Jul 21 09:35 feedproc.log
-rw-r--r-- 1 nagios nagios 25 Jul 23 2017 feedproc.log-20170723
-rw-r--r-- 1 nagios nagios 25 Jul 30 2017 feedproc.log-20170730
-rw-r--r-- 1 nagios nagios 25 Aug 6 2017 feedproc.log-20170806
-rw-r--r-- 1 nagios nagios 25 Aug 13 2017 feedproc.log-20170813
-rw-r--r-- 1 nagios nagios 46130 May 23 03:36 feedproc.log-20210523.gz
drwxrwxr-x 2 nagios nagios 4096 Dec 4 2018 keys
-rw-r--r-- 1 nagios nagios 998 Jul 12 04:08 load_url.log
-rw-r--r-- 1 nagios nagios 905 Jul 18 2017 load_url.log-20170719
-rw-r--r-- 1 nagios nagios 904 Jul 27 2017 load_url.log-20170727
-rw-r--r-- 1 nagios nagios 897 Jul 31 2017 load_url.log-20170801
-rw-r--r-- 1 nagios nagios 905 Aug 10 2017 load_url.log-20170810
-rw-r--r-- 1 nagios nagios 1279237 Jul 20 09:43 nom.log
-rw-r--r-- 1 nagios nagios 321 Mar 9 2014 nom.log-20140309
-rw-r--r-- 1 nagios nagios 651 Aug 14 2015 nom.log-20150814
-rw-r--r-- 1 nagios nagios 272 Mar 10 2016 nom.log-20160310
-rw-r--r-- 1 nagios nagios 638 May 3 2016 nom.log-20160503
-rw-r--r-- 1 nagios nagios 188114 Dec 5 2018 nom.log-20181205.gz
-rw-rw-rw- 1 nagios nagios 0 Dec 4 2018 NXTI_Write_Test
-rw-r--r-- 1 nagios nagios 4811293 Jul 21 09:35 perfdataproc.log
-rw-r--r-- 1 nagios nagios 81 Jul 23 2017 perfdataproc.log-20170723
-rw-r--r-- 1 nagios nagios 81 Jul 30 2017 perfdataproc.log-20170730
-rw-r--r-- 1 nagios nagios 81 Aug 6 2017 perfdataproc.log-20170806
-rw-r--r-- 1 nagios nagios 81 Aug 13 2017 perfdataproc.log-20170813
-rw-r--r-- 1 nagios nagios 231054 Jun 10 03:36 perfdataproc.log-20210610.gz
-rw-r--r-- 1 nagios nagios 4903094 Jul 21 09:01 recurringdowntime.log
-rw-r--r-- 1 nagios nagios 181207 Jul 23 2017 recurringdowntime.log-20170723
-rw-r--r-- 1 nagios nagios 181207 Jul 30 2017 recurringdowntime.log-20170730
-rw-r--r-- 1 nagios nagios 182033 Aug 6 2017 recurringdowntime.log-20170806
-rw-r--r-- 1 nagios nagios 183017 Aug 13 2017 recurringdowntime.log-20170813
-rw-r--r-- 1 nagios nagios 1370492 Dec 4 2018 recurringdowntime.log-20181204.gz
-rw-r--r-- 1 nagios nagios 306557 Nov 24 2020 reportengine.log
-rw-r--r-- 1 nagios nagios 321 Mar 2 2014 reportengine.log-20140302
-rw-r--r-- 1 nagios nagios 321 Mar 9 2014 reportengine.log-20140309
-rw-r--r-- 1 nagios nagios 529 Aug 14 2015 reportengine.log-20150814
-rw-r--r-- 1 nagios nagios 651 May 3 2016 reportengine.log-20160503
-rw-r--r-- 1 nagios nagios 557042 Oct 9 2019 scheduledreporting.log
-rw-r--r-- 1 nagios nagios 0 Jul 24 2019 snmptt_service_results.log
drwxrwxr-x. 2 nagios nagios 4096 Jun 15 14:08 subsys
-rw-r--r-- 1 nagios nagios 2742229 Jul 21 09:35 sysstat.log
-rw-r--r-- 1 nagios nagios 8263 Jul 23 2017 sysstat.log-20170723
-rw-r--r-- 1 nagios nagios 8260 Jul 30 2017 sysstat.log-20170730
-rw-r--r-- 1 nagios nagios 8258 Aug 6 2017 sysstat.log-20170806
-rw-r--r-- 1 nagios nagios 8266 Aug 13 2017 sysstat.log-20170813
-rw-r--r-- 1 nagios nagios 523881 Jul 21 03:36 sysstat.log-20210721.gz
drwxrwxr-x 2 nagios nagios 4096 Mar 23 2017 upgrades
-rw-r--r--. 1 nagios nagios 11941 Jun 15 14:17 xi-sys.cfg
-rw-r--r-- 1 nagios nagios 37 Mar 23 2017 xi-uuid
-rwxr-xr-x. 1 nagios nagios 196 Jun 15 14:17 xiversion
Re: POSTGRES_RELATION_SIZE WARNING: DB "nagiosxi"
Posted: Thu Jul 22, 2021 12:56 pm
by dchurch
I'm confused as to the timestamps on those log files. Was this machine shut down for a very long time?
What is the output from the following command?
Code: Select all
service crond status
cat /etc/cron.d/nagiosxi
time logrotate -vv /etc/logrotate.conf
Re: POSTGRES_RELATION_SIZE WARNING: DB "nagiosxi"
Posted: Thu Jul 22, 2021 2:48 pm
by TBT
No, the uptime on these servers is high.
Code: Select all
service crond status
crond (pid 20086) is running...
Code: Select all
cat /etc/cron.d/nagiosxi
# /etc/cron.d/nagiosxi: crontab fragment for nagiosxi
# Backup MySQL & PostgreSQL Databases
0 7 * * * root /root/scripts/automysqlbackup
0 7 * * * root /root/scripts/autopostgresqlbackup > /dev/null 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/sysstat.php >> /usr/local/nagiosxi/var/sysstat.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/cmdsubsys.php >> /usr/local/nagiosxi/var/cmdsubsys.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/eventman.php >> /usr/local/nagiosxi/var/eventman.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/event_handler.php >> /usr/local/nagiosxi/var/event_handler.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/feedproc.php >> /usr/local/nagiosxi/var/feedproc.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/perfdataproc.php >> /usr/local/nagiosxi/var/perfdataproc.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/nom.php >> /usr/local/nagiosxi/var/nom.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/reportengine.php >> /usr/local/nagiosxi/var/reportengine.log 2>&1
*/5 * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/dbmaint.php >> /usr/local/nagiosxi/var/dbmaint.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/cleaner.php >> /usr/local/nagiosxi/var/cleaner.log 2>&1
01 * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/recurring_downtime.php >> /usr/local/nagiosxi/var/recurringdowntime.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/snmptt_service_results.php >> /usr/local/nagiosxi/var/snmptt_service_results.log 2>&1
* * * * * nagios /usr/bin/php -q /usr/local/nagiosxi/cron/deadpool.php >> /usr/local/nagiosxi/var/deadpool.log 2>&1
Code: Select all
time logrotate -vv /etc/logrotate.conf
reading config file /etc/logrotate.conf
including /etc/logrotate.d
reading config file ConsoleKit
reading config info for /var/log/ConsoleKit/history
reading config file cups
reading config info for /var/log/cups/*_log
reading config file dracut
reading config info for /var/log/dracut.log
reading config file gearmand
reading config info for /var/log/gearmand/gearmand.log
reading config file httpd
reading config info for /var/log/httpd/*log
reading config file mod_gearman2
reading config info for /var/log/mod_gearman2/mod_gearman_worker.log
reading config info for /var/log/mod_gearman2/mod_gearman_neb.log
reading config file mrtg-check
reading config info for /var/log/mrtg-check/mrtg-check-output.log
reading config file mysqld
reading config file nagiosxi
reading config info for /usr/local/nagiosxi/var/*log
reading config info for /usr/local/nagiosxi/var/xidebug.log
reading config info for /usr/local/nagiosxi/var/xidebug.log.backtrace
reading config file ppp
reading config info for /var/log/ppp/connect-errors
reading config file psacct
reading config info for /var/account/pacct
reading config file snmptt
reading config info for /var/log/snmptt/snmptt*.log /var/log/snmptt/snmptthandler.debug
reading config info for /var/log/snmptt/snmptt.debug
reading config file snmptt_spool_check_logrotate
reading config info for /var/log/snmptt_spool_check.log
reading config file sssd
reading config info for /var/log/sssd/*.log
reading config file syslog
reading config info for /var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
reading config file wpa_supplicant
reading config info for /var/log/wpa_supplicant.log
reading config file yum
reading config info for /var/log/yum.log
reading config info for /var/log/wtmp
reading config info for /var/log/btmp
Handling 22 logs
rotating pattern: /var/log/ConsoleKit/history monthly (6 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/ConsoleKit/history
log does not need rotating
rotating pattern: /var/log/cups/*_log weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/cups/*_log
log /var/log/cups/*_log does not exist -- skipping
rotating pattern: /var/log/dracut.log 1048576 bytes (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/dracut.log
log does not need rotating
rotating pattern: /var/log/gearmand/gearmand.log after 1 days (7 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/gearmand/gearmand.log
log does not need rotating
rotating pattern: /var/log/httpd/*log after 1 days (15 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/httpd/access_log
log does not need rotating
considering log /var/log/httpd/error_log
log does not need rotating
considering log /var/log/httpd/ssl_access_log
log does not need rotating
considering log /var/log/httpd/ssl_error_log
log does not need rotating
considering log /var/log/httpd/ssl_request_log
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/mod_gearman2/mod_gearman_worker.log weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/mod_gearman2/mod_gearman_worker.log
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/mod_gearman2/mod_gearman_neb.log weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/mod_gearman2/mod_gearman_neb.log
log does not need rotating
rotating pattern: /var/log/mrtg-check/mrtg-check-output.log monthly (12 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/mrtg-check/mrtg-check-output.log
log does not need rotating
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
log does not need rotating
considering log /usr/local/nagiosxi/var/cmdsubsys.log
log does not need rotating
considering log /usr/local/nagiosxi/var/dbmaint.log
log does not need rotating
considering log /usr/local/nagiosxi/var/deadpool.log
log does not need rotating
considering log /usr/local/nagiosxi/var/event_handler.log
log does not need rotating
considering log /usr/local/nagiosxi/var/eventman.log
log does not need rotating
considering log /usr/local/nagiosxi/var/feedproc.log
log does not need rotating
considering log /usr/local/nagiosxi/var/load_url.log
log does not need rotating
considering log /usr/local/nagiosxi/var/nom.log
log does not need rotating
considering log /usr/local/nagiosxi/var/perfdataproc.log
log does not need rotating
considering log /usr/local/nagiosxi/var/recurringdowntime.log
log does not need rotating
considering log /usr/local/nagiosxi/var/reportengine.log
log does not need rotating
considering log /usr/local/nagiosxi/var/scheduledreporting.log
log does not need rotating
considering log /usr/local/nagiosxi/var/snmptt_service_results.log
log does not need rotating
considering log /usr/local/nagiosxi/var/sysstat.log
log needs rotating
rotating log /usr/local/nagiosxi/var/sysstat.log, log->rotateCount is 1
dateext suffix '-20210722'
glob pattern '-[0-9][0-9][0-9][0-9][0-9][0-9][0-9][0-9]'
destination /usr/local/nagiosxi/var/sysstat.log-20210722.gz already exists, skipping rotation
rotating pattern: /usr/local/nagiosxi/var/xidebug.log 104857600 bytes (1 rotations)
empty log files are not rotated, old logs are removed
considering log /usr/local/nagiosxi/var/xidebug.log
log /usr/local/nagiosxi/var/xidebug.log does not exist -- skipping
rotating pattern: /usr/local/nagiosxi/var/xidebug.log.backtrace 104857600 bytes (1 rotations)
empty log files are not rotated, old logs are removed
considering log /usr/local/nagiosxi/var/xidebug.log.backtrace
log /usr/local/nagiosxi/var/xidebug.log.backtrace does not exist -- skipping
rotating pattern: /var/log/ppp/connect-errors after 1 days (5 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/ppp/connect-errors
log /var/log/ppp/connect-errors does not exist -- skipping
rotating pattern: /var/account/pacct after 1 days (31 rotations)
empty log files are not rotated, old logs are removed
considering log /var/account/pacct
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/snmptt/snmptt*.log /var/log/snmptt/snmptthandler.debug weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/snmptt/snmptt.log
log does not need rotating
considering log /var/log/snmptt/snmpttsystem.log
log does not need rotating
considering log /var/log/snmptt/snmpttunknown.log
log does not need rotating
considering log /var/log/snmptt/snmptthandler.debug
log /var/log/snmptt/snmptthandler.debug does not exist -- skipping
rotating pattern: /var/log/snmptt/snmptt.debug weekly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/snmptt/snmptt.debug
log /var/log/snmptt/snmptt.debug does not exist -- skipping
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/snmptt_spool_check.log after 1 days (30 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/snmptt_spool_check.log
log does not need rotating
rotating pattern: /var/log/sssd/*.log weekly (2 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/sssd/*.log
log /var/log/sssd/*.log does not exist -- skipping
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/cron
/var/log/maillog
/var/log/messages
/var/log/secure
/var/log/spooler
weekly (4 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/cron
log does not need rotating
considering log /var/log/maillog
log does not need rotating
considering log /var/log/messages
log does not need rotating
considering log /var/log/secure
log does not need rotating
considering log /var/log/spooler
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/wpa_supplicant.log 30720 bytes (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/wpa_supplicant.log
log does not need rotating
not running postrotate script, since no logs were rotated
rotating pattern: /var/log/yum.log yearly (4 rotations)
empty log files are not rotated, old logs are removed
considering log /var/log/yum.log
log does not need rotating
rotating pattern: /var/log/wtmp monthly (1 rotations)
empty log files are rotated, only log files >= 1048576 bytes are rotated, old logs are removed
considering log /var/log/wtmp
log does not need rotating
rotating pattern: /var/log/btmp monthly (1 rotations)
empty log files are rotated, old logs are removed
considering log /var/log/btmp
log does not need rotating
real 0m0.304s
user 0m0.002s
sys 0m0.007s
Re: POSTGRES_RELATION_SIZE WARNING: DB "nagiosxi"
Posted: Fri Jul 23, 2021 5:08 pm
by benjaminsmith
Hi,
I'm helping Dan out with this ticket, that may or may not be an issue here. Let's check the table sizes on the system. Please post the output to the following command.
Code: Select all
echo "SELECT relname as Table, pg_size_pretty(pg_total_relation_size(relid)) As Size, pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as ExternalSize FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;" | psql nagiosxi nagiosxi
Re: POSTGRES_RELATION_SIZE WARNING: DB "nagiosxi"
Posted: Mon Jul 26, 2021 8:39 am
by TBT
Code: Select all
echo "SELECT relname as Table, pg_size_pretty(pg_total_relation_size(relid)) As Size, pg_size_pretty(pg_total_relation_size(relid) - pg_relation_size(relid)) as ExternalSize FROM pg_catalog.pg_statio_user_tables ORDER BY pg_total_relation_size(relid) DESC;" | psql nagiosxi nagiosxi
table | size | externalsize
--------------------------+------------+--------------
xi_auditlog | 647 MB | 256 MB
xi_meta | 18 MB | 15 MB
xi_events | 6768 kB | 6704 kB
xi_auth_tokens | 3472 kB | 3368 kB
xi_usermeta | 1400 kB | 984 kB
xi_options | 136 kB | 120 kB
xi_users | 96 kB | 72 kB
xi_sysstat | 96 kB | 72 kB
xi_eventqueue | 96 kB | 56 kB
xi_commands | 80 kB | 72 kB
xi_cmp_favorites | 64 kB | 56 kB
xi_mibs | 48 kB | 48 kB
xi_sessions | 48 kB | 40 kB
xi_incidents | 48 kB | 40 kB
xi_cmp_trapdata | 24 kB | 24 kB
xi_deploy_jobs | 16 kB | 16 kB
xi_deploy_agents | 16 kB | 16 kB
xi_cmp_nagiosbpi_backups | 16 kB | 16 kB
xi_cmp_trapdata_log | 16 kB | 16 kB
xi_cmp_ccm_backups | 8192 bytes | 8192 bytes
(20 rows)
Re: POSTGRES_RELATION_SIZE WARNING: DB "nagiosxi"
Posted: Mon Jul 26, 2021 12:55 pm
by ssax
I would probably change it to this since it's looking at the total DB size:
Code: Select all
check_xi_postgres_db!-H 127.0.0.1 --port 5432 --dbuser=nagiosxi --dbpass=nagiosxi --action=database_size --warning=2G --critical=4GB --exclude=postgres,template0,template1
Re: POSTGRES_RELATION_SIZE WARNING: DB "nagiosxi"
Posted: Tue Jul 27, 2021 7:56 am
by TBT
@benjaminsmith so, based on that information, should I do as @ssax suggested or is more trouble shooting required?
Re: POSTGRES_RELATION_SIZE WARNING: DB "nagiosxi"
Posted: Tue Jul 27, 2021 1:24 pm
by ssax
Are you experiencing any issues such as old notifications being sent/or notifications referencing non-existent systems?
If so, you can run this command to clean out those temporary tables:
Code: Select all
echo "truncate table xi_events; truncate table xi_meta; truncate table xi_eventqueue;" | psql nagiosxi nagiosxi
If not, since you're not seeing any errors in the dbmaint.log, if you're not seeing errors in
/usr/local/nagiosxi/var/eventman.log or in
/usr/local/nagios/var/event_handler.log I can only assume it's working properly and considering that specific check is checking the overall nagiosxi DB size (instead of relations) it's a fair assumption that you'll want to increase the thresholds since there is more audit logging going on in the nagiosxi DB and that can grow to a couple of gigabytes depending on your retention settings in Admin > Performance Settings > Databases.
It's currently warning you about a 682 MB nagiosxi DB, that's a small overall DB size for the system so the recommendation is for you to update the thresholds accordingly.