Rework of status flags, dynimic flag ordering fix
authorzev <zev@netxms.org>
Mon, 25 Sep 2017 09:02:03 +0000 (12:02 +0300)
committerzev <zev@netxms.org>
Mon, 25 Sep 2017 09:02:13 +0000 (12:02 +0300)
15 files changed:
include/nxcldefs.h
include/nxevent.h
sql/events.in
src/client/java/netxms-client/src/main/java/org/netxms/client/objects/AbstractNode.java
src/client/java/netxms-client/src/main/java/org/netxms/client/objects/DataCollectionTarget.java
src/client/java/netxms-client/src/main/java/org/netxms/client/objects/Sensor.java
src/server/core/correlate.cpp
src/server/core/dctarget.cpp
src/server/core/interface.cpp
src/server/core/netsrv.cpp
src/server/core/node.cpp
src/server/core/objects.cpp
src/server/core/sensor.cpp
src/server/include/nms_objects.h
src/server/tools/nxdbmgr/upgrade.cpp

index 223f29b..e4cb81f 100644 (file)
 #define NDF_QUEUED_FOR_TOPOLOGY_POLL   0x00010000
 #define NDF_QUEUED_FOR_DISCOVERY_POLL  0x00020000
 #define NDF_QUEUED_FOR_ROUTE_POLL      0x00040000
-#define NDF_RECHECK_CAPABILITIES       0x00100000
+#define NDF_RECHECK_CAPABILITIES       0x00080000
+
+/**
+ *
+ */
+#define DCSF_UNREACHABLE               0x00000001
+#define DCSF_NETWORK_PATH_PROBLEM      0x00000002
 
 /**
  * Cluster status flags
  */
-#define CLSF_DOWN                      0x000001
+#define CLSF_DOWN                      0x00010000
 
 /**
- * Node status flags
+ * Node state flags
  */
-#define NSF_UNREACHABLE                0x000001
-#define NSF_AGENT_UNREACHABLE          0x000002
-#define NSF_SNMP_UNREACHABLE           0x000004
-#define NSF_CPSNMP_UNREACHABLE         0x000020
-#define NSF_NETWORK_PATH_PROBLEM       0x000100
-#define NSF_CACHE_MODE_NOT_SUPPORTED   0x000200
+#define NSF_AGENT_UNREACHABLE          0x00010000
+#define NSF_SNMP_UNREACHABLE           0x00020000
+#define NSF_CPSNMP_UNREACHABLE         0x00040000
+#define NSF_CACHE_MODE_NOT_SUPPORTED   0x00080000
 
 /**
  * Sensor status flags
  */
