Many improvements in data collection configuration
authorVictor Kirhenshtein <victor@netxms.org>
Wed, 22 Sep 2004 17:38:37 +0000 (17:38 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Wed, 22 Sep 2004 17:38:37 +0000 (17:38 +0000)
39 files changed:
.gitattributes
TODO
configure.ac
include/netxms-version.h [new file with mode: 0644]
include/nms_common.h
include/nxclapi.h
sql/events.in
src/console/win32/AlarmBrowser.cpp
src/console/win32/AlarmBrowser.h
src/console/win32/DCIPropPage.cpp
src/console/win32/DCIPropPage.h
src/console/win32/DCIThresholdsPage.cpp
src/console/win32/DataCollectionEditor.cpp
src/console/win32/ThresholdDlg.cpp
src/console/win32/ThresholdDlg.h
src/console/win32/nxcon.clw
src/console/win32/nxcon.rc
src/console/win32/resource.h
src/libnetxms/libnetxms.dsp
src/libnxcl/alarms.cpp
src/libnxcl/datacoll.cpp
src/libnxcl/libnxcl.dsp
src/server/core/alarm.cpp
src/server/core/dcitem.cpp
src/server/core/netxmsd.dsp
src/server/core/nms_core.h
src/server/core/nms_dcoll.h
src/server/core/nms_objects.h
src/server/core/node.cpp
src/server/core/np.cpp
src/server/core/session.cpp
src/server/dbdrv/mysql/Makefile.am
src/server/dbdrv/odbc/Makefile.am
src/server/dbdrv/pgsql/Makefile.am
src/server/libnxsrv/libnxsrv.dsp
src/server/tools/nxaction/nxaction.cpp
src/server/tools/nxaction/nxaction.dsp
src/server/tools/nxget/nxget.cpp
src/server/tools/nxget/nxget.dsp

index 66baca8..e4342d2 100644 (file)
@@ -35,6 +35,7 @@ images/subnet.ico -text
 images/subnet.png -text
 include/Makefile.am -text
 include/getopt.h -text
+include/netxms-version.h -text
 include/netxmsdb.h -text
 include/nms_agent.h -text
 include/nms_common.h -text
diff --git a/TODO b/TODO
index 8ccd4ad..5e9f50d 100644 (file)
--- a/TODO
+++ b/TODO
@@ -22,6 +22,7 @@ GENERAL:
 - Allow converting counters to deltas in data collection
 - Change usage of MultiByteToWideChar() and WideCharToMultiByte() to
   wctomb() and mbtowc()
+- Add forced node polls (status and configuration)
 
 
 SERVER:
index 5648380..a2e64bb 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: configure.ac,v 1.24 2004-09-22 06:27:26 victor Exp $
+# $Id: configure.ac,v 1.25 2004-09-22 17:38:01 victor Exp $
 #
 # Process this file with autoconf to produce a configure script.
 #
@@ -325,9 +325,11 @@ AC_SUBST(SUBAGENT_DIRS)
 LIBNETXMS_LIBRARY_VERSION=0:1:0
 LIBNXCSCP_LIBRARY_VERSION=0:1:0
 LIBNXSRV_LIBRARY_VERSION=0:1:0
+DBDRV_LIBRARY_VERSION=0:1:0
 AC_SUBST(LIBNETXMS_LIBRARY_VERSION)
 AC_SUBST(LIBNXCSCP_LIBRARY_VERSION)
 AC_SUBST(LIBNXSRV_LIBRARY_VERSION)
+AC_SUBST(DBDRV_LIBRARY_VERSION)
 
 # --------------------------------------------------------------------------
 
diff --git a/include/netxms-version.h b/include/netxms-version.h
new file mode 100644 (file)
index 0000000..03e4caf
--- /dev/null
@@ -0,0 +1,37 @@
+/* 
+** NetXMS - Network Management System
+** Copyright (C) 2003, 2004 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.
+**
+** $module: netxms-version.h
+**
+**/
+
+#ifndef _netxms_version_h_
+#define _netxms_version_h_
+
+
+//
+// Version constants 
+//
+
+#define NETXMS_VERSION_MAJOR      0
+#define NETXMS_VERSION_MINOR      1
+#define NETXMS_VERSION_BUILD      1
+#define NETXMS_VERSION_STRING     "0.1.1"
+
+
+#endif
index 819bb4a..1eeb2cd 100644 (file)
@@ -1,6 +1,6 @@
 /* 
 ** NetXMS - Network Management System
-** Copyright (C) 2003 Victor Kirhenshtein
+** Copyright (C) 2003, 2004 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
 #include <stdio.h>
 #include <string.h>
 
-
-//
-// Version constants 
-//
-
-#define NETXMS_VERSION_MAJOR      1
-#define NETXMS_VERSION_MINOR      0
-#define NETXMS_VERSION_STRING     "1.0"
+#include <netxms-version.h>
 
 
 //
index 2f8aca9..bd6ab02 100644 (file)
@@ -383,10 +383,10 @@ typedef struct
    DWORD dwId;
    int iType;
    BOOL bIsDisabled;
-   char szName[MAX_OBJECT_NAME];
-   char szRcptAddr[MAX_RCPT_ADDR_LEN];
-   char szEmailSubject[MAX_EMAIL_SUBJECT_LEN];
-   char *pszData;
+   TCHAR szName[MAX_OBJECT_NAME];
+   TCHAR szRcptAddr[MAX_RCPT_ADDR_LEN];
+   TCHAR szEmailSubject[MAX_EMAIL_SUBJECT_LEN];
+   TCHAR *pszData;
 } NXC_ACTION;
 
 
@@ -418,7 +418,7 @@ typedef struct
    DWORD dwEventId;
    DWORD dwSourceId;
    DWORD dwSeverity;
-   char  szMessage[MAX_EVENT_MSG_LENGTH];
+   TCHAR  szMessage[MAX_EVENT_MSG_LENGTH];
 } NXC_EVENT;
 
 
@@ -430,7 +430,7 @@ typedef struct
 {
    DWORD dwEventId;
    DWORD dwSeverity;
-   char szName[MAX_EVENT_NAME];
+   TCHAR szName[MAX_EVENT_NAME];
 } NXC_EVENT_NAME;
 
 
@@ -441,7 +441,7 @@ typedef struct
 typedef struct
 {
    DWORD dwId;
-   char szName[MAX_OBJECT_NAME];
+   TCHAR szName[MAX_OBJECT_NAME];
    BYTE hash[MD5_DIGEST_SIZE];
 } NXC_IMAGE;
 
@@ -481,9 +481,9 @@ typedef struct
    DWORD dwCode;
    DWORD dwSeverity;
    DWORD dwFlags;
-   char szName[MAX_EVENT_NAME];
-   char *pszMessage;
-   char *pszDescription;
+   TCHAR szName[MAX_EVENT_NAME];
+   TCHAR *pszMessage;
+   TCHAR *pszDescription;
 } NXC_EVENT_TEMPLATE;
 
 
@@ -508,7 +508,7 @@ typedef struct
    int iClass;          // Object's class
    int iStatus;         // Object's status
    DWORD dwIpAddr;      // IP address
-   char szName[MAX_OBJECT_NAME];
+   TCHAR szName[MAX_OBJECT_NAME];
    DWORD dwNumParents;
    DWORD *pdwParentList;
    DWORD dwNumChilds;
@@ -530,9 +530,9 @@ typedef struct
       {
          DWORD dwFlags;
          DWORD dwDiscoveryFlags;
-         char szSharedSecret[MAX_SECRET_LENGTH];
-         char szCommunityString[MAX_COMMUNITY_LENGTH];
-         char szObjectId[MAX_OID_LENGTH];
+         TCHAR szSharedSecret[MAX_SECRET_LENGTH];
+         TCHAR szCommunityString[MAX_COMMUNITY_LENGTH];
+         TCHAR szObjectId[MAX_OID_LENGTH];
          WORD wAgentPort;     // Listening TCP port for native agent
          WORD wAuthMethod;    // Native agent's authentication method
       } node;
@@ -543,7 +543,7 @@ typedef struct
       struct
       {
          DWORD dwCategory;
-         char *pszDescription;
+         TCHAR *pszDescription;
       } container;
    };
 } NXC_OBJECT;
@@ -557,12 +557,12 @@ typedef struct
 {
    DWORD dwObjectId;
    DWORD dwFlags;
-   char *pszName;
+   TCHAR *pszName;
    int iAgentPort;
    int iAuthType;
-   char *pszSecret;
+   TCHAR *pszSecret;
    int iSnmpVersion;
-   char *pszCommunity;
+   TCHAR *pszCommunity;
    BOOL bInheritRights;
    DWORD dwImage;
    DWORD dwAclSize;
@@ -576,14 +576,14 @@ typedef struct
 
 typedef struct
 {
-   char szName[MAX_USER_NAME];
+   TCHAR szName[MAX_USER_NAME];
    DWORD dwId;
    WORD wFlags;
    WORD wSystemRights;
    DWORD dwNumMembers;     // Only for groups
    DWORD *pdwMemberList;   // Only for groups
-   char szFullName[MAX_USER_FULLNAME];    // Only for users
-   char szDescription[MAX_USER_DESCR];
+   TCHAR szFullName[MAX_USER_FULLNAME];    // Only for users
+   TCHAR szDescription[MAX_USER_DESCR];
 } NXC_USER;
 
 
index fb60d4b..a80ddcc 100644 (file)
@@ -4,6 +4,14 @@
 ** ex: syntax=sql
 */
 
+#define THRESHOLD_EVENT_PARAMS \
+       '   1) Parameter name#0D#0A   2) Item description#0D#0A   3) Threshold value#0D#0A   4) Actual value'
+
+
+/*
+** System events
+*/
+
 INSERT INTO events (event_id,name,severity,flags,message,description) VALUES
        (
                EVENT_NODE_ADDED, 'SYS_NODE_ADDED',
@@ -172,21 +180,20 @@ INSERT INTO events (event_id,name,severity,flags,message,description) VALUES
        (
                EVENT_THRESHOLD_REACHED, 'SYS_THRESHOLD_REACHED',
                EVENT_SEVERITY_WARNING, 1,
-               'Threshold reached for parameter %1 (Threshold value: %2; Actual value: %3)',
+               'Threshold reached for data collection item #22%2#22 (Parameter: %1; Threshold value: %3; Actual value: %4)',
                'Generated when threshold value reached for specific data collection item.#0D#0A' CONCAT
                'Parameters:#0D#0A' CONCAT
-               '   1) Item name#0D#0A' CONCAT
-               '   2) Threshold value#0D#0A' CONCAT
-               '   3) Actual value'
+               THRESHOLD_EVENT_PARAMS
        );
 INSERT INTO events (event_id,name,severity,flags,message,description) VALUES
        (
                EVENT_THRESHOLD_REARMED, 'SYS_THRESHOLD_REARMED',
                EVENT_SEVERITY_NORMAL, 0,
-               'Threshold rearmed for parameter %1',
+               'Threshold rearmed for data collection item %2 (Parameter: %1)',
                'Generated when threshold check is rearmed for specific data collection item.#0D#0A' CONCAT
                'Parameters:#0D#0A' CONCAT
-               '   1) Item name'
+               '   1) Parameter name#0D#0A' CONCAT
+               '   2) Item description'
        );
 INSERT INTO events (event_id,name,severity,flags,message,description) VALUES
        (
@@ -238,23 +245,19 @@ INSERT INTO events (event_id,name,severity,flags,message,description) VALUES
        (
                4000, 'DC_HIGH_CPU_UTIL',
                EVENT_SEVERITY_MINOR, 1,
-               'CPU utilization exceeds allowed maximum of %2 (Current: %3)',
+               'CPU utilization exceeds allowed maximum of %3 (Current: %4)',
                'Custom data collection threshold event.#0D#0A' CONCAT
                'Parameters:#0D#0A' CONCAT
-               '   1) Item name#0D#0A' CONCAT
-               '   2) Threshold value#0D#0A' CONCAT
-               '   3) Actual value'
+               THRESHOLD_EVENT_PARAMS
        );
 INSERT INTO events (event_id,name,severity,flags,message,description) VALUES
        (
                4001, 'DC_HIGH_PROCLOAD',
                EVENT_SEVERITY_MINOR, 1,
-               'Processor load average exceeds allowed maximum of %2 (Current: %3)',
+               'Processor load average exceeds allowed maximum of %3 (Current: %4)',
                'Custom data collection threshold event.#0D#0A' CONCAT
                'Parameters:#0D#0A' CONCAT
-               '   1) Item name#0D#0A' CONCAT
-               '   2) Threshold value#0D#0A' CONCAT
-               '   3) Actual value'
+               THRESHOLD_EVENT_PARAMS
        );
 INSERT INTO events (event_id,name,severity,flags,message,description) VALUES
        (
@@ -263,7 +266,5 @@ INSERT INTO events (event_id,name,severity,flags,message,description) VALUES
                'Host has been restarted within last 5 minutes',
                'Custom data collection threshold event.#0D#0A' CONCAT
                'Parameters:#0D#0A' CONCAT
-               '   1) Item name#0D#0A' CONCAT
-               '   2) Threshold value#0D#0A' CONCAT
-               '   3) Actual value'
+               THRESHOLD_EVENT_PARAMS
        );
index 5b71736..7be6bb8 100644 (file)
@@ -66,10 +66,26 @@ BOOL CAlarmBrowser::PreCreateWindow(CREATESTRUCT& cs)
 int CAlarmBrowser::OnCreate(LPCREATESTRUCT lpCreateStruct) 
 {
    RECT rect;
+   static int widths[6] = { 50, 100, 150, 200, 250, -1 };
+   static int icons[5] = { IDI_SEVERITY_NORMAL, IDI_SEVERITY_WARNING, IDI_SEVERITY_MINOR,
+                           IDI_SEVERITY_MAJOR, IDI_SEVERITY_CRITICAL };
+   int i;
 
        if (CMDIChildWnd::OnCreate(lpCreateStruct) == -1)
                return -1;
 
+   GetClientRect(&rect);
+
+   // Create status bar
+       m_wndStatusBar.Create(WS_CHILD | WS_VISIBLE, rect, this, IDC_STATUS_BAR);
+   m_wndStatusBar.SetParts(6, widths);
+   for(i = 0; i < 5; i++)
+      m_wndStatusBar.SetIcon(i, (HICON)LoadImage(theApp.m_hInstance, 
+                                                 MAKEINTRESOURCE(icons[i]),
+                                                 IMAGE_ICON, 16, 16, LR_SHARED));
+   m_iStatusBarHeight = GetWindowSize(&m_wndStatusBar).cy;
+   rect.bottom -= m_iStatusBarHeight;
+
    // Create font for elements
    m_fontNormal.CreateFont(-MulDiv(8, GetDeviceCaps(GetDC()->m_hDC, LOGPIXELSY), 72),
                           0, 0, 0, FW_BOLD, FALSE, FALSE, FALSE, ANSI_CHARSET,
@@ -77,7 +93,6 @@ int CAlarmBrowser::OnCreate(LPCREATESTRUCT lpCreateStruct)
                           VARIABLE_PITCH | FF_DONTCARE, "MS Sans Serif");
 
    // Create list view control
-   GetClientRect(&rect);
    m_wndListCtrl.Create(WS_CHILD | WS_VISIBLE | LVS_REPORT, rect, this, ID_LIST_VIEW);
    m_wndListCtrl.SetExtendedStyle(LVS_EX_TRACKSELECT | LVS_EX_UNDERLINEHOT | 
                                   LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
@@ -90,11 +105,11 @@ int CAlarmBrowser::OnCreate(LPCREATESTRUCT lpCreateStruct)
    m_wndListCtrl.SetImageList(m_pImageList, LVSIL_SMALL);
 
    // Setup columns
-   m_wndListCtrl.InsertColumn(0, "Severity", LVCFMT_LEFT, 70);
-   m_wndListCtrl.InsertColumn(1, "Source", LVCFMT_LEFT, 140);
-   m_wndListCtrl.InsertColumn(2, "Message", LVCFMT_LEFT, 400);
-   m_wndListCtrl.InsertColumn(3, "Time Stamp", LVCFMT_LEFT, 135);
-   m_wndListCtrl.InsertColumn(4, "Ack", LVCFMT_CENTER, 30);
+   m_wndListCtrl.InsertColumn(0, _T("Severity"), LVCFMT_LEFT, 70);
+   m_wndListCtrl.InsertColumn(1, _T("Source"), LVCFMT_LEFT, 140);
+   m_wndListCtrl.InsertColumn(2, _T("Message"), LVCFMT_LEFT, 400);
+   m_wndListCtrl.InsertColumn(3, _T("Time Stamp"), LVCFMT_LEFT, 135);
+   m_wndListCtrl.InsertColumn(4, _T("Ack"), LVCFMT_CENTER, 30);
        
    ((CConsoleApp *)AfxGetApp())->OnViewCreate(IDR_ALARMS, this);
 
@@ -134,7 +149,8 @@ void CAlarmBrowser::OnSize(UINT nType, int cx, int cy)
 {
        CMDIChildWnd::OnSize(nType, cx, cy);
        
-   m_wndListCtrl.SetWindowPos(NULL, 0, 0, cx, cy, SWP_NOZORDER);
+   m_wndStatusBar.SetWindowPos(NULL, 0, 0, 0, 0, SWP_NOZORDER);
+   m_wndListCtrl.SetWindowPos(NULL, 0, 0, cx, cy - m_iStatusBarHeight, SWP_NOZORDER);
 }
 
 
@@ -149,16 +165,18 @@ void CAlarmBrowser::OnViewRefresh()
 
    m_wndListCtrl.DeleteAllItems();
    dwRetCode = DoRequestArg3(NXCLoadAllAlarms, (void *)m_bShowAllAlarms, &dwNumAlarms, 
-                             &pAlarmList, "Loading alarms...");
+                             &pAlarmList, _T("Loading alarms..."));
    if (dwRetCode == RCC_SUCCESS)
    {
+      memset(m_iNumAlarms, 0, sizeof(int) * 5);
       for(i = 0; i < dwNumAlarms; i++)
          AddAlarm(&pAlarmList[i]);
       safe_free(pAlarmList);
+      UpdateStatusBar();
    }
    else
    {
-      theApp.ErrorBox(dwRetCode, "Error loading alarm list: %s");
+      theApp.ErrorBox(dwRetCode, _T("Error loading alarm list: %s"));
    }
 }
 
@@ -171,7 +189,7 @@ void CAlarmBrowser::AddAlarm(NXC_ALARM *pAlarm)
 {
    int iIdx;
    struct tm *ptm;
-   char szBuffer[64];
+   TCHAR szBuffer[64];
    NXC_OBJECT *pObject;
 
    pObject = NXCFindObjectById(pAlarm->dwSourceObject);
@@ -185,8 +203,9 @@ void CAlarmBrowser::AddAlarm(NXC_ALARM *pAlarm)
       ptm = localtime((const time_t *)&pAlarm->dwTimeStamp);
       strftime(szBuffer, 32, "%d-%b-%Y %H:%M:%S", ptm);
       m_wndListCtrl.SetItemText(iIdx, 3, szBuffer);
-      m_wndListCtrl.SetItemText(iIdx, 4, pAlarm->wIsAck ? "X" : "");
+      m_wndListCtrl.SetItemText(iIdx, 4, pAlarm->wIsAck ? _T("X") : _T(""));
    }
+   m_iNumAlarms[pAlarm->wSeverity]++;
 }
 
 
@@ -203,15 +222,26 @@ void CAlarmBrowser::OnAlarmUpdate(DWORD dwCode, NXC_ALARM *pAlarm)
    {
       case NX_NOTIFY_NEW_ALARM:
          if ((iItem == -1) && ((m_bShowAllAlarms) || (pAlarm->wIsAck == 0)))
+         {
             AddAlarm(pAlarm);
+            UpdateStatusBar();
+         }
          break;
       case NX_NOTIFY_ALARM_ACKNOWLEGED:
          if ((iItem != -1) && (!m_bShowAllAlarms))
+         {
             m_wndListCtrl.DeleteItem(iItem);
+            m_iNumAlarms[pAlarm->wSeverity]--;
+            UpdateStatusBar();
+         }
          break;
       case NX_NOTIFY_ALARM_DELETED:
          if (iItem != -1)
+         {
             m_wndListCtrl.DeleteItem(iItem);
+            m_iNumAlarms[pAlarm->wSeverity]--;
+            UpdateStatusBar();
+         }
          break;
       default:
          break;
@@ -276,3 +306,23 @@ void CAlarmBrowser::OnUpdateAlarmAcknowlege(CCmdUI* pCmdUI)
 {
    pCmdUI->Enable(m_wndListCtrl.GetSelectedCount() > 0);
 }
+
+
+//
+// Update status bar information
+//
+
+void CAlarmBrowser::UpdateStatusBar(void)
+{
+   int i, iSum;
+   TCHAR szBuffer[64];
+
+   for(i = 0, iSum = 0; i < 5; i++)
+   {
+      _stprintf(szBuffer, _T("%d"), m_iNumAlarms[i]);
+      m_wndStatusBar.SetText(szBuffer, i, 0);
+      iSum += m_iNumAlarms[i];
+   }
+   _stprintf(szBuffer, _T("Total: %d"), iSum);
+   m_wndStatusBar.SetText(szBuffer, 5, 0);
+}
index c8f3b92..8362d34 100644 (file)
@@ -32,6 +32,10 @@ public:
 
 // Implementation
 protected:
+       int m_iNumAlarms[5];
+       void UpdateStatusBar(void);
+       int m_iStatusBarHeight;
+       CStatusBarCtrl m_wndStatusBar;
        int FindAlarmRecord(DWORD dwAlarmId);
        CFont m_fontNormal;
        void AddAlarm(NXC_ALARM *pAlarm);
index 13646f3..8422275 100644 (file)
@@ -26,6 +26,7 @@ CDCIPropPage::CDCIPropPage()
        m_iDataType = -1;
        m_iOrigin = -1;
        m_iStatus = -1;
+       m_strDescription = _T("");
        //}}AFX_DATA_INIT
 }
 
@@ -47,6 +48,8 @@ void CDCIPropPage::DoDataExchange(CDataExchange* pDX)
        DDX_CBIndex(pDX, IDC_COMBO_DT, m_iDataType);
        DDX_CBIndex(pDX, IDC_COMBO_ORIGIN, m_iOrigin);
        DDX_Radio(pDX, IDC_RADIO_ACTIVE, m_iStatus);
+       DDX_Text(pDX, IDC_EDIT_DESCRIPTION, m_strDescription);
+       DDV_MaxChars(pDX, m_strDescription, 255);
        //}}AFX_DATA_MAP
 }
 
index cd2eb8c..149431d 100644 (file)
@@ -31,6 +31,7 @@ public:
        int             m_iDataType;
        int             m_iOrigin;
        int             m_iStatus;
+       CString m_strDescription;
        //}}AFX_DATA
 
 
index f12bbb2..4846f59 100644 (file)
@@ -71,8 +71,8 @@ BOOL CDCIThresholdsPage::OnInitDialog()
        
    // Setup list view
    m_wndListCtrl.GetClientRect(&rect);
-   m_wndListCtrl.InsertColumn(0, "Operation", LVCFMT_LEFT, rect.right - 80 - GetSystemMetrics(SM_CXVSCROLL));
-   m_wndListCtrl.InsertColumn(1, "Event", LVCFMT_LEFT, 80);
+   m_wndListCtrl.InsertColumn(0, "Operation", LVCFMT_LEFT, rect.right - 150 - GetSystemMetrics(SM_CXVSCROLL));
+   m_wndListCtrl.InsertColumn(1, "Event", LVCFMT_LEFT, 150);
    m_wndListCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_TRACKSELECT | LVS_EX_UNDERLINEHOT);
    m_wndListCtrl.SetHoverTime(0x7FFFFFFF);
 
