fixed broken cached data collection for DCIs with default interval
authorVictor Kirhenshtein <victor@netxms.org>
Mon, 19 Oct 2015 11:53:23 +0000 (14:53 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Mon, 19 Oct 2015 11:53:23 +0000 (14:53 +0300)
doc/internal/nxcp_command_ranges.txt
src/agent/core/static_link.sh
src/java/netxms-eclipse/ObjectTools/src/org/netxms/ui/eclipse/objecttools/views/ServerCommandResults.java
src/libnxcc/comm.cpp
src/server/core/node.cpp

index 399b4bd..7cd7142 100644 (file)
@@ -3,3 +3,4 @@
 1100 .. 11FF   Reporting
 5000 .. 5FFF    TTC Marconi
 6000 .. 60FF    FIS/IST
+6100 .. 61FF   Cortex
index a63f9be..dba652c 100755 (executable)
@@ -3,4 +3,4 @@
 # Script for linking static Linux agent
 #
 
-g++ -g -O2 -fno-rtti -fno-exceptions -o nxagentd messages.o actions.o appagent.o comm.o config.o ctrl.o datacoll.o dcsnmp.o epp.o exec.o extagent.o getparam.o localdb.o master.o nxagentd.o policy.o push.o register.o sa.o sd.o session.o snmpproxy.o snmptrapproxy.o static_subagents.o subagent.o sysinfo.o tools.o trap.o upgrade.o watchdog.o -Wl,-Bstatic -Wl,-Bdynamic  -L/usr/local/lib ../appagent/.libs/libappagent.a ../../../src/db/libnxdb/.libs/libnxdb.a ../../../src/libnetxms/.libs/libnetxms.a ../../../src/libexpat/libexpat/.libs/libnxexpat.a ../subagents/ecs/.libs/ecs.a ../subagents/filemgr/.libs/filemgr.a ../subagents/logwatch/.libs/logwatch.a ../../libnxlp/.libs/libnxlp.a ../subagents/ping/.libs/ping.a ../subagents/portCheck/.libs/portcheck.a ../subagents/ups/.libs/ups.a ../subagents/ds18x20/.libs/ds18x20.a ../subagents/linux/.libs/linux.a ../../snmp/libnxsnmp/.libs/libnxsnmp.a ../libnxagent/.libs/libnxagent.a ../../libnetxms/.libs/libnetxms.a ../../libexpat/libexpat/.libs/libnxexpat.a ../../libtre/.libs/libnxtre.a -ldl -lpthread -Wl,-Bstatic -lssl -lcrypto -lz -Wl,-Bdynamic
+g++ -g -O2 -fno-rtti -fno-exceptions -o nxagentd messages.o actions.o appagent.o comm.o config.o ctrl.o datacoll.o dcsnmp.o epp.o exec.o extagent.o getparam.o localdb.o master.o nxagentd.o policy.o push.o register.o sa.o sd.o session.o snmpproxy.o snmptrapproxy.o static_subagents.o subagent.o sysinfo.o tools.o trap.o upgrade.o watchdog.o -Wl,-Bstatic -Wl,-Bdynamic  -L/usr/local/lib ../../appagent/.libs/libappagent.a ../../../src/db/libnxdb/.libs/libnxdb.a ../../../src/libnetxms/.libs/libnetxms.a ../../../src/libexpat/libexpat/.libs/libnxexpat.a ../subagents/ecs/.libs/ecs.a ../subagents/filemgr/.libs/filemgr.a ../subagents/logwatch/.libs/logwatch.a ../../libnxlp/.libs/libnxlp.a ../subagents/ping/.libs/ping.a ../subagents/portCheck/.libs/portcheck.a ../subagents/ups/.libs/ups.a ../subagents/ds18x20/.libs/ds18x20.a ../subagents/linux/.libs/linux.a ../../snmp/libnxsnmp/.libs/libnxsnmp.a ../libnxagent/.libs/libnxagent.a ../../libnetxms/.libs/libnetxms.a ../../libexpat/libexpat/.libs/libnxexpat.a ../../libtre/.libs/libnxtre.a -ldl -lpthread -Wl,-Bstatic -lssl -lcrypto -lz -Wl,-Bdynamic
index 0419e7b..86c5dd5 100644 (file)
@@ -161,7 +161,7 @@ public class ServerCommandResults extends AbstractCommandResults implements Text
       try
       {
          if (out != null)
-            out.write(text);
+            out.write(text.replace("\r", ""));
       }
       catch(IOException e)
       {
index 648c0c1..4eb789d 100644 (file)
@@ -354,3 +354,33 @@ void ClusterDisconnect()
    ThreadJoin(s_connectorThread);
    ThreadJoin(s_keepaliveThread);
 }
+
+/**
+ * Send notification to all connected nodes
+ */
+void LIBNXCC_EXPORTABLE ClusterNotify(NXCPMessage *msg)
+{
+   NXCP_MESSAGE *rawMsg = msg->createMessage();
+
+   for(int i = 0; i < CLUSTER_MAX_NODE_ID; i++)
+   {
+      if (g_nxccNodes[i].m_id == 0)
+         continue;   // empty slot
+
+      MutexLock(g_nxccNodes[i].m_mutex);
+      if (g_nxccNodes[i].m_socket != INVALID_SOCKET)
+      {
+         if (SendEx(g_nxccNodes[i].m_socket, rawMsg, ntohl(rawMsg->size), 0, NULL) <= 0)
+         {
+            ClusterDebug(5, _T("ClusterKeepaliveThread: send failed for peer %d [%s]"),
+               g_nxccNodes[i].m_id, (const TCHAR *)g_nxccNodes[i].m_addr->toString());
+            shutdown(g_nxccNodes[i].m_socket, SHUT_RDWR);
+            g_nxccNodes[i].m_socket = INVALID_SOCKET; // current socket will be closed by receiver
+            ChangeClusterNodeState(&g_nxccNodes[i], CLUSTER_NODE_DOWN);
+         }
+      }
+      MutexUnlock(g_nxccNodes[i].m_mutex);
+   }
+
+   free(rawMsg);
+}
index db5babe..16d9ed1 100644 (file)
@@ -6999,7 +6999,7 @@ void Node::collectProxyInfo(ProxyInfo *info)
          info->msg->setField(info->fieldId++, (INT16)dco->getType());
          info->msg->setField(info->fieldId++, (INT16)dco->getDataSource());
          info->msg->setField(info->fieldId++, dco->getName());
-         info->msg->setField(info->fieldId++, (INT32)dco->getPollingInterval());
+         info->msg->setField(info->fieldId++, (INT32)dco->getEffectivePollingInterval());
          info->msg->setFieldFromTime(info->fieldId++, dco->getLastPollTime());
          info->msg->setField(info->fieldId++, m_guid);
          info->msg->setField(info->fieldId++, dco->getSnmpPort());
@@ -7062,7 +7062,7 @@ void Node::syncDataCollectionWithAgent(AgentConnectionEx *conn)
          msg.setField(fieldId++, (INT16)dco->getType());
          msg.setField(fieldId++, (INT16)dco->getDataSource());
          msg.setField(fieldId++, dco->getName());
-         msg.setField(fieldId++, (INT32)dco->getPollingInterval());
+         msg.setField(fieldId++, (INT32)dco->getEffectivePollingInterval());
          msg.setFieldFromTime(fieldId++, dco->getLastPollTime());
          fieldId += 4;
          count++;