-#define SSF_PROVISIONED                0x000001
-#define SSF_REGISTERED                 0x000002
-#define SSF_ACTIVE                     0x000004
-#define SSF_CONF_UPDATE_PENDING        0x000008
-#define SSF_AGENT_UNREACHABLE          0x000010
+#define SSF_PROVISIONED                0x00010000
+#define SSF_REGISTERED                 0x00020000
+#define SSF_ACTIVE                     0x00040000
+#define SSF_CONF_UPDATE_PENDING        0x00080000
 
 /**
  * Template flags
index f89ce60..4f1d7a1 100644 (file)
@@ -67,7 +67,7 @@
 #define EVENT_NODE_CRITICAL                10
 #define EVENT_NODE_UNKNOWN                 11
 #define EVENT_NODE_UNMANAGED               12
-#define EVENT_NODE_FLAGS_CHANGED           13
+#define EVENT_NODE_CAPABILITIES_CHANGED    13
 #define EVENT_SNMP_FAIL                    14
 #define EVENT_AGENT_FAIL                   15
 #define EVENT_INTERFACE_DELETED            16
index 3b1b4da..a144cec 100644 (file)
@@ -217,7 +217,7 @@ INSERT INTO event_cfg (event_code,event_name,guid,severity,flags,message,descrip
        );
 INSERT INTO event_cfg (event_code,event_name,guid,severity,flags,message,description) VALUES
        (
-               EVENT_NODE_FLAGS_CHANGED, 'SYS_NODE_CAP_CHANGED', 'b04e39f5-d3a7-4d9a-b594-37132f5eaf34',
+               EVENT_NODE_CAPABILITIES_CHANGED, 'SYS_NODE_CAP_CHANGED', 'b04e39f5-d3a7-4d9a-b594-37132f5eaf34',
                EVENT_SEVERITY_NORMAL, 0,
                'Node capabilities changed (Old: %1; New: %2)',
                'Generated when node capabilities changed.' CONCAT CRLF CONCAT
index 0fdb88a..84f3dab 100644 (file)
@@ -79,11 +79,10 @@ public abstract class AbstractNode extends DataCollectionTarget implements RackE
        public static final int NF_FORCE_ENCRYPTION       = 0x00400000;
    public static final int NF_DISABLE_ROUTE_POLL     = 0x00800000;
        
-       // Node runtime flags
-       public static final int NSF_UNREACHABLE        = 0x000000001;
-       public static final int NSF_AGENT_UNREACHABLE  = 0x000000002;
-       public static final int NSF_SNMP_UNREACHABLE   = 0x000000004;
-       public static final int NSF_CPSNMP_UNREACHABLE = 0x000000008;
+       // Node status flags
+       public static final int NSF_AGENT_UNREACHABLE  = 0x00010000;
+       public static final int NSF_SNMP_UNREACHABLE   = 0x00020000;
+       public static final int NSF_CPSNMP_UNREACHABLE = 0x00040000;
        
        public static final int IFXTABLE_DEFAULT = 0;
        public static final int IFXTABLE_ENABLED = 1;
index d322cf8..6feec66 100644 (file)
@@ -34,6 +34,11 @@ public class DataCollectionTarget extends GenericObject
    public static final int DCF_DISABLE_CONF_POLL      = 0x00000002;
    public static final int DCF_DISABLE_DATA_COLLECT   = 0x00000004;
    
+
+   public static final int DCSF_UNREACHABLE          = 0x000000001;
+   public static final int DCSF_NETWORK_PATH_PROBLEM = 0x000000002;
+   
+   
    protected List<DciValue> overviewDciData;
    protected List<DciValue> tooltipDciData;
 
index 1341463..67d51f4 100644 (file)
@@ -40,10 +40,10 @@ public class Sensor extends DataCollectionTarget implements PollingTarget
    /**
     * Sensor flags
     */