@@ -145,8 +145,7 @@ void CDCIThresholdsPage::UpdateListEntry(int iItem, DWORD dwIndex)
    m_wndListCtrl.SetItemText(iItem, 0, szBuffer);
 
    // Event
-   sprintf(szBuffer, "%d", m_pItem->pThresholdList[dwIndex].dwEvent);
-   m_wndListCtrl.SetItemText(iItem, 1, szBuffer);
+   m_wndListCtrl.SetItemText(iItem, 1, NXCGetEventName(m_pItem->pThresholdList[dwIndex].dwEvent));
 }
 
 
@@ -163,6 +162,7 @@ BOOL CDCIThresholdsPage::EditThreshold(NXC_DCI_THRESHOLD *pThreshold)
    dlg.m_iFunction = pThreshold->wFunction;
    dlg.m_iOperation = pThreshold->wOperation;
    dlg.m_dwArg1 = pThreshold->dwArg1;
+   dlg.m_dwEventId = pThreshold->dwEvent;
    switch(m_pItem->iDataType)
    {
       case DCI_DT_INTEGER:
@@ -186,6 +186,7 @@ BOOL CDCIThresholdsPage::EditThreshold(NXC_DCI_THRESHOLD *pThreshold)
       pThreshold->dwArg1 = dlg.m_dwArg1;
       pThreshold->wFunction = (WORD)dlg.m_iFunction;
       pThreshold->wOperation = (WORD)dlg.m_iOperation;
+      pThreshold->dwEvent = dlg.m_dwEventId;
       switch(m_pItem->iDataType)
       {
          case DCI_DT_INTEGER:
index d6a420f..dfe7481 100644 (file)
@@ -80,17 +80,18 @@ int CDataCollectionEditor::OnCreate(LPCREATESTRUCT lpCreateStruct)
    GetClientRect(&rect);
    m_wndListCtrl.Create(WS_CHILD | WS_VISIBLE | LVS_REPORT, rect, this, IDC_LIST_VIEW);
    m_wndListCtrl.SetExtendedStyle(LVS_EX_TRACKSELECT | LVS_EX_UNDERLINEHOT | 
-                                  LVS_EX_FULLROWSELECT);
+                                  LVS_EX_FULLROWSELECT | LVS_EX_GRIDLINES);
    m_wndListCtrl.SetHoverTime(0x7FFFFFFF);
 
    // Setup columns
    m_wndListCtrl.InsertColumn(0, "ID", LVCFMT_LEFT, 40);
    m_wndListCtrl.InsertColumn(1, "Source", LVCFMT_LEFT, 80);
-   m_wndListCtrl.InsertColumn(2, "Name", LVCFMT_LEFT, 200);
-   m_wndListCtrl.InsertColumn(3, "Data type", LVCFMT_LEFT, 80);
-   m_wndListCtrl.InsertColumn(4, "Polling Interval", LVCFMT_LEFT, 80);
-   m_wndListCtrl.InsertColumn(5, "Retention Time", LVCFMT_LEFT, 80);
-   m_wndListCtrl.InsertColumn(6, "Status", LVCFMT_LEFT, 90);
+   m_wndListCtrl.InsertColumn(2, "Description", LVCFMT_LEFT, 150);
+   m_wndListCtrl.InsertColumn(3, "Parameter", LVCFMT_LEFT, 150);
+   m_wndListCtrl.InsertColumn(4, "Data type", LVCFMT_LEFT, 80);
+   m_wndListCtrl.InsertColumn(5, "Polling Interval", LVCFMT_LEFT, 80);
+   m_wndListCtrl.InsertColumn(6, "Retention Time", LVCFMT_LEFT, 80);
+   m_wndListCtrl.InsertColumn(7, "Status", LVCFMT_LEFT, 90);
 
    // Fill list view with data
    for(i = 0; i < m_pItemList->dwNumItems; i++)
@@ -169,13 +170,14 @@ void CDataCollectionEditor::UpdateListItem(int iItem, NXC_DCI *pItem)
    char szBuffer[32];
 
    m_wndListCtrl.SetItemText(iItem, 1, g_pszItemOrigin[pItem->iSource]);
-   m_wndListCtrl.SetItemText(iItem, 2, pItem->szName);
-   m_wndListCtrl.SetItemText(iItem, 3, g_pszItemDataType[pItem->iDataType]);
+   m_wndListCtrl.SetItemText(iItem, 2, pItem->szDescription);
+   m_wndListCtrl.SetItemText(iItem, 3, pItem->szName);
+   m_wndListCtrl.SetItemText(iItem, 4, g_pszItemDataType[pItem->iDataType]);
    sprintf(szBuffer, "%d sec", pItem->iPollingInterval);
-   m_wndListCtrl.SetItemText(iItem, 4, szBuffer);
-   sprintf(szBuffer, "%d days", pItem->iRetentionTime);
    m_wndListCtrl.SetItemText(iItem, 5, szBuffer);
-   m_wndListCtrl.SetItemText(iItem, 6, g_pszItemStatus[pItem->iStatus]);
+   sprintf(szBuffer, "%d days", pItem->iRetentionTime);
+   m_wndListCtrl.SetItemText(iItem, 6, szBuffer);
+   m_wndListCtrl.SetItemText(iItem, 7, g_pszItemStatus[pItem->iStatus]);
 }
 
 
