implemented new DCI source "NXSL script"
authorVictor Kirhenshtein <victor@netxms.org>
Tue, 26 Aug 2014 16:18:52 +0000 (19:18 +0300)
committerVictor Kirhenshtein <victor@netxms.org>
Tue, 26 Aug 2014 16:18:52 +0000 (19:18 +0300)
35 files changed:
ChangeLog
include/nxclapi.h
include/nxsl_classes.h
src/client/windows/nxcon/globals.cpp
src/java/netxms-client/src/main/java/org/netxms/client/datacollection/DataCollectionObject.java
src/java/netxms-eclipse/DataCollection/META-INF/MANIFEST.MF
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/Messages.java
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/dialogs/SelectParameterScriptDialog.java [new file with mode: 0644]
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/messages.properties
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/messages_cs.properties
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/messages_es.properties
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/messages_ru.properties
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/messages_zh_CN.properties
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/propertypages/General.java
src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/views/helpers/DciLabelProvider.java
src/libnxsl/vm.cpp
src/server/core/client.cpp
src/server/core/container.cpp
src/server/core/datacoll.cpp
src/server/core/dcobject.cpp
src/server/core/dctarget.cpp
src/server/core/mdconn.cpp
src/server/core/mobile.cpp
src/server/core/node.cpp
src/server/include/nms_objects.h
webui/webapp/DataCollection/META-INF/MANIFEST.MF
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/Messages.java
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/dialogs/SelectParameterScriptDialog.java [new file with mode: 0644]
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/messages.properties
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/messages_cs.properties
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/messages_es.properties
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/messages_ru.properties
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/messages_zh_CN.properties
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/propertypages/General.java
webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/views/helpers/DciLabelProvider.java

index f49622a..22b21de 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,6 +1,13 @@
 *
 * 1.2.17
 *
+
+- New DCI source: NXSL script executed on server
+- Management console:
+    - Can show alarms for multiple selected objects
+    - Fixed non-working ordering in event list in alarm details view
+    - Fixed bug with LDAP user system rights
+    - Added device geolocation tracking and display on map 
 - Android console:
        - Fix bug in notifying connection point not found
        - Fix bug in computing interface expanded list size (removed hardcoded values)
@@ -8,12 +15,7 @@
        - Fix aesthetic problems in expandable list (graphs and interfaces list)
        - Integration of new support library
        - Target to new API version (20)
-- Management console:
-       - Can show alarms for multiple selected objects
-       - Fixed non-working ordering in event list in alarm details view
-    - Fixed bug with LDAP user system rights
-    - Added device geolocation tracking and display on map 
-- Fixed issues: #542, #593, #613, #624
+- Fixed issues: #542, #593, #613, #624, #632
 
 
 *
index 13d4ddc..8f82e05 100644 (file)
@@ -791,6 +791,7 @@ enum
 #define DS_PUSH_AGENT         4
 #define DS_WINPERF            5
 #define DS_SMCLP              6
+#define DS_SCRIPT             7
 
 /**
  * Item status
index 42f0283..6fbfcee 100644 (file)
@@ -594,12 +594,13 @@ public:
        NXSL_Variable *findGlobalVariable(const TCHAR *pszName) { return m_pGlobals->find(pszName); }
 
    bool load(NXSL_Program *program);
-   bool run(ObjectArray<NXSL_Value> *argv, NXSL_VariableSystem *pUserLocals = NULL,
+   bool run(ObjectArray<NXSL_Value> *args, NXSL_VariableSystem *pUserLocals = NULL,
             NXSL_VariableSystem **ppGlobals = NULL, NXSL_VariableSystem *pConstants = NULL,
             const TCHAR *entryPoint = NULL);
-   bool run(UINT32 argc = 0, NXSL_Value **argv = NULL, NXSL_VariableSystem *pUserLocals = NULL,
+   bool run(int argc, NXSL_Value **argv, NXSL_VariableSystem *pUserLocals = NULL,
             NXSL_VariableSystem **ppGlobals = NULL, NXSL_VariableSystem *pConstants = NULL,
             const TCHAR *entryPoint = NULL);
+   bool run() { ObjectArray<NXSL_Value> args(1, 1, false); return run(&args); }
 
    UINT32 getCodeSize() { return m_instructionSet->size(); }
 
index 4e57b55..57ab5e6 100644 (file)
@@ -226,9 +226,9 @@ COLORREF g_statusColorTable[9] =
 // Data collection item texts
 //
 
-TCHAR *g_pszItemOrigin[] = { _T("Internal"), _T("Agent"), _T("SNMP"), _T("CheckPoint"), _T("Push") };
+TCHAR *g_pszItemOrigin[] = { _T("Internal"), _T("Agent"), _T("SNMP"), _T("CheckPoint"), _T("Push"), _T("WinPerf"), _T("iLO"), _T("Script") };
 TCHAR *g_pszItemOriginLong[] = { _T("Internal"), _T("NetXMS Agent"), _T("SNMP Agent"),
-                                 _T("CheckPoint SNMP Agent"), _T("Push Agent") };
+                                 _T("CheckPoint SNMP Agent"), _T("Push Agent"), _T("WinPerf"), _T("iLO"), _T("Script") };
 TCHAR *g_pszItemDataType[] = { _T("Integer"), _T("Unsigned Integer"), _T("Int64"), 
                                _T("Unsigned Int64"), _T("String"), _T("Float") };
 TCHAR *g_pszItemStatus[] = { _T("Active"), _T("Disabled"), _T("Not supported") };
index a16be78..0688744 100644 (file)
@@ -41,6 +41,7 @@ public abstract class DataCollectionObject
        public static final int PUSH = 4;
        public static final int WINPERF = 5;
        public static final int ILO = 6;
+   public static final int SCRIPT = 7;
        
        // data collection object status
        public static final int ACTIVE = 0;
index 271306e..6da5df1 100644 (file)
@@ -2,17 +2,17 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Data Collection Management Plug-in
 Bundle-SymbolicName: org.netxms.ui.eclipse.datacollection;singleton:=true
-Bundle-Version: 1.2.16
+Bundle-Version: 1.2.17
 Bundle-Activator: org.netxms.ui.eclipse.datacollection.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.eclipse.ui;bundle-version="3.7.0",
  org.eclipse.core.runtime;bundle-version="3.7.0",
- org.netxms.ui.eclipse.objectbrowser;bundle-version="1.2.15",
+ org.netxms.ui.eclipse.objectbrowser;bundle-version="1.2.17",
  org.netxms.ui.eclipse.eventmanager;bundle-version="1.2.10",
  org.netxms.ui.eclipse.objectview;bundle-version="1.2.15",
  org.netxms.ui.eclipse.snmp;bundle-version="1.2.12",
  org.netxms.ui.eclipse.nxsl;bundle-version="1.2.15",
- org.netxms.ui.eclipse.console;bundle-version="1.2.16",
+ org.netxms.ui.eclipse.console;bundle-version="1.2.17",
  org.eclipse.core.expressions;bundle-version="3.4.300",
  org.netxms.ui.eclipse.charts;bundle-version="1.2.11",
  org.eclipse.ui.forms;bundle-version="3.5.101"
index e7c70c0..281cb72 100644 (file)
@@ -150,6 +150,7 @@ public class Messages extends NLS
        public static String DciLabelProvider_SourceCPSNMP;
        public static String DciLabelProvider_SourceInternal;
        public static String DciLabelProvider_SourcePush;
+   public static String DciLabelProvider_SourceScript;
        public static String DciLabelProvider_SourceSNMP;
        public static String DciLabelProvider_SourceILO;
        public static String DciLabelProvider_SourceWinPerf;
@@ -244,6 +245,7 @@ public class Messages extends NLS
        public static String General_ProxyNode;
        public static String General_RetentionTime;
        public static String General_SampleCountForAvg;
+   public static String General_Script;
        public static String General_Select;
        public static String General_SMCLP;
        public static String General_SNMP_DT_float;
diff --git a/src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/dialogs/SelectParameterScriptDialog.java b/src/java/netxms-eclipse/DataCollection/src/org/netxms/ui/eclipse/datacollection/dialogs/SelectParameterScriptDialog.java
new file mode 100644 (file)
index 0000000..4edc52c
--- /dev/null
@@ -0,0 +1,73 @@
+/**
+ * NetXMS - open source network management system
+ * Copyright (C) 2003-2014 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.netxms.ui.eclipse.datacollection.dialogs;
+
+import org.eclipse.swt.widgets.Shell;
+import org.netxms.client.datacollection.DataCollectionItem;
+import org.netxms.ui.eclipse.nxsl.dialogs.SelectScriptDialog;
+
+/**
+ * Script selection dialog for use in data collection configuration
+ */
+public class SelectParameterScriptDialog extends SelectScriptDialog implements IParameterSelectionDialog
+{
+   /**
+    * @param parentShell
+    */
+   public SelectParameterScriptDialog(Shell parentShell)
+   {
+      super(parentShell);
+   }
+
+   /* (non-Javadoc)
+    * @see org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog#getParameterName()
+    */
+   @Override
+   public String getParameterName()
+   {
+      return getScript().getName();
+   }
+
+   /* (non-Javadoc)
+    * @see org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog#getParameterDescription()
+    */
+   @Override
+   public String getParameterDescription()
+   {
+      return getScript().getName();
+   }
+
+   /* (non-Javadoc)
+    * @see org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog#getParameterDataType()
+    */
+   @Override
+   public int getParameterDataType()
+   {
+      return DataCollectionItem.DT_STRING;
+   }
+
+   /* (non-Javadoc)
+    * @see org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog#getInstanceColumn()
+    */
+   @Override
+   public String getInstanceColumn()
+   {
+      return null;
+   }
+}
index e65062e..a8b3989 100644 (file)
@@ -144,6 +144,7 @@ DciLabelProvider_SourceCPSNMP=Check Point SNMP
 DciLabelProvider_SourceILO=iLO
 DciLabelProvider_SourceInternal=Internal
 DciLabelProvider_SourcePush=Push
