unknowm syslog sources can be automatically added as nodes (discovery by syslog)
authorVictor Kirhenshtein <victor@netxms.org>
Thu, 2 Feb 2017 13:01:39 +0000 (15:01 +0200)
committerVictor Kirhenshtein <victor@netxms.org>
Thu, 2 Feb 2017 13:01:39 +0000 (15:01 +0200)
36 files changed:
ChangeLog
include/netxmsdb.h
sql/setup.in
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/Messages.java
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages.properties
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_ar.properties
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_cs.properties
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_de.properties
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_es.properties
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_fr.properties
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_pt.properties
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_ru.properties
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_zh_CN.properties
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/views/NetworkDiscoveryConfigurator.java
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/views/PersistentStorageView.java
src/java/netxms-eclipse/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/views/helpers/DiscoveryConfig.java
src/server/core/console.cpp
src/server/core/main.cpp
src/server/core/poll.cpp
src/server/core/snmptrap.cpp
src/server/core/syslogd.cpp
src/server/include/nxsrvapi.h
src/server/tools/nxdbmgr/upgrade.cpp
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/Messages.java
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages.properties
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_ar.properties
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_cs.properties
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_de.properties
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_es.properties
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_fr.properties
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_pt.properties
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_ru.properties
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/messages_zh_CN.properties
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/views/NetworkDiscoveryConfigurator.java
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/views/PersistentStorageView.java
webui/webapp/ServerConfig/src/org/netxms/ui/eclipse/serverconfig/views/helpers/DiscoveryConfig.java

index f05139f..46f09e6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -5,6 +5,7 @@
 - Improved the usability of the Server Configuration, by adding descriptions and recognition for data types and possible values
 - Alternative core configuration section can be set for nxagentd using -G command line option
 - Implicit external subagent registartion using EXT:* sections in agent configuration file
+- Unknown syslog sources can be automatically added as nodes
 - Fixed issues: NX-60, NX-630, NX-916, NX-1151
 
 
index f70e910..9c6d83c 100644 (file)
@@ -23,6 +23,6 @@
 #ifndef _netxmsdb_h
 #define _netxmsdb_h
 
-#define DB_FORMAT_VERSION   432
+#define DB_FORMAT_VERSION   433
 
 #endif
index 9ffde1f..9d57edf 100644 (file)
@@ -185,7 +185,8 @@ INSERT INTO config (var_name,var_value,is_visible,need_server_restart,data_type,
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart,data_type,description) VALUES ('UseFQDNForNodeNames','1',1,1,'B','Enable/disable the use of fully qualified domain names as primary names for newly discovered nodes.');
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart,data_type,description) VALUES ('UseIfXTable','1',1,0,'B','Enable/disable the use of SNMP ifXTable instead of ifTable for interface configuration polling.');
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart,data_type,description) VALUES ('UseInterfaceAliases','0',1,0,'C','Control usage of interface aliases (or descriptions).');
-INSERT INTO config (var_name,var_value,is_visible,need_server_restart,data_type,description) VALUES ('UseSNMPTrapsForDiscovery','0',1,1,'B','This parameter defines if trap information should be used for new node discovery.');
+INSERT INTO config (var_name,var_value,is_visible,need_server_restart,data_type,description) VALUES ('UseSNMPTrapsForDiscovery','0',1,1,'B','Use SNMP trap information for new node discovery.');
+INSERT INTO config (var_name,var_value,is_visible,need_server_restart,data_type,description) VALUES ('UseSyslogForDiscovery','0',1,1,'B','Use syslog messages for new node discovery.');
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart,data_type,description) VALUES ('XMPPLogin','netxms@localhost',1,1,'S','Login name that will be used to authentication on XMPP server.');
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart,data_type,description) VALUES ('XMPPPassword','netxms',1,1,'S','Password that will be used to authentication on XMPP server.');
 INSERT INTO config (var_name,var_value,is_visible,need_server_restart,data_type,description) VALUES ('XMPPPort','5222',1,1,'I','XMPP connection port.');
index 787b493..3dbea8a 100644 (file)
@@ -147,6 +147,7 @@ public class Messages extends NLS
    public static String NetworkDiscoveryConfigurator_SectionGeneral;
    public static String NetworkDiscoveryConfigurator_SectionGeneralDescr;
    public static String NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery;
