Fixed missed events and epp in db init scripts, updated ChangeLog Issue #1230
authorzev <zev@radensolutions.com>
Mon, 6 Jun 2016 18:36:08 +0000 (21:36 +0300)
committerzev <zev@radensolutions.com>
Mon, 6 Jun 2016 18:36:08 +0000 (21:36 +0300)
ChangeLog
sql/events.in
sql/policy.in
src/server/tools/nxdbmgr/upgrade.cpp

index 2d0273f..ba37af6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -8,6 +8,7 @@
 - Added configuration option to logparser to generate event only if regular expression have been matched exact count of the times in a predefined time period
 - Management console
        - New editors for Agent Config Policy and Log Parser Policy. 
+- Fixed issues: #1230
 
 
 *
index 916e794..c71e1e1 100644 (file)
@@ -895,7 +895,7 @@ INSERT INTO event_cfg (event_code,event_name,guid,severity,flags,message,descrip
       '   4) Network mask' CONCAT CRLF CONCAT
       '   5) Interface index'
    );
-   
+
 INSERT INTO event_cfg (event_code,event_name,guid,severity,flags,message,description) VALUES
    (
       EVENT_IF_IPADDR_DELETED, 'SYS_IF_IPADDR_DELETED', 'ef477387-eb50-4a1a-bf90-717502b9873c',
@@ -940,6 +940,28 @@ INSERT INTO event_cfg (event_code,event_name,guid,severity,flags,message,descrip
       '   5) Problem description'
    );
 
+INSERT INTO event_cfg (event_code,event_name,guid,severity,flags,message,description) VALUES
+   (
+      EVENT_AGENT_LOG_FAIL, 'SYS_AGENT_LOG_FAIL', '262057ca-357a-4a4d-9b78-42ae96e490a1',
+      EVENT_SEVERITY_MAJOR, 1,
+      'Problem with agent log: %2',
+      'Generated on status poll if agent reposts log open problem.' CONCAT CRLF CONCAT
+      'Parameters:' CONCAT CRLF CONCAT
+      '   1) Status' CONCAT CRLF CONCAT
+      '   2) Description'
+   );
+
+INSERT INTO event_cfg (event_code,event_name,guid,severity,flags,message,description) VALUES
+   (
+      EVENT_AGENT_LOCAL_DATABASE_FAIL, 'SYS_AGENT_LOCAL_DATABASE_FAIL', 'd02b63f1-1151-429e-adb9-1dfbb3a31b32',
+      EVENT_SEVERITY_MAJOR, 1,
+      'Problem with agent local database: %2',
+      'Generated on status poll if agent reposts local database problem.' CONCAT CRLF CONCAT
+      'Parameters:' CONCAT CRLF CONCAT
+      '   1) Status' CONCAT CRLF CONCAT
+      '   2) Description'
+   );
+
 /*
 ** SNMP traps
 */
index 5e360ad..0c604ff 100644 (file)
@@ -7,67 +7,67 @@
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (0,'2d2c3d32-49d4-4e76-b6aa-782b30d90f28',7944,'Show alarm when node is down',
                '%m',5,'NODE_DOWN_%i','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (1,'4fa20604-b56f-4f12-bb5d-2c3243a126c9',7944,'Terminate node down alarms when node is up',
                '%m',6,'NODE_DOWN_%i','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (2,'45999e66-c16c-400d-8b79-63a0f8eb8958',7944,'Show alarm when network service is down or in unknown state',
                '%m',5,'SERVICE_DOWN_%i_%2','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (3,'8537fa14-e824-435b-a1dd-be3e566b7f67',7944,'Terminate network service down/unknown alarms when service is up',
                '%m',6,'SERVICE_DOWN_%i_%2','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (4,'2daa869f-9921-4f3e-9cb9-004c2f31f70a',7944,'Show alarm when interface is down',
                '%m',5,'IF_DOWN_%i_%1','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (5,'95d42ff2-6fe0-4b1c-9c7b-c18520393f9f',7944,'Terminate interface down alarms when interface is up',
                '%m',6,'IF_DOWN_%i_%1','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (6,'727a0dca-ecc4-4490-bf4b-3fc8b5ff8cb4',7944,'Show alarm when interface is unexpectedly up',
                '%m',5,'IF_UNEXP_UP_%i_%1','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (7,'11176d3e-0149-448b-a5fe-2be764762775',7944,'Terminate interface unexpectedly up alarms when interface goes down',
                '%m',6,'IF_UNEXP_UP_%i_%1','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (8,'5b8115f1-5c84-443a-9f88-18fc0b70f29e',7944,'Generate alarm when incorrect network mask detected on interface',
                '%m',2,'BAD_NETMASK_%i_%2','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (9,'68a629ef-c645-49e5-8a7b-c5e79308080e',7944,'Generate alarm when MAC address change detected on interface',
                '%m',1,'','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (10,'062228ef-c155-4669-a90a-603cae13240e',7944,'Generate alarm when server enconters NXSL script execution error',
                '%m',2,'SCRIPT_ERR_%1_%2','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (11,'943f5474-5614-44e1-820c-b8fe17bc4d0b',7944,'Show alarm when connection with backend database is lost',
                '%m',4,'DB_CONN','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (12,'9ce6b59e-e274-4c94-b314-4b4652c10c74',7944,'Terminate DB connection loss alarm when connection restored',
                '%m',6,'DB_CONN','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (13,'e3120a33-216e-e048-aa3b-4f1a9f3f10fc',7944,'Show alarm when NetXMS server network connection is lost',
                '%m',4,'NET_CONN_LOST','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (14,'bdc76d2e-967e-bf44-95a1-a229ef8b3ff4',7944,'Terminate NetXMS server network connection loss alarm when connection restored',
                '%m',6,'NET_CONN_LOST','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (15,'226de02d-9eb2-4ea1-a92c-2bdb1718f2ec',7944,'Show alarm when DCI status changes to DISABLED or UNSUPPORTED',
                '%m',5,'DCI_STATUS_%i_%1','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (16,'02a21afe-c942-4953-8b5d-f463c597cff8',7944,'Terminate DCI status alarms when DCI status returns to ACTIVE',
                '%m',6,'DCI_STATUS_%i_%1','',0,EVENT_ALARM_TIMEOUT,0,'');
@@ -75,7 +75,7 @@ INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_s
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (17,'47fd5c32-b6c9-48b8-99fb-c389dde63bee',7944,'Generate alarm on threshold violation',
                '%m',5,'DC_THRESHOLD_%i_%5','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (18,'dcdd6f93-2f9e-4c3e-97cb-95b6847f13ce',7944,'Terminate threshold violation alarms',
                '%m',6,'DC_THRESHOLD_%i_%3','',0,EVENT_ALARM_TIMEOUT,0,'');
@@ -83,7 +83,7 @@ INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_s
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (19,'d3acabe8-717d-4ceb-bb7f-498d5af898f2',7944,'Generate alarm on table threshold violation',
                '%m',5,'DCTTHR_%i_%3_%5','',0,EVENT_ALARM_TIMEOUT,0,'');
-               
+
 INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
        VALUES (20,'8e26af4b-e478-44c9-9c12-0b049ccb6c3c',7944,'Terminate table threshold violation alarms',
                '%m',6,'DCTTHR_%i_%3_%5','',0,EVENT_ALARM_TIMEOUT,0,'');
@@ -124,6 +124,14 @@ INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_s
     VALUES (29,'417648af-5361-49a5-9471-6ef31e857b2d',7944,'Generate an alarm when error occurred during LDAP synchronization',
         '%m',5,'SYS_LDAP_SYNC_ERROR_%2','',0,EVENT_ALARM_TIMEOUT,0,'');
 
+INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
+    VALUES (30,'19bd89ba-8bb2-4915-8546-a1ecc650dedd',7944,'Generate an alarm when there is problem with log on agent',
+        '%m',5,'SYS_AGENT_LOG_FAIL_%1','',0,EVENT_ALARM_TIMEOUT,0,'');
+
+INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance)
+    VALUES (31,'cff7fe6b-2ad1-4c18-8a8f-4d397d44fe04',7944,'Generate an alarm when there is problem with local database on agent',
+        '%m',5,'SYS_AGENT_LOCAL_DATABASE_FAIL_%1','',0,EVENT_ALARM_TIMEOUT,0,'');
+
 INSERT INTO policy_event_list (rule_id,event_code) VALUES (0,EVENT_NODE_DOWN);
 INSERT INTO policy_event_list (rule_id,event_code) VALUES (1,EVENT_NODE_UP);
 INSERT INTO policy_event_list (rule_id,event_code) VALUES (2,EVENT_SERVICE_DOWN);