+DciLabelProvider_SourceScript=Script
 DciLabelProvider_SourceSNMP=SNMP
 DciLabelProvider_SourceWinPerf=Windows Performance Counters
 DciLabelProvider_Table=<< TABLE >>
@@ -264,6 +265,9 @@ General_PollingMode=Polling mode
 General_ProxyNode=Proxy node
 General_RetentionTime=Retention time (days)
 General_SampleCountForAvg=Sample count for average value calculation (0 to disable)
+General_Script=Script
+General_Select=&Select...
+General_SMCLP=SM-CLP
 General_SNMP_DT_None=None
 General_SNMP_DT_float=Floating point number
 General_SNMP_DT_int32=32-bit signed integer
@@ -272,8 +276,6 @@ General_SNMP_DT_ipAddr=IP address
 General_SNMP_DT_macAddr=MAC address
 General_SNMP_DT_uint32=32-bit unsigned integer
 General_SNMP_DT_uint64=64-bit unsigned integer
-General_Select=&Select...
-General_SMCLP=SM-CLP
 General_SourceAgent=NetXMS Agent
 General_SourceCPSNMP=Check Point SNMP
 General_SourceInternal=Internal
index 0ab8977..7ca170b 100644 (file)
@@ -145,6 +145,7 @@ DciLabelProvider_SourceILO=iLO
 DciLabelProvider_SourceInternal=Intern\u00ed
 DciLabelProvider_SourcePush=Push
 DciLabelProvider_SourceSNMP=SNMP
+DciLabelProvider_SourceScript=Skript
 DciLabelProvider_SourceWinPerf=Windows Performance Counter
 DciLabelProvider_Table=<<TABULKA>>
 DciLabelProvider_Unknown=<nezn\u00e1m\u00fd>
@@ -201,7 +202,7 @@ EditThresholdDialog_Operation=Operation
 EditThresholdDialog_RepeatEvent=Opakovat ud\u00e1lost
 EditThresholdDialog_RepeatInterval=Interval opakov\u00e1n\u00ed
 EditThresholdDialog_Samples=Vzorky
-EditThresholdDialog_Script=Script
+EditThresholdDialog_Script=Skript
 EditThresholdDialog_Seconds=sekundy
 EditThresholdDialog_Sum=Sou\u010det hodnot
 EditThresholdDialog_Title=Editovat prahov\u00e9 hodnoty
@@ -269,6 +270,7 @@ General_SNMP_DT_macAddr=MAC adresa
 General_SNMP_DT_uint32=32-bit unsigned integer
 General_SNMP_DT_uint64=64-bit unsigned integer
 General_SampleCountForAvg=Po\u010det vzork\u016f pro v\u00fdpo\u010det pr\u016fm\u011brn\u00e9 hodnoty (0 zak\u00e1zan\u00fd)
+General_Script=Skript
 General_Select=&Vybrat
 General_SourceAgent=NetXMSagent
 General_SourceCPSNMP=SNMP kontroln\u00ed bod
index 355b920..9f54ac2 100644 (file)
@@ -145,6 +145,7 @@ DciLabelProvider_SourceILO=iLO
 DciLabelProvider_SourceInternal=Interno
 DciLabelProvider_SourcePush=Enviar
 DciLabelProvider_SourceSNMP=SNMP
