- Performance view half-working
authorVictor Kirhenshtein <victor@netxms.org>
Thu, 1 Mar 2007 23:29:06 +0000 (23:29 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Thu, 1 Mar 2007 23:29:06 +0000 (23:29 +0000)
- Various minor fixes

31 files changed:
.gitattributes
include/netxms-version.h
include/nms_cscp.h
include/nms_threads.h
include/nxclapi.h
include/nxqueue.h
src/console/win32/Graph.cpp
src/console/win32/Graph.h
src/console/win32/MainFrm.cpp
src/console/win32/MainFrm.h
src/console/win32/Makefile.am
src/console/win32/NodePerfView.cpp [new file with mode: 0644]
src/console/win32/NodePerfView.h [new file with mode: 0644]
src/console/win32/ObjectView.cpp
src/console/win32/ObjectView.h
src/console/win32/globals.h
src/console/win32/nxcon.clw
src/console/win32/nxcon.cpp
src/console/win32/nxcon.dsp
src/console/win32/nxcon.rc
src/console/win32/resource.h
src/console/win32/tools.cpp
src/libnetxms/nxcp.cpp
src/libnetxms/queue.cpp
src/libnetxms/seh.cpp
src/libnxcl/datacoll.cpp
src/server/core/node.cpp
src/server/core/session.cpp
src/server/include/nms_core.h
src/server/include/nms_objects.h
src/server/netxmsd/netxmsd.cpp

index 7b2af18..490f394 100644 (file)
@@ -808,6 +808,8 @@ src/console/win32/NewObjectToolDlg.cpp -text
 src/console/win32/NewObjectToolDlg.h -text
 src/console/win32/NewUserDlg.cpp -text
 src/console/win32/NewUserDlg.h -text
+src/console/win32/NodePerfView.cpp -text
+src/console/win32/NodePerfView.h -text
 src/console/win32/NodePoller.cpp -text
 src/console/win32/NodePoller.h -text
 src/console/win32/NodePropsGeneral.cpp -text
index 1a4fbe0..e1ca1c4 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: netxms-version.h,v 1.109 2007-02-12 04:43:02 victor Exp $ */
+/* $Id: netxms-version.h,v 1.110 2007-03-01 23:29:04 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
 ** Copyright (C) 2003, 2004, 2005, 2006, 2007 Victor Kirhenshtein
@@ -33,7 +33,7 @@
 #define NETXMS_VERSION_MINOR        2
 #define NETXMS_VERSION_BUILD        16
 #define NETXMS_VERSION_HOTFIX                  0
-#define NETXMS_VERSION_STRING       _T("0.2.16-rc5")
+#define NETXMS_VERSION_STRING       _T("0.2.16-rc7")
 
 
 //
index b8531c0..2b21c11 100644 (file)
@@ -439,6 +439,7 @@ typedef struct
 #define CMD_GET_GRAPH_LIST                             0x00C5
 #define CMD_DEFINE_GRAPH                               0x00C6
 #define CMD_DELETE_GRAPH                               0x00C7
+#define CMD_GET_SYSTEM_DCI_LIST                0x00C8
 
 
 //
@@ -837,6 +838,9 @@ typedef struct
 #define VID_GRAPH_LIST_BASE         ((DWORD)0x10000000)
 #define VID_GRAPH_ACL_BASE                             ((DWORD)0x20000000)
 
+// Base value for system DCI list
+#define VID_SYSDCI_LIST_BASE                   ((DWORD)0x10000000)
+
 
 //
 // Inline functions
index d075442..250e3e9 100644 (file)
@@ -69,9 +69,9 @@ typedef struct
 THREAD_RESULT LIBNETXMS_EXPORTABLE THREAD_CALL SEHThreadStarter(void *);
 int LIBNETXMS_EXPORTABLE ___ExceptionHandler(EXCEPTION_POINTERS *pInfo);
 
-void LIBNETXMS_EXPORTABLE SetExceptionHandler(void (*pfHandler)(EXCEPTION_POINTERS *),
+void LIBNETXMS_EXPORTABLE SetExceptionHandler(BOOL (*pfHandler)(EXCEPTION_POINTERS *),
                                                                                                                         void (*pfWriter)(char *));
-void LIBNETXMS_EXPORTABLE SEHDefaultConsoleHandler(EXCEPTION_POINTERS *pInfo);
+BOOL LIBNETXMS_EXPORTABLE SEHDefaultConsoleHandler(EXCEPTION_POINTERS *pInfo);
 TCHAR LIBNETXMS_EXPORTABLE *SEHExceptionName(DWORD code);
 void LIBNETXMS_EXPORTABLE SEHShowCallStack(CONTEXT *pCtx);
 
index 0b734cc..ed9b661 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: nxclapi.h,v 1.257 2007-02-08 22:25:20 victor Exp $ */
+/* $Id: nxclapi.h,v 1.258 2007-03-01 23:29:04 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
 ** Client Library API
@@ -1621,6 +1621,18 @@ typedef struct
 } NXC_GRAPH;
 
 
+//
+// System DCI information
+//
+
+typedef struct
+{
+       DWORD dwId;
+       TCHAR szName[MAX_DB_STRING];
+       int nStatus;
+} NXC_SYSTEM_DCI;
+
+
 //
 // Functions
 //
@@ -1775,6 +1787,8 @@ DWORD LIBNXCL_EXPORTABLE NXCQueryParameter(NXC_SESSION hSession, DWORD dwNodeId,
                                            TCHAR *pszBuffer, DWORD dwBufferSize);
 DWORD LIBNXCL_EXPORTABLE NXCResolveDCINames(NXC_SESSION hSession, DWORD dwNumDCI,
                                             INPUT_DCI *pDCIList, TCHAR ***pppszNames);
+DWORD LIBNXCL_EXPORTABLE NXCGetSystemDCIList(NXC_SESSION hSession, DWORD dwNodeId,
+                                             DWORD *pdwNumItems, NXC_SYSTEM_DCI **ppList);
 DWORD LIBNXCL_EXPORTABLE NXCPushDCIData(NXC_SESSION hSession, DWORD dwNumItems,
                                         NXC_DCI_PUSH_DATA *pItems, DWORD *pdwIndex);
 
index 99e19fa..da8b35a 100644 (file)
@@ -42,11 +42,13 @@ private:
    DWORD m_dwLast;
    DWORD m_dwBufferIncrement;
 
+       void CommonInit(void);
    void Lock(void) { MutexLock(m_mutexQueueAccess, INFINITE); }
    void Unlock(void) { MutexUnlock(m_mutexQueueAccess); }
 
 public:
-   Queue(DWORD dwInitialSize = 256, DWORD dwBufferIncrement = 32);
+   Queue();
+   Queue(DWORD dwInitialSize, DWORD dwBufferIncrement = 32);
    ~Queue();
 
    void Put(void *pObject);
index a22ba51..4e7a0c1 100644 (file)
@@ -49,31 +49,11 @@ CGraph::CGraph()
    m_bShowRuler = TRUE;
    m_bShowLegend = TRUE;
    m_bEnableZoom = TRUE;
+       m_bSet3DEdge = TRUE;
    m_dwNumItems = 0;
-   m_rgbBkColor = RGB(0,0,0);
-   m_rgbGridColor = RGB(64, 64, 64);
-   m_rgbAxisColor = RGB(127, 127, 127);
-   m_rgbRulerColor = RGB(127, 127, 127);
-   m_rgbTextColor = RGB(255, 255, 255);
-   m_rgbSelRectColor = RGB(0, 255, 255);
 
        memset(m_graphItemStyles, 0, sizeof(GRAPH_ITEM_STYLE) * MAX_GRAPH_ITEMS);
-   m_graphItemStyles[0].rgbColor = RGB(0, 255, 0);
-   m_graphItemStyles[1].rgbColor = RGB(255, 255, 0);
-   m_graphItemStyles[2].rgbColor = RGB(0, 255, 255);
-   m_graphItemStyles[3].rgbColor = RGB(0, 0, 255);
-   m_graphItemStyles[4].rgbColor = RGB(255, 0, 255);
-   m_graphItemStyles[5].rgbColor = RGB(255, 0, 0);
-   m_graphItemStyles[6].rgbColor = RGB(0, 128, 128);
-   m_graphItemStyles[7].rgbColor = RGB(0, 128, 0);
-   m_graphItemStyles[8].rgbColor = RGB(128, 128, 255);
-   m_graphItemStyles[9].rgbColor = RGB(255, 128, 0);
-   m_graphItemStyles[10].rgbColor = RGB(128, 128, 0);
-   m_graphItemStyles[11].rgbColor = RGB(128, 0, 255);
-   m_graphItemStyles[12].rgbColor = RGB(255, 255, 128);
-   m_graphItemStyles[13].rgbColor = RGB(0, 128, 64);
-   m_graphItemStyles[14].rgbColor = RGB(0, 128, 255);
-   m_graphItemStyles[15].rgbColor = RGB(192, 192, 192);
+       SetColorScheme(GCS_CLASSIC);
 
    memset(m_pData, 0, sizeof(NXC_DCI_DATA *) * MAX_GRAPH_ITEMS);
    m_ppItems = NULL;
@@ -125,8 +105,11 @@ BOOL CGraph::PreCreateWindow(CREATESTRUCT& cs)
        if (!CWnd::PreCreateWindow(cs))
                return FALSE;
 
-       cs.dwExStyle |= WS_EX_CLIENTEDGE;
-       cs.style &= ~WS_BORDER;
+       if (m_bSet3DEdge)
+       {
+               cs.dwExStyle |= WS_EX_CLIENTEDGE;
+               cs.style &= ~WS_BORDER;
+       }
        cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS, 
       ::LoadCursor(NULL, IDC_ARROW), ::CreateSolidBrush(RGB(0, 0, 0)), NULL);
 
@@ -1140,3 +1123,65 @@ BOOL CGraph::GetTimeFrameForUpdate(DWORD dwIndex, DWORD *pdwFrom, DWORD *pdwTo)
 
    return TRUE;
 }
+
+
+//
+// Set predefined color scheme
+//
+
+void CGraph::SetColorScheme(int nScheme)
+{
+       switch(nScheme)
+       {
+               case GCS_CLASSIC:
+                       m_rgbBkColor = RGB(0, 0, 0);
+                       m_rgbGridColor = RGB(64, 64, 64);
+                       m_rgbAxisColor = RGB(127, 127, 127);
+                       m_rgbRulerColor = RGB(127, 127, 127);
+                       m_rgbTextColor = RGB(255, 255, 255);
+                       m_rgbSelRectColor = RGB(0, 255, 255);
+                       m_graphItemStyles[0].rgbColor = RGB(0, 255, 0);
+                       m_graphItemStyles[1].rgbColor = RGB(255, 255, 0);
+                       m_graphItemStyles[2].rgbColor = RGB(0, 255, 255);
+                       m_graphItemStyles[3].rgbColor = RGB(0, 0, 255);
+                       m_graphItemStyles[4].rgbColor = RGB(255, 0, 255);
+                       m_graphItemStyles[5].rgbColor = RGB(255, 0, 0);
+                       m_graphItemStyles[6].rgbColor = RGB(0, 128, 128);
+                       m_graphItemStyles[7].rgbColor = RGB(0, 128, 0);
+                       m_graphItemStyles[8].rgbColor = RGB(128, 128, 255);
+                       m_graphItemStyles[9].rgbColor = RGB(255, 128, 0);
+                       m_graphItemStyles[10].rgbColor = RGB(128, 128, 0);
+                       m_graphItemStyles[11].rgbColor = RGB(128, 0, 255);
+                       m_graphItemStyles[12].rgbColor = RGB(255, 255, 128);
+                       m_graphItemStyles[13].rgbColor = RGB(0, 128, 64);
+                       m_graphItemStyles[14].rgbColor = RGB(0, 128, 255);
+                       m_graphItemStyles[15].rgbColor = RGB(192, 192, 192);
+                       break;
+               case GCS_LIGHT:
+                       m_rgbBkColor = RGB(255, 255, 255);
+                       m_rgbGridColor = RGB(56, 142, 142);
+                       m_rgbAxisColor = RGB(56, 142, 142);
+                       m_rgbRulerColor = RGB(0, 0, 0);
+                       m_rgbTextColor = RGB(0, 0, 0);
+                       m_rgbSelRectColor = RGB(0, 0, 94);
+                       m_graphItemStyles[0].rgbColor = RGB(0, 147, 0);
+                       m_graphItemStyles[1].rgbColor = RGB(165, 42, 0);
+                       m_graphItemStyles[2].rgbColor = RGB(0, 64, 64);
+                       m_graphItemStyles[3].rgbColor = RGB(0, 0, 255);
+                       m_graphItemStyles[4].rgbColor = RGB(255, 0, 255);
+                       m_graphItemStyles[5].rgbColor = RGB(255, 0, 0);
+                       m_graphItemStyles[6].rgbColor = RGB(0, 128, 128);
+                       m_graphItemStyles[7].rgbColor = RGB(0, 128, 0);
+                       m_graphItemStyles[8].rgbColor = RGB(128, 128, 255);
+                       m_graphItemStyles[9].rgbColor = RGB(255, 128, 0);
+                       m_graphItemStyles[10].rgbColor = RGB(128, 128, 0);
+                       m_graphItemStyles[11].rgbColor = RGB(128, 0, 255);
+                       m_graphItemStyles[12].rgbColor = RGB(0, 0, 0);
+                       m_graphItemStyles[13].rgbColor = RGB(0, 128, 64);
+                       m_graphItemStyles[14].rgbColor = RGB(0, 128, 255);
+                       m_graphItemStyles[15].rgbColor = RGB(192, 192, 192);
+                       break;
+               default:
+                       break;
+       }
+}
index 229f9dd..b19124a 100644 (file)
@@ -16,6 +16,9 @@
 #define GRAPH_TYPE_AREA                1
 #define GRAPH_TYPE_STACKED     2
 
+#define GCS_CLASSIC                    0
+#define GCS_LIGHT                              1
+
 struct ZOOM_INFO
 {
    DWORD dwTimeFrom;
@@ -111,6 +114,8 @@ private:
    int m_nLastGridSizeY;
 
 public:
+       BOOL m_bSet3DEdge;
+       void SetColorScheme(int nScheme);
        void UpdateData(DWORD dwIndex, NXC_DCI_DATA *pData);
        BOOL GetTimeFrameForUpdate(DWORD dwIndex, DWORD *pdwFrom, DWORD *pdwTo);
        BOOL m_bEnableZoom;
index 3f9b8f2..e5239bf 100644 (file)
@@ -615,7 +615,7 @@ void CMainFrame::OnDesktopNew()
 // NXCM_SHOW_FATAL_ERROR message handler
 //
 
-void CMainFrame::OnShowFatalError(WPARAM wParam, LPARAM lParam)
+LRESULT CMainFrame::OnShowFatalError(WPARAM wParam, LPARAM lParam)
 {
-       ((CFatalErrorDlg *)lParam)->DoModal();
+       return ((CFatalErrorDlg *)lParam)->DoModal() != IDOK;           // IDOK == Debug
 }
index d3f5917..1e56a26 100644 (file)
@@ -65,7 +65,7 @@ protected:
    afx_msg void OnDeploymentInfo(WPARAM wParam, LPARAM lParam);
    afx_msg void OnUpdateEventList(WPARAM wParam, LPARAM lParam);
    afx_msg void OnUpdateObjectTools(WPARAM wParam, LPARAM lParam);
-   afx_msg void OnShowFatalError(WPARAM wParam, LPARAM lParam);
+   afx_msg LRESULT OnShowFatalError(WPARAM wParam, LPARAM lParam);
        DECLARE_MESSAGE_MAP()
 };
 
index a315463..3169a28 100644 (file)
@@ -94,6 +94,7 @@ EXTRA_DIST = \
        NewActionDlg.cpp NewActionDlg.h \
        NewObjectToolDlg.cpp NewObjectToolDlg.h \
        NewUserDlg.cpp NewUserDlg.h \
+       NodePerfView.cpp NodePerfView.h \
        NodePoller.cpp NodePoller.h \
        NodePropsGeneral.cpp NodePropsGeneral.h \
        NodePropsPolling.cpp NodePropsPolling.h \
diff --git a/src/console/win32/NodePerfView.cpp b/src/console/win32/NodePerfView.cpp
new file mode 100644 (file)
index 0000000..a0d5157
--- /dev/null
@@ -0,0 +1,378 @@
+// NodePerfView.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "nxcon.h"
+#include "NodePerfView.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+#define STATE_IDLE             0
+#define STATE_LOADING  1
+#define STATE_NO_DATA  2
+#define STATE_UPDATING 3
+
+#define TASK_SHUTDOWN                  0
+#define TASK_GET_AVAIL_DCI             1
+#define TASK_UPDATE_GRAPH              2
+#define TASK_FINISH_UPDATE             3
+
+#define GRAPH_X_MARGIN         30
+#define GRAPH_Y_MARGIN         50
+#define GRAPH_HEIGHT                   150
+
+
+//
+// Worker task
+//
+
+class WorkerTask
+{
+public:
+       int m_nTask;
+       DWORD m_dwId;
+       DWORD m_dwId2;
+       DWORD m_dwTimeFrom;
+       DWORD m_dwTimeTo;
+
+       WorkerTask(int nTask) { m_nTask = nTask; }
+       WorkerTask(int nTask, DWORD dwId) { m_nTask = nTask; m_dwId = dwId; }
+       WorkerTask(int nTask, DWORD dwId, DWORD dwId2,
+                  DWORD dwTimeFrom, DWORD dwTimeTo)
+       {
+               m_nTask = nTask;
+               m_dwId = dwId;
+               m_dwId2 = dwId2;
+               m_dwTimeFrom = dwTimeFrom;
+               m_dwTimeTo = dwTimeTo;
+       }
+};
+
+
+//
+// Worker thread
+//
+
+static THREAD_RESULT THREAD_CALL PerfViewWorkerThread(void *pArg)
+{
+       ((CNodePerfView *)pArg)->WorkerThread();
+       return THREAD_OK;
+}
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CNodePerfView
+
+CNodePerfView::CNodePerfView()
+{
+       m_dwNumGraphs = 0;
+       m_pGraphList = NULL;
+       m_hWorkerThread = INVALID_THREAD_HANDLE;
+       m_nTimer = 0;
+}
+
+CNodePerfView::~CNodePerfView()
+{
+       WorkerTask *pTask;
+
+       while((pTask = (WorkerTask *)m_workerQueue.Get()) != NULL)
+               delete pTask;
+       m_workerQueue.Put(new WorkerTask(TASK_SHUTDOWN));
+       ThreadJoin(PerfViewWorkerThread);
+       safe_free(m_pGraphList);
+}
+
+
+BEGIN_MESSAGE_MAP(CNodePerfView, CWnd)
+       //{{AFX_MSG_MAP(CNodePerfView)
+       ON_WM_CREATE()
+       ON_WM_PAINT()
+       ON_WM_DESTROY()
+       ON_WM_TIMER()
+       //}}AFX_MSG_MAP
+   ON_MESSAGE(NXCM_SET_OBJECT, OnSetObject)
+   ON_MESSAGE(NXCM_REQUEST_COMPLETED, OnRequestCompleted)
+       ON_MESSAGE(NXCM_GRAPH_DATA, OnGraphData)
+       ON_MESSAGE(NXCM_UPDATE_FINISHED, OnUpdateFinished)
+END_MESSAGE_MAP()
+
+
+/////////////////////////////////////////////////////////////////////////////
+// CNodePerfView message handlers
+
+BOOL CNodePerfView::PreCreateWindow(CREATESTRUCT& cs) 
+{
+   if (cs.lpszClass == NULL)
+      cs.lpszClass = AfxRegisterWndClass(CS_HREDRAW | CS_VREDRAW, 
+                                         LoadCursor(NULL, IDC_ARROW),
+                                         (HBRUSH)(COLOR_WINDOW + 1), NULL);
+       return CWnd::PreCreateWindow(cs);
+}
+
+
+//
+// WM_CREATE message handler
+//
+
+int CNodePerfView::OnCreate(LPCREATESTRUCT lpCreateStruct) 
+{
+       if (CWnd::OnCreate(lpCreateStruct) == -1)
+               return -1;
+       
+       m_hWorkerThread = ThreadCreateEx(PerfViewWorkerThread, 0, this);
+
+       return 0;
+}
+
+
+//
+// NXCM_SET_OBJECT message handler
+//
+
+void CNodePerfView::OnSetObject(WPARAM wParam, NXC_OBJECT *pObject)
+{
+       DWORD i;
+
+       if (m_nTimer != 0)
+       {
+               KillTimer(m_nTimer);
+               m_nTimer = 0;
+       }
+
+       for(i = 0; i < m_dwNumGraphs; i++)
+       {
+               m_pGraphList[i].pWnd->DestroyWindow();
+               delete m_pGraphList[i].pWnd;
+       }
+       m_dwNumGraphs = 0;
+   m_pObject = pObject;
+       m_nState = STATE_LOADING;
+       InvalidateRect(NULL);
+       m_workerQueue.Put(new WorkerTask(TASK_GET_AVAIL_DCI));
+}
+
+
+//
+// WM_PAINT message handler
+//
+
+void CNodePerfView::OnPaint() 
+{
+       CPaintDC dc(this); // device context for painting
+       
+       switch(m_nState)
+       {
+               case STATE_LOADING:
+                       dc.TextOut(10, 10, _T("Loading performance data from server..."), 39);
+                       break;
+               case STATE_NO_DATA:
+                       dc.TextOut(10, 10, _T("No performance data available"), 29);
+                       break;
+               default:
+                       break;
+       }
+}
+
+
+//
+// Create graph if appropriate parameter exists
+//
+
+void CNodePerfView::CreateGraph(NXC_SYSTEM_DCI *pItemList, DWORD dwNumItems,
+                                                                                 TCHAR *pszParam, TCHAR *pszTitle, RECT &rect)
+{
+       DWORD i;
+
+       for(i = 0; i < dwNumItems; i++)
+       {
+               if ((!_tcsicmp(pItemList[i].szName, pszParam)) &&
+                        (pItemList[i].nStatus == ITEM_STATUS_ACTIVE))
+               {
+                       m_pGraphList[m_dwNumGraphs].dwItemId = pItemList[i].dwId;
+                       m_pGraphList[m_dwNumGraphs].pWnd = new CGraph;
+                       m_pGraphList[m_dwNumGraphs].pWnd->m_bSet3DEdge = FALSE;
+                       m_pGraphList[m_dwNumGraphs].pWnd->m_bShowLegend = FALSE;
+                       m_pGraphList[m_dwNumGraphs].pWnd->SetColorScheme(GCS_LIGHT);
+                       m_pGraphList[m_dwNumGraphs].pWnd->Create(WS_CHILD | WS_VISIBLE, rect, this, m_dwNumGraphs);
+                       m_dwNumGraphs++;
+                       rect.top += GRAPH_HEIGHT + GRAPH_Y_MARGIN;
+                       rect.bottom = rect.top + GRAPH_HEIGHT;
+                       break;
+               }
+       }
+}
+
+
+//
+// Handler for NXCM_REQUEST_COMPLETED message
+//
+
+void CNodePerfView::OnRequestCompleted(WPARAM wParam, LPARAM lParam)
+{
+       RECT rect;
+
+       if (m_nState != STATE_LOADING)
+               return;
+
+       if (wParam != 0xFFFFFFFF)
+       {
+               GetClientRect(&rect);
+               rect.left += GRAPH_X_MARGIN;
+               rect.right -= GRAPH_X_MARGIN;
+               rect.top += GRAPH_Y_MARGIN;
+               rect.bottom = rect.top + GRAPH_HEIGHT;
+
+               m_pGraphList = (PERF_GRAPH *)realloc(m_pGraphList, wParam * sizeof(PERF_GRAPH));
+               m_dwNumGraphs = 0;
+
+               CreateGraph((NXC_SYSTEM_DCI *)lParam, wParam, _T("@system.cpu_usage"), _T("CPU Utilization"), rect);
+               CreateGraph((NXC_SYSTEM_DCI *)lParam, wParam, _T("@system.freemem"), _T("Free Physical Memory"), rect);
+
+               safe_free(CAST_TO_POINTER(lParam, void *));
+               if (m_dwNumGraphs > 0)
+               {
+                       UpdateAllGraphs();
+                       m_nTimer = SetTimer(1, 30000, NULL);
+               }
+               else
+               {
+                       m_nState = STATE_NO_DATA;
+               }
+       }
+       else
+       {
+               m_nState = STATE_NO_DATA;
+       }
+       InvalidateRect(NULL);
+}
+
+
+//
+// Worker thread
+//
+
+void CNodePerfView::WorkerThread()
+{
+       WorkerTask *pTask;
+       DWORD dwResult, dwNumItems;
+       NXC_SYSTEM_DCI *pItemList;
+       NXC_DCI_DATA *pData;
+
+       while(1)
+       {
+               pTask = (WorkerTask *)m_workerQueue.GetOrBlock();
+               if (pTask->m_nTask == TASK_SHUTDOWN)
+                       break;
+
+               switch(pTask->m_nTask)
+               {
+                       case TASK_GET_AVAIL_DCI:
+                               dwResult = NXCGetSystemDCIList(g_hSession, m_pObject->dwId, &dwNumItems, &pItemList);
+                               PostMessage(NXCM_REQUEST_COMPLETED,
+                                           (dwResult == RCC_SUCCESS) ? dwNumItems : 0xFFFFFFFF,
+                                           CAST_FROM_POINTER(pItemList, LPARAM));
+                               break;
+                       case TASK_FINISH_UPDATE:
+                               PostMessage(NXCM_UPDATE_FINISHED, 0, pTask->m_dwId);
+                               break;
+                       case TASK_UPDATE_GRAPH:
+                               dwResult = NXCGetDCIData(g_hSession, pTask->m_dwId2, pTask->m_dwId, 0,
+                                                        pTask->m_dwTimeFrom, pTask->m_dwTimeTo, &pData);
+                               PostMessage(NXCM_GRAPH_DATA, pTask->m_dwId,
+                                           (dwResult == RCC_SUCCESS) ? CAST_FROM_POINTER(pData, LPARAM) : 0);
+                               break;
+                       default:
+                               break;
+               }
+
+               delete pTask;
+       }
+       delete pTask;
+}
+
+
+//
+// WM_DESTROY message handler
+//
+
+void CNodePerfView::OnDestroy() 
+{
+       if (m_nTimer != 0)
+               KillTimer(m_nTimer);
+       CWnd::OnDestroy();
+}
+
+
+//
+// WM_TIMER message handler
+//
+
+void CNodePerfView::OnTimer(UINT nIDEvent) 
+{
+       if (m_nState == STATE_IDLE)
+               UpdateAllGraphs();
+}
+
+
+//
+// NXCM_UPDATE_FINISHED message handler
+//
+
+void CNodePerfView::OnUpdateFinished(WPARAM wParam, LPARAM lParam)
+{
+       if ((m_nState != STATE_UPDATING) || (m_pObject == NULL))
+               return;
+
+       if (m_pObject->dwId == (DWORD)lParam)
+               m_nState = STATE_IDLE;
+}
+
+
+//
+// Initiate update of all graphs
+//
+
+void CNodePerfView::UpdateAllGraphs()
+{
+       DWORD i;
+
+       m_nState = STATE_UPDATING;
+   m_dwTimeTo = time(NULL);
+   m_dwTimeTo += 60 - m_dwTimeTo % 60;   // Round to minute boundary
+   m_dwTimeFrom = m_dwTimeTo - 3600;
+       for(i = 0; i < m_dwNumGraphs; i++)
+               m_workerQueue.Put(new WorkerTask(TASK_UPDATE_GRAPH, m_pGraphList[i].dwItemId,
+                                                m_pObject->dwId, m_dwTimeFrom, m_dwTimeTo));
+       m_workerQueue.Put(new WorkerTask(TASK_FINISH_UPDATE, m_pObject->dwId));
+}
+
+
+//
+// NXCM_GRAPH_DATA message handler
+//
+
+void CNodePerfView::OnGraphData(WPARAM wParam, LPARAM lParam)
+{
+       DWORD i;
+
+       if (m_nState != STATE_UPDATING)
+               return;
+
+       for(i = 0; i < m_dwNumGraphs; i++)
+       {
+               if (m_pGraphList[i].dwItemId == wParam)
+               {
+                       m_pGraphList[i].pWnd->SetData(0, CAST_TO_POINTER(lParam, NXC_DCI_DATA *));
+                       m_pGraphList[i].pWnd->SetTimeFrame(m_dwTimeFrom, m_dwTimeTo);
+                       m_pGraphList[i].pWnd->Update();
+                       break;
+               }
+       }
+
+       if (i == m_dwNumGraphs)         // Graph for given DCI ID not found
+               NXCDestroyDCIData(CAST_TO_POINTER(lParam, NXC_DCI_DATA *));
+}
diff --git a/src/console/win32/NodePerfView.h b/src/console/win32/NodePerfView.h
new file mode 100644 (file)
index 0000000..82a3ae9
--- /dev/null
@@ -0,0 +1,79 @@
+#if !defined(AFX_NODEPERFVIEW_H__66B55EB4_974D_401D_B1CF_15C4D134347D__INCLUDED_)
+#define AFX_NODEPERFVIEW_H__66B55EB4_974D_401D_B1CF_15C4D134347D__INCLUDED_
+
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// NodePerfView.h : header file
+//
+
+#include <nxqueue.h>
+#include "Graph.h"
+
+
+typedef struct
+{
+       TCHAR *pszTitle;
+       CGraph *pWnd;
+       DWORD dwItemId;
+} PERF_GRAPH;
+
+/////////////////////////////////////////////////////////////////////////////
+// CNodePerfView window
+
+class CNodePerfView : public CWnd
+{
+// Construction
+public:
+       CNodePerfView();
+
+// Attributes
+public:
+
+// Operations
+public:
+
+// Overrides
+       // ClassWizard generated virtual function overrides
+       //{{AFX_VIRTUAL(CNodePerfView)
+       protected:
+       virtual BOOL PreCreateWindow(CREATESTRUCT& cs);
+       //}}AFX_VIRTUAL
+
+// Implementation
+public:
+       void WorkerThread(void);
+       virtual ~CNodePerfView();
+
+       // Generated message map functions
+protected:
+       void CreateGraph(NXC_SYSTEM_DCI *pItemList, DWORD dwNumItems, TCHAR *pszParam, TCHAR *pszTitle, RECT &rect);
+       DWORD m_dwTimeTo;
+       DWORD m_dwTimeFrom;
+       void UpdateAllGraphs(void);
+       UINT m_nTimer;
+       Queue m_workerQueue;
+       THREAD m_hWorkerThread;
+       DWORD m_dwNumGraphs;
+       PERF_GRAPH *m_pGraphList;
+       int m_nState;
+       NXC_OBJECT * m_pObject;
+       //{{AFX_MSG(CNodePerfView)
+       afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
+       afx_msg void OnPaint();
+       afx_msg void OnDestroy();
+       afx_msg void OnTimer(UINT nIDEvent);
+       //}}AFX_MSG
+   afx_msg void OnSetObject(WPARAM wParam, NXC_OBJECT *pObject);
+       afx_msg void OnRequestCompleted(WPARAM wParam, LPARAM lParam);
+       afx_msg void OnUpdateFinished(WPARAM wParam, LPARAM lParam);
+       afx_msg void OnGraphData(WPARAM wParam, LPARAM lParam);
+       DECLARE_MESSAGE_MAP()
+};
+
+/////////////////////////////////////////////////////////////////////////////
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_NODEPERFVIEW_H__66B55EB4_974D_401D_B1CF_15C4D134347D__INCLUDED_)
index 0fd4450..30021e4 100644 (file)
@@ -126,6 +126,7 @@ int CObjectView::OnCreate(LPCREATESTRUCT lpCreateStruct)
    m_imageList.Add(theApp.LoadIcon(IDI_ALARM));
    m_imageList.Add(theApp.LoadIcon(IDI_TREE));
    m_imageList.Add(theApp.LoadIcon(IDI_CLUSTER));
+   m_imageList.Add(theApp.LoadIcon(IDI_GRAPH));
 
    GetClientRect(&rect);
    rect.top += TITLE_BAR_HEIGHT;
@@ -139,10 +140,10 @@ int CObjectView::OnCreate(LPCREATESTRUCT lpCreateStruct)
    m_wndAlarms.Create(NULL, _T("Alarms"), WS_CHILD, rect, this, 2);
    m_wndDepView.Create(NULL, _T("Deps"), WS_CHILD, rect, this, 3);
    m_wndClusterView.Create(NULL, _T("Cluster"), WS_CHILD, rect, this, 4);
+   m_wndPerfView.Create(NULL, _T("Performance"), WS_CHILD, rect, this, 5);
 
    // Create common tabs
    CreateTab(0, _T("Overview"), 0, &m_wndOverview);
-//   CreateTab(1, _T("Alarms"), 1, &m_wndAlarms);
 
    // Activate current tab
    nTemp = theApp.GetProfileInt(_T("ObjectView"), _T("ActiveTab"), 0);
@@ -224,6 +225,8 @@ void CObjectView::SetCurrentObject(NXC_OBJECT *pObject)
        nTab = 1;
    if (m_pObject != NULL)
    {
+               if (m_pObject->iClass == OBJECT_NODE)
+         CreateTab(nTab++, _T("Performance"), 4, &m_wndPerfView);
       switch(m_pObject->iClass)
       {
                        case OBJECT_CLUSTER:
@@ -453,6 +456,7 @@ void CObjectView::AdjustView()
    m_wndAlarms.SetWindowPos(NULL, 0, nOffset, cx, cy - nOffset, SWP_NOZORDER);
    m_wndDepView.SetWindowPos(NULL, 0, nOffset, cx, cy - nOffset, SWP_NOZORDER);
    m_wndClusterView.SetWindowPos(NULL, 0, nOffset, cx, cy - nOffset, SWP_NOZORDER);
+   m_wndPerfView.SetWindowPos(NULL, 0, nOffset, cx, cy - nOffset, SWP_NOZORDER);
 
        if (m_bShowSearchBar)
        {
index f836434..e38bd8b 100644 (file)
@@ -5,6 +5,7 @@
 #include "AlarmView.h" // Added by ClassView
 #include "ObjectDepView.h"     // Added by ClassView
 #include "ClusterView.h"       // Added by ClassView
+#include "NodePerfView.h"
 #include "ExtEditCtrl.h"
 #if _MSC_VER > 1000
 #pragma once
@@ -56,6 +57,7 @@ protected:
        int m_nTitleBarOffset;
        void AdjustView(void);
        BOOL m_bShowSearchBar;
+       CNodePerfView m_wndPerfView;
        CClusterView m_wndClusterView;
        CObjectDepView m_wndDepView;
        CAlarmView m_wndAlarms;
index 3c8b264..bbadf1c 100644 (file)
@@ -131,6 +131,8 @@ extern CConsoleApp theApp;
 #define NXCM_ACTIVATE_OBJECT_TREE  (WM_USER + 126)
 #define NXCM_GRAPH_LIST_UPDATED    (WM_USER + 127)
 #define NXCM_SHOW_FATAL_ERROR      (WM_USER + 128)
+#define NXCM_UPDATE_FINISHED       (WM_USER + 129)
+#define NXCM_GRAPH_DATA            (WM_USER + 130)
 
 
 //
index 330d014..748f208 100644 (file)
@@ -2,13 +2,13 @@
 
 [General Info]
 Version=1
-LastClass=CGraphSettingsPage
-LastTemplate=CPropertyPage
+LastClass=CNodePerfView
+LastTemplate=generic CWnd
 NewFileInclude1=#include "stdafx.h"
 NewFileInclude2=#include "nxcon.h"
 LastPage=0
 
-ClassCount=155
+ClassCount=156
 Class1=CConsoleApp
 Class3=CMainFrame
 Class4=CChildFrame
@@ -17,20 +17,20 @@ Class9=CMapView
 
 ResourceCount=197
 Resource1=IDD_CP_GENERAL (English (U.S.))
-Resource2=IDD_DISCOVERY_GENERAL
+Resource2=IDD_CLUSTER_RESOURCE
 Resource3=IDD_DCI_DATA_EXPORT (English (U.S.))
-Resource4=IDM_CONTEXT
-Resource5=IDA_OBJECT_TOOLS_EDITOR
+Resource4=IDM_VIEW_SPECIFIC
+Resource5=IDD_OBJECT_SECURITY
 Class2=CChildView
 Class5=CAboutDlg
 Class6=CControlPanel
 Class8=CMapFrame
 Class10=CLoginDialog
-Resource6=IDA_GRAPH
+Resource6=IDD_ABOUTBOX
 Class11=CProgressDialog
-Resource7=IDD_COND_DCI_PROP
+Resource7=IDD_CREATE_CLUSTER
 Class12=CAddrEntryDlg
-Resource8=IDA_EPP
+Resource8=IDA_LAST_VALUES
 Class13=CObjectPropDlg
 Resource9=IDD_THRESHOLD (English (U.S.))
 Resource10=IDD_SELECT_OBJECT (English (U.S.))
@@ -46,45 +46,45 @@ Resource17=IDD_NEW_USER (English (U.S.))
 Class16=CDebugFrame
 Resource18=IDD_NEW_ACTION (English (U.S.))
 Resource19=IDD_OBJECT_PROPERTIES (English (U.S.))
-Resource20=IDD_SELECT_MP
+Resource20=IDA_MDI_DEFAULT
 Class17=CObjectPreview
 Resource21=IDA_OBJECT_BROWSER (English (U.S.))
 Class18=CToolBox
 Class19=CObjectInfoBox
 Class20=CObjectSearchBox
-Resource22=IDA_AGENT_CONFIG_MANAGER
+Resource22=IDD_USER_PROPERTIES
 Class21=CEditBox
 Class22=COPGeneral
 Class23=CNodePropsGeneral
 Resource23=IDD_GRAPH_PROPERTIES (English (U.S.))
 Class24=CObjectPropCaps
 Class25=CObjectPropSheet
-Resource24=IDD_AGENT_CONFIG
+Resource24=IDD_OBJECT_CLUSTER_GENERAL
 Class26=CRequestProcessingDlg
 Resource25=IDD_SELECT_USER (English (U.S.))
 Resource26=IDD_PROGRESS (English (U.S.))
-Resource27=IDD_OBJECT_CLUSTER_GENERAL
+Resource27=IDA_NETMAP
 Resource28=IDD_DCI_COLLECTION (English (U.S.))
 Class27=CObjectPropsGeneral
 Resource29=IDR_MAINFRAME (English (U.S.))
 Class28=CObjectPropsSecurity
 Resource30=IDD_SAVE_AGENT_CFG (English (U.S.))
-Resource31=IDD_OBJECT_PRESENTATION
-Resource32=IDD_GRAPH_PROP_SETTINGS
+Resource31=IDD_CREATE_TEMPLATE
+Resource32=IDD_OBJTOOL_GENERAL
 Class29=CUserSelectDlg
-Resource33=IDD_EDIT_TRAP
+Resource33=IDD_GRAPH_PROP_DATA
 Class30=CUserEditor
 Resource34=IDD_DCI_PROPERTIES
 Class31=CNewUserDlg
-Resource35=IDD_DCI_THRESHOLDS
-Resource36=IDD_REMOVE_TEMPLATE
+Resource35=IDD_ACTION_PROPERTIES
+Resource36=IDD_AGENT_CONFIG
 Class32=CUserPropDlg
 Resource37=IDD_EDIT_VARIABLE (English (U.S.))
-Resource38=IDD_GROUP_PROPERTIES
+Resource38=IDD_EDIT_RULE_ALARM
 Class33=CGroupPropDlg
-Resource39=IDD_CREATE_NODE
-Resource40=IDD_SAVE_AGENT_CFG
-Resource41=IDD_DISCOVERY_TARGETS
+Resource39=IDD_OBJECT_NETSRV_GENERAL
+Resource40=IDD_CHANGE_PASSWORD
+Resource41=IDD_FATAL_ERROR
 Resource42=IDA_ACTION_EDITOR (English (U.S.))
 Class34=CPasswordChangeDlg
 Class35=CNodeSummary
@@ -100,55 +100,55 @@ Class41=CGraphFrame
 Class42=CDCIThresholdsPage
 Resource46=IDA_OBJECT_TOOLS_EDITOR (English (U.S.))
 Resource47=IDM_CONTEXT (English (U.S.))
-Resource48=IDD_OBJECT_COND_SCRIPT
+Resource48=IDD_SELECT_MP
 Class43=CThresholdDlg
 Resource49=IDD_DESKTOP_SAVE_AS (English (U.S.))
-Resource50=IDD_ABOUTBOX
+Resource50=IDD_NEW_USER
 Class44=CMIBBrowserDlg
 Class45=CEventPolicyEditor
 Class46=CRuleList
 Class47=CRuleHeader
 Resource51=IDD_SELECT_AGENT_PARAM (English (U.S.))
-Resource52=IDD_SELECT_INTERNAL_ITEM
+Resource52=IDD_DCI_DATA_EXPORT
 Class48=CObjectSelDlg
-Resource53=IDD_LASTVAL_PROP
-Resource54=IDD_SELECT_TRAP
+Resource53=IDD_OBJTOOL_OPTIONS
+Resource54=IDA_OBJECT_BROWSER
 Class49=CRuleCommentDlg
-Resource55=IDD_INPUT_BOX
+Resource55=IDD_CREATE_VPNC
 Class50=CEventSelDlg
-Resource56=IDD_SELECT_EVENT
+Resource56=IDD_CREATE_CONTAINER
 Resource57=IDA_EPP (English (U.S.))
-Resource58=IDD_DATA_QUERY
+Resource58=IDD_GRAPH_PROP_SETTINGS
 Resource59=IDA_PACKAGE_MGR (English (U.S.))
 Resource60=IDD_OBJTOOL_GENERAL (English (U.S.))
 Class51=CObjectPropsPresentation
 Resource61=IDD_CREATE_TEMPLATE (English (U.S.))
-Resource62=IDA_ALARM_BROWSER
+Resource62=IDA_OBJECT_TOOLS_EDITOR
 Class52=CRuleSeverityDlg
-Resource63=IDD_SELECT_ACTION
+Resource63=IDD_INPUT_BOX
 Class53=CRuleAlarmDlg
 Class54=CAlarmBrowser
 Resource64=IDA_MDI_DEFAULT (English (U.S.))
-Resource65=IDA_SERVER_CFG_EDITOR
+Resource65=IDD_OBJECT_CAPS
 Resource66=IDD_EDIT_IP_SUBNET (English (U.S.))
 Resource67=IDD_EDIT_RULE_SEVERITY (English (U.S.))
 Resource68=IDD_ACTION_PROPERTIES (English (U.S.))
 Class55=CConsolePropsGeneral
 Class56=CActionEditor
-Resource69=IDD_CREATE_MP
-Resource70=IDD_REQUEST_PROCESSING
+Resource69=IDR_MAINFRAME
+Resource70=IDD_MIB_BROWSER
 Class57=CNewActionDlg
-Resource71=IDD_NEW_OBJECT_TOOL
+Resource71=IDD_OBJECT_COND_DATA
 Class58=CEditActionDlg
-Resource72=IDD_SNMP_WALK
+Resource72=IDD_DISCOVERY_GENERAL
 Class59=CActionSelDlg
-Resource73=IDD_OBJTOOL_COLUMNS
+Resource73=IDD_EDIT_RULE_SCRIPT
 Resource74=IDD_EDIT_TRAP (English (U.S.))
 Resource75=IDD_USER_PROPERTIES (English (U.S.))
-Resource76=IDA_AGENT_CFG_EDITOR
+Resource76=IDD_REQUEST_PROCESSING
 Class60=CCreateObjectDlg
 Class61=CCreateContainerDlg
-Resource77=IDD_EDIT_VARIABLE
+Resource77=IDD_REMOVE_TEMPLATE
 Class62=CCreateNodeDlg
 Resource78=IDD_OBJECT_NODE_GENERAL (English (U.S.))
 Resource79=IDT_MAP (English (U.S.))
@@ -158,31 +158,31 @@ Resource81=IDD_LASTVAL_PROP (English (U.S.))
 Class64=CPollNodeDlg
 Resource82=IDD_POLL_NODE (English (U.S.))
 Class65=CNodePoller
-Resource83=IDD_ACTION_PROPERTIES
-Resource84=IDD_DISCOVERY_RANGES
+Resource83=IDD_EDIT_TRAP
+Resource84=IDD_DEFINE_GRAPH
 Class66=CCreateTemplateDlg
 Class67=CCreateTGDlg
-Resource85=IDD_ADD_DCI
-Resource86=IDD_UPGRADE
+Resource85=IDD_UPGRADE
+Resource86=IDA_EPP
 Class68=CTrapEditor
-Resource87=IDD_CREATE_NETSRV
-Resource88=IDD_CP_GENERAL
-Resource89=IDD_MIB_BROWSER
+Resource87=IDD_OBJECT_VPNC_GENERAL
+Resource88=IDD_EDIT_TRAP_ARG
+Resource89=IDD_NEW_ACTION
 Class69=CDataQueryDlg
-Resource90=IDD_CREATE_CLUSTER
+Resource90=IDA_ALARM_BROWSER
 Class70=CTrapEditDlg
 Resource91=IDM_VIEW_SPECIFIC (English (U.S.))
 Class71=CTrapParamDlg
-Resource92=IDA_DATA_VIEW
-Resource93=IDD_EDIT_RULE_SCRIPT
+Resource92=IDD_SET_PASSWORD
+Resource93=IDD_OBJECT_CLUSTER_RESOURCES
 Class72=CGraphPropDlg
 Class73=CColorSelector
 Class74=CPackageMgr
-Resource94=IDD_MANAGE_GRAPHS
+Resource94=IDA_PACKAGE_MGR
 Resource95=IDA_SCRIPT_MANAGER (English (U.S.))
 Resource96=IDD_SET_PASSWORD (English (U.S.))
 Resource97=IDD_DCI_TRANSFORM (English (U.S.))
-Resource98=IDA_PACKAGE_MGR
+Resource98=IDD_EDIT_EVENT
 Resource99=IDD_OBJECT_NETSRV_GENERAL (English (U.S.))
 Resource100=IDD_OBJTOOL_OPTIONS (English (U.S.))
 Resource101=IDA_LAST_VALUES (English (U.S.))
@@ -244,7 +244,7 @@ Class102=CWaitView
 Class103=CWebBrowser
 Class104=CSyslogBrowser
 Class105=CLPPList
-Resource129=IDD_CLUSTER_RESOURCE
+Resource129=IDA_ACTION_EDITOR
 Class106=CDCISchedulePage
 Resource130=IDD_OBJECT_CAPS (English (U.S.))
 Class107=CObjectPropsStatus
@@ -270,98 +270,99 @@ Class119=CMapControlBox
 Resource138=IDD_OBJECT_GENERAL (English (U.S.))
 Class120=CSubmapBkgndDlg
 Resource139=IDD_SUBMAP_BKGND (English (U.S.))
-Resource140=IDD_EDIT_RULE_ALARM
-Resource141=IDD_EDIT_RULE_COMMENT
-Resource142=IDD_OBJECT_RELATIONS
-Resource143=IDA_DC_EDITOR
-Resource144=IDD_SUBMAP_BKGND
-Resource145=IDD_OBJTOOL_OPTIONS
-Resource146=IDD_CREATE_TG
-Resource147=IDD_CHANGE_IP
-Resource148=IDD_OBJECT_SECURITY
-Resource149=IDD_ADDR_ENTRY
-Resource150=IDD_NEW_ACTION
-Resource151=IDA_OBJECT_COMMENTS
-Resource152=IDA_EVENT_EDITOR
-Resource153=IDD_DCI_DATA_EXPORT
-Resource154=IDD_SET_PASSWORD
-Resource155=IDD_OBJECT_COND_GENERAL
-Resource156=IDD_OBJECT_STATUS
-Resource157=IDA_ACTION_EDITOR
-Resource158=IDD_DEFINE_GRAPH
-Resource159=IDD_OBJECT_GENERAL
-Resource160=IDD_FATAL_ERROR
-Resource161=IDD_CREATE_TEMPLATE
-Resource162=IDD_OBJTOOL_GENERAL
-Resource163=IDD_OBJECT_NETSRV_GENERAL
-Resource164=IDD_OBJECT_CAPS
-Resource165=IDD_OBJECT_NODE_GENERAL
-Resource166=IDA_MDI_DEFAULT
-Resource167=IDD_EDIT_RULE_SEVERITY
-Resource168=IDD_OBJECT_CLUSTER_RESOURCES
-Resource169=IDA_TRAP_EDITOR
-Resource170=IDD_OBJECT_COND_DATA
-Resource171=IDD_DESKTOP_SAVE_AS
+Resource140=IDD_CREATE_TG
+Resource141=IDD_DCI_TRANSFORM
+Resource142=IDD_DCI_SCHEDULE
+Resource143=IDD_OBJECT_GENERAL
+Resource144=IDD_DISCOVERY_TARGETS
+Resource145=IDD_ADD_DCI
+Resource146=IDD_OBJECT_RELATIONS
+Resource147=IDD_COND_DCI_PROP
+Resource148=IDD_THRESHOLD
+Resource149=IDD_MANAGE_GRAPHS
+Resource150=IDD_SELECT_INTERNAL_ITEM
+Resource151=IDD_GROUP_PROPERTIES
+Resource152=IDA_DATA_VIEW
+Resource153=IDD_CHANGE_IP
+Resource154=IDD_CP_GENERAL
+Resource155=IDD_CREATE_MP
+Resource156=IDD_OBJECT_COND_GENERAL
+Resource157=IDA_AGENT_CONFIG_MANAGER
+Resource158=IDA_GRAPH
+Resource159=IDD_SELECT_OBJECT
+Resource160=IDA_TRAP_EDITOR
+Resource161=IDD_DESKTOP_SAVE_AS
+Resource162=IDD_OBJECT_COND_SCRIPT
+Resource163=IDD_EDIT_IP_SUBNET
+Resource164=IDD_EDIT_RULE_COMMENT
+Resource165=IDD_DCI_THRESHOLDS
+Resource166=IDA_SERVER_CFG_EDITOR
+Resource167=IDD_DATA_QUERY
+Resource168=IDA_EVENT_EDITOR
+Resource169=IDA_SCRIPT_MANAGER
+Resource170=IDD_SELECT_TRAP
+Resource171=IDD_OBJECT_STATUS
 Class121=CModuleManager
 Class122=CDesktopManager
-Resource172=IDD_GRAPH_PROP_DATA
-Resource173=IDD_EDIT_TRAP_ARG
+Resource172=IDD_NEW_OBJECT_TOOL
+Resource173=IDD_LASTVAL_PROP
 Class123=CCreateCondDlg
 Class124=CCondPropsGeneral
 Class125=CCondPropsScript
 Class126=CCondPropsData
-Resource174=IDD_EDIT_IP_SUBNET
+Resource174=IDD_SUBMAP_BKGND
 Class127=CAddDCIDlg
-Resource175=IDD_OBJECT_VPNC_GENERAL
+Resource175=IDD_SNMP_WALK
 Class128=CCondDCIPropDlg
-Resource176=IDD_CHANGE_PASSWORD
+Resource176=IDD_DISCOVERY_RANGES
 Class129=CAgentConfigMgr
-Resource177=IDD_CREATE_CONDITION
-Resource178=IDD_USER_PROPERTIES
+Resource177=IDD_ADDR_ENTRY
+Resource178=IDD_EDIT_RULE_SEVERITY
 Class130=CAgentCfgDlg
 Class131=CObjectCommentsEditor
-Resource179=IDD_SELECT_AGENT_PARAM
+Resource179=IDD_EDIT_VARIABLE
 Class132=CRuleScriptDlg
 Class133=CDetailsView
-Resource180=IDD_CREATE_CONTAINER
+Resource180=IDD_CREATE_NETSRV
 Class134=CDiscoveryPropGeneral
-Resource181=IDA_SCRIPT_MANAGER
+Resource181=IDD_SELECT_USER
 Class135=CDiscoveryPropTargets
-Resource182=IDD_SELECT_USER
+Resource182=IDD_SELECT_EVENT
 Class136=CDiscoveryPropAddrList
-Resource183=IDD_DCI_COLLECTION
+Resource183=IDD_SELECT_AGENT_PARAM
 Class138=CObjectView
 Class139=CObjectOverview
 Class140=CAlarmView
 Class141=CObjectDepView
-Resource184=IDD_EDIT_EVENT
+Resource184=IDD_DCI_COLLECTION
 Class137=CObjectBrowser
 Class142=CCreateMPDlg
-Resource185=IDA_LAST_VALUES
+Resource185=IDA_OBJECT_COMMENTS
 Class143=CSelectMPDlg
-Resource186=IDM_VIEW_SPECIFIC
+Resource186=IDM_CONTEXT
 Class144=CTrapSelDlg
-Resource187=IDD_OBJECT_NODE_POLL
+Resource187=IDD_SAVE_AGENT_CFG
 Class145=CConsoleUpgradeDlg
-Resource188=IDD_SELECT_OBJECT
+Resource188=IDD_CREATE_NODE
 Class146=CCreateClusterDlg
-Resource189=IDD_DCI_SCHEDULE
+Resource189=IDD_CREATE_CONDITION
 Class147=CClusterPropsGeneral
-Resource190=IDA_NETMAP
+Resource190=IDD_OBJECT_NODE_GENERAL
 Class148=CClusterPropsResources
-Resource191=IDD_NEW_USER
+Resource191=IDD_OBJECT_PRESENTATION
 Class149=CClusterResDlg
-Resource192=IDD_CREATE_VPNC
+Resource192=IDD_OBJTOOL_COLUMNS
 Class150=CClusterView
 Class151=CExtEditCtrl
-Resource193=IDA_OBJECT_BROWSER
+Resource193=IDA_AGENT_CFG_EDITOR
 Class152=CFatalErrorDlg
-Resource194=IDD_DCI_TRANSFORM
+Resource194=IDD_OBJECT_NODE_POLL
 Class153=CDefineGraphDlg
-Resource195=IDD_THRESHOLD
+Resource195=IDD_SELECT_ACTION
 Class154=CGraphManagerDlg
-Resource196=IDR_MAINFRAME
+Resource196=IDA_DC_EDITOR
 Class155=CGraphStylePage
+Class156=CNodePerfView
 Resource197=IDD_GRAPH_PROP_STYLES
 
 [CLS:CConsoleApp]
@@ -5256,12 +5257,13 @@ LastObject=CExtEditCtrl
 [DLG:IDD_FATAL_ERROR]
 Type=1
 Class=CFatalErrorDlg
-ControlCount=5
+ControlCount=6
 Control1=IDC_EDIT_TEXT,edit,1352730756
 Control2=IDC_EDIT_FILE,edit,1350633600
-Control3=IDOK,button,1342242817
-Control4=IDC_STATIC,static,1342308352
+Control3=IDOK,button,1342242816
+Control4=IDCANCEL,button,1342242817
 Control5=IDC_STATIC,static,1342308352
+Control6=IDC_STATIC,static,1342308352
 
 [CLS:CFatalErrorDlg]
 Type=0
@@ -5331,3 +5333,11 @@ Filter=D
 VirtualFilter=idWC
 LastObject=CGraphStylePage
 
+[CLS:CNodePerfView]
+Type=0
+HeaderFile=NodePerfView.h
+ImplementationFile=NodePerfView.cpp
+BaseClass=CWnd
+Filter=W
+VirtualFilter=WC
+
index 67f539c..12df0a3 100644 (file)
@@ -3779,7 +3779,7 @@ static void ExceptionDataWriter(char *pszText)
 // Exception handler
 //
 
-static void ExceptionHandler(EXCEPTION_POINTERS *pInfo)
+static BOOL ExceptionHandler(EXCEPTION_POINTERS *pInfo)
 {
        TCHAR szBuffer[MAX_PATH], szInfoFile[MAX_PATH], szDumpFile[MAX_PATH];
        HANDLE hFile;
@@ -3790,6 +3790,7 @@ static void ExceptionHandler(EXCEPTION_POINTERS *pInfo)
    SYSTEM_INFO sysInfo;
        CFatalErrorDlg dlg;
        BYTE *pData;
+       BOOL bRet;
 
        t = time(NULL);
 
@@ -3912,12 +3913,14 @@ static void ExceptionHandler(EXCEPTION_POINTERS *pInfo)
        // Dialog should be executed from GUI thread
        if (GetCurrentThreadId() == theApp.m_dwMainThreadId)
        {
-               dlg.DoModal();
+               bRet = (dlg.DoModal() != IDOK);
        }
        else
        {
-               theApp.m_pMainWnd->SendMessage(NXCM_SHOW_FATAL_ERROR, 0, (LPARAM)&dlg);
+               bRet = (BOOL)theApp.m_pMainWnd->SendMessage(NXCM_SHOW_FATAL_ERROR, 0, (LPARAM)&dlg);
        }
+
+       return bRet;
 }
 
 
index 85ffe93..4f6f022 100644 (file)
@@ -524,6 +524,10 @@ SOURCE=.\NewUserDlg.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\NodePerfView.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=.\NodePoller.cpp
 # End Source File
 # Begin Source File
@@ -1129,6 +1133,10 @@ SOURCE=..\..\..\include\nms_util.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\NodePerfView.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\NodePoller.h
 # End Source File
 # Begin Source File
index 7945d46..6210e27 100644 (file)
@@ -2937,7 +2937,8 @@ BEGIN
     EDITTEXT        IDC_EDIT_TEXT,7,18,290,162,ES_MULTILINE | ES_AUTOHSCROLL | 
                     ES_READONLY | WS_VSCROLL
     EDITTEXT        IDC_EDIT_FILE,7,196,290,14,ES_AUTOHSCROLL | ES_READONLY
-    DEFPUSHBUTTON   "Close",IDOK,247,221,50,14
+    PUSHBUTTON      "&Debug",IDOK,191,221,50,14
+    DEFPUSHBUTTON   "Close",IDCANCEL,247,221,50,14
     LTEXT           "Fatal application error occured. Please send the following information to dump@netxms.org.",
                     IDC_STATIC,7,7,287,8
     LTEXT           "If possible, please also attach the following file:",
index a2d0013..d081893 100644 (file)
 #define _APS_3D_CONTROLS                     1
 #define _APS_NEXT_RESOURCE_VALUE        362
 #define _APS_NEXT_COMMAND_VALUE         33056
-#define _APS_NEXT_CONTROL_VALUE         1462
+#define _APS_NEXT_CONTROL_VALUE         1463
 #define _APS_NEXT_SYMED_VALUE           134
 #endif
 #endif
index 6a7341c..aea319f 100644 (file)
@@ -1,7 +1,7 @@
 /* 
 ** NetXMS - Network Management System
 ** Windows Console
-** Copyright (C) 2004, 2005, 2006 Victor Kirhenshtein
+** Copyright (C) 2004, 2005, 2006, 2007 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
@@ -17,7 +17,7 @@
 ** along with this program; if not, write to the Free Software
 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
 **
-** $module: tools.cpp
+** File: tools.cpp
 ** Various tools and helper functions
 **
 **/
@@ -36,7 +36,10 @@ TCHAR *FormatTimeStamp(DWORD dwTimeStamp, TCHAR *pszBuffer, int iType)
    static TCHAR *pFormat[] = { _T("%d-%b-%Y %H:%M:%S"), _T("%H:%M:%S"), _T("%b/%d"), _T("%b") };
 
    pTime = localtime((const time_t *)&dwTimeStamp);
-   _tcsftime(pszBuffer, 32, pFormat[iType], pTime);
+       if (pTime != NULL)
+               _tcsftime(pszBuffer, 32, pFormat[iType], pTime);
+       else
+               _tcscpy(pszBuffer, _T("(null)"));
    return pszBuffer;
 }
 