+   public static String NetworkDiscoveryConfigurator_UseSyslogForDiscovery;
    public static String OpenMappingTables_Error;
    public static String OpenMappingTables_ErrorOpeningView;
    public static String OpenNetworkDiscoveryConfig_Error;
index 612d35c..5073dc5 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index bc89561..711e966 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index 59d4dde..efcf41c 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Objevovac\u00ed filtr
 NetworkDiscoveryConfigurator_SectionGeneral=Obecn\u00fd
 NetworkDiscoveryConfigurator_SectionGeneralDescr=Obecn\u00e9 nastaven\u00ed objevov\u00e1n\u00ed s\u00edt\u011b
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Chyba
 OpenMappingTables_ErrorOpeningView=Chyba p\u0159i otev\u00edr\u00e1n\u00ed\:
 OpenNetworkDiscoveryConfig_Error=Chyba
index bc89561..711e966 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index bc89561..711e966 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index bc89561..711e966 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index 4302e9d..f3cf2b0 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Filtro de detec\u00e7\u00e3o
 NetworkDiscoveryConfigurator_SectionGeneral=Geral
 NetworkDiscoveryConfigurator_SectionGeneralDescr=Configura\u00e7\u00f5es gerais de descoberta de rede
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Usar SNMP trap para descobrir origem de endere\u00e7os
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Erro
 OpenMappingTables_ErrorOpeningView=Erro ao abrir a visualiza\u00e7\u00e3o:
 OpenNetworkDiscoveryConfig_Error=Erro
index 0dccc3a..7611916 100644 (file)
@@ -139,7 +139,8 @@ NetworkDiscoveryConfigurator_SectionFilter=\u0424\u0438\u043b\u044c\u0442\u0440\
 NetworkDiscoveryConfigurator_SectionFilterDescr=\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f
 NetworkDiscoveryConfigurator_SectionGeneral=\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435
 NetworkDiscoveryConfigurator_SectionGeneralDescr=\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0435\u0442\u0438
-NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f SNMP trap \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430
+NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 SNMP trap \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u043e\u0432
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 syslog \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u043e\u0432
 OpenMappingTables_Error=\u041e\u0448\u0438\u0431\u043a\u0430
 OpenMappingTables_ErrorOpeningView=\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f: 
 OpenNetworkDiscoveryConfig_Error=\u041e\u0448\u0438\u0431\u043a\u0430
index bc89561..711e966 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index c66d463..6804d36 100644 (file)
@@ -78,6 +78,7 @@ public class NetworkDiscoveryConfigurator extends ViewPart implements ISaveableP
    private Button radioDiscoveryPassive;
    private Button radioDiscoveryActive;
    private Button checkUseSnmpTraps;
+   private Button checkUseSyslog;
    private Button radioFilterOff;
    private Button radioFilterCustom;
    private Button radioFilterAuto;
@@ -241,8 +242,7 @@ public class NetworkDiscoveryConfigurator extends ViewPart implements ISaveableP
             SWT.RADIO);
       radioDiscoveryActive.addSelectionListener(listener);
 
-      checkUseSnmpTraps = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery,
-            SWT.CHECK);
+      checkUseSnmpTraps = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery, SWT.CHECK);
       checkUseSnmpTraps.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e)
@@ -254,6 +254,16 @@ public class NetworkDiscoveryConfigurator extends ViewPart implements ISaveableP
       GridData gd = new GridData();
       gd.verticalIndent = 10;
       checkUseSnmpTraps.setLayoutData(gd);