+DciLabelProvider_SourceScript=Script
 DciLabelProvider_SourceWinPerf=Windows Performance Counters
 DciLabelProvider_Table=<< TABLA >>
 DciLabelProvider_Unknown=<desconocido>
@@ -269,6 +270,7 @@ General_SNMP_DT_macAddr=Direcci\u00f3n MAC
 General_SNMP_DT_uint32=Entero sin signo de 32 bits
 General_SNMP_DT_uint64=Entero sin signo de 64 bits
 General_SampleCountForAvg=Sample count for average value calculation (0 to disable)
+General_Script=Script
 General_Select=&Seleccionar\u2026
 General_SourceAgent=Agente NetXMS
 General_SourceCPSNMP=Comprobaci\u00f3n SNMP
index 980c5a3..3d50476 100644 (file)
@@ -145,6 +145,7 @@ DciLabelProvider_SourceILO=iLO
 DciLabelProvider_SourceInternal=\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439
 DciLabelProvider_SourcePush=Push \u0430\u0433\u0435\u043d\u0442
 DciLabelProvider_SourceSNMP=SNMP
+DciLabelProvider_SourceScript=\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439
 DciLabelProvider_SourceWinPerf=\u0421\u0447\u0435\u0442\u0447\u0438\u043a\u0438 Windows
 DciLabelProvider_Table=<< \u0422\u0410\u0411\u041b\u0418\u0426\u0410 >>
 DciLabelProvider_Unknown=<\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e>
@@ -269,6 +270,7 @@ General_SNMP_DT_macAddr=MAC \u0430\u0434\u0440\u0435\u0441
 General_SNMP_DT_uint32=32-\u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e
 General_SNMP_DT_uint64=64-\u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e
 General_SampleCountForAvg=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (0 \u0434\u043b\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f)
+General_Script=\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439
 General_Select=&\u0412\u044b\u0431\u0440\u0430\u0442\u044c...
 General_SourceAgent=\u0410\u0433\u0435\u043d\u0442 NetXMS
 General_SourceCPSNMP=Check Point SNMP
index fa20b11..7203795 100644 (file)
@@ -145,6 +145,7 @@ DciLabelProvider_SourceILO=iLO
 DciLabelProvider_SourceInternal=Internal
 DciLabelProvider_SourcePush=Push
 DciLabelProvider_SourceSNMP=SNMP
+DciLabelProvider_SourceScript=Script
 DciLabelProvider_SourceWinPerf=Windows Performance Counters
 DciLabelProvider_Table=<< TABLE >>
 DciLabelProvider_Unknown=<unknown>
@@ -269,6 +270,7 @@ General_SNMP_DT_macAddr=MAC address
 General_SNMP_DT_uint32=32-bit unsigned integer
 General_SNMP_DT_uint64=64-bit unsigned integer
 General_SampleCountForAvg=Sample count for average value calculation (0 to disable)
+General_Script=Script
 General_Select=&Select...
 General_SourceAgent=NetXMS Agent
 General_SourceCPSNMP=Check Point SNMP
index 1311633..cfe9191 100644 (file)
@@ -50,6 +50,7 @@ import org.netxms.ui.eclipse.datacollection.api.DataCollectionObjectEditor;
 import org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog;
 import org.netxms.ui.eclipse.datacollection.dialogs.SelectAgentParamDlg;
 import org.netxms.ui.eclipse.datacollection.dialogs.SelectInternalParamDlg;
+import org.netxms.ui.eclipse.datacollection.dialogs.SelectParameterScriptDialog;
 import org.netxms.ui.eclipse.datacollection.dialogs.SelectSnmpParamDlg;
 import org.netxms.ui.eclipse.datacollection.dialogs.WinPerfCounterSelectionDialog;
 import org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector;
@@ -188,6 +189,7 @@ public class General extends PropertyPage
       origin.add(Messages.get().General_SourcePush);
       origin.add(Messages.get().General_WinPerf);
       origin.add(Messages.get().General_SMCLP);
