Postgres Table Sizes Alert

This support forum board is for support questions relating to Nagios XI, our flagship commercial network monitoring solution.
Locked
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Postgres Table Sizes Alert

Post by TBT »

Receiving the following alert on Postgres Table Sizes. Is this something that will recover once nightly DB maintenance is ran or should action be taken? Please advise.

Service: Postgres Table Sizes - nagiosxi
Host: THBYONA212NVLXVM9194
Alias: monitor4
Address: 127.0.0.1
State: CRITICAL
Info:
POSTGRES_RELATION_SIZE CRITICAL: DB nagiosxi (host:127.0.0.1) largest relation is table public.xi_meta: 118 MB
Date/Time: 2018-10-23 12:21:47
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Postgres Table Sizes Alert

Post by benjaminsmith »

Hi@TBT

There is could be caused be a number of things. Let's first check the database performance settings in Nagios XI (or post of screen shot of your settings). See the Nagios Database Optimization Guide:
(https://assets.nagios.com/downloads/nag ... zation.pdf)

After checking the settings, are there any errors in the db maintenance log?

Code: Select all

tail /usr/local/nagiosxi/var/dbmaint.log
Lastly, what version of postgres are you using?

Code: Select all

postgres -V
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Postgres Table Sizes Alert

Post by TBT »

benjaminsmith wrote:Hi@TBT

There is could be caused be a number of things. Let's first check the database performance settings in Nagios XI (or post of screen shot of your settings). See the Nagios Database Optimization Guide:
(https://assets.nagios.com/downloads/nag ... zation.pdf)

After checking the settings, are there any errors in the db maintenance log?

Code: Select all

tail /usr/local/nagiosxi/var/dbmaint.log
Lastly, what version of postgres are you using?

Code: Select all

postgres -V

I should also mention that we had an outage overnight for roughly 4 hours. Several XI Servers (this one included) could not reach thousands of network elements that are being monitored, however, this one XI Server in particular is the only experiencing the Postgres Table Sizes Alert.

Nagios XI Database
Max Commands Age: 480 Max time in minutes to keep commands.
Max Events Age: 480 Max time in minutes to keep events.
Optimize Interval: 60 Max time in minutes between optimization runs.

tail /usr/local/nagiosxi/var/dbmaint.log
SQL2: Deleted 529 (DELETE FROM xi_meta WHERE meta_id IN (SELECT xi_meta.meta_id FROM xi_meta LEFT JOIN xi_events ON xi_meta.metaobj_id=xi_events.event_id WHERE metatype_id='1' AND event_id IS NULL))
CLEANING nagiosxi TABLE 'auditlog'...
SQL: DELETE FROM xi_auditlog WHERE log_time < 1537729801::abstime::timestamp without time zone
CLEANING nagiosql TABLE 'logbook'...
SQL: DELETE FROM tbl_logbook WHERE time < FROM_UNIXTIME(1540293001)
Repair Complete: Removing Lock File

postgres -V
postgres (PostgreSQL) 8.4.20
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Postgres Table Sizes Alert

Post by benjaminsmith »

Ok. That' looks normal.

Let's run vacuum on the postgres database to clean up the database.

Code: Select all

echo "vacuum;vacuum analyze;vacuum full;"|psql nagiosxi postgres
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
TBT
Posts: 625
Joined: Wed May 18, 2011 1:26 pm

Re: Postgres Table Sizes Alert

Post by TBT »

benjaminsmith wrote:Ok. That' looks normal.

Let's run vacuum on the postgres database to clean up the database.

Code: Select all

echo "vacuum;vacuum analyze;vacuum full;"|psql nagiosxi postgres
Resolved with vacuum.
POSTGRES_RELATION_SIZE OK: DB "nagiosxi" (host:127.0.0.1) largest relation is table "public.xi_meta": 33 MB

Thank you.
Nagios XI 2024R2.2.1 (8 Servers)
Nagios Fusion 2024R1.0.2
benjaminsmith
Posts: 5324
Joined: Wed Aug 22, 2018 4:39 pm
Location: saint paul

Re: Postgres Table Sizes Alert

Post by benjaminsmith »

Thanks for getting back to us, and glad to know that resolved the issue. I will go ahead a close this forum topic.
As of May 25th, 2018, all communications with Nagios Enterprises and its employees are covered under our new Privacy Policy.

Be sure to check out our Knowledgebase for helpful articles and solutions!
Locked