Alarms
The watcher service that runs on each managed host submits alarms in real time from the host to the Management Station, which stores information about the alarms in the database.
Schema overview
This figure shows the table that stores information about alarms:
The following table describes the data in the alarms schema.
t_alarms
All alarm data is stored using a single table, t_alarms:
|
Field name |
Description |
Type |
Constraints |
|---|---|---|---|
|
id (Primary key) |
Id for the table. Can be used during join operations. |
int(11) |
NOT NULL |
|
service_id (Index) |
Service ID. A unique identifier for the service that enables the Management Station to map diagnostic logs to a particular service. When a service is restarted after a failure, it keeps the same service ID. |
varchar(36) |
|
|
clapi_version |
Version number of the logging library used to generate this file. |
int(11) |
NOT NULL |
|
session_id (Index) |
Unique session identifier for the call during which this alarm was generated. |
varchar(255) |
|
|
category |
Alarm category. Currently this is always LOGGING. |
varchar(16) |
NOT NULL |
|
type (Index) |
The alarm level for this message. |
int(11) |
NOT NULL |
|
msg_id |
Identifier for this message in the message catalog. |
varchar(255) |
|
|
msg_timestamp (Index: msg_timestamp, msg_timestamp_us) |
Timestamp for the message, in seconds. |
datetime |
NOT NULL |
|
msg_timestamp_us (Index: msg_timestamp, msg_timestamp_us) |
Timestamp for the message based on the milliseconds value plus the microseconds value used for sequencing. |
int(11) |
NOT NULL |
|
host_name (Index) |
Name of the host machine running the service that generated this alarm. |
varchar(64) |
NOT NULL |
|
app_name (Index) |
Application handling the call when this alarm was generated. |
varchar(64) |
NOT NULL |
|
thread_id |
The ID for the thread within the service that generated this alarm. |
int(11) |
|
|
source |
Name of the service subsystem that generated this alarm, for example, MSERVER. |
varchar(64) |
|
|
internal_source |
The class or method name or line number at which this alarm was generated. |
varchar(255) |
|
|
msg_length |
The length of this alarm message, in bytes. |
int(11) |
|
|
msg |
The contents of the alarm message. |
text |
NOT NULL |
Sample query
This query shows how to return all alarms that have been received by the Management Station:
SELECT * FROM t_alarms
WHERE t_alarms.type <= '4'
AND t_alarms.host_name = 'waterfall'
ORDER BY t_alarms.msg_timestamp DESC,
t_alarms.msg_timestamp_us DESC;