Server and agents are separated by NAT

Started by fINT, February 01, 2019, 10:29:21 AM

Previous topic - Next topic

fINT

Good afternoon, members of the forum.

Perhaps the question will seem simple, but by virtue of the "patchiness" of knowledge on NetXMS, it has turned into a difficult task.
There are 2 local networks in different offices (office 1 and office 2). Both are behind NAT. Both have access to the Internet. Network addresses: 192.168.0.x (office 1) and 192.168.1.x (office 2).
NetXMS Server is installed on the 192.168.0.x network, 10 NetXMS agents are installed on the 192.168.1.x network. Office 1 (where the server is installed) has a static IP address. In office 2
(where agents are installed) - no static address. On the router in office 1, port 4700 (DNAT) was forwarded to the internal address of the NetXMS server.
How to configure NetXMS agents in office 2 so that they can transfer data to the NetXMS server in office 1?
Do you need any changes to the default server settings?
Can someone find a walkthrough?
Thank you in advance.

Here is the agent configuration (in office 2):
MasterServers = x.x.x.x (External IP address of office 1)
ConfigIncludeDir = C: \ NetXMS \ etc \ nxagentd.conf.d
LogFile = {syslog}
FileStore = C: \ NetXMS \ var
SubAgent = filemgr.nsm
SubAgent = ping.nsm
SubAgent = logwatch.nsm
SubAgent = portcheck.nsm
SubAgent = winperf.nsm
SubAgent = wmi.nsm
SubAgent = ups.nsm