@@ -297,6 +299,7 @@ BOOL CDataCollectionEditor::EditItem(NXC_DCI *pItem)
    pgCollection.m_iRetentionTime = pItem->iRetentionTime;
    pgCollection.m_iStatus = pItem->iStatus;
    pgCollection.m_strName = pItem->szName;
+   pgCollection.m_strDescription = pItem->szDescription;
 
    // Setup "Transformation" page
    pgTransform.m_iDeltaProc = pItem->iDeltaCalculation;
@@ -319,6 +322,10 @@ BOOL CDataCollectionEditor::EditItem(NXC_DCI *pItem)
       pItem->iRetentionTime = pgCollection.m_iRetentionTime;
       pItem->iStatus = pgCollection.m_iStatus;
       strcpy(pItem->szName, (LPCTSTR)pgCollection.m_strName);
+      strcpy(pItem->szDescription, (LPCTSTR)pgCollection.m_strDescription);
+      StrStrip(pItem->szDescription);
+      if (pItem->szDescription[0] == 0)
+         strcpy(pItem->szDescription, pItem->szName);
       pItem->iDeltaCalculation = pgTransform.m_iDeltaProc;
       safe_free(pItem->pszFormula);
       pItem->pszFormula = strdup((LPCTSTR)pgTransform.m_strFormula);
index ccc31dc..7586d2b 100644 (file)
@@ -18,6 +18,7 @@ static char THIS_FILE[] = __FILE__;
 CThresholdDlg::CThresholdDlg(CWnd* pParent /*=NULL*/)
        : CDialog(CThresholdDlg::IDD, pParent)
 {
+   m_dwEventId = EVENT_THRESHOLD_REACHED;
        //{{AFX_DATA_INIT(CThresholdDlg)
        m_iFunction = -1;
        m_strValue = _T("");
@@ -31,6 +32,7 @@ void CThresholdDlg::DoDataExchange(CDataExchange* pDX)
 {
        CDialog::DoDataExchange(pDX);
        //{{AFX_DATA_MAP(CThresholdDlg)
+       DDX_Control(pDX, IDC_EDIT_EVENT, m_wndEventName);
        DDX_Control(pDX, IDC_STATIC_SAMPLES, m_wndStaticSamples);
        DDX_Control(pDX, IDC_STATIC_FOR, m_wndStaticFor);
        DDX_Control(pDX, IDC_EDIT_ARG1, m_wndEditArg1);
@@ -48,6 +50,7 @@ void CThresholdDlg::DoDataExchange(CDataExchange* pDX)
 BEGIN_MESSAGE_MAP(CThresholdDlg, CDialog)
        //{{AFX_MSG_MAP(CThresholdDlg)
        ON_CBN_SELCHANGE(IDC_COMBO_FUNCTION, OnSelchangeComboFunction)
+       ON_BN_CLICKED(IDC_BUTTON_SELECT, OnButtonSelect)
        //}}AFX_MSG_MAP
 END_MESSAGE_MAP()
 
@@ -79,6 +82,8 @@ BOOL CThresholdDlg::OnInitDialog()
       m_wndStaticSamples.EnableWindow(FALSE);
       m_wndEditArg1.EnableWindow(FALSE);
    }
+
+   m_wndEventName.SetWindowText(NXCGetEventName(m_dwEventId));
        
        return TRUE;
 }
