IBM Support

SQL Query is Too Large For RTM to accept in Alert Template

Troubleshooting


Problem

In Console -> Templates -> Alert Templates -> (edit) -> Data Source -> Data Type (SQL Query), long SQL query is not fully accepted in 'SQL Query' box.

Symptom

Attempted to use a long query to create an alert template.

image-20181023103145-1

After clicking on 'save', the query has been cut off at the end.

image-20181023103406-2

As a result, this query can not be used in alert template.

Cause

There is a character limit for SQL Query in table 'gridalarms_template_expression'.
MariaDB [cacti]> desc gridalarms_template_expression;
+------------------+---------- --------+------+-----+---------+----------------+
| Field           | Type            | Null | Key | Default |Extra         |
+------------------+------------------+------+-----+---------+----------------+
| id              | int(10) unsigned | NO  | PRI | NULL   | auto_increment |
| hash            | varchar(32)     | YES | MUL |        |               |
| name            | varchar(255)    | NO  |    | NULL   |               |
| description     | varchar(255)    | NO  |    |        |               |
| ds_type         | int(10) unsigned | YES |    | 0      |               |
| type            | int(1)          | NO  |    | NULL   |               |
| db_table        | varchar(50)     | NO  |    |        |               |
| sql_query       | varchar(1048)   | YES |    | NULL   |               |
| script_thold    | varchar(255)    | YES |    | NULL   |               |
| script_data     | varchar(255)    | YES |    | NULL   |               |
| script_data_type | int(10) unsigned | YES |    | 0      |               |
+------------------+------------------+------+-----+---------+----------------+

As default, the max length accept to 'sql_query' column was 1048. Modify this limit to larger number could fix the problem.

Resolving The Problem

Change sql_query to larger number by using following query:
alter table gridalarms_template_expression modify sql_query varchar(2048);

As a result, 'SQL Query' box is able to accept larger query which helps us create alert template.

[{"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSZT2D","label":"IBM Spectrum LSF RTM"},"Component":"","Platform":[{"code":"PF016","label":"Linux"}],"Version":"All Versions","Edition":"","Line of Business":{"code":"LOB10","label":"Data and AI"}}]

Document Information

Modified date:
01 November 2018

UID

ibm10737057