+
+      checkUseSyslog = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_UseSyslogForDiscovery, SWT.CHECK);
+      checkUseSyslog.addSelectionListener(new SelectionAdapter() {
+         @Override
+         public void widgetSelected(SelectionEvent e)
+         {
+            config.setUseSyslog(checkUseSyslog.getSelection());
+            setModified();
+         }
+      });
    }
 
    /**
@@ -516,6 +526,7 @@ public class NetworkDiscoveryConfigurator extends ViewPart implements ISaveableP
       radioDiscoveryPassive.setSelection(config.isEnabled() && !config.isActive());
       radioDiscoveryActive.setSelection(config.isEnabled() && config.isActive());
       checkUseSnmpTraps.setSelection(config.isUseSnmpTraps());
+      checkUseSyslog.setSelection(config.isUseSyslog());
 
       if (config.getFilter().equalsIgnoreCase(NetworkDiscovery.FILTER_NONE) || config.getFilter().isEmpty())
       {
index ea3ce73..7f23d53 100644 (file)
@@ -19,7 +19,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.ui.IActionBars;
@@ -28,7 +27,6 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.part.ViewPart;
 import org.netxms.client.NXCSession;
-import org.netxms.client.ScheduledTask;
 import org.netxms.ui.eclipse.actions.RefreshAction;
 import org.netxms.ui.eclipse.console.dialogs.SetEntryEditDialog;
 import org.netxms.ui.eclipse.console.resources.SharedIcons;
@@ -36,7 +34,6 @@ import org.netxms.ui.eclipse.jobs.ConsoleJob;
 import org.netxms.ui.eclipse.serverconfig.Activator;
 import org.netxms.ui.eclipse.shared.ConsoleSharedData;
 import org.netxms.ui.eclipse.tools.ObjectLabelComparator;
-import org.netxms.ui.eclipse.tools.WidgetHelper;
 import org.netxms.ui.eclipse.widgets.SortableTableViewer;
 import org.netxms.ui.eclipse.widgets.helpers.AttributeLabelProvider;
 
index 7be6054..3672e88 100644 (file)
@@ -20,6 +20,7 @@ public class DiscoveryConfig
        private boolean enabled;
        private boolean active;
        private boolean useSnmpTraps;
+       private boolean useSyslog;
        private int filterFlags;
        private String filter;
        private List<InetAddressListElement> targets;
@@ -50,6 +51,7 @@ public class DiscoveryConfig
                config.enabled = getBoolean(variables, "RunNetworkDiscovery", false); //$NON-NLS-1$
                config.active = getBoolean(variables, "ActiveNetworkDiscovery", false); //$NON-NLS-1$
                config.useSnmpTraps = getBoolean(variables, "UseSNMPTrapsForDiscovery", false); //$NON-NLS-1$
+      config.useSyslog = getBoolean(variables, "UseSyslogForDiscovery", false); //$NON-NLS-1$
                config.filterFlags = getInteger(variables, "DiscoveryFilterFlags", 0); //$NON-NLS-1$
                config.filter = getString(variables, "DiscoveryFilter", "none"); //$NON-NLS-1$ //$NON-NLS-2$
                
@@ -135,6 +137,7 @@ public class DiscoveryConfig
                session.setServerVariable("RunNetworkDiscovery", enabled ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                session.setServerVariable("ActiveNetworkDiscovery", active ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
       session.setServerVariable("UseSNMPTrapsForDiscovery", useSnmpTraps ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+      session.setServerVariable("UseSyslogForDiscovery", useSyslog ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                session.setServerVariable("DiscoveryFilterFlags", Integer.toString(filterFlags)); //$NON-NLS-1$
                session.setServerVariable("DiscoveryFilter", filter); //$NON-NLS-1$
                
@@ -255,4 +258,20 @@ public class DiscoveryConfig
    {
       this.useSnmpTraps = useSnmpTraps;
    }
+
+   /**
+    * @return the useSyslog
+    */
+   public boolean isUseSyslog()
+   {
+      return useSyslog;
+   }
+
+   /**
+    * @param useSyslog the useSyslog to set
+    */
+   public void setUseSyslog(boolean useSyslog)
+   {
+      this.useSyslog = useSyslog;
+   }
 }
index 026ad4c..2ccccd0 100644 (file)
@@ -522,6 +522,7 @@ int ProcessConsoleCommand(const TCHAR *pszCmdLine, CONSOLE_CTX pCtx)
          ConsolePrintf(pCtx, SHOW_FLAG_VALUE(AF_BACKGROUND_LOG_WRITER));
          ConsolePrintf(pCtx, SHOW_FLAG_VALUE(AF_CASE_INSENSITIVE_LOGINS));
          ConsolePrintf(pCtx, SHOW_FLAG_VALUE(AF_TRAP_SOURCES_IN_ALL_ZONES));
+         ConsolePrintf(pCtx, SHOW_FLAG_VALUE(AF_SYSLOG_DISCOVERY));
          ConsolePrintf(pCtx, SHOW_FLAG_VALUE(AF_SERVER_INITIALIZED));
          ConsolePrintf(pCtx, SHOW_FLAG_VALUE(AF_SHUTDOWN));
          ConsolePrintf(pCtx, _T("\n"));