@@ -95,3 +100,19 @@ void CThresholdDlg::OnSelchangeComboFunction()
    m_wndStaticSamples.EnableWindow(m_iFunction != F_LAST);
    m_wndEditArg1.EnableWindow(m_iFunction != F_LAST);
 }
+
+
+//
+// "Select" button handler
+//
+
+void CThresholdDlg::OnButtonSelect() 
+{
+   CEventSelDlg dlg;
+
+   if (dlg.DoModal())
+   {
+      m_dwEventId = dlg.m_pdwEventList[0];
+      m_wndEventName.SetWindowText(NXCGetEventName(m_dwEventId));
+   }
+}
index e22ff9c..6272492 100644 (file)
@@ -14,11 +14,13 @@ class CThresholdDlg : public CDialog
 {
 // Construction
 public:
+       DWORD m_dwEventId;
        CThresholdDlg(CWnd* pParent = NULL);   // standard constructor
 
 // Dialog Data
        //{{AFX_DATA(CThresholdDlg)
        enum { IDD = IDD_THRESHOLD };
+       CEdit   m_wndEventName;
        CStatic m_wndStaticSamples;
        CStatic m_wndStaticFor;
        CEdit   m_wndEditArg1;
@@ -45,6 +47,7 @@ protected:
        //{{AFX_MSG(CThresholdDlg)
        virtual BOOL OnInitDialog();
        afx_msg void OnSelchangeComboFunction();
+       afx_msg void OnButtonSelect();
        //}}AFX_MSG
        DECLARE_MESSAGE_MAP()
 };
index 3d7eb14..806e294 100644 (file)
@@ -2,7 +2,7 @@
 
 [General Info]
 Version=1
-LastClass=CDCITransformPage
+LastClass=CThresholdDlg
 LastTemplate=CPropertyPage
 NewFileInclude1=#include "stdafx.h"
 NewFileInclude2=#include "nxcon.h"
@@ -16,7 +16,7 @@ Class7=CEventBrowser
 Class9=CMapView
 
 ResourceCount=81
-Resource1=IDD_SET_PASSWORD (English (U.S.))
+Resource1=IDD_USER_PROPERTIES (English (U.S.))
 Resource2=IDD_REQUEST_PROCESSING
 Resource3=IDD_OBJECT_NODE_GENERAL (English (U.S.))
 Resource4=IDD_OBJECT_CAPS
@@ -32,7 +32,7 @@ Resource7=IDR_MAINFRAME
 Class12=CObjectBrowser
 Resource8=IDD_CP_GENERAL
 Class13=CObjectPropDlg
-Resource9=IDA_ALARM_BROWSER (English (U.S.))
+Resource9=IDD_EDIT_RULE_COMMENT (English (U.S.))
 Resource10=IDD_SELECT_ACTION (English (U.S.))
 Resource11=IDA_EPP (English (U.S.))
 Resource12=IDR_CTRLPANEL (English (U.S.))
@@ -42,13 +42,13 @@ Resource15=IDR_OBJECTS (English (U.S.))
 Resource16=IDD_DUMMY (English (U.S.))
 Class14=CEventEditor
 Class15=CEditEventDlg
-Resource17=IDD_CREATE_CONTAINER (English (U.S.))
+Resource17=IDD_OBJECT_SECURITY (English (U.S.))
 Class16=CDebugFrame
-Resource18=IDD_EDIT_RULE_ALARM (English (U.S.))
+Resource18=IDD_EDIT_EVENT (English (U.S.))
 Resource19=IDD_OBJECT_PROPERTIES (English (U.S.))
 Resource20=IDD_USER_PROPERTIES
 Class17=CObjectPreview
-Resource21=IDD_NEW_USER (English (U.S.))
+Resource21=IDD_CP_GENERAL (English (U.S.))
 Class18=CToolBox
 Class19=CObjectInfoBox
 Class20=CObjectSearchBox
@@ -56,7 +56,7 @@ Resource22=IDD_MIB_BROWSER (English (U.S.))
 Class21=CEditBox
 Class22=COPGeneral
 Class23=CNodePropsGeneral
-Resource23=IDD_CREATE_NODE (English (U.S.))
+Resource23=IDA_MDI_DEFAULT (English (U.S.))
 Class24=CObjectPropCaps
 Class25=CObjectPropSheet
 Resource24=IDD_SELECT_USER
@@ -64,11 +64,11 @@ Class26=CRequestProcessingDlg
 Resource25=IDM_VIEW_SPECIFIC (English (U.S.))
 Resource26=IDD_PROGRESS (English (U.S.))
 Resource27=IDA_OBJECT_BROWSER
-Resource28=IDD_SELECT_OBJECT (English (U.S.))
+Resource28=IDD_LOGIN (English (U.S.))
 Class27=CObjectPropsGeneral
-Resource29=IDD_OBJECT_GENERAL (English (U.S.))
+Resource29=IDD_CREATE_NODE (English (U.S.))
 Class28=CObjectPropsSecurity
-Resource30=IDD_EDIT_EVENT (English (U.S.))
+Resource30=IDD_EDIT_RULE_ALARM (English (U.S.))
 Resource31=IDD_EDIT_RULE_SEVERITY
 Resource32=IDA_MDI_DEFAULT
 Class29=CUserSelectDlg
@@ -79,36 +79,36 @@ Class31=CNewUserDlg
 Resource35=IDD_MIB_BROWSER
 Resource36=IDD_NEW_USER
 Class32=CUserPropDlg
-Resource37=IDD_USER_PROPERTIES (English (U.S.))
+Resource37=IDD_ABOUTBOX (English (U.S.))
 Resource38=IDM_CONTEXT
 Class33=CGroupPropDlg
 Resource39=IDD_CREATE_CONTAINER
 Resource40=IDD_OBJECT_GENERAL
 Resource41=IDD_LOGIN
-Resource42=IDD_THRESHOLD (English (U.S.))
+Resource42=IDD_SET_PASSWORD (English (U.S.))
 Class34=CPasswordChangeDlg
 Class35=CNodeSummary
 Class36=CNetSummaryFrame
 Class37=CDataCollectionEditor
-Resource43=IDD_NEW_ACTION (English (U.S.))
+Resource43=IDD_OBJECT_PRESENTATION (English (U.S.))
 Class38=CDCIPropPage
-Resource44=IDD_ABOUTBOX (English (U.S.))
+Resource44=IDD_OBJECT_GENERAL (English (U.S.))
 Class39=CDCIDataView
-Resource45=IDD_CP_GENERAL (English (U.S.))
+Resource45=IDD_NEW_USER (English (U.S.))
 Class40=CGraph
 Class41=CGraphFrame
 Class42=CDCIThresholdsPage
-Resource46=IDD_REQUEST_PROCESSING (English (U.S.))
-Resource47=IDR_MAINFRAME (English (U.S.))
+Resource46=IDD_ACTION_PROPERTIES (English (U.S.))
+Resource47=IDA_ALARM_BROWSER (English (U.S.))
 Resource48=IDD_DCI_THRESHOLDS
 Class43=CThresholdDlg
-Resource49=IDD_EDIT_RULE_COMMENT (English (U.S.))
+Resource49=IDR_MAINFRAME (English (U.S.))
 Resource50=IDD_SELECT_EVENT
 Class44=CMIBBrowserDlg
 Class45=CEventPolicyEditor
 Class46=CRuleList
 Class47=CRuleHeader
-Resource51=IDD_OBJECT_CAPS (English (U.S.))
+Resource51=IDD_NEW_ACTION (English (U.S.))
 Resource52=IDM_VIEW_SPECIFIC
 Class48=CObjectSelDlg
 Resource53=IDD_EDIT_EVENT
@@ -119,20 +119,20 @@ Class50=CEventSelDlg
 Resource56=IDD_OBJECT_PRESENTATION
 Resource57=IDM_CONTEXT (English (U.S.))
 Resource58=IDD_CREATE_NODE
-Resource59=IDD_LOGIN (English (U.S.))
+Resource59=IDA_OBJECT_BROWSER (English (U.S.))
 Resource60=IDD_GROUP_PROPERTIES (English (U.S.))
 Class51=CObjectPropsPresentation
-Resource61=IDD_DCI_COLLECTION (English (U.S.))
+Resource61=IDD_THRESHOLD (English (U.S.))
 Resource62=IDD_DCI_COLLECTION
 Class52=CRuleSeverityDlg
 Resource63=IDD_SELECT_ACTION
 Class53=CRuleAlarmDlg
 Class54=CAlarmBrowser
-Resource64=IDD_OBJECT_PRESENTATION (English (U.S.))
+Resource64=IDD_DCI_THRESHOLDS (English (U.S.))
 Resource65=IDD_OBJECT_NODE_GENERAL
 Resource66=IDD_SELECT_EVENT (English (U.S.))
-Resource67=IDD_DCI_THRESHOLDS (English (U.S.))
-Resource68=IDD_SELECT_USER (English (U.S.))
+Resource67=IDD_SELECT_USER (English (U.S.))
+Resource68=IDD_OBJECT_CAPS (English (U.S.))
 Class55=CConsolePropsGeneral
 Class56=CActionEditor
 Resource69=IDD_GROUP_PROPERTIES
@@ -143,16 +143,16 @@ Class58=CEditActionDlg
 Resource72=IDD_OBJECT_SECURITY
 Class59=CActionSelDlg
 Resource73=IDD_EDIT_RULE_ALARM
