"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/server/core/node.cpp" between
netxms-3.8.382.tar.gz and netxms-3.8.405.tar.gz

About: NetXMS is a multi-platform open source network management and monitoring system.

node.cpp  (netxms-3.8.382):node.cpp  (netxms-3.8.405)
skipping to change at line 1741 skipping to change at line 1741
else else
{ {
nxlog_debug_tag(DEBUG_TAG_NODE_INTERFACES, 4, _T("Node::createInterface Object(%s [%u]): hook script execution error: %s"), m_name, m_id, vm->getErrorTe xt()); nxlog_debug_tag(DEBUG_TAG_NODE_INTERFACES, 4, _T("Node::createInterface Object(%s [%u]): hook script execution error: %s"), m_name, m_id, vm->getErrorTe xt());
PostSystemEvent(EVENT_SCRIPT_ERROR, g_dwMgmtNode, "ssd", _T("Hook::Crea teInterface"), vm->getErrorText(), 0); PostSystemEvent(EVENT_SCRIPT_ERROR, g_dwMgmtNode, "ssd", _T("Hook::Crea teInterface"), vm->getErrorText(), 0);
} }
vm.destroy(); vm.destroy();
nxlog_debug_tag(DEBUG_TAG_NODE_INTERFACES, 6, _T("Node::createInterfaceObj ect(%s [%u]): interface \"%s\" (ifIndex=%d) %s by filter"), nxlog_debug_tag(DEBUG_TAG_NODE_INTERFACES, 6, _T("Node::createInterfaceObj ect(%s [%u]): interface \"%s\" (ifIndex=%d) %s by filter"),
m_name, m_id, iface->getName(), info->index, pass ? _T("accepted ") : _T("rejected")); m_name, m_id, iface->getName(), info->index, pass ? _T("accepted ") : _T("rejected"));
if (!pass) if (!pass)
{ {
sendPollerMsg(POLLER_WARNING _T(" Creation of interface object \"%s\" blocked by filter\r\n"), iface->getName());
iface.reset(); iface.reset();
} }
} }
return iface; return iface;
} }
/** /**
* Create new interface - convenience wrapper * Create new interface - convenience wrapper
*/ */
shared_ptr<Interface> Node::createNewInterface(const InetAddress& ipAddr, const MacAddress& macAddr, bool fakeInterface) shared_ptr<Interface> Node::createNewInterface(const InetAddress& ipAddr, const MacAddress& macAddr, bool fakeInterface)
skipping to change at line 3721 skipping to change at line 3722
POLL_CANCELLATION_CHECKPOINT(); POLL_CANCELLATION_CHECKPOINT();
// Generate event if node flags has been changed // Generate event if node flags has been changed
if (oldCapabilities != m_capabilities) if (oldCapabilities != m_capabilities)
{ {
PostSystemEvent(EVENT_NODE_CAPABILITIES_CHANGED, m_id, "xx", oldCapabil ities, m_capabilities); PostSystemEvent(EVENT_NODE_CAPABILITIES_CHANGED, m_id, "xx", oldCapabil ities, m_capabilities);
modified |= MODIFY_NODE_PROPERTIES; modified |= MODIFY_NODE_PROPERTIES;
} }
// Update system description
TCHAR buffer[MAX_RESULT_LENGTH] = { 0 };
if ((m_capabilities & NC_IS_NATIVE_AGENT) && !(m_flags & NF_DISABLE_NXCP))
{
getMetricFromAgent(_T("System.Uname"), buffer, MAX_RESULT_LENGTH);
}
else if ((m_capabilities & NC_IS_SNMP) && !(m_flags & NF_DISABLE_SNMP))
{
getMetricFromSNMP(m_snmpPort, SNMP_VERSION_DEFAULT, _T(".1.3.6.1.2.1.1.
1.0"), buffer, MAX_RESULT_LENGTH, SNMP_RAWTYPE_NONE);
}
if (buffer[0] != _T('\0'))
{
TranslateStr(buffer, _T("\r\n"), _T(" "));
TranslateStr(buffer, _T("\n"), _T(" "));
TranslateStr(buffer, _T("\r"), _T(" "));
lockProperties();
if ((m_sysDescription == nullptr) || _tcscmp(m_sysDescription, buffer))
{
MemFree(m_sysDescription);
m_sysDescription = MemCopyString(buffer);
modified |= MODIFY_NODE_PROPERTIES;
sendPollerMsg(_T(" System description changed to %s\r\n"), m_sysDe
scription);
}
unlockProperties();
}
// Retrieve interface list // Retrieve interface list
poller->setStatus(_T("interface check")); poller->setStatus(_T("interface check"));
sendPollerMsg(_T("Capability check finished\r\n")); sendPollerMsg(_T("Capability check finished\r\n"));
if (updateInterfaceConfiguration(rqId, 0)) // maskBits if (updateInterfaceConfiguration(rqId, 0)) // maskBits
modified |= MODIFY_NODE_PROPERTIES; modified |= MODIFY_NODE_PROPERTIES;
POLL_CANCELLATION_CHECKPOINT(); POLL_CANCELLATION_CHECKPOINT();
if (g_flags & AF_MERGE_DUPLICATE_NODES) if (g_flags & AF_MERGE_DUPLICATE_NODES)
skipping to change at line 3758 skipping to change at line 3789
return; return;
} }
else if (dcr == REMOVE_OTHER) else if (dcr == REMOVE_OTHER)
{ {
nxlog_debug_tag(DEBUG_TAG_CONF_POLL, 3, _T("Removing node %s [%u] as duplicate"), duplicateNode->getName(), duplicateNode->getId()); nxlog_debug_tag(DEBUG_TAG_CONF_POLL, 3, _T("Removing node %s [%u] as duplicate"), duplicateNode->getName(), duplicateNode->getId());
reconcileWithDuplicateNode(duplicateNode.get()); reconcileWithDuplicateNode(duplicateNode.get());
ThreadPoolExecute(g_pollerThreadPool, DeleteDuplicateNode, new Delet eDuplicateNodeData(self(), duplicateNode, reason)); ThreadPoolExecute(g_pollerThreadPool, DeleteDuplicateNode, new Delet eDuplicateNodeData(self(), duplicateNode, reason));
} }
} }
// Update system description
TCHAR buffer[MAX_RESULT_LENGTH] = { 0 };
if ((m_capabilities & NC_IS_NATIVE_AGENT) && !(m_flags & NF_DISABLE_NXCP))
{
getMetricFromAgent(_T("System.Uname"), buffer, MAX_RESULT_LENGTH);
}
else if ((m_capabilities & NC_IS_SNMP) && !(m_flags & NF_DISABLE_SNMP))
{
getMetricFromSNMP(m_snmpPort, SNMP_VERSION_DEFAULT, _T(".1.3.6.1.2.1.1.
1.0"), buffer, MAX_RESULT_LENGTH, SNMP_RAWTYPE_NONE);
}
if (buffer[0] != _T('\0'))
{
TranslateStr(buffer, _T("\r\n"), _T(" "));
TranslateStr(buffer, _T("\n"), _T(" "));
TranslateStr(buffer, _T("\r"), _T(" "));
lockProperties();
if ((m_sysDescription == nullptr) || _tcscmp(m_sysDescription, buffer))
{
free(m_sysDescription);
m_sysDescription = MemCopyString(buffer);
modified |= MODIFY_NODE_PROPERTIES;
sendPollerMsg(_T(" System description changed to %s\r\n"), m_sysDe
scription);
}
unlockProperties();
}
// Check node name // Check node name
sendPollerMsg(_T("Checking node name\r\n")); sendPollerMsg(_T("Checking node name\r\n"));
if (g_flags & AF_RESOLVE_NODE_NAMES) if (g_flags & AF_RESOLVE_NODE_NAMES)
{ {
InetAddress addr = InetAddress::parse(m_name); InetAddress addr = InetAddress::parse(m_name);
if (addr.isValidUnicast() && isMyIP(addr)) if (addr.isValidUnicast() && isMyIP(addr))
{ {
nxlog_debug_tag(DEBUG_TAG_CONF_POLL, 6, _T("ConfPoll(%s [%u]): node name is an IP address and need to be resolved"), m_name, m_id); nxlog_debug_tag(DEBUG_TAG_CONF_POLL, 6, _T("ConfPoll(%s [%u]): node name is an IP address and need to be resolved"), m_name, m_id);
sendPollerMsg(_T("Node name is an IP address and need to be resolved \r\n")); sendPollerMsg(_T("Node name is an IP address and need to be resolved \r\n"));
poller->setStatus(_T("resolving name")); poller->setStatus(_T("resolving name"));
skipping to change at line 5405 skipping to change at line 5406
unlockChildList(); unlockChildList();
if (isNewInterface) if (isNewInterface)
{ {
// New interface // New interface
sendPollerMsg(POLLER_INFO _T(" Found new interface \"%s\"\r\n"), i fInfo->name); sendPollerMsg(POLLER_INFO _T(" Found new interface \"%s\"\r\n"), i fInfo->name);
if (createNewInterface(ifInfo, false, false) != nullptr) if (createNewInterface(ifInfo, false, false) != nullptr)
{ {
hasChanges = true; hasChanges = true;
} }
else
{
sendPollerMsg(POLLER_WARNING _T(" Creation of interface object
\"%s\" blocked by filter\r\n"), ifInfo->name);
}
} }
else if (interfaceUpdated) else if (interfaceUpdated)
{ {
executeInterfaceUpdateHook(pInterface.get()); executeInterfaceUpdateHook(pInterface.get());
} }
} }
// Set parent interfaces // Set parent interfaces
for(int j = 0; j < ifList->size(); j++) for(int j = 0; j < ifList->size(); j++)
{ {
 End of changes. 4 change blocks. 
37 lines changed or deleted 33 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)