-   public final static int SENSOR_PROVISIONED         = 0x00000001;
-   public final static int SENSOR_REGISTERED          = 0x00000002;
-   public final static int SENSOR_ACTIVE              = 0x00000004;
-   public final static int SENSOR_CONF_UPDATE_PENDING = 0x00000008;
+   public final static int SENSOR_PROVISIONED         = 0x00010000;
+   public final static int SENSOR_REGISTERED          = 0x00020000;
+   public final static int SENSOR_ACTIVE              = 0x00040000;
+   public final static int SENSOR_CONF_UPDATE_PENDING = 0x00080000;
    
    /**
     * Sensor communication protocol type
index 93e77eb..4cf1e46 100644 (file)
@@ -243,14 +243,14 @@ void CorrelateEvent(Event *pEvent)
          // there are intentionally no break
       case EVENT_SERVICE_DOWN:
       case EVENT_SNMP_FAIL:
-         if (node->getState() & NSF_UNREACHABLE)
+         if (node->getState() & DCSF_UNREACHABLE)
          {
             pEvent->setRootId(node->getLastEventId(LAST_EVENT_NODE_DOWN));
          }
          break;
       case EVENT_AGENT_FAIL:
          node->setLastEventId(LAST_EVENT_AGENT_DOWN, pEvent->getId());
-         if (node->getState() & NSF_UNREACHABLE)
+         if (node->getState() & DCSF_UNREACHABLE)
          {
             pEvent->setRootId(node->getLastEventId(LAST_EVENT_NODE_DOWN));
          }
index 389cf1f..eae300d 100644 (file)
@@ -1348,7 +1348,7 @@ void DataCollectionTarget::instanceDiscoveryPoll(ClientSession *session, UINT32
    DbgPrintf(4, _T("Starting instance discovery poll for %s %s (ID: %d)"), getObjectClassName(), m_name, m_id);
 
    // Check if DataCollectionTarget is marked as unreachable
-   if (!(m_state & NSF_UNREACHABLE))
+   if (!(m_state & DCSF_UNREACHABLE))
    {
       poller->setStatus(_T("instance discovery"));
       doInstanceDiscovery(requestId);
index 29e0a5e..fc8e1ec 100644 (file)
@@ -607,7 +607,7 @@ void Interface::statusPoll(ClientSession *session, UINT32 rqId, Queue *eventQueu
        }
 
        // Reset status to unknown if node has known network connectivity problems
-       if ((newStatus == STATUS_CRITICAL) && (pNode->getState() & NSF_NETWORK_PATH_PROBLEM))
+       if ((newStatus == STATUS_CRITICAL) && (pNode->getState() & DCSF_NETWORK_PATH_PROBLEM))
        {
                newStatus = STATUS_UNKNOWN;
                DbgPrintf(6, _T("StatusPoll(%s): Status for interface %s reset to UNKNOWN"), pNode->getName(), m_name);
index 886d3e3..eda1253 100644 (file)
@@ -380,7 +380,7 @@ void NetworkService::statusPoll(ClientSession *session, UINT32 rqId, Node *polle
    }
 
        // Reset status to unknown if node has known network connectivity problems
-       if ((newStatus == STATUS_CRITICAL) && (pNode->getState() & NSF_NETWORK_PATH_PROBLEM))
+       if ((newStatus == STATUS_CRITICAL) && (pNode->getState() & DCSF_NETWORK_PATH_PROBLEM))
        {
                newStatus = STATUS_UNKNOWN;
                DbgPrintf(6, _T("StatusPoll(%s): Status for network service %s reset to UNKNOWN"), pNode->getName(), m_name);
index c7e03be..52d7e49 100644 (file)
@@ -403,9 +403,9 @@ bool Node::loadFromDatabase(DB_HANDLE hdb, UINT32 dwId)
    m_agentCompressionMode = (INT16)DBGetFieldLong(hResult, 0, 45);
    m_tunnelId = DBGetFieldGUID(hResult, 0, 46);
    m_lldpNodeId = DBGetField(hResult, 0, 47, NULL, 0);
-   m_capabilities = DBGetFieldULong(hResult, 0, 48);
    if ((m_lldpNodeId != NULL) && (*m_lldpNodeId == 0))
       safe_free_and_null(m_lldpNodeId);
+   m_capabilities = DBGetFieldULong(hResult, 0, 48);
 
    DBFreeResult(hResult);
    DBFreeStatement(hStmt);
@@ -1315,7 +1315,8 @@ void Node::statusPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *poller
    if (IsShutdownInProgress())
       return;
 
-   UINT32 dwOldFlags = m_capabilities;
+   UINT32 oldCapabilities = m_capabilities;
+   UINT32 oldState = m_state;
    NetObj *pPollerNode = NULL, **ppPollList;
    SNMP_Transport *pTransport;
    Cluster *pCluster;
@@ -1416,7 +1417,7 @@ restart_agent_check:
             sendPollerMsg(dwRqId, POLLER_ERROR _T("SNMP agent unreachable\r\n"));
             if (m_state & NSF_SNMP_UNREACHABLE)
             {
-               if ((tNow > m_failTimeSNMP + tExpire) && (!(m_state & NSF_UNREACHABLE)))
+               if ((tNow > m_failTimeSNMP + tExpire) && (!(m_state & DCSF_UNREACHABLE)))
                {
                   m_capabilities &= ~NC_IS_SNMP;
                   m_state &= ~NSF_SNMP_UNREACHABLE;
@@ -1467,7 +1468,7 @@ restart_agent_check:
          sendPollerMsg(dwRqId, POLLER_ERROR _T("NetXMS agent unreachable\r\n"));
          if (m_state & NSF_AGENT_UNREACHABLE)
          {
-            if ((tNow > m_failTimeAgent + tExpire) && !(m_state & NSF_UNREACHABLE))
+            if ((tNow > m_failTimeAgent + tExpire) && !(m_state & DCSF_UNREACHABLE))
             {
                m_capabilities &= ~NC_IS_NATIVE_AGENT;
                m_state &= ~NSF_AGENT_UNREACHABLE;
@@ -1613,14 +1614,14 @@ restart_agent_check:
       DbgPrintf(6, _T("StatusPoll(%s): allDown=%s, statFlags=0x%08X"), m_name, allDown ? _T("true") : _T("false"), m_state);
       if (allDown)
       {
-         if (!(m_state & NSF_UNREACHABLE))
+         if (!(m_state & DCSF_UNREACHABLE))
          {
-            m_state |= NSF_UNREACHABLE;
+            m_state |= DCSF_UNREACHABLE;
             m_downSince = time(NULL);
             poller->setStatus(_T("check network path"));
             if (checkNetworkPath(dwRqId))
             {
-               m_state |= NSF_NETWORK_PATH_PROBLEM;
+               m_state |= DCSF_NETWORK_PATH_PROBLEM;
 
                // Set interfaces and network services to UNKNOWN state
                lockChildList(false);
@@ -1661,10 +1662,10 @@ restart_agent_check:
       else
       {
          m_downSince = 0;
-         if (m_state & NSF_UNREACHABLE)
+         if (m_state & DCSF_UNREACHABLE)
          {
-            int reason = (m_state & NSF_NETWORK_PATH_PROBLEM) ? 1 : 0;
-            m_state &= ~(NSF_UNREACHABLE | NSF_SNMP_UNREACHABLE | NSF_AGENT_UNREACHABLE | NSF_NETWORK_PATH_PROBLEM);
+            int reason = (m_state & DCSF_NETWORK_PATH_PROBLEM) ? 1 : 0;
+            m_state &= ~(DCSF_UNREACHABLE | NSF_SNMP_UNREACHABLE | NSF_AGENT_UNREACHABLE | DCSF_NETWORK_PATH_PROBLEM);
             PostEvent(EVENT_NODE_UP, m_id, "d", reason);
             sendPollerMsg(dwRqId, POLLER_INFO _T("Node recovered from unreachable state\r\n"));
             goto restart_agent_check;
@@ -1677,7 +1678,7 @@ restart_agent_check:
    }
 
    // Get uptime and update boot time
-   if (!(m_state & NSF_UNREACHABLE))
+   if (!(m_state & DCSF_UNREACHABLE))
    {
       TCHAR buffer[MAX_RESULT_LENGTH];
       if (getItemFromAgent(_T("System.Uptime"), MAX_RESULT_LENGTH, buffer) == DCE_SUCCESS)
@@ -1701,7 +1702,7 @@ restart_agent_check:
    }
 
    // Get agent uptime to check if it was restared
-   if (!(m_state & NSF_UNREACHABLE) && isNativeAgent())
+   if (!(m_state & DCSF_UNREACHABLE) && isNativeAgent())
    {
       TCHAR buffer[MAX_RESULT_LENGTH];
       if (getItemFromAgent(_T("Agent.Uptime"), MAX_RESULT_LENGTH, buffer) == DCE_SUCCESS)
@@ -1727,7 +1728,7 @@ restart_agent_check:
    }
 
    // Get geolocation
-   if (!(m_state & NSF_UNREACHABLE) && isNativeAgent())
+   if (!(m_state & DCSF_UNREACHABLE) && isNativeAgent())
    {
       TCHAR buffer[MAX_RESULT_LENGTH];
       if (getItemFromAgent(_T("GPS.LocationData"), MAX_RESULT_LENGTH, buffer) == DCE_SUCCESS)
@@ -1749,7 +1750,7 @@ restart_agent_check:
    }
 
    // Get agent log and agent local database status
-   if (!(m_state & NSF_UNREACHABLE) && isNativeAgent())
+   if (!(m_state & DCSF_UNREACHABLE) && isNativeAgent())
    {
       TCHAR buffer[MAX_RESULT_LENGTH];
       if (getItemFromAgent(_T("Agent.LogFile.Status"), MAX_RESULT_LENGTH, buffer) == DCE_SUCCESS)
@@ -1805,9 +1806,11 @@ restart_agent_check:
    if (pPollerNode != NULL)
       pPollerNode->decRefCount();
 
-   if (dwOldFlags != m_capabilities) //currectly not flags but capabilities
+   if (oldCapabilities != m_capabilities) //currectly not flags but capabilities
+      PostEvent(EVENT_NODE_CAPABILITIES_CHANGED, m_id, "xx", oldCapabilities, m_capabilities);
+
+   if (oldState != m_state || oldCapabilities != m_capabilities)
    {
-      PostEvent(EVENT_NODE_FLAGS_CHANGED, m_id, "xx", dwOldFlags, m_capabilities);
       lockProperties();
       setModified();
       unlockProperties();
@@ -2294,7 +2297,7 @@ void Node::configurationPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo
  */
 void Node::configurationPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *poller, int maskBits)
 {
-   if (m_state & DCDF_DELETE_IN_PROGRESS)
+   if (m_runtimeFlags & DCDF_DELETE_IN_PROGRESS)
    {
       if (dwRqId == 0)
          m_runtimeFlags &= ~DCDF_QUEUED_FOR_CONFIGURATION_POLL;
@@ -2338,7 +2341,7 @@ void Node::configurationPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo
    }
 
    // Check if node is marked as unreachable
-   if ((m_state & NSF_UNREACHABLE) && !(m_runtimeFlags & NDF_RECHECK_CAPABILITIES))
+   if ((m_state & DCSF_UNREACHABLE) && !(m_runtimeFlags & NDF_RECHECK_CAPABILITIES))
    {
       sendPollerMsg(dwRqId, POLLER_WARNING _T("Node is marked as unreachable, configuration poll aborted\r\n"));
       DbgPrintf(4, _T("Node is marked as unreachable, configuration poll aborted"));
@@ -2380,7 +2383,7 @@ void Node::configurationPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo
       // Generate event if node flags has been changed
       if (dwOldFlags != m_capabilities)
       {
-         PostEvent(EVENT_NODE_FLAGS_CHANGED, m_id, "xx", dwOldFlags, m_capabilities);
+         PostEvent(EVENT_NODE_CAPABILITIES_CHANGED, m_id, "xx", dwOldFlags, m_capabilities);
          hasChanges = true;
       }
 
@@ -3777,7 +3780,7 @@ UINT32 Node::getItemFromSNMP(WORD port, const TCHAR *param, size_t bufSize, TCHA
    UINT32 dwResult;
 
    if ((((m_state & NSF_SNMP_UNREACHABLE) || !(m_capabilities & NC_IS_SNMP)) && (port == 0)) ||
-       (m_state & NSF_UNREACHABLE) ||
+       (m_state & DCSF_UNREACHABLE) ||
        (m_flags & NF_DISABLE_SNMP))
    {
       dwResult = SNMP_ERR_COMM;
@@ -4043,7 +4046,7 @@ UINT32 Node::getItemFromCheckPointSNMP(const TCHAR *szParam, UINT32 dwBufSize, T
    UINT32 dwResult;
 
    if ((m_state & NSF_CPSNMP_UNREACHABLE) ||
-       (m_state & NSF_UNREACHABLE))
+       (m_state & DCSF_UNREACHABLE))
    {
       dwResult = SNMP_ERR_COMM;
    }
@@ -4066,7 +4069,7 @@ UINT32 Node::getItemFromCheckPointSNMP(const TCHAR *szParam, UINT32 dwBufSize, T
 UINT32 Node::getItemFromAgent(const TCHAR *szParam, UINT32 dwBufSize, TCHAR *szBuffer)
 {
    if ((m_state & NSF_AGENT_UNREACHABLE) ||
-       (m_state & NSF_UNREACHABLE) ||
+       (m_state & DCSF_UNREACHABLE) ||
        (m_flags & NF_DISABLE_NXCP) ||
        !(m_capabilities & NC_IS_NATIVE_AGENT))
       return DCE_COMM_ERROR;
@@ -4136,7 +4139,7 @@ UINT32 Node::getTableFromAgent(const TCHAR *name, Table **table)
    *table = NULL;
 
    if ((m_state & NSF_AGENT_UNREACHABLE) ||
-       (m_state & NSF_UNREACHABLE) ||
+       (m_state & DCSF_UNREACHABLE) ||
        (m_flags & NF_DISABLE_NXCP) ||
        !(m_capabilities & NC_IS_NATIVE_AGENT))
       return DCE_COMM_ERROR;
@@ -4203,7 +4206,7 @@ UINT32 Node::getListFromAgent(const TCHAR *name, StringList **list)
    *list = NULL;
 
    if ((m_state & NSF_AGENT_UNREACHABLE) ||
-       (m_state & NSF_UNREACHABLE) ||
+       (m_state & DCSF_UNREACHABLE) ||
        (m_flags & NF_DISABLE_NXCP) ||
        !(m_capabilities & NC_IS_NATIVE_AGENT))
       return DCE_COMM_ERROR;
@@ -4270,7 +4273,7 @@ UINT32 Node::getItemFromSMCLP(const TCHAR *param, UINT32 bufSize, TCHAR *buffer)
    UINT32 result = DCE_COMM_ERROR;
    int tries = 3;
 
-   if (m_state & NSF_UNREACHABLE)
+   if (m_state & DCSF_UNREACHABLE)
       return DCE_COMM_ERROR;
 
    smclpLock();
@@ -5257,7 +5260,7 @@ UINT32 Node::checkNetworkService(UINT32 *pdwStatus, const InetAddress& ipAddr, i
 
    if ((m_capabilities & NC_IS_NATIVE_AGENT) &&
        (!(m_state & NSF_AGENT_UNREACHABLE)) &&
-       (!(m_state & NSF_UNREACHABLE)))
+       (!(m_state & DCSF_UNREACHABLE)))
    {
       AgentConnection *conn = createAgentConnection();
       if (conn != NULL)
@@ -5316,7 +5319,7 @@ AgentConnectionEx *Node::createAgentConnection(bool sendServerId)
    if ((!(m_capabilities & NC_IS_NATIVE_AGENT)) ||
        (m_flags & NF_DISABLE_NXCP) ||
        (m_state & NSF_AGENT_UNREACHABLE) ||
-       (m_state & NSF_UNREACHABLE))
+       (m_state & DCSF_UNREACHABLE))
       return NULL;
 
    AgentTunnel *tunnel = GetTunnelForNode(m_id);
@@ -5775,7 +5778,7 @@ UINT32 Node::callSnmpEnumerate(const TCHAR *pszRootOid,
 {
    if ((m_capabilities & NC_IS_SNMP) &&
        (!(m_state & NSF_SNMP_UNREACHABLE)) &&
-       (!(m_state & NSF_UNREACHABLE)))
+       (!(m_state & DCSF_UNREACHABLE)))
    {
       SNMP_Transport *pTransport;
       UINT32 dwResult;
index 4a5cce3..06c376b 100644 (file)
@@ -1967,6 +1967,8 @@ static void DumpObjectCallback(NetObj *object, void *data)
 #endif
        _tcsftime(dd->buffer, 256, _T("%d.%b.%Y %H:%M:%S"), ltm);
    ConsolePrintf(pCtx, _T("   Last change: %s\n"), dd->buffer);
+   if (object->isDataCollectionTarget())
+      ConsolePrintf(pCtx, _T("   State flags: 0x%08x\n"), ((DataCollectionTarget *)object)->getState());
    switch(object->getObjectClass())
    {
       case OBJECT_NODE:
index 40ceaff..a092093 100644 (file)
@@ -641,9 +641,9 @@ void Sensor::statusPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *poll
    if (conn != NULL)
    {
       nxlog_debug(6, _T("StatusPoll(%s): connected to agent"), m_name);
-      if (m_state & SSF_AGENT_UNREACHABLE)
+      if (m_state & DCSF_UNREACHABLE)
       {
-         m_state &= ~SSF_AGENT_UNREACHABLE;
+         m_state &= ~DCSF_UNREACHABLE;
          sendPollerMsg(dwRqId, POLLER_INFO _T("Connectivity with NetXMS agent restored\r\n"));
       }
    }
@@ -651,8 +651,8 @@ void Sensor::statusPoll(ClientSession *pSession, UINT32 dwRqId, PollerInfo *poll
    {
       nxlog_debug(6, _T("StatusPoll(%s): agent unreachable"), m_name);
       sendPollerMsg(dwRqId, POLLER_ERROR _T("NetXMS agent unreachable\r\n"));
-      if (!(m_state & SSF_AGENT_UNREACHABLE))
-         m_state |= SSF_AGENT_UNREACHABLE;
+      if (!(m_state & DCSF_UNREACHABLE))
+         m_state |= DCSF_UNREACHABLE;
    }
    unlockProperties();
    nxlog_debug(6, _T("StatusPoll(%s): agent check finished"), m_name);
@@ -827,7 +827,7 @@ void Sensor::prepareDlmsDciParameters(String &parameter)
  */
 UINT32 Sensor::getItemFromAgent(const TCHAR *szParam, UINT32 dwBufSize, TCHAR *szBuffer)
 {
-   if (m_state & SSF_AGENT_UNREACHABLE)
+   if (m_state & DCSF_UNREACHABLE)
       return DCE_COMM_ERROR;
 
    UINT32 dwError = ERR_NOT_CONNECTED, dwResult = DCE_COMM_ERROR;
@@ -899,7 +899,7 @@ UINT32 Sensor::getListFromAgent(const TCHAR *name, StringList **list)
 
    *list = NULL;
 
-   if (m_state & SSF_AGENT_UNREACHABLE) //removed disable agent usage for all polls
+   if (m_state & DCSF_UNREACHABLE) //removed disable agent usage for all polls
       return DCE_COMM_ERROR;
 
    nxlog_debug(7, _T("Sensor(%s)->GetItemFromAgent(%s)"), m_name, name);
index 512dfac..94f1e42 100644 (file)
@@ -1841,7 +1841,7 @@ public:
    const TCHAR *getPrimaryName() const { return m_primaryName; }
    const uuid& getTunnelId() const { return m_tunnelId; }
 
-   bool isDown() { return (m_state & NSF_UNREACHABLE) ? true : false; }
+   bool isDown() { return (m_state & DCSF_UNREACHABLE) ? true : false; }
        time_t getDownTime() const { return m_downSince; }
 
    void addInterface(Interface *pInterface) { addChild(pInterface); pInterface->addParent(this); }
index 0b6ee4a..66ac9a9 100644 (file)
@@ -703,11 +703,11 @@ static void MoveNodeCapabilities(UINT32 oldFlag, UINT32 *capabilities)
  */
 static void MoveNodeState(UINT32 oldRuntime, UINT32 *state)
 {
-   MoveFlag(oldRuntime, state, 0x000004, NSF_UNREACHABLE);
+   MoveFlag(oldRuntime, state, 0x000004, DCSF_UNREACHABLE);
    MoveFlag(oldRuntime, state, 0x000008, NSF_AGENT_UNREACHABLE);
    MoveFlag(oldRuntime, state, 0x000010, NSF_SNMP_UNREACHABLE);
    MoveFlag(oldRuntime, state, 0x000200, NSF_CPSNMP_UNREACHABLE);
-   MoveFlag(oldRuntime, state, 0x008000, NSF_NETWORK_PATH_PROBLEM);
+   MoveFlag(oldRuntime, state, 0x008000, DCSF_NETWORK_PATH_PROBLEM);
    MoveFlag(oldRuntime, state, 0x020000, NSF_CACHE_MODE_NOT_SUPPORTED);
 }
 
@@ -720,7 +720,7 @@ static void MoveSensorState(UINT32 oldFlag, UINT32 oldRuntime, UINT32 *status)
    MoveFlag(oldFlag, status, 0x00000002, SSF_REGISTERED);
    MoveFlag(oldFlag, status, 0x00000004, SSF_ACTIVE);
    MoveFlag(oldFlag, status, 0x00000008, SSF_CONF_UPDATE_PENDING);
-   MoveFlag(oldRuntime, status, 0x000004, SSF_AGENT_UNREACHABLE);
+   MoveFlag(oldRuntime, status, 0x000004, DCSF_UNREACHABLE);
 }
 
 /**
@@ -3284,7 +3284,7 @@ static BOOL H_UpgradeFromV396(int currVersion, int newVersion)
       { EVENT_NODE_CRITICAL, _T("8f2e98f8-1cd4-4e12-b41f-48b5c60ebe8e") },
       { EVENT_NODE_UNKNOWN, _T("6933cce0-fe1f-4123-817f-af1fb9f0eab4") },
       { EVENT_NODE_UNMANAGED, _T("a8356ba7-51b7-4487-b74e-d12132db233c") },
-      { EVENT_NODE_FLAGS_CHANGED, _T("b04e39f5-d3a7-4d9a-b594-37132f5eaf34") },
+      { EVENT_NODE_CAPABILITIES_CHANGED, _T("b04e39f5-d3a7-4d9a-b594-37132f5eaf34") },
       { EVENT_SNMP_FAIL, _T("d2fc3b0c-1215-4a92-b8f3-47df5d753602") },
       { EVENT_AGENT_FAIL, _T("ba484457-3594-418e-a72a-65336055d025") },
       { EVENT_INTERFACE_DELETED, _T("ad7e9856-e361-4095-9361-ccc462d93624") },