index 8747f15..d7b2b99 100644 (file)
@@ -327,6 +327,8 @@ static void LoadGlobalConfig()
                g_flags |= AF_ACTIVE_NETWORK_DISCOVERY;
    if (ConfigReadInt(_T("UseSNMPTrapsForDiscovery"), 0))
       g_flags |= AF_SNMP_TRAP_DISCOVERY;
+   if (ConfigReadInt(_T("UseSyslogForDiscovery"), 0))
+      g_flags |= AF_SYSLOG_DISCOVERY;
        if (ConfigReadInt(_T("ResolveNodeNames"), 1))
                g_flags |= AF_RESOLVE_NODE_NAMES;
        if (ConfigReadInt(_T("SyncNodeNamesWithDNS"), 0))
index 927b5e1..6172b47 100644 (file)
@@ -636,4 +636,9 @@ void ResetDiscoveryPoller()
       g_flags |= AF_SNMP_TRAP_DISCOVERY;
    else
       g_flags &= ~AF_SNMP_TRAP_DISCOVERY;
+
+   if (ConfigReadInt(_T("UseSyslogForDiscovery"), 0))
+      g_flags |= AF_SYSLOG_DISCOVERY;
+   else
+      g_flags &= ~AF_SYSLOG_DISCOVERY;
 }
index bcd08d9..e9dec2f 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ** NetXMS - Network Management System
-** Copyright (C) 2003-2016 Victor Kirhenshtein
+** Copyright (C) 2003-207 Victor Kirhenshtein
 **
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
@@ -22,7 +22,6 @@
 
 #include "nxcore.h"
 
-
 /**
  * Externals
  */