index 526082b..0c60209 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: nxcp.cpp,v 1.12 2007-02-08 22:25:21 victor Exp $ */
+/* $Id: nxcp.cpp,v 1.13 2007-03-01 23:29:05 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
 ** NetXMS Foundation Library
@@ -238,10 +238,11 @@ TCHAR LIBNETXMS_EXPORTABLE *NXCPMessageCodeName(WORD wCode, TCHAR *pszBuffer)
                _T("CMD_GET_DCI_INFO"),
                _T("CMD_GET_GRAPH_LIST"),
                _T("CMD_DEFINE_GRAPH"),
-               _T("CMD_DELETE_GRAPH")
+               _T("CMD_DELETE_GRAPH"),
+               _T("CMD_GET_SYSTEM_DCI_LIST")
    };
 
-   if ((wCode >= CMD_LOGIN) && (wCode <= CMD_DELETE_GRAPH))
+   if ((wCode >= CMD_LOGIN) && (wCode <= CMD_GET_SYSTEM_DCI_LIST))
       _tcscpy(pszBuffer, pszMsgNames[wCode - CMD_LOGIN]);
    else
       _stprintf(pszBuffer, _T("CMD_UNKNOWN(%d)"), wCode);
index ba68122..6927455 100644 (file)
@@ -1,7 +1,7 @@
-/* $Id: queue.cpp,v 1.6 2006-11-20 23:37:04 victor Exp $ */
+/* $Id: queue.cpp,v 1.7 2007-03-01 23:29:05 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
-** Copyright (C) 2003, 2004, 2005, 2006 Victor Kirhenshtein
+** Copyright (C) 2003, 2004, 2005, 2006, 2007 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
 //
 
 Queue::Queue(DWORD dwInitialSize, DWORD dwBufferIncrement)
+{
+   m_dwBufferSize = dwInitialSize;
+   m_dwBufferIncrement = dwBufferIncrement;
+       CommonInit();
+}
+
+
+//
+// Default queue constructor
+//
+
+Queue::Queue()
+{
+   m_dwBufferSize = 256;
+   m_dwBufferIncrement = 32;
+       CommonInit();
+}
+
+
+//
+// Common initialization (used by all constructors)
+//
+
+void Queue::CommonInit(void)
 {
    m_mutexQueueAccess = MutexCreate();
    m_condWakeup = ConditionCreate(FALSE);
    m_dwNumElements = 0;
    m_dwFirst = 0;
    m_dwLast = 0;
-   m_dwBufferSize = dwInitialSize;
-   m_dwBufferIncrement = dwBufferIncrement;
    m_pElements = (void **)malloc(sizeof(void *) * m_dwBufferSize);
 }
 
index a15599e..675349f 100644 (file)
@@ -46,7 +46,7 @@ public:
 // Static data
 //
 
-static void (*m_pfExceptionHandler)(EXCEPTION_POINTERS *) = NULL;
+static BOOL (*m_pfExceptionHandler)(EXCEPTION_POINTERS *) = NULL;
 static void (*m_pfWriter)(char *pszText) = NULL;
 static HANDLE m_hExceptionLock = INVALID_HANDLE_VALUE;
 
@@ -84,7 +84,7 @@ void SEHInit(void)
 // Set exception handler
 //
 
-void LIBNETXMS_EXPORTABLE SetExceptionHandler(void (*pfHandler)(EXCEPTION_POINTERS *),
+void LIBNETXMS_EXPORTABLE SetExceptionHandler(BOOL (*pfHandler)(EXCEPTION_POINTERS *),
                                                                                                                         void (*pfWriter)(char *))
 {
        m_pfExceptionHandler = pfHandler;
@@ -140,7 +140,7 @@ TCHAR LIBNETXMS_EXPORTABLE *SEHExceptionName(DWORD code)
 // Default exception handler for console applications
 //
 
-void LIBNETXMS_EXPORTABLE SEHDefaultConsoleHandler(EXCEPTION_POINTERS *pInfo)
+BOOL LIBNETXMS_EXPORTABLE SEHDefaultConsoleHandler(EXCEPTION_POINTERS *pInfo)
 {
        _tprintf(_T("EXCEPTION: %08X (%s) at %08X\n"),
             pInfo->ExceptionRecord->ExceptionCode,
@@ -166,6 +166,7 @@ void LIBNETXMS_EXPORTABLE SEHDefaultConsoleHandler(EXCEPTION_POINTERS *pInfo)
        sw.ShowCallstack(GetCurrentThread(), pInfo->ContextRecord);
 
        _tprintf(_T("\nPROCESS TERMINATED\n"));
+       return TRUE;
 }
 
 
@@ -195,8 +196,7 @@ int LIBNETXMS_EXPORTABLE ___ExceptionHandler(EXCEPTION_POINTERS *pInfo)
                // will call ExitProcess anyway and we want to log only first
                // exception in case of multiple simultaneous exceptions
                WaitForSingleObject(m_hExceptionLock, INFINITE);
-               m_pfExceptionHandler(pInfo);
-               return EXCEPTION_EXECUTE_HANDLER;
+               return m_pfExceptionHandler(pInfo) ? EXCEPTION_EXECUTE_HANDLER : EXCEPTION_CONTINUE_SEARCH;
        }
        return EXCEPTION_CONTINUE_SEARCH;
 }
index 9802592..d0ec93c 100644 (file)
@@ -368,6 +368,8 @@ DWORD LIBNXCL_EXPORTABLE NXCGetDCIData(NXC_SESSION hSession, DWORD dwNodeId, DWO
             dwPrevRowCount = (*ppData)->dwNumRows;
             (*ppData)->dwNumRows += dwRecvRows;
             (*ppData)->wDataType = (WORD)ntohl(pHdr->dwDataType);
+                               if ((*ppData)->wDataType > 5)
+                                       (*ppData)->wDataType = 0;
             (*ppData)->wRowSize = m_wRowSize[(*ppData)->wDataType];
             if (dwRecvRows > 0)
                (*ppData)->pRows = (NXC_DCI_ROW *)realloc((*ppData)->pRows, (*ppData)->dwNumRows * (*ppData)->wRowSize);
@@ -768,7 +770,7 @@ DWORD LIBNXCL_EXPORTABLE NXCPushDCIData(NXC_SESSION hSession, DWORD dwNumItems,
 //
 
 DWORD LIBNXCL_EXPORTABLE NXCGetDCIInfo(NXC_SESSION hSession, DWORD dwNodeId,
-                                                                                                       DWORD dwItemId, NXC_DCI *pInfo)
+                                       DWORD dwItemId, NXC_DCI *pInfo)
 {
    CSCPMessage msg, *pResponse;
    DWORD dwRqId, dwResult;
@@ -805,3 +807,48 @@ DWORD LIBNXCL_EXPORTABLE NXCGetDCIInfo(NXC_SESSION hSession, DWORD dwNodeId,
    }
    return dwResult;
 }
+
+
+//
+// Get list of system DCIs
+//
+
+DWORD LIBNXCL_EXPORTABLE NXCGetSystemDCIList(NXC_SESSION hSession, DWORD dwNodeId,
+                                             DWORD *pdwNumItems, NXC_SYSTEM_DCI **ppList)
+{
+   CSCPMessage msg, *pResponse;
+   DWORD i, dwId, dwRqId, dwResult;
+
+   dwRqId = ((NXCL_Session *)hSession)->CreateRqId();
+       *ppList = NULL;
+       *pdwNumItems = 0;
+
+   msg.SetCode(CMD_GET_SYSTEM_DCI_LIST);
+   msg.SetId(dwRqId);
+   msg.SetVariable(VID_OBJECT_ID, dwNodeId);
+
+   ((NXCL_Session *)hSession)->SendMsg(&msg);
+
+   pResponse = ((NXCL_Session *)hSession)->WaitForMessage(CMD_REQUEST_COMPLETED, dwRqId);
+   if (pResponse != NULL)
+   {
+      dwResult = pResponse->GetVariableLong(VID_RCC);
+      if (dwResult == RCC_SUCCESS)
+      {
+                       *pdwNumItems = pResponse->GetVariableLong(VID_NUM_ITEMS);
+                       *ppList = (NXC_SYSTEM_DCI *)malloc(sizeof(NXC_SYSTEM_DCI) * (*pdwNumItems));
+                       for(i = 0, dwId = VID_SYSDCI_LIST_BASE; i < *pdwNumItems; i++, dwId += 7)
+                       {
+                               (*ppList)[i].dwId = pResponse->GetVariableLong(dwId++);
+                               pResponse->GetVariableStr(dwId++, (*ppList)[i].szName, MAX_DB_STRING);
+                               (*ppList)[i].nStatus = pResponse->GetVariableShort(dwId++);
+                       }
+      }
+      delete pResponse;
+   }
+   else
+   {
+      dwResult = RCC_TIMEOUT;
+   }
+   return dwResult;
+}
index ad220fa..f062ad1 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: node.cpp,v 1.174 2007-02-24 18:51:26 victor Exp $ */
+/* $Id: node.cpp,v 1.175 2007-03-01 23:29:05 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
 ** Copyright (C) 2003, 2004, 2005, 2006 Victor Kirhenshtein
@@ -2668,3 +2668,31 @@ BOOL Node::ResolveName(void)
                DbgPrintf(AF_DEBUG_DISCOVERY, _T("Name for node %d was not resolved"), m_dwId, m_szName);
        return bSuccess;
 }
+
+
+//
+// Send list of system DCIs
+//
+
+DWORD Node::GetSystemDCIList(CSCPMessage *pMsg)
+{
+   DWORD i, dwId, dwCount;
+
+   LockData();
+
+   for(i = 0, dwId = VID_SYSDCI_LIST_BASE, dwCount = 0; i < m_dwNumItems; i++)
+       {
+               if (!_tcsnicmp(m_ppItems[i]->Description(), _T("@System."), 8))
+               {
+                       pMsg->SetVariable(dwId++, m_ppItems[i]->Id());
+                       pMsg->SetVariable(dwId++, (TCHAR *)m_ppItems[i]->Description());
+                       pMsg->SetVariable(dwId++, (WORD)m_ppItems[i]->Status());
+                       dwId += 7;
+                       dwCount++;
+               }
+       }
+   pMsg->SetVariable(VID_NUM_ITEMS, dwCount);
+
+   UnlockData();
+   return RCC_SUCCESS;
+}
index eb763a5..7c73d4b 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: session.cpp,v 1.264 2007-02-24 18:51:26 victor Exp $ */
+/* $Id: session.cpp,v 1.265 2007-03-01 23:29:05 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
 ** Copyright (C) 2003, 2004, 2005, 2006, 2007 Victor Kirhenshtein
@@ -1003,6 +1003,9 @@ void ClientSession::ProcessingThread(void)
          case CMD_GET_DCI_EVENTS_LIST:
             SendDCIEventList(pMsg);
             break;
+                       case CMD_GET_SYSTEM_DCI_LIST:
+                               SendSystemDCIList(pMsg);
+                               break;
          case CMD_PUSH_DCI_DATA:
             PushDCIData(pMsg);
             break;
@@ -8717,3 +8720,43 @@ void ClientSession::DeleteGraph(CSCPMessage *pRequest)
 
    SendMessage(&msg);
 }
+
+
+//
+// Send list of system DCIs
+//
+
+void ClientSession::SendSystemDCIList(CSCPMessage *pRequest)
+{
+   CSCPMessage msg;
+       NetObj *pObject;
+
+       msg.SetId(pRequest->GetId());
+       msg.SetCode(CMD_REQUEST_COMPLETED);
+
+       pObject = FindObjectById(pRequest->GetVariableLong(VID_OBJECT_ID));
+       if (pObject != NULL)
+       {
+               if (pObject->CheckAccessRights(m_dwUserId, OBJECT_ACCESS_READ))
+               {
+                       if (pObject->Type() == OBJECT_NODE)
+                       {
+                               msg.SetVariable(VID_RCC, ((Node *)pObject)->GetSystemDCIList(&msg));
+                       }
+                       else
+                       {
+                               msg.SetVariable(VID_RCC, RCC_INCOMPATIBLE_OPERATION);
+                       }
+               }
+               else
+               {
+                       msg.SetVariable(VID_RCC, RCC_ACCESS_DENIED);
+               }
+       }
+       else
+       {
+               msg.SetVariable(VID_RCC, RCC_INVALID_OBJECT_ID);
+       }
+
+   SendMessage(&msg);
+}
index b77e9cc..d7209a3 100644 (file)
@@ -477,6 +477,7 @@ private:
    void ResetComponent(CSCPMessage *pRequest);
    void SendDCIEventList(CSCPMessage *pRequest);
        void SendDCIInfo(CSCPMessage *pRequest);
+   void SendSystemDCIList(CSCPMessage *pRequest);
    void CreateManagementPack(CSCPMessage *pRequest);
    void InstallManagementPack(CSCPMessage *pRequest);
        void SendGraphList(DWORD dwRqId);
index aa3b0c0..1b8ea9a 100644 (file)
@@ -696,6 +696,7 @@ public:
    void CleanDeletedTemplateItems(DWORD dwTemplateId, DWORD dwNumItems, DWORD *pdwItemList);
    void UnbindFromTemplate(DWORD dwTemplateId, BOOL bRemoveDCI);
    void UpdateDCICache(void);
+       DWORD GetSystemDCIList(CSCPMessage *pMsg);
 
    void OpenParamList(DWORD *pdwNumParams, NXC_AGENT_PARAM **ppParamList);
    void CloseParamList(void) { UnlockData(); }
index dc42532..9be806f 100644 (file)
@@ -1,4 +1,4 @@
-/* $Id: netxmsd.cpp,v 1.19 2007-02-15 15:31:43 alk Exp $ */
+/* $Id: netxmsd.cpp,v 1.20 2007-03-01 23:29:06 victor Exp $ */
 /* 
 ** NetXMS - Network Management System
 ** Server startup module
 **/
 
 #include "netxmsd.h"
-
-#ifdef _WIN32
-# include <dbghelp.h>
-#endif
+#include <dbghelp.h>
 
 
 //
@@ -117,7 +114,7 @@ static void ExceptionDataWriter(char *pszText)
 // Exception handler
 //
 
-static void ExceptionHandler(EXCEPTION_POINTERS *pInfo)
+static BOOL ExceptionHandler(EXCEPTION_POINTERS *pInfo)
 {
        char szBuffer[MAX_PATH], szInfoFile[MAX_PATH], szDumpFile[MAX_PATH];
        HANDLE hFile;
@@ -251,6 +248,8 @@ static void ExceptionHandler(EXCEPTION_POINTERS *pInfo)
              SEHExceptionName(pInfo->ExceptionRecord->ExceptionCode),
              pInfo->ExceptionRecord->ExceptionAddress);
        }
+
+       return TRUE;    // Terminate process
 }