@@ -156,3 +164,5 @@ INSERT INTO policy_event_list (rule_id,event_code) VALUES (26,EVENT_AGENT_OK);
 INSERT INTO policy_event_list (rule_id,event_code) VALUES (27,EVENT_SNMP_FAIL);
 INSERT INTO policy_event_list (rule_id,event_code) VALUES (28,EVENT_SNMP_OK);
 INSERT INTO policy_event_list (rule_id,event_code) VALUES (29,EVENT_LDAP_SYNC_ERROR);
+INSERT INTO policy_event_list (rule_id,event_code) VALUES (30,EVENT_AGENT_LOG_FAIL);
+INSERT INTO policy_event_list (rule_id,event_code) VALUES (31,EVENT_AGENT_LOCAL_DATABASE_FAIL);
index bbbd771..7693731 100644 (file)
@@ -703,7 +703,7 @@ static BOOL H_UpgradeFromV404(int currVersion, int newVersion)
    CHK_EXEC(SQLQuery(query));
        ruleId = NextFreeEPPruleID();
        _sntprintf(query, 1024, _T("INSERT INTO event_policy (rule_id,rule_guid,flags,comments,alarm_message,alarm_severity,alarm_key,script,alarm_timeout,alarm_timeout_event,situation_id,situation_instance) ")
-                           _T("VALUES (%d,'cff7fe6b-2ad1-4c18-8a8f-4d397d44fe04',7944,'Generate an alarm when  there is problem with local database on agent','%%m',5,'SYS_AGENT_LOCAL_DATABASE_FAIL_%%1','',0,%d,0,'')"),
+                           _T("VALUES (%d,'cff7fe6b-2ad1-4c18-8a8f-4d397d44fe04',7944,'Generate an alarm when there is problem with local database on agent','%%m',5,'SYS_AGENT_LOCAL_DATABASE_FAIL_%%1','',0,%d,0,'')"),
                            ruleId, EVENT_ALARM_TIMEOUT);
    CHK_EXEC(SQLQuery(query));
    _sntprintf(query, 1024, _T("INSERT INTO policy_event_list (rule_id,event_code) VALUES (%d,%d)"), ruleId, EVENT_AGENT_LOCAL_DATABASE_FAIL);