Here is the server configuration (in office 1):
Name Value Default value Restart
XMPPServer localhost localhost Yes
XMPPPort 5222 5222 Yes
XMPPPassword netxms netxms Yes
XMPPLogin netxms @ localhost netxms @ localhost Yes
UseSyslogForDiscovery 1 0 Yes
UseSNMPTrapsForDiscovery 1 0 Yes
UseInterfaceAliases Don't use aliases Don't use aliases No
UseIfXTable 1 1 No
UseFQDNForNodeNames 1 1 Yes
UseDNSNameForDiscoveredNodes 0 0 No
TrapSourcesInAllZones 0 0 Yes
TopologyPollingInterval 1800 1800 Yes
TopologyExpirationTime 900 900 No
TopologyDiscoveryRadius 3 3 No
TileServerURL http://tile.openstreetmap.org/ http://tile.openstreetmap.org/ No
ThresholdRepeatInterval 0 0 Yes
ThreadPool.Syncer.MaxSize 1 1 Yes
ThreadPool.Syncer.BaseSize 1 1 Yes
ThreadPool.Scheduler.MaxSize 64 64 Yes
ThreadPool.Scheduler.BaseSize 1 1 Yes
ThreadPool.Poller.MaxSize 250 250 Yes
ThreadPool.Poller.BaseSize 10 10 Yes
ThreadPool.Main.MaxSize 256 256 Yes
ThreadPool.Main.BaseSize 8 8 Yes
ThreadPool.DataCollector.MaxSize 250 250 Yes
ThreadPool.DataCollector.BaseSize 10 10 Yes
ThreadPool.Agent.MaxSize 256 256 Yes
ThreadPool.Agent.BaseSize 4 4 ​​Yes
SyslogRetentionTime 90 90 No
SyslogNodeMatchingPolicy IP, then hostname IP, then hostname Yes
SyslogListenPort 514 514 Yes
SyslogIgnoreMessageTimestamp 0 0 No
SyncNodeNamesWithDNS 0 0 No
SyncInterval 60 60 Yes
StrictAlarmStatusFlow 0 0 No
StatusTranslation 1020304 1020304 Yes
StatusThresholds 503C2814 503C2814 Yes
StatusSingleThreshold 75 75 Yes
StatusShift 0 0 Yes
StatusPropagationAlgorithm Unchanged Unchanged Yes
StatusPollingInterval 60 60 Yes
StatusCalculationAlgorithm 1 1 Yes
SNMPTrapPort 162 162 Yes
SNMPTrapLogRetentionTime 90 90 No
SNMPRequestTimeout 1500 1500 Yes
SNMPPorts 161 161 No
SMTPServer localhost localhost No
SMTPRetryCount 10 1 No
SMTPPort 2525 25 No
SMTPFromName NetXMS Server NetXMS Server No
SMTPFromAddr netxms @ localhost netxms @ localhost No
SMSDrvConfig COM1: Yes
SMSDriver <none> <none> Yes
ServerName No
ServerCommandOutputTimeout 60 60 No
ServerColor No
RunNetworkDiscovery 0 0 Yes
RoutingTableUpdateInterval 300 300 Yes
ResolveNodeNames 1 1 No
ResolveDNSToIPOnStatusPoll 0 0 Yes
ReportingServerPort 4710 4710 Yes
ReportingServerHostname localhost localhost Yes
ReceiveForwardedEvents 0 0 No
RADIUSTimeout 3 3 No
RADIUSServer none none
RADIUSSecret netxms netxms No
RADIUSSecondaryServer none none
RADIUSSecondarySecret netxms netxms No
RADIUSSecondaryPort 1645 1645 No
RADIUSPort 1645 1645 No
RADIUSNumRetries 5 5 No
RADIUSAuthMethod PAP PAP No
PollCountForStatusChange 1 1 Yes
PasswordHistoryLength 0 0 No
PasswordExpiration 0 0 No
PasswordComplexity 0 0 No
OfflineDataRelevanceTime 86400 86400 Yes
NXSL.EnableFileIOFunctions 0 0 Yes
NXSL.EnableContainerFunctions 1 1 Yes
NumberOfUpgradeThreads 10 10 No
MobileDeviceListenerPort 4747 4747 Yes
MinViewRefreshInterval 1000 1000 No
MinPasswordLength 0 0 No
MessageOfTheDay No
MailEncoding utf8 utf8 No
LongRunningQueryThreshold 0 0 Yes
LogAllSNMPTraps 0 0 Yes
LockTimeout 60000 60000 Yes
LdapUserUniqueId No
LdapUserMappingName No
LdapUserDeleteAction Disable user Disable user No
LdapUserClass No
LdapSyncUserPassword No
LdapSyncUser No
LdapSyncInterval 0 0 No
LdapSearchFilter No
LdapSearchBase No
LdapPageSize 1000 1000 No
LdapMappingFullName displayName displayName No
LdapMappingDescription No
LdapGroupUniqueId No
LdapGroupMappingName No
LdapGroupClass No
LdapConnectionString ldap: // localhost: 389 ldap: // localhost: 389 No
KeepAliveInterval 60 60 Yes
JobRetryCount 5 5 No
JobHistoryRetentionTime 90 90 No
JiraServerURL http: // localhost http: // localhost Yes
JiraProjectComponent No
JiraProjectCode NETXMS NETXMS No
JiraPassword Yes
JiraLogin netxms netxms Yes
JiraIssueType Task Task No
IntruderLockoutTime 30 30 No
IntruderLockoutThreshold 0 0 No
InternalCA 0 0 Y

Victor Kirhenshtein

Hi,

looks like in your setup you need agents connecting to server. In NetXMS default configuration is when server connects to agents. Reverse configuration called "agent tunnel". You have to configure server for accepting connections from agents: https://www.netxms.org/documentation/adminguide/server-management.html#server-configuration-for-agent-to-server-connection-tunnel-connection.

Best regards,
Victor

fINT

Hi,

Quotelooks like in your setup you need agents connecting to server.
Yes, thats correct.
QuoteIn NetXMS default configuration is when server connects to agents. Reverse configuration called "agent tunnel".
Thanks, for clarifications.
So, as I understand, I need (in my case):
1. Install one agent in office 2 as "Proxy Agent" (https://www.netxms.org/documentation/adminguide/agent-management.html#agent-proxy-node-configuration)
2. Сonfigure server for accepting connections (from Proxy Agent): https://www.netxms.org/documentation/adminguide/server-management.html#server-configuration-for-agent-to-server-connection-tunnel-connection.
3. Configure other agents in office 2 to work through Proxy Agent.

Correct?
Thanks :)

Tursiops

Using Agent Tunnels, you can have all the NetXMS Agents talk directly to the server via tunnel - they agents themselves no longer need to be polled via a proxy.
However, you will still need to use one of the agents as proxy for any SNMP devices you wish to monitor in that remote network.