+      origin.add(Messages.get().General_Script);
       origin.select(dci.getOrigin());
       origin.addSelectionListener(new SelectionListener() {
                        @Override
@@ -464,6 +466,9 @@ public class General extends PropertyPage
                        case DataCollectionItem.WINPERF:
                                dlg = new WinPerfCounterSelectionDialog(getShell(), dci.getNodeId());
                                break;
+         case DataCollectionItem.SCRIPT:
+            dlg = new SelectParameterScriptDialog(getShell());
+            break;
                        default:
                                dlg = null;
                                break;
index 483d0d8..77ae4ed 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * NetXMS - open source network management system
- * Copyright (C) 2003-2012 Victor Kirhenshtein
+ * Copyright (C) 2003-2014 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
@@ -62,6 +62,7 @@ public class DciLabelProvider implements ITableLabelProvider
                originTexts.put(DataCollectionItem.PUSH, Messages.get().DciLabelProvider_SourcePush);
                originTexts.put(DataCollectionItem.WINPERF, Messages.get().DciLabelProvider_SourceWinPerf);
                originTexts.put(DataCollectionItem.ILO, Messages.get().DciLabelProvider_SourceILO);
+      originTexts.put(DataCollectionItem.SCRIPT, Messages.get().DciLabelProvider_SourceScript);
                
                statusTexts.put(DataCollectionItem.ACTIVE, Messages.get().DciLabelProvider_Active);
                statusTexts.put(DataCollectionItem.DISABLED, Messages.get().DciLabelProvider_Disabled);
index 171a132..d50b5dd 100644 (file)
@@ -214,11 +214,13 @@ bool NXSL_VM::load(NXSL_Program *program)
  * Run program
  * Returns true on success and false on error
  */
-bool NXSL_VM::run(UINT32 argc, NXSL_Value **argv,
+bool NXSL_VM::run(int argc, NXSL_Value **argv,
                   NXSL_VariableSystem *pUserLocals, NXSL_VariableSystem **ppGlobals,
                   NXSL_VariableSystem *pConstants, const TCHAR *entryPoint)
 {
    ObjectArray<NXSL_Value> args(argc, 8, false);
+   for(int i = 0; i < argc; i++)
+      args.add(argv[i]);
    return run(&args, pUserLocals, ppGlobals, pConstants, entryPoint);
 }
 
@@ -226,7 +228,7 @@ bool NXSL_VM::run(UINT32 argc, NXSL_Value **argv,
  * Run program
  * Returns true on success and false on error
  */
-bool NXSL_VM::run(ObjectArray<NXSL_Value> *argv,
+bool NXSL_VM::run(ObjectArray<NXSL_Value> *args,
                   NXSL_VariableSystem *pUserLocals, NXSL_VariableSystem **ppGlobals,
                   NXSL_VariableSystem *pConstants, const TCHAR *entryPoint)
 {
@@ -246,10 +248,10 @@ bool NXSL_VM::run(ObjectArray<NXSL_Value> *argv,
 
    // Create local variable system for main() and bind arguments
    m_pLocals = (pUserLocals == NULL) ? new NXSL_VariableSystem : pUserLocals;
-   for(int i = 0; i < argv->size(); i++)
+   for(int i = 0; i < args->size(); i++)
    {
       _sntprintf(szBuffer, 32, _T("$%d"), i + 1);
-      m_pLocals->create(szBuffer, argv->get(i));
+      m_pLocals->create(szBuffer, args->get(i));
    }
 
    // Preserve original global variables and constants
index 8762553..8a6680b 100644 (file)
@@ -214,7 +214,7 @@ THREAD_RESULT THREAD_CALL ClientListenerIPv6(void *arg)
    // Create socket
    if ((sock = socket(AF_INET6, SOCK_STREAM, 0)) == INVALID_SOCKET)
    {
-      nxlog_write(MSG_SOCKET_FAILED, EVENTLOG_ERROR_TYPE, "s", _T("ClientListener"));
+      nxlog_write(MSG_SOCKET_FAILED, EVENTLOG_ERROR_TYPE, "s", _T("ClientListenerIPv6"));
       return THREAD_OK;
    }
 
@@ -230,7 +230,7 @@ THREAD_RESULT THREAD_CALL ClientListenerIPv6(void *arg)
    // Bind socket
    if (bind(sock, (struct sockaddr *)&servAddr, sizeof(struct sockaddr_in6)) != 0)
    {
-      nxlog_write(MSG_BIND_ERROR, EVENTLOG_ERROR_TYPE, "dse", wListenPort, _T("ClientListener"), WSAGetLastError());
+      nxlog_write(MSG_BIND_ERROR, EVENTLOG_ERROR_TYPE, "dse", wListenPort, _T("ClientListenerIPv6"), WSAGetLastError());
       closesocket(sock);
       /* TODO: we should initiate shutdown procedure here */
       return THREAD_OK;
index c25ddb5..ba530a5 100644 (file)
@@ -336,7 +336,7 @@ bool Container::isSuitableForNode(Node *node)
        if ((m_flags & CF_AUTO_BIND) && (m_bindFilter != NULL))
        {
                m_bindFilter->setGlobalVariable(_T("$node"), new NXSL_Value(new NXSL_Object(&g_nxslNodeClass, node)));
-               if (m_bindFilter->run(0, NULL))
+               if (m_bindFilter->run())
                {
        NXSL_Value *value = m_bindFilter->getResult();
                        result = ((value != NULL) && (value->getValueAsInt32() != 0));
index d05cc93..7adc696 100644 (file)
@@ -113,6 +113,9 @@ static void *GetItemData(DataCollectionTarget *dcTarget, DCItem *pItem, TCHAR *p
                *error = DCE_NOT_SUPPORTED;
             }
             break;
+         case DS_SCRIPT:
+            *error = dcTarget->getScriptItem(pItem->getName(), MAX_LINE_SIZE, pBuffer);
+            break;
                   default:
                           *error = DCE_NOT_SUPPORTED;
                           break;
index e400228..4890e3d 100644 (file)
@@ -422,10 +422,8 @@ void DCObject::setStatus(int status, bool generateEvent)
        if (generateEvent && (m_pNode != NULL) && (m_status != (BYTE)status) && IsEventSource(m_pNode->Type()))
        {
                static UINT32 eventCode[3] = { EVENT_DCI_ACTIVE, EVENT_DCI_DISABLED, EVENT_DCI_UNSUPPORTED };
-               static const TCHAR *originName[7] = { _T("Internal"), _T("NetXMS Agent"), _T("SNMP"), _T("CheckPoint SNMP"), _T("Push"), _T("WinPerf"), _T("iLO") };
-
-               PostEvent(eventCode[status], m_pNode->Id(), "dssds", m_dwId, m_szName, m_szDescription,
-                         m_source, originName[m_source]);
+               static const TCHAR *originName[8] = { _T("Internal"), _T("NetXMS Agent"), _T("SNMP"), _T("CheckPoint SNMP"), _T("Push"), _T("WinPerf"), _T("iLO"), _T("Script") };
+               PostEvent(eventCode[status], m_pNode->Id(), "dssds", m_dwId, m_szName, m_szDescription, m_source, originName[m_source]);
        }
        m_status = (BYTE)status;
 }
index 5e58a23..06fba49 100644 (file)
@@ -409,25 +409,25 @@ void DataCollectionTarget::queueItemsForPolling(Queue *pPollerQueue)
 /**
  * Get value for server's internal parameter
  */
-UINT32 DataCollectionTarget::getInternalItem(const TCHAR *szParam, UINT32 dwBufSize, TCHAR *szBuffer)
+UINT32 DataCollectionTarget::getInternalItem(const TCHAR *param, size_t bufSize, TCHAR *buffer)
 {
    UINT32 dwError = DCE_SUCCESS;
 
-   if (!_tcsicmp(szParam, _T("Status")))
+   if (!_tcsicmp(param, _T("Status")))
    {
-      _sntprintf(szBuffer, dwBufSize, _T("%d"), m_iStatus);
+      _sntprintf(buffer, bufSize, _T("%d"), m_iStatus);
    }
-   else if (!_tcsicmp(szParam, _T("Dummy")))
+   else if (!_tcsicmp(param, _T("Dummy")))
    {
-      _tcscpy(szBuffer, _T("0"));
+      _tcscpy(buffer, _T("0"));
    }
-   else if (MatchString(_T("ChildStatus(*)"), szParam, FALSE))
+   else if (MatchString(_T("ChildStatus(*)"), param, FALSE))
    {
       TCHAR *pEnd, szArg[256];
       UINT32 i, dwId;
       NetObj *pObject = NULL;
 
-      AgentGetParameterArg(szParam, 1, szArg, 256);
+      AgentGetParameterArg(param, 1, szArg, 256);
       dwId = _tcstoul(szArg, &pEnd, 0);
       if (*pEnd != 0)
       {
@@ -450,20 +450,20 @@ UINT32 DataCollectionTarget::getInternalItem(const TCHAR *szParam, UINT32 dwBufS
 
       if (pObject != NULL)
       {
-         _sntprintf(szBuffer, dwBufSize, _T("%d"), pObject->Status());
+         _sntprintf(buffer, bufSize, _T("%d"), pObject->Status());
       }
       else
       {
          dwError = DCE_NOT_SUPPORTED;
       }
    }
-   else if (MatchString(_T("ConditionStatus(*)"), szParam, FALSE))
+   else if (MatchString(_T("ConditionStatus(*)"), param, FALSE))
    {
       TCHAR *pEnd, szArg[256];
       UINT32 dwId;
       NetObj *pObject = NULL;
 
-      AgentGetParameterArg(szParam, 1, szArg, 256);
+      AgentGetParameterArg(param, 1, szArg, 256);
       dwId = _tcstoul(szArg, &pEnd, 0);
       if (*pEnd == 0)
                {
@@ -482,7 +482,7 @@ UINT32 DataCollectionTarget::getInternalItem(const TCHAR *szParam, UINT32 dwBufS
       {
                        if (pObject->isTrustedNode(m_dwId))
                        {
-                               _sntprintf(szBuffer, dwBufSize, _T("%d"), pObject->Status());
+                               _sntprintf(buffer, bufSize, _T("%d"), pObject->Status());
                        }
                        else
                        {
@@ -503,6 +503,72 @@ UINT32 DataCollectionTarget::getInternalItem(const TCHAR *szParam, UINT32 dwBufS
 }
 
 /**
+ * Get parameter value from NXSL script
+ */
+UINT32 DataCollectionTarget::getScriptItem(const TCHAR *param, size_t bufSize, TCHAR *buffer)
+{
+   TCHAR name[256];
+   nx_strncpy(name, param, 256);
+   Trim(name);
+
+   ObjectArray<NXSL_Value> args(16, 16, false);
+
+   // Can be in form parameter(arg1, arg2, ... argN)
+   TCHAR *p = _tcschr(name, _T('('));
+   if (p != NULL)
+   {
+      if (name[_tcslen(name) - 1] != _T(')'))
+         return DCE_NOT_SUPPORTED;
+      name[_tcslen(name) - 1] = 0;
+
+      *p = 0;
+      p++;
+      
+      TCHAR *s;
+      do
+      {
+         s = _tcschr(p, _T(','));
+         if (s != NULL)
+            *s = 0;
+         Trim(p);
+         args.add(new NXSL_Value(p));
+         p = s + 1;
+      } while(s != NULL);
+   }
+
+   UINT32 rc = DCE_NOT_SUPPORTED;
+   NXSL_VM *vm = g_pScriptLibrary->createVM(name, new NXSL_ServerEnv);
+   if (vm != NULL)
+   {
+      vm->setGlobalVariable(_T("$object"), new NXSL_Value(new NXSL_Object(&g_nxslNetObjClass, this)));
+      if (Type() == OBJECT_NODE)
+      {
+         vm->setGlobalVariable(_T("$node"), new NXSL_Value(new NXSL_Object(&g_nxslNodeClass, this)));
+      }
+      vm->setGlobalVariable(_T("$isCluster"), new NXSL_Value((Type() == OBJECT_CLUSTER) ? 1 : 0));
+      if (vm->run(&args))
+      {
+         NXSL_Value *value = vm->getResult();
+         nx_strncpy(buffer, value->getValueAsCString(), bufSize);
+         rc = DCE_SUCCESS;
+      }
+      else
+      {
+                       DbgPrintf(4, _T("DataCollectionTarget(%s)->getScriptItem(%s): Script execution error: %s"), m_szName, param, vm->getErrorText());
+                       PostEvent(EVENT_SCRIPT_ERROR, g_dwMgmtNode, "ssd", name, vm->getErrorText(), m_dwId);
+         rc = DCE_COMM_ERROR;
+      }
+      delete vm;
+   }
+   else
+   {
+      args.setOwner(true);
+   }
+   DbgPrintf(7, _T("DataCollectionTarget(%s)->getScriptItem(%s): rc=%d"), m_szName, param, rc);
+   return rc;
+}
+
+/**
  * Get last (current) DCI values for summary table.
  */
 void DataCollectionTarget::getLastValuesSummary(SummaryTable *tableDefinition, Table *tableData)
index d7124d2..32e6ed4 100644 (file)
@@ -178,7 +178,7 @@ THREAD_RESULT THREAD_CALL MobileDeviceListenerIPv6(void *arg)
    // Create socket
    if ((sock = socket(AF_INET6, SOCK_STREAM, 0)) == INVALID_SOCKET)
    {
-      nxlog_write(MSG_SOCKET_FAILED, EVENTLOG_ERROR_TYPE, "s", _T("MobileDeviceListener"));
+      nxlog_write(MSG_SOCKET_FAILED, EVENTLOG_ERROR_TYPE, "s", _T("MobileDeviceListenerIPv6"));
       return THREAD_OK;
    }
 
@@ -194,7 +194,7 @@ THREAD_RESULT THREAD_CALL MobileDeviceListenerIPv6(void *arg)
    // Bind socket
    if (bind(sock, (struct sockaddr *)&servAddr, sizeof(struct sockaddr_in6)) != 0)
    {
-      nxlog_write(MSG_BIND_ERROR, EVENTLOG_ERROR_TYPE, "dse", wListenPort, _T("MobileDeviceListener"), WSAGetLastError());
+      nxlog_write(MSG_BIND_ERROR, EVENTLOG_ERROR_TYPE, "dse", wListenPort, _T("MobileDeviceListenerIPv6"), WSAGetLastError());
       closesocket(sock);
       /* TODO: we should initiate shutdown procedure here */
       return THREAD_OK;
index 8d74ff3..f96556f 100644 (file)
@@ -271,7 +271,7 @@ void MobileDevice::updateStatus(CSCPMessage *msg)
 /**
  * Get value for server's internal parameter
  */
-UINT32 MobileDevice::getInternalItem(const TCHAR *param, UINT32 bufSize, TCHAR *buffer)
+UINT32 MobileDevice::getInternalItem(const TCHAR *param, size_t bufSize, TCHAR *buffer)
 {
        UINT32 rc = DataCollectionTarget::getInternalItem(param, bufSize, buffer);
        if (rc == DCE_SUCCESS)
index 5b19d12..9d8e404 100644 (file)
@@ -3103,7 +3103,7 @@ BOOL Node::connectToAgent(UINT32 *error, UINT32 *socketError)
 /**
  * Get DCI value via SNMP
  */
-UINT32 Node::getItemFromSNMP(WORD port, const TCHAR *szParam, UINT32 dwBufSize, TCHAR *szBuffer, int interpretRawValue)
+UINT32 Node::getItemFromSNMP(WORD port, const TCHAR *param, size_t bufSize, TCHAR *buffer, int interpretRawValue)
 {
    UINT32 dwResult;
 
@@ -3122,40 +3122,40 @@ UINT32 Node::getItemFromSNMP(WORD port, const TCHAR *szParam, UINT32 dwBufSize,
                {
                        if (interpretRawValue == SNMP_RAWTYPE_NONE)
                        {
-                               dwResult = SnmpGet(m_snmpVersion, pTransport, szParam, NULL, 0, szBuffer, dwBufSize * sizeof(TCHAR), SG_PSTRING_RESULT);
+                               dwResult = SnmpGet(m_snmpVersion, pTransport, param, NULL, 0, buffer, bufSize * sizeof(TCHAR), SG_PSTRING_RESULT);
                        }
                        else
                        {
                                BYTE rawValue[1024];
                                memset(rawValue, 0, 1024);
-                               dwResult = SnmpGet(m_snmpVersion, pTransport, szParam, NULL, 0, rawValue, 1024, SG_RAW_RESULT);
+                               dwResult = SnmpGet(m_snmpVersion, pTransport, param, NULL, 0, rawValue, 1024, SG_RAW_RESULT);
                                if (dwResult == SNMP_ERR_SUCCESS)
                                {
                                        switch(interpretRawValue)
                                        {
                                                case SNMP_RAWTYPE_INT32:
-                                                       _sntprintf(szBuffer, dwBufSize, _T("%d"), ntohl(*((LONG *)rawValue)));
+                                                       _sntprintf(buffer, bufSize, _T("%d"), ntohl(*((LONG *)rawValue)));
                                                        break;
                                                case SNMP_RAWTYPE_UINT32:
-                                                       _sntprintf(szBuffer, dwBufSize, _T("%u"), ntohl(*((UINT32 *)rawValue)));
+                                                       _sntprintf(buffer, bufSize, _T("%u"), ntohl(*((UINT32 *)rawValue)));
                                                        break;
                                                case SNMP_RAWTYPE_INT64:
-                                                       _sntprintf(szBuffer, dwBufSize, INT64_FMT, (INT64)ntohq(*((INT64 *)rawValue)));
+                                                       _sntprintf(buffer, bufSize, INT64_FMT, (INT64)ntohq(*((INT64 *)rawValue)));
                                                        break;
                                                case SNMP_RAWTYPE_UINT64:
-                                                       _sntprintf(szBuffer, dwBufSize, UINT64_FMT, ntohq(*((QWORD *)rawValue)));
+                                                       _sntprintf(buffer, bufSize, UINT64_FMT, ntohq(*((QWORD *)rawValue)));
                                                        break;
                                                case SNMP_RAWTYPE_DOUBLE:
-                                                       _sntprintf(szBuffer, dwBufSize, _T("%f"), ntohd(*((double *)rawValue)));
+                                                       _sntprintf(buffer, bufSize, _T("%f"), ntohd(*((double *)rawValue)));
                                                        break;
                                                case SNMP_RAWTYPE_IP_ADDR:
-                                                       IpToStr(ntohl(*((UINT32 *)rawValue)), szBuffer);
+                                                       IpToStr(ntohl(*((UINT32 *)rawValue)), buffer);
                                                        break;
                                                case SNMP_RAWTYPE_MAC_ADDR:
-                                                       MACToStr(rawValue, szBuffer);
+                                                       MACToStr(rawValue, buffer);
                                                        break;
                                                default:
-                                                       szBuffer[0] = 0;
+                                                       buffer[0] = 0;
                                                        break;
                                        }
                                }
@@ -3167,7 +3167,7 @@ UINT32 Node::getItemFromSNMP(WORD port, const TCHAR *szParam, UINT32 dwBufSize,
                        dwResult = SNMP_ERR_COMM;
                }
    }
-   DbgPrintf(7, _T("Node(%s)->GetItemFromSNMP(%s): dwResult=%d"), m_szName, szParam, dwResult);
+   DbgPrintf(7, _T("Node(%s)->GetItemFromSNMP(%s): dwResult=%d"), m_szName, param, dwResult);
    return (dwResult == SNMP_ERR_SUCCESS) ? DCE_SUCCESS :
       ((dwResult == SNMP_ERR_NO_OBJECT) ? DCE_NOT_SUPPORTED : DCE_COMM_ERROR);
 }
@@ -3611,7 +3611,7 @@ end_loop:
 /**
  * Get value for server's internal parameter
  */
-UINT32 Node::getInternalItem(const TCHAR *param, UINT32 bufSize, TCHAR *buffer)
+UINT32 Node::getInternalItem(const TCHAR *param, size_t bufSize, TCHAR *buffer)
 {
        UINT32 rc = DataCollectionTarget::getInternalItem(param, bufSize, buffer);
        if (rc == DCE_SUCCESS)
index 914fd9e..77ad4f5 100644 (file)
@@ -788,7 +788,8 @@ public:
        virtual void CreateMessage(CSCPMessage *pMsg);
    virtual UINT32 ModifyFromMessage(CSCPMessage *pRequest, BOOL bAlreadyLocked = FALSE);
 
-   virtual UINT32 getInternalItem(const TCHAR *szParam, UINT32 dwBufSize, TCHAR *szBuffer);
+   virtual UINT32 getInternalItem(const TCHAR *param, size_t bufSize, TCHAR *buffer);
+   virtual UINT32 getScriptItem(const TCHAR *param, size_t bufSize, TCHAR *buffer);
 
    UINT32 getTableLastValues(UINT32 dciId, CSCPMessage *msg);
        UINT32 getThresholdSummary(CSCPMessage *msg, UINT32 baseId);
@@ -842,7 +843,7 @@ public:
 
        const TCHAR *getDeviceId() { return CHECK_NULL_EX(m_deviceId); }
 
-       virtual UINT32 getInternalItem(const TCHAR *szParam, UINT32 dwBufSize, TCHAR *szBuffer);
+       virtual UINT32 getInternalItem(const TCHAR *param, size_t bufSize, TCHAR *buffer);
 };
 
 /**
@@ -1182,8 +1183,9 @@ public:
 
    bool connectToSMCLP();
 
-       virtual UINT32 getInternalItem(const TCHAR *szParam, UINT32 dwBufSize, TCHAR *szBuffer);
-   UINT32 getItemFromSNMP(WORD port, const TCHAR *szParam, UINT32 dwBufSize, TCHAR *szBuffer, int interpretRawValue);
+       virtual UINT32 getInternalItem(const TCHAR *param, size_t bufSize, TCHAR *buffer);
+
+   UINT32 getItemFromSNMP(WORD port, const TCHAR *param, size_t bufSize, TCHAR *buffer, int interpretRawValue);
        UINT32 getTableFromSNMP(WORD port, const TCHAR *oid, ObjectArray<DCTableColumn> *columns, Table **table);
    UINT32 getListFromSNMP(WORD port, const TCHAR *oid, StringList **list);
    UINT32 getOIDSuffixListFromSNMP(WORD port, const TCHAR *oid, StringList **list);
index c76dc21..b88223d 100644 (file)
@@ -2,7 +2,7 @@ Manifest-Version: 1.0
 Bundle-ManifestVersion: 2
 Bundle-Name: Data Collection Management Plug-in
 Bundle-SymbolicName: org.netxms.ui.eclipse.datacollection;singleton:=true
-Bundle-Version: 1.2.16
+Bundle-Version: 1.2.17
 Bundle-Activator: org.netxms.ui.eclipse.datacollection.Activator
 Bundle-Vendor: netxms.org
 Require-Bundle: org.netxms.ui.eclipse.objectbrowser;bundle-version="1.2.15",
index 8727b0a..69c4731 100644 (file)
@@ -153,6 +153,7 @@ public class Messages extends NLS
        public String DciLabelProvider_SourceCPSNMP;
        public String DciLabelProvider_SourceInternal;
        public String DciLabelProvider_SourcePush;
+   public String DciLabelProvider_SourceScript;
        public String DciLabelProvider_SourceSNMP;
        public String DciLabelProvider_SourceILO;
        public String DciLabelProvider_SourceWinPerf;
@@ -247,6 +248,7 @@ public class Messages extends NLS
        public String General_ProxyNode;
        public String General_RetentionTime;
        public String General_SampleCountForAvg;
+   public String General_Script;
        public String General_Select;
        public String General_SMCLP;
        public String General_SNMP_DT_float;
diff --git a/webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/dialogs/SelectParameterScriptDialog.java b/webui/webapp/DataCollection/src/org/netxms/ui/eclipse/datacollection/dialogs/SelectParameterScriptDialog.java
new file mode 100644 (file)
index 0000000..4edc52c
--- /dev/null
@@ -0,0 +1,73 @@
+/**
+ * NetXMS - open source network management system
+ * Copyright (C) 2003-2014 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
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program; if not, write to the Free Software
+ * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+ */
+package org.netxms.ui.eclipse.datacollection.dialogs;
+
+import org.eclipse.swt.widgets.Shell;
+import org.netxms.client.datacollection.DataCollectionItem;
+import org.netxms.ui.eclipse.nxsl.dialogs.SelectScriptDialog;
+
+/**
+ * Script selection dialog for use in data collection configuration
+ */
+public class SelectParameterScriptDialog extends SelectScriptDialog implements IParameterSelectionDialog
+{
+   /**
+    * @param parentShell
+    */
+   public SelectParameterScriptDialog(Shell parentShell)
+   {
+      super(parentShell);
+   }
+
+   /* (non-Javadoc)
+    * @see org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog#getParameterName()
+    */
+   @Override
+   public String getParameterName()
+   {
+      return getScript().getName();
+   }
+
+   /* (non-Javadoc)
+    * @see org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog#getParameterDescription()
+    */
+   @Override
+   public String getParameterDescription()
+   {
+      return getScript().getName();
+   }
+
+   /* (non-Javadoc)
+    * @see org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog#getParameterDataType()
+    */
+   @Override
+   public int getParameterDataType()
+   {
+      return DataCollectionItem.DT_STRING;
+   }
+
+   /* (non-Javadoc)
+    * @see org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog#getInstanceColumn()
+    */
+   @Override
+   public String getInstanceColumn()
+   {
+      return null;
+   }
+}
index e65062e..a8b3989 100644 (file)
@@ -144,6 +144,7 @@ DciLabelProvider_SourceCPSNMP=Check Point SNMP
 DciLabelProvider_SourceILO=iLO
 DciLabelProvider_SourceInternal=Internal
 DciLabelProvider_SourcePush=Push
+DciLabelProvider_SourceScript=Script
 DciLabelProvider_SourceSNMP=SNMP
 DciLabelProvider_SourceWinPerf=Windows Performance Counters
 DciLabelProvider_Table=<< TABLE >>
@@ -264,6 +265,9 @@ General_PollingMode=Polling mode
 General_ProxyNode=Proxy node
 General_RetentionTime=Retention time (days)
 General_SampleCountForAvg=Sample count for average value calculation (0 to disable)
+General_Script=Script
+General_Select=&Select...
+General_SMCLP=SM-CLP
 General_SNMP_DT_None=None
 General_SNMP_DT_float=Floating point number
 General_SNMP_DT_int32=32-bit signed integer
@@ -272,8 +276,6 @@ General_SNMP_DT_ipAddr=IP address
 General_SNMP_DT_macAddr=MAC address
 General_SNMP_DT_uint32=32-bit unsigned integer
 General_SNMP_DT_uint64=64-bit unsigned integer
-General_Select=&Select...
-General_SMCLP=SM-CLP
 General_SourceAgent=NetXMS Agent
 General_SourceCPSNMP=Check Point SNMP
 General_SourceInternal=Internal
index 0ab8977..7ca170b 100644 (file)
@@ -145,6 +145,7 @@ DciLabelProvider_SourceILO=iLO
 DciLabelProvider_SourceInternal=Intern\u00ed
 DciLabelProvider_SourcePush=Push
 DciLabelProvider_SourceSNMP=SNMP
+DciLabelProvider_SourceScript=Skript
 DciLabelProvider_SourceWinPerf=Windows Performance Counter
 DciLabelProvider_Table=<<TABULKA>>
 DciLabelProvider_Unknown=<nezn\u00e1m\u00fd>
@@ -201,7 +202,7 @@ EditThresholdDialog_Operation=Operation
 EditThresholdDialog_RepeatEvent=Opakovat ud\u00e1lost
 EditThresholdDialog_RepeatInterval=Interval opakov\u00e1n\u00ed
 EditThresholdDialog_Samples=Vzorky
-EditThresholdDialog_Script=Script
+EditThresholdDialog_Script=Skript
 EditThresholdDialog_Seconds=sekundy
 EditThresholdDialog_Sum=Sou\u010det hodnot
 EditThresholdDialog_Title=Editovat prahov\u00e9 hodnoty
@@ -269,6 +270,7 @@ General_SNMP_DT_macAddr=MAC adresa
 General_SNMP_DT_uint32=32-bit unsigned integer
 General_SNMP_DT_uint64=64-bit unsigned integer
 General_SampleCountForAvg=Po\u010det vzork\u016f pro v\u00fdpo\u010det pr\u016fm\u011brn\u00e9 hodnoty (0 zak\u00e1zan\u00fd)
+General_Script=Skript
 General_Select=&Vybrat
 General_SourceAgent=NetXMSagent
 General_SourceCPSNMP=SNMP kontroln\u00ed bod
index 355b920..9f54ac2 100644 (file)
@@ -145,6 +145,7 @@ DciLabelProvider_SourceILO=iLO
 DciLabelProvider_SourceInternal=Interno
 DciLabelProvider_SourcePush=Enviar
 DciLabelProvider_SourceSNMP=SNMP
+DciLabelProvider_SourceScript=Script
 DciLabelProvider_SourceWinPerf=Windows Performance Counters
 DciLabelProvider_Table=<< TABLA >>
 DciLabelProvider_Unknown=<desconocido>
@@ -269,6 +270,7 @@ General_SNMP_DT_macAddr=Direcci\u00f3n MAC
 General_SNMP_DT_uint32=Entero sin signo de 32 bits
 General_SNMP_DT_uint64=Entero sin signo de 64 bits
 General_SampleCountForAvg=Sample count for average value calculation (0 to disable)
+General_Script=Script
 General_Select=&Seleccionar\u2026
 General_SourceAgent=Agente NetXMS
 General_SourceCPSNMP=Comprobaci\u00f3n SNMP
index 980c5a3..3d50476 100644 (file)
@@ -145,6 +145,7 @@ DciLabelProvider_SourceILO=iLO
 DciLabelProvider_SourceInternal=\u0412\u043d\u0443\u0442\u0440\u0435\u043d\u043d\u0438\u0439
 DciLabelProvider_SourcePush=Push \u0430\u0433\u0435\u043d\u0442
 DciLabelProvider_SourceSNMP=SNMP
+DciLabelProvider_SourceScript=\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439
 DciLabelProvider_SourceWinPerf=\u0421\u0447\u0435\u0442\u0447\u0438\u043a\u0438 Windows
 DciLabelProvider_Table=<< \u0422\u0410\u0411\u041b\u0418\u0426\u0410 >>
 DciLabelProvider_Unknown=<\u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e>
@@ -269,6 +270,7 @@ General_SNMP_DT_macAddr=MAC \u0430\u0434\u0440\u0435\u0441
 General_SNMP_DT_uint32=32-\u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e
 General_SNMP_DT_uint64=64-\u0431\u0438\u0442\u043e\u0432\u043e\u0435 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u043e\u0435 \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e
 General_SampleCountForAvg=\u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0437\u0430\u043c\u0435\u0440\u043e\u0432 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0443\u0441\u0440\u0435\u0434\u043d\u0435\u043d\u043d\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f (0 \u0434\u043b\u044f \u043e\u0442\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f)
+General_Script=\u0421\u0446\u0435\u043d\u0430\u0440\u0438\u0439
 General_Select=&\u0412\u044b\u0431\u0440\u0430\u0442\u044c...
 General_SourceAgent=\u0410\u0433\u0435\u043d\u0442 NetXMS
 General_SourceCPSNMP=Check Point SNMP
index fa20b11..7203795 100644 (file)
@@ -145,6 +145,7 @@ DciLabelProvider_SourceILO=iLO
 DciLabelProvider_SourceInternal=Internal
 DciLabelProvider_SourcePush=Push
 DciLabelProvider_SourceSNMP=SNMP
+DciLabelProvider_SourceScript=Script
 DciLabelProvider_SourceWinPerf=Windows Performance Counters
 DciLabelProvider_Table=<< TABLE >>
 DciLabelProvider_Unknown=<unknown>
@@ -269,6 +270,7 @@ General_SNMP_DT_macAddr=MAC address
 General_SNMP_DT_uint32=32-bit unsigned integer
 General_SNMP_DT_uint64=64-bit unsigned integer
 General_SampleCountForAvg=Sample count for average value calculation (0 to disable)
+General_Script=Script
 General_Select=&Select...
 General_SourceAgent=NetXMS Agent
 General_SourceCPSNMP=Check Point SNMP
index 1311633..cfe9191 100644 (file)
@@ -50,6 +50,7 @@ import org.netxms.ui.eclipse.datacollection.api.DataCollectionObjectEditor;
 import org.netxms.ui.eclipse.datacollection.dialogs.IParameterSelectionDialog;
 import org.netxms.ui.eclipse.datacollection.dialogs.SelectAgentParamDlg;
 import org.netxms.ui.eclipse.datacollection.dialogs.SelectInternalParamDlg;
+import org.netxms.ui.eclipse.datacollection.dialogs.SelectParameterScriptDialog;
 import org.netxms.ui.eclipse.datacollection.dialogs.SelectSnmpParamDlg;
 import org.netxms.ui.eclipse.datacollection.dialogs.WinPerfCounterSelectionDialog;
 import org.netxms.ui.eclipse.objectbrowser.widgets.ObjectSelector;
@@ -188,6 +189,7 @@ public class General extends PropertyPage
       origin.add(Messages.get().General_SourcePush);
       origin.add(Messages.get().General_WinPerf);
       origin.add(Messages.get().General_SMCLP);
+      origin.add(Messages.get().General_Script);
       origin.select(dci.getOrigin());
       origin.addSelectionListener(new SelectionListener() {
                        @Override
@@ -464,6 +466,9 @@ public class General extends PropertyPage
                        case DataCollectionItem.WINPERF:
                                dlg = new WinPerfCounterSelectionDialog(getShell(), dci.getNodeId());
                                break;
+         case DataCollectionItem.SCRIPT:
+            dlg = new SelectParameterScriptDialog(getShell());
+            break;
                        default:
                                dlg = null;
                                break;
index 483d0d8..77ae4ed 100644 (file)
@@ -1,6 +1,6 @@
 /**
  * NetXMS - open source network management system
- * Copyright (C) 2003-2012 Victor Kirhenshtein
+ * Copyright (C) 2003-2014 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
@@ -62,6 +62,7 @@ public class DciLabelProvider implements ITableLabelProvider
                originTexts.put(DataCollectionItem.PUSH, Messages.get().DciLabelProvider_SourcePush);
                originTexts.put(DataCollectionItem.WINPERF, Messages.get().DciLabelProvider_SourceWinPerf);
                originTexts.put(DataCollectionItem.ILO, Messages.get().DciLabelProvider_SourceILO);
+      originTexts.put(DataCollectionItem.SCRIPT, Messages.get().DciLabelProvider_SourceScript);
                
                statusTexts.put(DataCollectionItem.ACTIVE, Messages.get().DciLabelProvider_Active);
                statusTexts.put(DataCollectionItem.DISABLED, Messages.get().DciLabelProvider_Disabled);