-Resource74=IDA_MDI_DEFAULT (English (U.S.))
-Resource75=IDA_OBJECT_BROWSER (English (U.S.))
+Resource74=IDD_DCI_COLLECTION (English (U.S.))
+Resource75=IDD_SELECT_OBJECT (English (U.S.))
 Resource76=IDA_EPP
 Class60=CCreateObjectDlg
 Class61=CCreateContainerDlg
 Resource77=IDD_SET_PASSWORD
 Class62=CCreateNodeDlg
-Resource78=IDD_OBJECT_SECURITY (English (U.S.))
+Resource78=IDD_CREATE_CONTAINER (English (U.S.))
 Resource79=IDD_EDIT_RULE_SEVERITY (English (U.S.))
-Resource80=IDD_ACTION_PROPERTIES (English (U.S.))
+Resource80=IDD_REQUEST_PROCESSING (English (U.S.))
 Class63=CDCITransformPage
 Resource81=IDD_DCI_TRANSFORM (English (U.S.))
 
@@ -1346,7 +1346,7 @@ HeaderFile=DCIPropPage.h
 ImplementationFile=DCIPropPage.cpp
 BaseClass=CPropertyPage
 Filter=D
-LastObject=IDC_EDIT_NAME
+LastObject=CDCIPropPage
 VirtualFilter=dWC
 
 [DLG:IDD_DCI_COLLECTION]
@@ -1401,26 +1401,28 @@ VirtualFilter=mfWC
 [DLG:IDD_DCI_COLLECTION (English (U.S.))]
 Type=1
 Class=CDCIPropPage
-ControlCount=19
-Control1=IDC_EDIT_NAME,edit,1350631552
-Control2=IDC_BUTTON_SELECT,button,1342242816
-Control3=IDC_COMBO_ORIGIN,combobox,1344339971
-Control4=IDC_COMBO_DT,combobox,1344339971
-Control5=IDC_EDIT_INTERVAL,edit,1350639744
-Control6=IDC_EDIT_RETENTION,edit,1350639744
-Control7=IDC_RADIO_ACTIVE,button,1342373897
-Control8=IDC_RADIO_DISABLED,button,1342242825
-Control9=IDC_RADIO_NOT_SUPPORTED,button,1342242825
-Control10=IDC_STATIC,button,1342177287
+ControlCount=21
+Control1=IDC_EDIT_DESCRIPTION,edit,1350631552
+Control2=IDC_EDIT_NAME,edit,1350631552
+Control3=IDC_BUTTON_SELECT,button,1342242816
+Control4=IDC_COMBO_ORIGIN,combobox,1344339971
+Control5=IDC_COMBO_DT,combobox,1344339971
+Control6=IDC_EDIT_INTERVAL,edit,1350639744
+Control7=IDC_EDIT_RETENTION,edit,1350639744
+Control8=IDC_RADIO_ACTIVE,button,1342373897
+Control9=IDC_RADIO_DISABLED,button,1342242825
+Control10=IDC_RADIO_NOT_SUPPORTED,button,1342242825
 Control11=IDC_STATIC,button,1342177287
-Control12=IDC_STATIC,static,1342308352
+Control12=IDC_STATIC,button,1342177287
 Control13=IDC_STATIC,static,1342308352
 Control14=IDC_STATIC,static,1342308352
 Control15=IDC_STATIC,static,1342308352
-Control16=IDC_STATIC,button,1342177287
-Control17=IDC_STATIC,static,1342308352
+Control16=IDC_STATIC,static,1342308352
+Control17=IDC_STATIC,button,1342177287
 Control18=IDC_STATIC,static,1342308352
 Control19=IDC_STATIC,static,1342308352
+Control20=IDC_STATIC,static,1342308352
+Control21=IDC_STATIC,button,1342177287
 
 [DLG:IDD_DCI_THRESHOLDS (English (U.S.))]
 Type=1
@@ -1456,7 +1458,7 @@ Control6=IDC_BUTTON_MOVEDOWN,button,1342242944
 [DLG:IDD_THRESHOLD (English (U.S.))]
 Type=1
 Class=CThresholdDlg
-ControlCount=11
+ControlCount=16
 Control1=IDC_COMBO_FUNCTION,combobox,1344339971
 Control2=IDC_EDIT_ARG1,edit,1350639744
 Control3=IDC_COMBO_OPERATION,combobox,1344339971
@@ -1468,6 +1470,11 @@ Control8=IDC_STATIC_COMPARE,static,1342308352
 Control9=IDC_STATIC,static,1342308352
 Control10=IDC_STATIC_FOR,static,1342308352
 Control11=IDC_STATIC_SAMPLES,static,1342308352
+Control12=IDC_STATIC,button,1342177287
+Control13=IDC_STATIC,button,1342177287
+Control14=IDC_STATIC,static,1342308352
+Control15=IDC_EDIT_EVENT,edit,1350633600
+Control16=IDC_BUTTON_SELECT,button,1342242816
 
 [CLS:CThresholdDlg]
 Type=0
@@ -2054,11 +2061,12 @@ Control14=IDC_STATIC,static,1342308352
 [DLG:IDD_DCI_TRANSFORM (English (U.S.))]
 Type=1
 Class=CDCITransformPage
-ControlCount=4
+ControlCount=5
 Control1=IDC_STATIC,static,1342308352
 Control2=IDC_COMBO_DELTA,combobox,1344339971
 Control3=IDC_STATIC,static,1342308352
 Control4=IDC_EDIT_FORMULA,edit,1350631552
+Control5=IDC_BUTTON_CREATE,button,1342242816
 
 [CLS:CDCITransformPage]
 Type=0
index efab16b..ff594db 100644 (file)
@@ -754,71 +754,81 @@ BEGIN
     ICON            IDI_PASSWORD,IDC_STATIC,7,7,20,20
 END
 
-IDD_DCI_COLLECTION DIALOG DISCARDABLE  0, 0, 228, 135
+IDD_DCI_COLLECTION DIALOG DISCARDABLE  0, 0, 228, 170
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION
 CAPTION "Collection"
 FONT 8, "MS Sans Serif"
 BEGIN
-    EDITTEXT        IDC_EDIT_NAME,13,28,148,14,ES_AUTOHSCROLL
-    PUSHBUTTON      "S&elect...",IDC_BUTTON_SELECT,165,28,50,14
-    COMBOBOX        IDC_COMBO_ORIGIN,13,57,95,90,CBS_DROPDOWNLIST | 
+    EDITTEXT        IDC_EDIT_DESCRIPTION,13,17,202,14,ES_AUTOHSCROLL
+    EDITTEXT        IDC_EDIT_NAME,13,61,148,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "S&elect...",IDC_BUTTON_SELECT,165,61,50,14
+    COMBOBOX        IDC_COMBO_ORIGIN,13,90,95,90,CBS_DROPDOWNLIST | 
                     WS_VSCROLL | WS_TABSTOP
-    COMBOBOX        IDC_COMBO_DT,120,57,95,90,CBS_DROPDOWNLIST | WS_VSCROLL | 
+    COMBOBOX        IDC_COMBO_DT,120,90,95,90,CBS_DROPDOWNLIST | WS_VSCROLL | 
                     WS_TABSTOP
-    EDITTEXT        IDC_EDIT_INTERVAL,63,89,40,14,ES_AUTOHSCROLL | ES_NUMBER
-    EDITTEXT        IDC_EDIT_RETENTION,63,108,40,14,ES_AUTOHSCROLL | 
+    EDITTEXT        IDC_EDIT_INTERVAL,63,124,40,14,ES_AUTOHSCROLL | 
+                    ES_NUMBER
+    EDITTEXT        IDC_EDIT_RETENTION,63,143,40,14,ES_AUTOHSCROLL | 
                     ES_NUMBER
     CONTROL         "&Active",IDC_RADIO_ACTIVE,"Button",BS_AUTORADIOBUTTON | 
-                    WS_GROUP | WS_TABSTOP,156,91,36,10
+                    WS_GROUP | WS_TABSTOP,156,125,36,10
     CONTROL         "&Disabled",IDC_RADIO_DISABLED,"Button",
-                    BS_AUTORADIOBUTTON | WS_TABSTOP,156,102,50,10
+                    BS_AUTORADIOBUTTON | WS_TABSTOP,156,136,50,10
     CONTROL         "N&ot supported",IDC_RADIO_NOT_SUPPORTED,"Button",
-                    BS_AUTORADIOBUTTON | WS_TABSTOP,156,113,59,10
-    GROUPBOX        "Data",IDC_STATIC,7,7,214,70
-    GROUPBOX        "Polling",IDC_STATIC,7,79,140,49
-    LTEXT           "Interval:",IDC_STATIC,12,92,26,8
-    LTEXT           "Retention time:",IDC_STATIC,12,111,48,8
-    LTEXT           "seconds",IDC_STATIC,107,92,28,8
-    LTEXT           "days",IDC_STATIC,107,111,16,8
-    GROUPBOX        "Status",IDC_STATIC,151,79,70,49
-    LTEXT           "Data Type",IDC_STATIC,120,47,34,8
-    LTEXT           "Origin",IDC_STATIC,13,47,19,8
-    LTEXT           "Name",IDC_STATIC,13,18,20,8
+                    BS_AUTORADIOBUTTON | WS_TABSTOP,156,147,59,10
+    GROUPBOX        "Data",IDC_STATIC,7,40,214,70
+    GROUPBOX        "Polling",IDC_STATIC,7,114,140,49
+    LTEXT           "Interval:",IDC_STATIC,12,127,26,8
+    LTEXT           "Retention time:",IDC_STATIC,12,146,48,8
+    LTEXT           "seconds",IDC_STATIC,107,127,28,8
+    LTEXT           "days",IDC_STATIC,107,146,16,8
+    GROUPBOX        "Status",IDC_STATIC,151,114,70,49
+    LTEXT           "Data Type",IDC_STATIC,120,80,34,8
+    LTEXT           "Origin",IDC_STATIC,13,80,19,8
+    LTEXT           "Parameter",IDC_STATIC,13,51,33,8
+    GROUPBOX        "Description",IDC_STATIC,7,7,214,30
 END
 
-IDD_DCI_THRESHOLDS DIALOGEX 0, 0, 228, 135
+IDD_DCI_THRESHOLDS DIALOGEX 0, 0, 228, 170
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Thresholds"
-FONT 8, "MS Sans Serif", 0, 0, 0x1
+FONT 8, "MS Sans Serif"
 BEGIN
     CONTROL         "List1",IDC_LIST_THRESHOLDS,"SysListView32",LVS_REPORT | 
                     LVS_SHOWSELALWAYS | LVS_NOSORTHEADER | WS_TABSTOP,7,7,