@@ -430,9 +429,7 @@ void ProcessTrap(SNMP_PDU *pdu, const InetAddress& srcAddr, UINT32 zoneId, int s
       {
          if (!subnet->getIpAddress().equals(srcAddr) && !srcAddr.isSubnetBroadcast(subnet->getIpAddress().getMaskBits()))
          {
-            NEW_NODE *pInfo;
-
-            pInfo = (NEW_NODE *)malloc(sizeof(NEW_NODE));
+            NEW_NODE *pInfo = (NEW_NODE *)malloc(sizeof(NEW_NODE));
             pInfo->ipAddr = srcAddr;
             pInfo->ipAddr.setMaskBits(subnet->getIpAddress().getMaskBits());
                                pInfo->zoneId = zoneId;
@@ -443,9 +440,7 @@ void ProcessTrap(SNMP_PDU *pdu, const InetAddress& srcAddr, UINT32 zoneId, int s
       }
       else
       {
-         NEW_NODE *pInfo;
-
-         pInfo = (NEW_NODE *)malloc(sizeof(NEW_NODE));
+         NEW_NODE *pInfo = (NEW_NODE *)malloc(sizeof(NEW_NODE));
          pInfo->ipAddr = srcAddr;
                        pInfo->zoneId = zoneId;
                        pInfo->ignoreFilter = FALSE;
index 948bd2a..24eda6e 100644 (file)
@@ -1,6 +1,6 @@
 /*
 ** NetXMS - Network Management System
-** Copyright (C) 2003-2016 Victor Kirhenshtein
+** Copyright (C) 2003-2017 Victor Kirhenshtein
 **
 ** This program is free software; you can redistribute it and/or modify
 ** it under the terms of the GNU General Public License as published by
  */
 #define MAX_SYSLOG_MSG_LEN    1024
 
+/**
+ * Externals
+ */
+extern Queue g_nodePollerQueue;
+
 /**
  * Queued syslog message structure
  */
@@ -465,6 +470,34 @@ static void ProcessSyslogMessage(QueuedSyslogMessage *msg)
 #endif
                }
                MutexUnlock(s_parserLock);
+
+          if ((record.dwSourceObject == 0) && (g_flags & AF_SYSLOG_DISCOVERY))  // unknown node, discovery enabled
+          {
+             DbgPrintf(4, _T("ProcessSyslogMessage: source not matched to node, adding new IP address %s for discovery"), msg->sourceAddr.toString(ipAddr));
+             Subnet *subnet = FindSubnetForNode(msg->zoneId, msg->sourceAddr);
+             if (subnet != NULL)
+             {
+                if (!subnet->getIpAddress().equals(msg->sourceAddr) && !msg->sourceAddr.isSubnetBroadcast(subnet->getIpAddress().getMaskBits()))
+                {
+                   NEW_NODE *pInfo = (NEW_NODE *)malloc(sizeof(NEW_NODE));
+                   pInfo->ipAddr = msg->sourceAddr;
+                   pInfo->ipAddr.setMaskBits(subnet->getIpAddress().getMaskBits());
+                   pInfo->zoneId = msg->zoneId;
+                   pInfo->ignoreFilter = FALSE;
+                   memset(pInfo->bMacAddr, 0, MAC_ADDR_LENGTH);
+                   g_nodePollerQueue.put(pInfo);
+                }
+             }
+             else
+             {
+                NEW_NODE *pInfo = (NEW_NODE *)malloc(sizeof(NEW_NODE));
+                pInfo->ipAddr = msg->sourceAddr;
+                pInfo->zoneId = msg->zoneId;
+                pInfo->ignoreFilter = FALSE;
+                memset(pInfo->bMacAddr, 0, MAC_ADDR_LENGTH);
+                g_nodePollerQueue.put(pInfo);
+             }
+          }
    }
        else
        {
index 226b3a9..be60dca 100644 (file)
 #define AF_BACKGROUND_LOG_WRITER               _ULL(0x0000000200000000)
 #define AF_CASE_INSENSITIVE_LOGINS             _ULL(0x0000000400000000)
 #define AF_TRAP_SOURCES_IN_ALL_ZONES           _ULL(0x0000000800000000)
+#define AF_SYSLOG_DISCOVERY                    _ULL(0x0000001000000000)
 #define AF_SERVER_INITIALIZED                  _ULL(0x4000000000000000)
 #define AF_SHUTDOWN                            _ULL(0x8000000000000000)
 
index 0a15dda..2cc606b 100644 (file)
@@ -725,6 +725,16 @@ static bool SetSchemaVersion(int version)
    return SQLQuery(query);
 }
 
+/*
+ * Upgrade from V432 to V433
+ */
+static BOOL H_UpgradeFromV432(int currVersion, int newVersion)
+{
+   CHK_EXEC(CreateConfigParam(_T("UseSyslogForDiscovery"), _T("0"), _T("Use syslog messages for new node discovery."), 'B', true, false, false, false));
+   CHK_EXEC(SetSchemaVersion(433));
+   return TRUE;
+}
+
 /*
  * Upgrade from V431 to V432
  */
@@ -1017,7 +1027,7 @@ static BOOL H_UpgradeFromV428(int currVersion, int newVersion)
    CHK_EXEC(SQLQuery(_T("UPDATE config SET data_type='B',description='Enable/disable the use of fully qualified domain names as primary names for newly discovered nodes.' WHERE var_name='UseFQDNForNodeNames'")));
    CHK_EXEC(SQLQuery(_T("UPDATE config SET data_type='B',description='Enable/disable the use of SNMP ifXTable instead of ifTable for interface configuration polling.' WHERE var_name='UseIfXTable'")));
    CHK_EXEC(SQLQuery(_T("UPDATE config SET data_type='C',description='Control usage of interface aliases (or descriptions).' WHERE var_name='UseInterfaceAliases'")));
-   CHK_EXEC(SQLQuery(_T("UPDATE config SET data_type='B',description='This parameter defines if trap information should be used for new node discovery.' WHERE var_name='UseSNMPTrapsForDiscovery'")));
+   CHK_EXEC(SQLQuery(_T("UPDATE config SET data_type='B',description='Use SNMP trap information for new node discovery.' WHERE var_name='UseSNMPTrapsForDiscovery'")));
    CHK_EXEC(SQLQuery(_T("UPDATE config SET data_type='S',description='Login name that will be used to authentication on XMPP server.' WHERE var_name='XMPPLogin'")));
    CHK_EXEC(SQLQuery(_T("UPDATE config SET data_type='S',description='Password that will be used to authentication on XMPP server.' WHERE var_name='XMPPPassword'")));
    CHK_EXEC(SQLQuery(_T("UPDATE config SET data_type='I',description='XMPP connection port.' WHERE var_name='XMPPPort'")));
@@ -11291,6 +11301,7 @@ static struct
    { 429, 430, H_UpgradeFromV429 },
    { 430, 431, H_UpgradeFromV430 },
    { 431, 432, H_UpgradeFromV431 },
+   { 432, 433, H_UpgradeFromV432 },
    { 0, 0, NULL }
 };
 
index a6244d4..b61b1c8 100644 (file)
@@ -150,6 +150,7 @@ public class Messages extends NLS
    public String NetworkDiscoveryConfigurator_SectionGeneral;
    public String NetworkDiscoveryConfigurator_SectionGeneralDescr;
    public String NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery;
+   public String NetworkDiscoveryConfigurator_UseSyslogForDiscovery;
    public String OpenMappingTables_Error;
    public String OpenMappingTables_ErrorOpeningView;
    public String OpenNetworkDiscoveryConfig_Error;
index 612d35c..5073dc5 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index bc89561..711e966 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index 59d4dde..efcf41c 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Objevovac\u00ed filtr
 NetworkDiscoveryConfigurator_SectionGeneral=Obecn\u00fd
 NetworkDiscoveryConfigurator_SectionGeneralDescr=Obecn\u00e9 nastaven\u00ed objevov\u00e1n\u00ed s\u00edt\u011b
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Chyba
 OpenMappingTables_ErrorOpeningView=Chyba p\u0159i otev\u00edr\u00e1n\u00ed\:
 OpenNetworkDiscoveryConfig_Error=Chyba
index bc89561..711e966 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index bc89561..711e966 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index bc89561..711e966 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index 4302e9d..f3cf2b0 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Filtro de detec\u00e7\u00e3o
 NetworkDiscoveryConfigurator_SectionGeneral=Geral
 NetworkDiscoveryConfigurator_SectionGeneralDescr=Configura\u00e7\u00f5es gerais de descoberta de rede
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Usar SNMP trap para descobrir origem de endere\u00e7os
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Erro
 OpenMappingTables_ErrorOpeningView=Erro ao abrir a visualiza\u00e7\u00e3o:
 OpenNetworkDiscoveryConfig_Error=Erro
index 4726284..7611916 100644 (file)
@@ -79,7 +79,7 @@ LogParserRuleEditor_MoveDown=\u041d\u0438\u0436\u0435
 LogParserRuleEditor_MoveUp=\u0412\u044b\u0448\u0435
 LogParserRuleEditor_Parameters=\u041f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u044b
 LogParserRuleEditor_Severity=\u0421\u0435\u0440\u044c\u0435\u0437\u043d\u043e\u0441\u0442\u044c
-LogParserRuleEditor_SyslogTag=Syslog tag
+LogParserRuleEditor_SyslogTag=Syslog \u0442\u0435\u0433
 MappingTableEditor_ColComments=\u041a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u0439
 MappingTableEditor_ColKey=\u041a\u043b\u044e\u0447
 MappingTableEditor_ColValue=\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435
@@ -95,7 +95,7 @@ MappingTableEditor_Save=&\u0421\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c
 MappingTableEditor_SaveJobError=\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f
 MappingTableEditor_SaveJobName=\u0421\u043e\u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0441\u043e\u043f\u043e\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f
 MappingTableListLabelProvider_FlagNone=none
-MappingTableListLabelProvider_FlagNumeric=NUMERIC
+MappingTableListLabelProvider_FlagNumeric=\u0427\u0438\u0441\u043b\u043e\u0432\u043e\u0439
 MappingTables_ColDescription=\u041e\u043f\u0438\u0441\u0430\u043d\u0438\u0435
 MappingTables_ColFlags=\u0424\u043b\u0430\u0433\u0438
 MappingTables_ColID=ID
@@ -139,7 +139,8 @@ NetworkDiscoveryConfigurator_SectionFilter=\u0424\u0438\u043b\u044c\u0442\u0440\
 NetworkDiscoveryConfigurator_SectionFilterDescr=\u0424\u0438\u043b\u044c\u0442\u0440\u0430\u0446\u0438\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f
 NetworkDiscoveryConfigurator_SectionGeneral=\u041e\u0441\u043d\u043e\u0432\u043d\u043e\u0435
 NetworkDiscoveryConfigurator_SectionGeneralDescr=\u041e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u043d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0438 \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0435\u0442\u0438
-NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f SNMP trap \u0438\u0441\u0445\u043e\u0434\u043d\u043e\u0433\u043e \u0430\u0434\u0440\u0435\u0441\u0430
+NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 SNMP trap \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u043e\u0432
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0430\u0434\u0440\u0435\u0441\u0430 syslog \u0441\u043e\u043e\u0431\u0449\u0435\u043d\u0438\u0439 \u0434\u043b\u044f \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0435\u043d\u0438\u044f \u0443\u0437\u043b\u043e\u0432
 OpenMappingTables_Error=\u041e\u0448\u0438\u0431\u043a\u0430
 OpenMappingTables_ErrorOpeningView=\u041e\u0448\u0438\u0431\u043a\u0430 \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u044f: 
 OpenNetworkDiscoveryConfig_Error=\u041e\u0448\u0438\u0431\u043a\u0430
@@ -158,7 +159,7 @@ ServerConfigurationEditor_ActionCreate=&\u0421\u043e\u0437\u0434\u0430\u0442\u04
 ServerConfigurationEditor_ActionDelete=&\u0423\u0434\u0430\u043b\u0438\u0442\u044c
 ServerConfigurationEditor_ActionEdit=&\u0420\u0435\u0434\u0430\u043a\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c...
 ServerConfigurationEditor_ColName=\u0418\u043c\u044f \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430
-ServerConfigurationEditor_ColRestart=\u041f\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430
+ServerConfigurationEditor_ColRestart=\u041f\u0435\u0440\u0435\u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0430
 ServerConfigurationEditor_ColValue=\u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435
 ServerConfigurationEditor_CreateJobError=\u041e\u0448\u0438\u0431\u043a\u0430 \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430
 ServerConfigurationEditor_CreateJobName=\u0421\u043e\u0437\u0434\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0444\u0438\u0433\u0443\u0440\u0430\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u0430
index bc89561..711e966 100644 (file)
@@ -140,6 +140,7 @@ NetworkDiscoveryConfigurator_SectionFilterDescr=Discovery filter
 NetworkDiscoveryConfigurator_SectionGeneral=General
 NetworkDiscoveryConfigurator_SectionGeneralDescr=General network discovery settings
 NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery=Use SNMP trap source addresses for discovery
+NetworkDiscoveryConfigurator_UseSyslogForDiscovery=Use syslog source addresses for discovery
 OpenMappingTables_Error=Error
 OpenMappingTables_ErrorOpeningView=Error opening view: 
 OpenNetworkDiscoveryConfig_Error=Error
index b65d4f8..e2c33ce 100644 (file)
@@ -81,6 +81,7 @@ public class NetworkDiscoveryConfigurator extends ViewPart implements ISaveableP
    private Button radioDiscoveryPassive;
    private Button radioDiscoveryActive;
    private Button checkUseSnmpTraps;
+   private Button checkUseSyslog;
    private Button radioFilterOff;
    private Button radioFilterCustom;
    private Button radioFilterAuto;
@@ -244,8 +245,7 @@ public class NetworkDiscoveryConfigurator extends ViewPart implements ISaveableP
             SWT.RADIO);
       radioDiscoveryActive.addSelectionListener(listener);
 
