NetXMS Support Forum

English Support => General Support => Topic started by: jbriseno on February 21, 2024, 04:46:50 PM

Title: The table 'alarm_event' is full in NetXMS 4.5.3-1 version
Post by: jbriseno on February 21, 2024, 04:46:50 PM
Hi, there. five days ago, we did no able to log into the NetXMS server. The NetXMS client sent back the following message: Connection refused. I decided to look up for in the log of the system. I found the following message:


2024.02.14 16:49:51.981 *E* [db.drv            ] SQL query failed (Query = "INSERT INTO alarm_events (alarm_id,event_id,event_code,event_name,severity,source_object_id,event_timestamp,message) VALUES (?,?,?,?,?,?,?,?)"): The table 'alarm_events' is full


Any idea how to fix this database issue? Thanks in advance.
Title: Re: The table 'alarm_event' is full in NetXMS 4.5.3-1 version
Post by: Victor Kirhenshtein on February 21, 2024, 05:25:58 PM
Hi,

it looks to be disk space issue. You probably can truncate biggest tables (possible candidates are event_log and top idata_ tables). 
If you are ok with losing all alarms and event history, you can truncate tables event_log, alarms, alarm_events, and alarm_notes.

What database you are using?

Best regards,
Victor
Title: Re: The table 'alarm_event' is full in NetXMS 4.5.3-1 version
Post by: jbriseno on February 21, 2024, 05:33:20 PM
Hi, Victor. First, I appreciate your time to reply my message. Second, even better you reply it as soon as possible. Third, we are using: mysql  Ver 15.1 Distrib 10.3.39-MariaDB, for debian-linux-gnu (x86_64) using readline 5.2

Best regards !
Jose
Title: Re: The table 'alarm_event' is full in NetXMS 4.5.3-1 version
Post by: jbriseno on February 21, 2024, 05:36:49 PM
Before to do it. Do I have to think about the primary key on these tables? because, I had have problems with mariaDB tables when I use the Mysql TRuncate table command. Thanks in advance
Title: Re: The table 'alarm_event' is full in NetXMS 4.5.3-1 version
Post by: Victor Kirhenshtein on February 21, 2024, 05:42:35 PM
Seems to be MariaDB specific issue. I'm not an expert on it unfortunately, but seems that they have all sort of strange limits on tables. One thing you may want to look at is big_tables configuration option. Maybe you should turn it on. Or consider migration to PostgreSQL :)
How many records do you have in this table? And how many active alarms? It is a bit unexpected that event_log for example works fine, but alarm_events is full. This table should contain event records for active alarms only.

Best regards,
Victor

P.S. Primary key on that table is alarm_id,event_id - those are two integers, so should not be an issue as such.
Title: Re: The table 'alarm_event' is full in NetXMS 4.5.3-1 version
Post by: jbriseno on February 21, 2024, 05:59:38 PM
Awesome ! Thanks ! I will do it.

Best regards

Jose
Title: Re: The table 'alarm_event' is full in NetXMS 4.5.3-1 version
Post by: jbriseno on February 21, 2024, 06:36:23 PM
Victor, for your information: 

event_log table

105941216 rows

alarm_events table

55125439  rows

MariaDB [netxms]> describe alarm_events;
+------------------+---------------+------+-----+---------+-------+
| Field            | Type          | Null | Key | Default | Extra |
+------------------+---------------+------+-----+---------+-------+
| alarm_id         | int(11)       | NO   | PRI | NULL    |       |
| event_id         | bigint(20)    | NO   | PRI | NULL    |       |
| event_code       | int(11)       | NO   |     | NULL    |       |
| event_name       | varchar(63)   | YES  |     | NULL    |       |
| severity         | int(11)       | NO   |     | NULL    |       |
| source_object_id | int(11)       | NO   |     | NULL    |       |
| event_timestamp  | int(11)       | NO   |     | NULL    |       |
| message          | varchar(2000) | YES  |     | NULL    |       |
+------------------+---------------+------+-----+---------+-------+
8 rows in set (0.027 sec)
Title: Re: The table 'alarm_event' is full in NetXMS 4.5.3-1 version
Post by: jbriseno on February 21, 2024, 06:40:21 PM
Victor. I have other question:

Do I need to stop the NetXMS server before to truncate both tables?
Title: Re: The table 'alarm_event' is full in NetXMS 4.5.3-1 version
Post by: Victor Kirhenshtein on February 21, 2024, 06:52:57 PM
Yes, it's better to stop it.

Best regards,
Victor
Title: Re: The table 'alarm_event' is full in NetXMS 4.5.3-1 version
Post by: bdefloo on February 23, 2024, 03:54:12 PM
Hi,

Hopping over from https://www.netxms.org/forum/general-support/netxmsd-hangs-during-startup/ to say thanks for the pointer towards alarm_events which solved my issue!

I also had a huge number of rows in this table, and found the culprit in a misconfigured event processing policy which was catching too many events. You may also have something similar.

In my case I discovered it by looking at alarms with very high repeat counts. If you open the alarm details it will show the EPP rule which created it.