-                    193,100,WS_EX_CLIENTEDGE
-    PUSHBUTTON      "&Add...",IDC_BUTTON_ADD,59,114,50,14
-    PUSHBUTTON      "&Modify...",IDC_BUTTON_MODIFY,115,114,50,14
-    PUSHBUTTON      "&Delete",IDC_BUTTON_DELETE,171,114,50,14
+                    193,135,WS_EX_CLIENTEDGE
+    PUSHBUTTON      "&Add...",IDC_BUTTON_ADD,59,149,50,14
+    PUSHBUTTON      "&Modify...",IDC_BUTTON_MODIFY,115,149,50,14
+    PUSHBUTTON      "&Delete",IDC_BUTTON_DELETE,171,149,50,14
     PUSHBUTTON      "&U",IDC_BUTTON_MOVEUP,205,7,16,16,BS_BITMAP
     PUSHBUTTON      "D",IDC_BUTTON_MOVEDOWN,205,27,16,16,BS_BITMAP
 END
 
-IDD_THRESHOLD DIALOG DISCARDABLE  0, 0, 196, 95
+IDD_THRESHOLD DIALOG DISCARDABLE  0, 0, 211, 169
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
 CAPTION "Threshold Configuration"
 FONT 8, "MS Sans Serif"
 BEGIN
-    COMBOBOX        IDC_COMBO_FUNCTION,7,18,123,90,CBS_DROPDOWNLIST | 
+    COMBOBOX        IDC_COMBO_FUNCTION,15,27,123,90,CBS_DROPDOWNLIST | 
                     WS_VSCROLL | WS_TABSTOP
-    EDITTEXT        IDC_EDIT_ARG1,19,36,40,14,ES_AUTOHSCROLL | ES_NUMBER
-    COMBOBOX        IDC_COMBO_OPERATION,32,56,98,90,CBS_DROPDOWNLIST | 
+    EDITTEXT        IDC_EDIT_ARG1,27,45,40,14,ES_AUTOHSCROLL | ES_NUMBER
+    COMBOBOX        IDC_COMBO_OPERATION,40,65,98,90,CBS_DROPDOWNLIST | 
                     WS_VSCROLL | WS_TABSTOP
-    EDITTEXT        IDC_EDIT_VALUE,26,74,104,14,ES_AUTOHSCROLL
-    DEFPUSHBUTTON   "OK",IDOK,139,7,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,139,24,50,14
-    LTEXT           "will be",IDC_STATIC,7,57,20,8
-    LTEXT           "than",IDC_STATIC_COMPARE,7,77,15,8
-    LTEXT           "This threshold will be armed if",IDC_STATIC,7,7,93,8
-    LTEXT           "for",IDC_STATIC_FOR,7,39,9,8
-    LTEXT           "consecutive samples",IDC_STATIC_SAMPLES,63,39,67,8
+    EDITTEXT        IDC_EDIT_VALUE,34,84,104,14,ES_AUTOHSCROLL
+    DEFPUSHBUTTON   "OK",IDOK,154,7,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,154,24,50,14
+    LTEXT           "will be",IDC_STATIC,15,66,20,8
+    LTEXT           "than",IDC_STATIC_COMPARE,15,86,15,8
+    LTEXT           "This threshold will be armed if",IDC_STATIC,15,16,93,8
+    LTEXT           "for",IDC_STATIC_FOR,15,48,9,8
+    LTEXT           "consecutive samples",IDC_STATIC_SAMPLES,71,48,67,8
+    GROUPBOX        "Condition",IDC_STATIC,7,7,139,101
+    GROUPBOX        "Event",IDC_STATIC,7,111,139,51
+    LTEXT           "If condition is TRUE, generate the following event:",
+                    IDC_STATIC,13,122,126,18
+    EDITTEXT        IDC_EDIT_EVENT,13,141,108,14,ES_AUTOHSCROLL | 
+                    ES_READONLY
+    PUSHBUTTON      "...",IDC_BUTTON_SELECT,125,141,16,14
 END
 
 IDD_MIB_BROWSER DIALOGEX 0, 0, 329, 322
@@ -1075,6 +1085,7 @@ BEGIN
                     WS_VSCROLL | WS_TABSTOP
     LTEXT           "Step 2 - Formula",IDC_STATIC,7,39,52,8
     EDITTEXT        IDC_EDIT_FORMULA,7,50,214,14,ES_AUTOHSCROLL
+    PUSHBUTTON      "&Create...",IDC_BUTTON_CREATE,171,68,50,14
 END
 
 
@@ -1238,7 +1249,7 @@ BEGIN
         LEFTMARGIN, 7
         RIGHTMARGIN, 221
         TOPMARGIN, 7
-        BOTTOMMARGIN, 128
+        BOTTOMMARGIN, 163
     END
 
     IDD_DCI_THRESHOLDS, DIALOG
@@ -1246,15 +1257,15 @@ BEGIN
         LEFTMARGIN, 7
         RIGHTMARGIN, 221
         TOPMARGIN, 7
-        BOTTOMMARGIN, 128
+        BOTTOMMARGIN, 163
     END
 
     IDD_THRESHOLD, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 189
+        RIGHTMARGIN, 204
         TOPMARGIN, 7
-        BOTTOMMARGIN, 88
+        BOTTOMMARGIN, 162
     END
 
     IDD_MIB_BROWSER, DIALOG
index e4fa4d7..0dd7391 100644 (file)
 #define IDC_IP_MASK                     1162
 #define IDC_COMBO_DELTA                 1163
 #define IDC_EDIT_FORMULA                1164
+#define IDC_BUTTON_CREATE               1166
+#define IDC_EDIT_EVENT                  1167
 #define ID_VIEW_CONTROLPANEL            32771
 #define ID_VIEW_EVENTS                  32774
 #define ID_VIEW_MAP                     32776
 #define _APS_3D_CONTROLS                     1
 #define _APS_NEXT_RESOURCE_VALUE        223
 #define _APS_NEXT_COMMAND_VALUE         32876
-#define _APS_NEXT_CONTROL_VALUE         1165
+#define _APS_NEXT_CONTROL_VALUE         1169
 #define _APS_NEXT_SYMED_VALUE           119
 #endif
 #endif
index 819a795..d9e5b22 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /dll /machine:I386
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /version:0.1 /dll /machine:I386
 # Begin Special Build Tool
 SOURCE="$(InputPath)"
 PostBuild_Desc=Copy files
@@ -84,7 +84,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib /nologo /version:0.1 /dll /debug /machine:I386 /pdbtype:sept
 # Begin Special Build Tool
 SOURCE="$(InputPath)"
 PostBuild_Desc=Copy files
@@ -162,6 +162,10 @@ SOURCE=.\md5.h
 # End Source File
 # Begin Source File
 
+SOURCE="..\..\include\netxms-version.h"
+# End Source File
+# Begin Source File
+
 SOURCE=..\..\include\nms_agent.h
 # End Source File
 # Begin Source File
index 894dff9..8610879 100644 (file)
@@ -52,8 +52,7 @@ void ProcessAlarmUpdate(CSCPMessage *pMsg)
 
    dwCode = pMsg->GetVariableLong(VID_NOTIFICATION_CODE);
    alarm.dwAlarmId = pMsg->GetVariableLong(VID_ALARM_ID);
-   if (dwCode == NX_NOTIFY_NEW_ALARM)
-      AlarmFromMsg(pMsg, &alarm);
+   AlarmFromMsg(pMsg, &alarm);
    CallEventHandler(NXC_EVENT_NOTIFICATION, dwCode, &alarm);
 }
 
index af8aec1..7548308 100644 (file)
@@ -61,6 +61,8 @@ void ProcessDCI(CSCPMessage *pMsg)
             m_pItemList->pItems[i].iDeltaCalculation = (BYTE)pMsg->GetVariableShort(VID_DCI_DELTA_CALCULATION);
             m_pItemList->pItems[i].pszFormula = pMsg->GetVariableStr(VID_DCI_FORMULA);
             pMsg->GetVariableStr(VID_NAME, m_pItemList->pItems[i].szName, MAX_ITEM_NAME);
+            pMsg->GetVariableStr(VID_DESCRIPTION, m_pItemList->pItems[i].szDescription,
+                                 MAX_DB_STRING);
             m_pItemList->pItems[i].dwNumThresholds = pMsg->GetVariableLong(VID_NUM_THRESHOLDS);
             m_pItemList->pItems[i].pThresholdList = 
                (NXC_DCI_THRESHOLD *)malloc(sizeof(NXC_DCI_THRESHOLD) * m_pItemList->pItems[i].dwNumThresholds);
@@ -248,6 +250,7 @@ DWORD LIBNXCL_EXPORTABLE NXCUpdateDCI(DWORD dwNodeId, NXC_DCI *pItem)
    msg.SetVariable(VID_DCI_DELTA_CALCULATION, (WORD)pItem->iDeltaCalculation);
    msg.SetVariable(VID_DCI_STATUS, (WORD)pItem->iStatus);
    msg.SetVariable(VID_NAME, pItem->szName);
+   msg.SetVariable(VID_DESCRIPTION, pItem->szDescription);
    msg.SetVariable(VID_DCI_FORMULA, pItem->pszFormula);
    msg.SetVariable(VID_NUM_THRESHOLDS, pItem->dwNumThresholds);
    for(i = 0, dwId = VID_DCI_THRESHOLD_BASE; i < pItem->dwNumThresholds; i++, dwId++)
index 3ef4194..1be6551 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnetxms.lib ws2_32.lib libnxcscp.lib /nologo /dll /machine:I386 /libpath:"..\libnetxms\Release" /libpath:"..\libnxcscp\Release"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnetxms.lib ws2_32.lib libnxcscp.lib /nologo /version:0.1 /dll /machine:I386 /libpath:"..\libnetxms\Release" /libpath:"..\libnxcscp\Release"
 # Begin Special Build Tool
 SOURCE="$(InputPath)"
 PostBuild_Desc=Copy files
@@ -84,7 +84,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnetxms.lib ws2_32.lib libnxcscp.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\libnetxms\Debug" /libpath:"..\libnxcscp\Debug"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnetxms.lib ws2_32.lib libnxcscp.lib /nologo /version:0.1 /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\libnetxms\Debug" /libpath:"..\libnxcscp\Debug"
 # Begin Special Build Tool
 SOURCE="$(InputPath)"
 PostBuild_Cmds=copy Debug\libnxcl.dll ..\..\bin