-      checkUseSnmpTraps = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery,
-            SWT.CHECK);
+      checkUseSnmpTraps = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_UseSNMPTrapsForDiscovery, SWT.CHECK);
       checkUseSnmpTraps.addSelectionListener(new SelectionAdapter() {
          @Override
          public void widgetSelected(SelectionEvent e)
@@ -257,6 +257,16 @@ public class NetworkDiscoveryConfigurator extends ViewPart implements ISaveableP
       GridData gd = new GridData();
       gd.verticalIndent = 10;
       checkUseSnmpTraps.setLayoutData(gd);
+
+      checkUseSyslog = toolkit.createButton(clientArea, Messages.get().NetworkDiscoveryConfigurator_UseSyslogForDiscovery, SWT.CHECK);
+      checkUseSyslog.addSelectionListener(new SelectionAdapter() {
+         @Override
+         public void widgetSelected(SelectionEvent e)
+         {
+            config.setUseSyslog(checkUseSyslog.getSelection());
+            setModified();
+         }
+      });
    }
 
    /**
@@ -519,6 +529,7 @@ public class NetworkDiscoveryConfigurator extends ViewPart implements ISaveableP
       radioDiscoveryPassive.setSelection(config.isEnabled() && !config.isActive());
       radioDiscoveryActive.setSelection(config.isEnabled() && config.isActive());
       checkUseSnmpTraps.setSelection(config.isUseSnmpTraps());
+      checkUseSyslog.setSelection(config.isUseSyslog());
 
       if (config.getFilter().equalsIgnoreCase(NetworkDiscovery.FILTER_NONE) || config.getFilter().isEmpty())
       {
index ea3ce73..7f23d53 100644 (file)
@@ -19,7 +19,6 @@ import org.eclipse.jface.viewers.IStructuredSelection;
 import org.eclipse.jface.viewers.SelectionChangedEvent;
 import org.eclipse.jface.window.Window;
 import org.eclipse.swt.SWT;
-import org.eclipse.swt.layout.GridLayout;
 import org.eclipse.swt.widgets.Composite;
 import org.eclipse.swt.widgets.Menu;
 import org.eclipse.ui.IActionBars;
@@ -28,7 +27,6 @@ import org.eclipse.ui.PartInitException;
 import org.eclipse.ui.handlers.IHandlerService;
 import org.eclipse.ui.part.ViewPart;
 import org.netxms.client.NXCSession;
-import org.netxms.client.ScheduledTask;
 import org.netxms.ui.eclipse.actions.RefreshAction;
 import org.netxms.ui.eclipse.console.dialogs.SetEntryEditDialog;
 import org.netxms.ui.eclipse.console.resources.SharedIcons;
@@ -36,7 +34,6 @@ import org.netxms.ui.eclipse.jobs.ConsoleJob;
 import org.netxms.ui.eclipse.serverconfig.Activator;
 import org.netxms.ui.eclipse.shared.ConsoleSharedData;
 import org.netxms.ui.eclipse.tools.ObjectLabelComparator;
-import org.netxms.ui.eclipse.tools.WidgetHelper;
 import org.netxms.ui.eclipse.widgets.SortableTableViewer;
 import org.netxms.ui.eclipse.widgets.helpers.AttributeLabelProvider;
 
index 1d2a2d4..5bf08d8 100644 (file)
@@ -19,6 +19,7 @@ public class DiscoveryConfig
        private boolean enabled;
        private boolean active;
        private boolean useSnmpTraps;
+       private boolean useSyslog;
        private int filterFlags;
        private String filter;
        private List<InetAddressListElement> targets;
@@ -48,6 +49,7 @@ public class DiscoveryConfig
                config.enabled = getBoolean(variables, "RunNetworkDiscovery", false); //$NON-NLS-1$
                config.active = getBoolean(variables, "ActiveNetworkDiscovery", false); //$NON-NLS-1$
                config.useSnmpTraps = getBoolean(variables, "UseSNMPTrapsForDiscovery", false); //$NON-NLS-1$
+      config.useSyslog = getBoolean(variables, "UseSyslogForDiscovery", false); //$NON-NLS-1$
                config.filterFlags = getInteger(variables, "DiscoveryFilterFlags", 0); //$NON-NLS-1$
                config.filter = getString(variables, "DiscoveryFilter", "none"); //$NON-NLS-1$ //$NON-NLS-2$
                
@@ -131,6 +133,7 @@ public class DiscoveryConfig
                session.setServerVariable("RunNetworkDiscovery", enabled ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                session.setServerVariable("ActiveNetworkDiscovery", active ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
       session.setServerVariable("UseSNMPTrapsForDiscovery", useSnmpTraps ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
+      session.setServerVariable("UseSyslogForDiscovery", useSyslog ? "1" : "0"); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$
                session.setServerVariable("DiscoveryFilterFlags", Integer.toString(filterFlags)); //$NON-NLS-1$
                session.setServerVariable("DiscoveryFilter", filter); //$NON-NLS-1$
                
@@ -251,4 +254,20 @@ public class DiscoveryConfig
    {
       this.useSnmpTraps = useSnmpTraps;
    }
+
+   /**
+    * @return the useSyslog
+    */
+   public boolean isUseSyslog()
+   {
+      return useSyslog;
+   }
+
+   /**
+    * @param useSyslog the useSyslog to set
+    */
+   public void setUseSyslog(boolean useSyslog)
+   {
+      this.useSyslog = useSyslog;
+   }
 }