54e446ca1fa7732178160c6d8f60070fcdc8f4f5
[public/netxms.git] / sql / policy.in
1 /*
2 ** Default event processing policy
3 **
4 ** ex: syntax=sql
5 */
6
7 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
8 VALUES (0,'2d2c3d32-49d4-4e76-b6aa-782b30d90f28',7944,'Show alarm when node is down',
9 '%m',5,'NODE_DOWN_%i','',0,EVENT_ALARM_TIMEOUT);
10
11 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
12 VALUES (1,'4fa20604-b56f-4f12-bb5d-2c3243a126c9',7944,'Terminate node down alarms when node is up',
13 '%m',6,'NODE_DOWN_%i','',0,EVENT_ALARM_TIMEOUT);
14
15 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
16 VALUES (2,'45999e66-c16c-400d-8b79-63a0f8eb8958',7944,'Show alarm when network service is down or in unknown state',
17 '%m',5,'SERVICE_DOWN_%i_%2','',0,EVENT_ALARM_TIMEOUT);
18
19 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
20 VALUES (3,'8537fa14-e824-435b-a1dd-be3e566b7f67',7944,'Terminate network service down/unknown alarms when service is up',
21 '%m',6,'SERVICE_DOWN_%i_%2','',0,EVENT_ALARM_TIMEOUT);
22
23 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
24 VALUES (4,'2daa869f-9921-4f3e-9cb9-004c2f31f70a',7944,'Show alarm when interface is down',
25 '%m',5,'IF_DOWN_%i_%5','',0,EVENT_ALARM_TIMEOUT);
26
27 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
28 VALUES (5,'95d42ff2-6fe0-4b1c-9c7b-c18520393f9f',7944,'Terminate interface down alarms when interface is up',
29 '%m',6,'IF_DOWN_%i_%5','',0,EVENT_ALARM_TIMEOUT);
30
31 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
32 VALUES (6,'6f46d451-ee66-4563-8747-d129877df24d',7944,'Terminate interface down alarms when interface is deleted or it''s expected state changed',
33 '%m',6,'IF_DOWN_%i_%1','',0,EVENT_ALARM_TIMEOUT);
34
35 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
36 VALUES (7,'727a0dca-ecc4-4490-bf4b-3fc8b5ff8cb4',7944,'Show alarm when interface is unexpectedly up',
37 '%m',5,'IF_UNEXP_UP_%i_%5','',0,EVENT_ALARM_TIMEOUT);
38
39 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
40 VALUES (8,'11176d3e-0149-448b-a5fe-2be764762775',7944,'Terminate interface unexpectedly up alarms when interface goes down',
41 '%m',6,'IF_UNEXP_UP_%i_%5','',0,EVENT_ALARM_TIMEOUT);
42
43 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
44 VALUES (9,'ecc3fb57-672d-489d-a0ef-4214ea896e0f',7944,'Terminate interface unexpectedly up alarms when interface is deleted or it''s expected state changed',
45 '%m',6,'IF_UNEXP_UP_%i_%1','',0,EVENT_ALARM_TIMEOUT);
46
47 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
48 VALUES (10,'5b8115f1-5c84-443a-9f88-18fc0b70f29e',7944,'Generate alarm when incorrect network mask detected on interface',
49 '%m',2,'BAD_NETMASK_%i_%2','',0,EVENT_ALARM_TIMEOUT);
50
51 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
52 VALUES (11,'68a629ef-c645-49e5-8a7b-c5e79308080e',7944,'Generate alarm when MAC address change detected on interface',
53 '%m',1,'','',0,EVENT_ALARM_TIMEOUT);
54
55 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
56 VALUES (12,'062228ef-c155-4669-a90a-603cae13240e',7944,'Generate alarm when server enconters NXSL script execution error',
57 '%m',2,'SCRIPT_ERR_%1_%2','',0,EVENT_ALARM_TIMEOUT);
58
59 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
60 VALUES (13,'943f5474-5614-44e1-820c-b8fe17bc4d0b',7944,'Show alarm when connection with backend database is lost',
61 '%m',4,'DB_CONN','',0,EVENT_ALARM_TIMEOUT);
62
63 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
64 VALUES (14,'9ce6b59e-e274-4c94-b314-4b4652c10c74',7944,'Terminate DB connection loss alarm when connection restored',
65 '%m',6,'DB_CONN','',0,EVENT_ALARM_TIMEOUT);
66
67 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
68 VALUES (15,'e3120a33-216e-e048-aa3b-4f1a9f3f10fc',7944,'Show alarm when NetXMS server network connection is lost',
69 '%m',4,'NET_CONN_LOST','',0,EVENT_ALARM_TIMEOUT);
70
71 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
72 VALUES (16,'bdc76d2e-967e-bf44-95a1-a229ef8b3ff4',7944,'Terminate NetXMS server network connection loss alarm when connection restored',
73 '%m',6,'NET_CONN_LOST','',0,EVENT_ALARM_TIMEOUT);
74
75 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
76 VALUES (17,'226de02d-9eb2-4ea1-a92c-2bdb1718f2ec',7944,'Show alarm when DCI status changes to DISABLED or UNSUPPORTED',
77 '%m',5,'DCI_STATUS_%i_%1','',0,EVENT_ALARM_TIMEOUT);
78
79 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
80 VALUES (18,'02a21afe-c942-4953-8b5d-f463c597cff8',7944,'Terminate DCI status alarms when DCI status returns to ACTIVE',
81 '%m',6,'DCI_STATUS_%i_%1','',0,EVENT_ALARM_TIMEOUT);
82
83 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
84 VALUES (19,'47fd5c32-b6c9-48b8-99fb-c389dde63bee',7944,'Generate alarm on threshold violation',
85 '%m',5,'DC_THRESHOLD_%i_%<dciId>','',0,EVENT_ALARM_TIMEOUT);
86
87 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
88 VALUES (20,'dcdd6f93-2f9e-4c3e-97cb-95b6847f13ce',7944,'Terminate threshold violation alarms',
89 '%m',6,'DC_THRESHOLD_%i_%<dciId>','',0,EVENT_ALARM_TIMEOUT);
90
91 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
92 VALUES (21,'d3acabe8-717d-4ceb-bb7f-498d5af898f2',7944,'Generate alarm on table threshold violation',
93 '%m',5,'DCTTHR_%i_%<dciId>_%<instance>','',0,EVENT_ALARM_TIMEOUT);
94
95 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
96 VALUES (22,'8e26af4b-e478-44c9-9c12-0b049ccb6c3c',7944,'Terminate table threshold violation alarms',
97 '%m',6,'DCTTHR_%i_%<dciId>_%<instance>','',0,EVENT_ALARM_TIMEOUT);
98
99 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
100 VALUES (23,'ea1dee96-b42e-499c-a992-0b0f9e4874b9',7944,'Generate an alarm when one of the system threads hangs or stops unexpectedly',
101 '%m',5,'SYS_THREAD_HANG_%1','',0,EVENT_ALARM_TIMEOUT);
102
103 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
104 VALUES (24,'f0c5a6b2-7427-45e5-8333-7d60d2b408e6',7944,'Terminate the alarm when one of the system threads which previously hanged or stoped unexpectedly returned to the running state',
105 '%m',6,'SYS_THREAD_HANG_%1','',0,EVENT_ALARM_TIMEOUT);
106
107 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
108 VALUES (25,'ed3397a8-a496-4534-839b-5a6fc77c167c',7944,'Generate an alarm when the object enters the maintanance mode',
109 '%m',5,'MAINTENANCE_MODE_%i','',0,EVENT_ALARM_TIMEOUT);
110
111 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
112 VALUES (26,'20a0f4a5-d90e-4961-ba88-a65b9ee45d07',7944,'Terminate the alarm when the object leaves the maintanance mode',
113 '%m',6,'MAINTENANCE_MODE_%i','',0,EVENT_ALARM_TIMEOUT);
114
115 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
116 VALUES (27,'c6f66840-4758-420f-a27d-7bbf7b66a511',7944,'Generate an alarm if the NetXMS agent on the node stops responding',
117 '%m',5,'AGENT_UNREACHABLE_%i','',0,EVENT_ALARM_TIMEOUT);
118
119 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
120 VALUES (28,'9fa60260-c2ec-4371-b4e4-f5346b1d8400',7944,'Terminate the alarm if the NetXMS agent on the node start responding again',
121 '%m',6,'AGENT_UNREACHABLE_%i','',0,EVENT_ALARM_TIMEOUT);
122
123 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
124 VALUES (29,'20ef861f-b8e4-4e04-898e-e57d13863661',7944,'Generate an alarm if the SNMP agent on the node stops responding',
125 '%m',5,'SNMP_UNREACHABLE_%i','',0,EVENT_ALARM_TIMEOUT);
126
127 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
128 VALUES (30,'33f6193a-e103-4f5f-8bee-870bbcc08066',7944,'Terminate the alarm if the SNMP agent on the node start responding again',
129 '%m',6,'SNMP_UNREACHABLE_%i','',0,EVENT_ALARM_TIMEOUT);
130
131 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
132 VALUES (31,'417648af-5361-49a5-9471-6ef31e857b2d',7944,'Generate an alarm when error occurred during LDAP synchronization',
133 '%m',5,'SYS_LDAP_SYNC_ERROR_%2','',0,EVENT_ALARM_TIMEOUT);
134
135 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
136 VALUES (32,'19bd89ba-8bb2-4915-8546-a1ecc650dedd',7944,'Generate an alarm when there is problem with agent log',
137 '%m',5,'SYS_AGENT_LOG_PROBLEM_%i','',0,EVENT_ALARM_TIMEOUT);
138
139 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
140 VALUES (33,'cff7fe6b-2ad1-4c18-8a8f-4d397d44fe04',7944,'Generate an alarm when there is problem with agent local database',
141 '%m',5,'SYS_AGENT_LOCAL_DATABASE_PROBLEM_%i','',0,EVENT_ALARM_TIMEOUT);
142
143 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
144 VALUES (34,'68e102a3-58d3-4112-901c-f683356ba662',7944,'Show alarm when interface with expected state UP is administratively disabled',
145 '%m',2,'IF_DOWN_%i_%5','interface = GetInterfaceObject($node, $event-&gt;parameters[5]);&#x0D;&#x0A;&#x0D;&#x0A;// if interface not found or interface expected state is not UP, do not match&#x0D;&#x0A;// otherwize (if interface expected status is UP), match&#x0D;&#x0A;return (interface != null &amp;&amp; interface-&gt;expectedState == 0);&#x0D;&#x0A;',0,EVENT_ALARM_TIMEOUT);
146
147 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
148 VALUES (35,'68a629ef-c645-49e5-8a7b-c5e79308080e',7944,'Generate alarm when MAC address change detected on interface',
149 '%m',1,'MAC_ADDRESS_CHANGED_%i_%2','',0,EVENT_ALARM_TIMEOUT);
150
151 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
152 VALUES (36,'18507220-6a16-4e13-a6ba-141d907b924a',7944,'Terminate MAC address change alarms when the interface is deleted',
153 '%m',6,'MAC_ADDRESS_CHANGED_%i_%1','',0,EVENT_ALARM_TIMEOUT);
154
155 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
156 VALUES (37,'8cca36cd-f821-43ae-8329-0eefe35df3b7',7944,'Terminate network mask alarms when an interface is deleted',
157 '%m',6,'BAD_NETMASK_%i_%1','',0,EVENT_ALARM_TIMEOUT);
158
159 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
160 VALUES (38,'404642a0-deb0-400d-b9f9-c86f5a83f7f5',7944,'Terminate network mask alarms when the mask of interface changes or IP address of interface is deleted',
161 '%m',6,'BAD_NETMASK_%i_%5','',0,EVENT_ALARM_TIMEOUT);
162
163 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event)
164 VALUES (39,'b8abb037-ab4a-4e05-adc4-9425ce440e4a',7944,'Generate alarm when a routing loop is detected',
165 '%m',5,'ROUTING_LOOP_%i','',0,EVENT_ALARM_TIMEOUT);
166
167
168 INSERT INTO policy_event_list (rule_id,event_code) VALUES (0,EVENT_NODE_DOWN);
169 INSERT INTO policy_event_list (rule_id,event_code) VALUES (1,EVENT_NODE_UP);
170 INSERT INTO policy_event_list (rule_id,event_code) VALUES (2,EVENT_SERVICE_DOWN);
171 INSERT INTO policy_event_list (rule_id,event_code) VALUES (2,EVENT_SERVICE_UNKNOWN);
172 INSERT INTO policy_event_list (rule_id,event_code) VALUES (3,EVENT_SERVICE_UP);
173 INSERT INTO policy_event_list (rule_id,event_code) VALUES (4,EVENT_INTERFACE_DOWN);
174 INSERT INTO policy_event_list (rule_id,event_code) VALUES (5,EVENT_INTERFACE_UP);
175 INSERT INTO policy_event_list (rule_id,event_code) VALUES (6,EVENT_INTERFACE_DELETED);
176 INSERT INTO policy_event_list (rule_id,event_code) VALUES (6,EVENT_IF_EXPECTED_STATE_DOWN);
177 INSERT INTO policy_event_list (rule_id,event_code) VALUES (6,EVENT_IF_EXPECTED_STATE_IGNORE);
178 INSERT INTO policy_event_list (rule_id,event_code) VALUES (7,EVENT_INTERFACE_UNEXPECTED_UP);
179 INSERT INTO policy_event_list (rule_id,event_code) VALUES (8,EVENT_INTERFACE_EXPECTED_DOWN);
180 INSERT INTO policy_event_list (rule_id,event_code) VALUES (9,EVENT_INTERFACE_DELETED);
181 INSERT INTO policy_event_list (rule_id,event_code) VALUES (9,EVENT_IF_EXPECTED_STATE_UP);
182 INSERT INTO policy_event_list (rule_id,event_code) VALUES (9,EVENT_IF_EXPECTED_STATE_IGNORE);
183 INSERT INTO policy_event_list (rule_id,event_code) VALUES (10,EVENT_INCORRECT_NETMASK);
184 INSERT INTO policy_event_list (rule_id,event_code) VALUES (11,EVENT_MAC_ADDR_CHANGED);
185 INSERT INTO policy_event_list (rule_id,event_code) VALUES (12,EVENT_SCRIPT_ERROR);
186 INSERT INTO policy_event_list (rule_id,event_code) VALUES (13,EVENT_DB_CONNECTION_LOST);
187 INSERT INTO policy_event_list (rule_id,event_code) VALUES (14,EVENT_DB_CONNECTION_RESTORED);
188 INSERT INTO policy_event_list (rule_id,event_code) VALUES (15,EVENT_NETWORK_CONNECTION_LOST);
189 INSERT INTO policy_event_list (rule_id,event_code) VALUES (16,EVENT_NETWORK_CONNECTION_RESTORED);
190 INSERT INTO policy_event_list (rule_id,event_code) VALUES (17,EVENT_DCI_DISABLED);
191 INSERT INTO policy_event_list (rule_id,event_code) VALUES (17,EVENT_DCI_UNSUPPORTED);
192 INSERT INTO policy_event_list (rule_id,event_code) VALUES (18,EVENT_DCI_ACTIVE);
193 INSERT INTO policy_event_list (rule_id,event_code) VALUES (19,EVENT_THRESHOLD_REACHED);
194 INSERT INTO policy_event_list (rule_id,event_code) VALUES (20,EVENT_THRESHOLD_REARMED);
195 INSERT INTO policy_event_list (rule_id,event_code) VALUES (21,EVENT_TABLE_THRESHOLD_ACTIVATED);
196 INSERT INTO policy_event_list (rule_id,event_code) VALUES (22,EVENT_TABLE_THRESHOLD_DEACTIVATED);
197 INSERT INTO policy_event_list (rule_id,event_code) VALUES (23,EVENT_THREAD_HANGS);
198 INSERT INTO policy_event_list (rule_id,event_code) VALUES (24,EVENT_THREAD_RUNNING);
199 INSERT INTO policy_event_list (rule_id,event_code) VALUES (25,EVENT_MAINTENANCE_MODE_ENTERED);
200 INSERT INTO policy_event_list (rule_id,event_code) VALUES (26,EVENT_MAINTENANCE_MODE_LEFT);
201 INSERT INTO policy_event_list (rule_id,event_code) VALUES (27,EVENT_AGENT_FAIL);
202 INSERT INTO policy_event_list (rule_id,event_code) VALUES (28,EVENT_AGENT_OK);
203 INSERT INTO policy_event_list (rule_id,event_code) VALUES (29,EVENT_SNMP_FAIL);
204 INSERT INTO policy_event_list (rule_id,event_code) VALUES (30,EVENT_SNMP_OK);
205 INSERT INTO policy_event_list (rule_id,event_code) VALUES (31,EVENT_LDAP_SYNC_ERROR);
206 INSERT INTO policy_event_list (rule_id,event_code) VALUES (32,EVENT_AGENT_LOG_PROBLEM);
207 INSERT INTO policy_event_list (rule_id,event_code) VALUES (33,EVENT_AGENT_LOCAL_DATABASE_PROBLEM);
208 INSERT INTO policy_event_list (rule_id,event_code) VALUES (34,EVENT_INTERFACE_DISABLED);
209 INSERT INTO policy_event_list (rule_id,event_code) VALUES (35,EVENT_MAC_ADDR_CHANGED);
210 INSERT INTO policy_event_list (rule_id,event_code) VALUES (36,EVENT_INTERFACE_DELETED);
211 INSERT INTO policy_event_list (rule_id,event_code) VALUES (37,EVENT_INTERFACE_DELETED);
212 INSERT INTO policy_event_list (rule_id,event_code) VALUES (38,EVENT_IF_MASK_CHANGED);
213 INSERT INTO policy_event_list (rule_id,event_code) VALUES (38,EVENT_IF_IPADDR_DELETED);
214 INSERT INTO policy_event_list (rule_id,event_code) VALUES (39,EVENT_ROUTING_LOOP_DETECTED);