index 565f4b8..0badfc0 100644 (file)
@@ -36,6 +36,7 @@ AlarmManager g_alarmMgr;
 
 void FillAlarmInfoMessage(CSCPMessage *pMsg, NXC_ALARM *pAlarm)
 {
+   pMsg->SetVariable(VID_ALARM_ID, pAlarm->dwAlarmId);
    pMsg->SetVariable(VID_ACK_BY_USER, pAlarm->dwAckByUser);
    pMsg->SetVariable(VID_EVENT_ID, pAlarm->dwSourceEvent);
    pMsg->SetVariable(VID_OBJECT_ID, pAlarm->dwSourceObject);
@@ -306,7 +307,6 @@ void AlarmManager::SendAlarmsToClient(DWORD dwRqId, BOOL bIncludeAck, ClientSess
          {
             if (pObject->CheckAccessRights(dwUserId, OBJECT_ACCESS_READ_ALARMS))
             {
-               msg.SetVariable(VID_ALARM_ID, m_pAlarmList[i].dwAlarmId);
                FillAlarmInfoMessage(&msg, &m_pAlarmList[i]);
                pSession->SendMessage(&msg);
                msg.DeleteAllVariables();
index 48d6e80..84c8f53 100644 (file)
@@ -41,6 +41,7 @@ DCItem::DCItem()
    m_iSource = DS_INTERNAL;
    m_iStatus = ITEM_STATUS_NOT_SUPPORTED;
    m_szName[0] = 0;
+   m_szDescription[0] = 0;
    m_tLastPoll = 0;
    m_pszFormula = strdup("");
    m_pNode = NULL;
@@ -54,13 +55,13 @@ DCItem::DCItem()
 // Constructor for creating DCItem from database
 // Assumes that fields in SELECT query are in following order:
 // item_id,name,source,datatype,polling_interval,retention_time,status,
-// delta_calculation,transformation,template_id
+// delta_calculation,transformation,template_id,description
 //
 
 DCItem::DCItem(DB_RESULT hResult, int iRow, Node *pNode)
 {
    m_dwId = DBGetFieldULong(hResult, iRow, 0);
-   strcpy(m_szName, DBGetField(hResult, iRow, 1));
+   strncpy(m_szName, DBGetField(hResult, iRow, 1), MAX_ITEM_NAME);
    m_iSource = (BYTE)DBGetFieldLong(hResult, iRow, 2);
    m_iDataType = (BYTE)DBGetFieldLong(hResult, iRow, 3);
    m_iPollingInterval = DBGetFieldLong(hResult, iRow, 4);
@@ -69,6 +70,7 @@ DCItem::DCItem(DB_RESULT hResult, int iRow, Node *pNode)
    m_iDeltaCalculation = (BYTE)DBGetFieldLong(hResult, iRow, 7);
    m_pszFormula = strdup(DBGetField(hResult, iRow, 8));
    m_dwTemplateId = DBGetFieldULong(hResult, iRow, 9);
+   strncpy(m_szDescription, DBGetField(hResult, iRow, 10), MAX_DB_STRING);
    m_iBusy = 0;
    m_tLastPoll = 0;
    m_dwNumThresholds = 0;
@@ -90,6 +92,7 @@ DCItem::DCItem(DWORD dwId, char *szName, int iSource, int iDataType,
    m_dwId = dwId;
    m_dwTemplateId = 0;
    strncpy(m_szName, szName, MAX_ITEM_NAME);
+   strcpy(m_szDescription, m_szName);
    m_iSource = iSource;
    m_iDataType = iDataType;
    m_iPollingInterval = iPollingInterval;
@@ -165,7 +168,7 @@ BOOL DCItem::LoadThresholdsFromDB(void)
 
 BOOL DCItem::SaveToDB(void)
 {
-   char *pszEscFormula, szQuery[1024];
+   char *pszEscFormula, *pszEscDescr, szQuery[1024];
    DB_RESULT hResult;
    BOOL bNewObject = TRUE, bResult;
 
@@ -183,22 +186,26 @@ BOOL DCItem::SaveToDB(void)
 
    // Prepare and execute query
    pszEscFormula = EncodeSQLString(m_pszFormula);
+   pszEscDescr = EncodeSQLString(m_szDescription);
    if (bNewObject)
       sprintf(szQuery, "INSERT INTO items (item_id,node_id,template_id,name,description,source,"
                        "datatype,polling_interval,retention_time,status,delta_calculation,"
-                       "transformation) VALUES (%ld,%ld,%ld,'%s','',%d,%d,%ld,%ld,%d,%d,'%s')",
+                       "transformation) VALUES (%ld,%ld,%ld,'%s','%s',%d,%d,%ld,%ld,%d,%d,'%s')",
                        m_dwId, (m_pNode == NULL) ? 0 : m_pNode->Id(), m_dwTemplateId,
-                       m_szName, m_iSource, m_iDataType, m_iPollingInterval,
+                       m_szName, pszEscDescr, m_iSource, m_iDataType, m_iPollingInterval,
                        m_iRetentionTime, m_iStatus, m_iDeltaCalculation, pszEscFormula);
    else
       sprintf(szQuery, "UPDATE items SET node_id=%ld,template_id=%ld,name='%s',source=%d,"
                        "datatype=%d,polling_interval=%ld,retention_time=%ld,status=%d,"
-                       "delta_calculation=%d,transformation='%s' WHERE item_id=%ld",
+                       "delta_calculation=%d,transformation='%s',description='%s' "
+                       "WHERE item_id=%ld",
                        (m_pNode == NULL) ? 0 : m_pNode->Id(), m_dwTemplateId,
                        m_szName, m_iSource, m_iDataType, m_iPollingInterval,
-                       m_iRetentionTime, m_iStatus, m_iDeltaCalculation, pszEscFormula, m_dwId);
+                       m_iRetentionTime, m_iStatus, m_iDeltaCalculation, pszEscFormula,
+                       pszEscDescr, m_dwId);
    bResult = DBQuery(g_hCoreDB, szQuery);
    free(pszEscFormula);
+   free(pszEscDescr);
 
    // Save thresholds
    if (bResult)
@@ -253,8 +260,8 @@ void DCItem::CheckThresholds(ItemValue &value)
       switch(iResult)
       {
          case THRESHOLD_REACHED:
-            PostEvent(m_ppThresholdList[i]->EventCode(), m_pNode->Id(), "sss", m_szName,
-                      m_ppThresholdList[i]->Value(), (const char *)value);
+            PostEvent(m_ppThresholdList[i]->EventCode(), m_pNode->Id(), "ssss", m_szName,
+                      m_szDescription, m_ppThresholdList[i]->Value(), (const char *)value);
             i = m_dwNumThresholds;  // Stop processing
             break;
          case THRESHOLD_REARMED:
@@ -282,6 +289,7 @@ void DCItem::CreateMessage(CSCPMessage *pMsg)
    Lock();
    pMsg->SetVariable(VID_DCI_ID, m_dwId);
    pMsg->SetVariable(VID_NAME, m_szName);
+   pMsg->SetVariable(VID_DESCRIPTION, m_szDescription);
    pMsg->SetVariable(VID_POLLING_INTERVAL, (DWORD)m_iPollingInterval);
    pMsg->SetVariable(VID_RETENTION_TIME, (DWORD)m_iRetentionTime);
    pMsg->SetVariable(VID_DCI_SOURCE_TYPE, (WORD)m_iSource);
@@ -330,6 +338,7 @@ void DCItem::UpdateFromMessage(CSCPMessage *pMsg, DWORD *pdwNumMaps,
    Lock();
 
    pMsg->GetVariableStr(VID_NAME, m_szName, MAX_ITEM_NAME);
+   pMsg->GetVariableStr(VID_DESCRIPTION, m_szDescription, MAX_DB_STRING);
    m_iSource = (BYTE)pMsg->GetVariableShort(VID_DCI_SOURCE_TYPE);
    m_iDataType = (BYTE)pMsg->GetVariableShort(VID_DCI_DATA_TYPE);
    m_iPollingInterval = pMsg->GetVariableLong(VID_POLLING_INTERVAL);
index 3742dbe..d3b52e0 100644 (file)
@@ -50,7 +50,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libsnmp.lib iphlpapi.lib libnetxms.lib libnxcscp.lib libnxsrv.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\libnetxms\Release" /libpath:"..\..\libnxcscp\Release" /libpath:"..\libnxsrv\Release"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libsnmp.lib iphlpapi.lib libnetxms.lib libnxcscp.lib libnxsrv.lib /nologo /version:0.1 /subsystem:console /machine:I386 /libpath:"..\..\libnetxms\Release" /libpath:"..\..\libnxcscp\Release" /libpath:"..\libnxsrv\Release"
 
 !ELSEIF  "$(CFG)" == "netxmsd - Win32 Debug"
 
@@ -74,7 +74,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libsnmp.lib iphlpapi.lib libnetxms.lib libnxcscp.lib libnxsrv.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libnetxms\Debug" /libpath:"..\..\libnxcscp\Debug" /libpath:"..\libnxsrv\Debug"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libsnmp.lib iphlpapi.lib libnetxms.lib libnxcscp.lib libnxsrv.lib /nologo /version:0.1 /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libnetxms\Debug" /libpath:"..\..\libnxcscp\Debug" /libpath:"..\libnxsrv\Debug"
 # Begin Special Build Tool
 SOURCE="$(InputPath)"
 PostBuild_Cmds=copy Debug\netxmsd.exe ..\..\..\bin
index eadcbdf..f7af26f 100644 (file)
@@ -393,7 +393,7 @@ void WatchdogNotify(DWORD dwId);
 void WatchdogPrintStatus(void);
 
 void CheckForMgmtNode(void);
-NetObj *PollNewNode(DWORD dwIpAddr, DWORD dwNetMask, DWORD dwFlags);
+NetObj *PollNewNode(DWORD dwIpAddr, DWORD dwNetMask, DWORD dwFlags, TCHAR *pszName);
 
 void EnumerateClientSessions(void (*pHandler)(ClientSession *, void *), void *pArg);
 void NotifyClient(ClientSession *pSession, void *pArg);
index 0fad039..5fcd000 100644 (file)
@@ -137,6 +137,7 @@ class DCItem
 private:
    DWORD m_dwId;
    char m_szName[MAX_ITEM_NAME];
+   char m_szDescription[MAX_DB_STRING];
    time_t m_tLastPoll;        // Last poll time
    int m_iPollingInterval;    // Polling interval in seconds
    int m_iRetentionTime;      // Retention time in seconds
index 0d258bc..fd4f6f3 100644 (file)
@@ -142,6 +142,7 @@ public:
 
    void SetId(DWORD dwId) { m_dwId = dwId; Modify(); }
    void SetMgmtStatus(BOOL bIsManaged);
+   void SetName(char *pszName) { strncpy(m_szName, pszName, MAX_OBJECT_NAME); Modify(); }
 
    virtual void CalculateCompoundStatus(void);
 
index 75270a6..456ace2 100644 (file)
@@ -237,7 +237,7 @@ void Node::LoadItemsFromDB(void)
    DB_RESULT hResult;
 
    sprintf(szQuery, "SELECT item_id,name,source,datatype,polling_interval,retention_time,"
-                    "status,delta_calculation,transformation,template_id "
+                    "status,delta_calculation,transformation,template_id,description "
                     "FROM items WHERE node_id=%d", m_dwId);
    hResult = DBSelect(g_hCoreDB, szQuery);
 
index 41c3988..a8ba895 100644 (file)
@@ -28,7 +28,7 @@
 // Returns pointer to new node object on success or NULL on failure
 //
 
-NetObj *PollNewNode(DWORD dwIpAddr, DWORD dwNetMask, DWORD dwFlags)
+NetObj *PollNewNode(DWORD dwIpAddr, DWORD dwNetMask, DWORD dwFlags, TCHAR *pszName)
 {
    Node *pNode;
    char szIpAddr1[32], szIpAddr2[32];
@@ -56,6 +56,8 @@ NetObj *PollNewNode(DWORD dwIpAddr, DWORD dwNetMask, DWORD dwFlags)
       delete pNode;     // Node poll failed, delete it
       return NULL;
    }
+   if (pszName != NULL)
+      pNode->SetName(pszName);
 
    // DEBUG
    pNode->AddItem(new DCItem(CreateUniqueId(IDG_ITEM), "Status", DS_INTERNAL, DCI_DT_INTEGER, 60, 30, pNode));
@@ -101,7 +103,7 @@ THREAD_RESULT THREAD_CALL NodePoller(void *arg)
             dwNetMask = DBGetFieldULong(hResult, i, 2);
             dwFlags = DBGetFieldULong(hResult, i, 3);
 
-            PollNewNode(dwIpAddr, dwNetMask, dwFlags);
+            PollNewNode(dwIpAddr, dwNetMask, dwFlags, NULL);
 
             // Delete processed node
             sprintf(szQuery, "DELETE FROM new_nodes WHERE id=%ld", dwId);
index 22030d1..6e57943 100644 (file)
@@ -341,9 +341,7 @@ void ClientSession::UpdateThread(void)
             msg.SetCode(CMD_ALARM_UPDATE);
             msg.SetId(0);
             msg.SetVariable(VID_NOTIFICATION_CODE, pUpdate->dwCode);
-            msg.SetVariable(VID_ALARM_ID, ((NXC_ALARM *)pUpdate->pData)->dwAlarmId);
-            if (pUpdate->dwCode == NX_NOTIFY_NEW_ALARM)
-               FillAlarmInfoMessage(&msg, (NXC_ALARM *)pUpdate->pData);
+            FillAlarmInfoMessage(&msg, (NXC_ALARM *)pUpdate->pData);
             SendMessage(&msg);
             MutexUnlock(m_mutexSendAlarms);
             msg.DeleteAllVariables();
@@ -2096,7 +2094,7 @@ void ClientSession::CreateObject(CSCPMessage *pRequest)
                      case OBJECT_NODE:
                         pObject = PollNewNode(pRequest->GetVariableLong(VID_IP_ADDRESS),
                                               pRequest->GetVariableLong(VID_IP_NETMASK),
-                                              DF_DEFAULT);
+                                              DF_DEFAULT, szObjectName);
                         break;
                      case OBJECT_CONTAINER:
                         pDescription = pRequest->GetVariableStr(VID_DESCRIPTION);
index 50f863e..e117525 100644 (file)
@@ -2,4 +2,4 @@ INCLUDES=-I@top_srcdir@/include -I@top_srcdir@/src/server/include
 
 lib_LTLIBRARIES = libnxddr_mysql.la
 libnxddr_mysql_la_SOURCES = mysql.cpp
-libnxddr_mysql_la_LDFLAGS = -version-info $(LIBNETXMS_LIBRARY_VERSION)
+libnxddr_mysql_la_LDFLAGS = -version-info $(DBDRV_LIBRARY_VERSION)
index 80abf65..c622d3f 100644 (file)
@@ -2,4 +2,4 @@ INCLUDES=-I@top_srcdir@/include -I@top_srcdir@/src/server/include
 
 lib_LTLIBRARIES = libnxddr_odbc.la
 libnxddr_odbc_la_SOURCES = odbc.cpp
-libnxddr_odbc_la_LDFLAGS = -version-info $(LIBNETXMS_LIBRARY_VERSION)
+libnxddr_odbc_la_LDFLAGS = -version-info $(DBDRV_LIBRARY_VERSION)
index 6335845..cd337bf 100644 (file)
@@ -2,4 +2,4 @@ INCLUDES=-I@top_srcdir@/include -I@top_srcdir@/src/server/include
 
 lib_LTLIBRARIES = libnxddr_pgsql.la
 libnxddr_pgsql_la_SOURCES = pgsql.cpp
-libnxddr_pgsql_la_LDFLAGS = -version-info $(LIBNETXMS_LIBRARY_VERSION)
+libnxddr_pgsql_la_LDFLAGS = -version-info $(DBDRV_LIBRARY_VERSION)
index b1dabeb..989372b 100644 (file)
@@ -53,7 +53,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libnxcscp.lib libnetxms.lib /nologo /dll /machine:I386 /libpath:"..\..\libnetxms\Release" /libpath:"..\..\libnxcscp\Release"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libnxcscp.lib libnetxms.lib /nologo /version:0.1 /dll /machine:I386 /libpath:"..\..\libnetxms\Release" /libpath:"..\..\libnxcscp\Release"
 
 !ELSEIF  "$(CFG)" == "libnxsrv - Win32 Debug"
 
@@ -79,7 +79,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /dll /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libnxcscp.lib libnetxms.lib /nologo /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libnetxms\Debug" /libpath:"..\..\libnxcscp\Debug"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libnxcscp.lib libnetxms.lib /nologo /version:0.1 /dll /debug /machine:I386 /pdbtype:sept /libpath:"..\..\libnetxms\Debug" /libpath:"..\..\libnxcscp\Debug"
 # Begin Special Build Tool
 SOURCE="$(InputPath)"
 PostBuild_Desc=Copy files
index f6e5cba..c6434ba 100644 (file)
 #endif
 
 
-//
-// Constants
-//
-
-#define NXACTION_VERSION   "0"
-
-
 //
 // Startup
 //
@@ -107,7 +100,7 @@ int main(int argc, char *argv[])
             strncpy(szSecret, optarg, MAX_SECRET_LENGTH - 1);
             break;
          case 'v':   // Print version and exit
-            printf("NetXMS ACTION command-line utility Version " NETXMS_VERSION_STRING "." NXACTION_VERSION "\n");
+            printf("NetXMS ACTION command-line utility Version " NETXMS_VERSION_STRING "\n");
             bStart = FALSE;
             break;
          case 'w':   // Command timeout
index 133b87e..bb75f38 100644 (file)
@@ -50,7 +50,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnetxms.lib libnxcscp.lib libnxsrv.lib ws2_32.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libnetxms\Release" /libpath:"..\..\..\libnxcscp\Release" /libpath:"..\..\libnxsrv\Release"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnetxms.lib libnxcscp.lib libnxsrv.lib ws2_32.lib /nologo /version:0.1 /subsystem:console /machine:I386 /libpath:"..\..\..\libnetxms\Release" /libpath:"..\..\..\libnxcscp\Release" /libpath:"..\..\libnxsrv\Release"
 
 !ELSEIF  "$(CFG)" == "nxaction - Win32 Debug"
 
@@ -74,7 +74,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnetxms.lib libnxcscp.lib libnxsrv.lib ws2_32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libnetxms\Debug" /libpath:"..\..\..\libnxcscp\Debug" /libpath:"..\..\libnxsrv\Debug"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib libnetxms.lib libnxcscp.lib libnxsrv.lib ws2_32.lib /nologo /version:0.1 /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libnetxms\Debug" /libpath:"..\..\..\libnxcscp\Debug" /libpath:"..\..\libnxsrv\Debug"
 # Begin Special Build Tool
 SOURCE="$(InputPath)"
 PostBuild_Desc=Copy files
index 36c98f3..848518b 100644 (file)
@@ -36,7 +36,6 @@
 //
 
 #define MAX_LINE_SIZE      4096
-#define NXGET_VERSION      "2"
 
 #define CMD_GET            0
 #define CMD_LIST           1
@@ -192,7 +191,7 @@ int main(int argc, char *argv[])
             strncpy(szSecret, optarg, MAX_SECRET_LENGTH - 1);
             break;
          case 'v':   // Print version and exit
-            printf("NetXMS GET command-line utility Version " NETXMS_VERSION_STRING "." NXGET_VERSION "\n");
+            printf("NetXMS GET command-line utility Version " NETXMS_VERSION_STRING "\n");
             bStart = FALSE;
             break;
          case 'w':   // Command timeout
index ae8e743..06b8c9a 100644 (file)
@@ -50,7 +50,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /machine:I386
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libnetxms.lib libnxsrv.lib /nologo /subsystem:console /machine:I386 /libpath:"..\..\..\libnetxms\Release" /libpath:"..\..\libnxsrv\Release"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libnetxms.lib libnxsrv.lib /nologo /version:0.1 /subsystem:console /machine:I386 /libpath:"..\..\..\libnetxms\Release" /libpath:"..\..\libnxsrv\Release"
 
 !ELSEIF  "$(CFG)" == "nxget - Win32 Debug"
 
@@ -74,7 +74,7 @@ BSC32=bscmake.exe
 # ADD BSC32 /nologo
 LINK32=link.exe
 # ADD BASE LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept
-# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libnetxms.lib libnxsrv.lib /nologo /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libnetxms\Debug" /libpath:"..\..\libnxsrv\Debug"
+# ADD LINK32 kernel32.lib user32.lib gdi32.lib winspool.lib comdlg32.lib advapi32.lib shell32.lib ole32.lib oleaut32.lib uuid.lib odbc32.lib odbccp32.lib ws2_32.lib libnetxms.lib libnxsrv.lib /nologo /version:0.1 /subsystem:console /debug /machine:I386 /pdbtype:sept /libpath:"..\..\..\libnetxms\Debug" /libpath:"..\..\libnxsrv\Debug"
 # Begin Special Build Tool
 SOURCE="$(InputPath)"
 PostBuild_Desc=Copy Files