Implemented NetXMS agent's parameters selection in DCI configuration dialog
authorVictor Kirhenshtein <victor@netxms.org>
Tue, 25 Jan 2005 12:01:24 +0000 (12:01 +0000)
committerVictor Kirhenshtein <victor@netxms.org>
Tue, 25 Jan 2005 12:01:24 +0000 (12:01 +0000)
13 files changed:
.gitattributes
TODO
include/nxclapi.h
src/console/win32/AgentParamSelDlg.cpp [new file with mode: 0644]
src/console/win32/AgentParamSelDlg.h [new file with mode: 0644]
src/console/win32/DCIPropPage.cpp
src/console/win32/DCIPropPage.h
src/console/win32/InternalItemSelDlg.cpp
src/console/win32/nxcon.clw
src/console/win32/nxcon.dsp
src/console/win32/nxcon.rc
src/console/win32/resource.h
src/libnxcl/objects.cpp

index bbe10b7..4a318ef 100644 (file)
@@ -264,6 +264,8 @@ src/console/win32/ActionEditor.cpp -text
 src/console/win32/ActionEditor.h -text
 src/console/win32/ActionSelDlg.cpp -text
 src/console/win32/ActionSelDlg.h -text
+src/console/win32/AgentParamSelDlg.cpp -text
+src/console/win32/AgentParamSelDlg.h -text
 src/console/win32/AlarmBrowser.cpp -text
 src/console/win32/AlarmBrowser.h -text
 src/console/win32/ColorSelector.cpp -text
diff --git a/TODO b/TODO
index a23cb34..af10bd4 100644 (file)
--- a/TODO
+++ b/TODO
@@ -46,7 +46,6 @@ SERVER:
 - Event correlation
 - Internal parameters for service checks
 - "Proxy agent for service checks" attribure for node objects
-- Gather list of supported parameters from agent in configuration poller
 - Implement reconnect in all database drivers
 - Network service autodiscovery
 - New attribute: disable status/configuration poll
@@ -85,7 +84,6 @@ SOLARIS AGENT:
 
 WINDOWS CONSOLE:
 
-- Add parameter selection for native agents in DCI configuration dialog
 - Find good graph creation library
 - Enlarge 16x16 status overlay icons
 - Add primary IP address selection 
index e506258..ec75ed9 100644 (file)
@@ -936,6 +936,9 @@ DWORD LIBNXCL_EXPORTABLE NXCDeleteObject(NXC_SESSION hSession, DWORD dwObject);
 DWORD LIBNXCL_EXPORTABLE NXCPollNode(NXC_SESSION hSession, DWORD dwObjectId, int iPollType, 
                                      void (* pCallback)(TCHAR *, void *), void *pArg);
 DWORD LIBNXCL_EXPORTABLE NXCWakeUpNode(NXC_SESSION hSession, DWORD dwObjectId);
+DWORD LIBNXCL_EXPORTABLE NXCGetSupportedParameters(NXC_SESSION hSession, DWORD dwNodeId,
+                                                   DWORD *pdwNumParams, 
+                                                   NXC_AGENT_PARAM **ppParamList);
 
 DWORD LIBNXCL_EXPORTABLE NXCLoadCCList(NXC_SESSION hSession, NXC_CC_LIST **ppList);
 void LIBNXCL_EXPORTABLE NXCDestroyCCList(NXC_CC_LIST *pList);
diff --git a/src/console/win32/AgentParamSelDlg.cpp b/src/console/win32/AgentParamSelDlg.cpp
new file mode 100644 (file)
index 0000000..72d2135
--- /dev/null
@@ -0,0 +1,122 @@
+// AgentParamSelDlg.cpp : implementation file
+//
+
+#include "stdafx.h"
+#include "nxcon.h"
+#include "AgentParamSelDlg.h"
+#include "DataQueryDlg.h"
+
+#ifdef _DEBUG
+#define new DEBUG_NEW
+#undef THIS_FILE
+static char THIS_FILE[] = __FILE__;
+#endif
+
+/////////////////////////////////////////////////////////////////////////////
+// CAgentParamSelDlg dialog
+
+
+CAgentParamSelDlg::CAgentParamSelDlg(CWnd* pParent /*=NULL*/)
+       : CDialog(CAgentParamSelDlg::IDD, pParent)
+{
+       //{{AFX_DATA_INIT(CAgentParamSelDlg)
+               // NOTE: the ClassWizard will add member initialization here
+       //}}AFX_DATA_INIT
+
+   m_pNode = NULL;
+}
+
+
+void CAgentParamSelDlg::DoDataExchange(CDataExchange* pDX)
+{
+       CDialog::DoDataExchange(pDX);
+       //{{AFX_DATA_MAP(CAgentParamSelDlg)
+       DDX_Control(pDX, IDC_LIST_PARAMS, m_wndListCtrl);
+       //}}AFX_DATA_MAP
+}
+
+
+BEGIN_MESSAGE_MAP(CAgentParamSelDlg, CDialog)
+       //{{AFX_MSG_MAP(CAgentParamSelDlg)
+       ON_BN_CLICKED(IDC_BUTTON_GET, OnButtonGet)
+       //}}AFX_MSG_MAP
+END_MESSAGE_MAP()
+
+/////////////////////////////////////////////////////////////////////////////
+// CAgentParamSelDlg message handlers
+
+
+//
+// WM_INITDIALOG message handler
+//
+
+BOOL CAgentParamSelDlg::OnInitDialog() 
+{
+   DWORD i;
+   int iItem;
+   RECT rect;
+
+       CDialog::OnInitDialog();
+
+   m_wndListCtrl.SetExtendedStyle(LVS_EX_FULLROWSELECT | LVS_EX_UNDERLINEHOT);
+   m_wndListCtrl.SetHoverTime(0x7FFFFFFF);
+   m_wndListCtrl.GetClientRect(&rect);
+   m_wndListCtrl.InsertColumn(0, _T("Parameter name"), LVCFMT_LEFT, 160);
+   m_wndListCtrl.InsertColumn(1, _T("Type"), LVCFMT_LEFT, 90);
+   m_wndListCtrl.InsertColumn(2, _T("Description"), LVCFMT_LEFT,
+                              rect.right - 250 - GetSystemMetrics(SM_CXVSCROLL));
+       
+   for(i = 0; i < m_dwNumParams; i++)
+   {
+      iItem = m_wndListCtrl.InsertItem(0x7FFFFFFF, m_pParamList[i].szName);
+      if (iItem != -1)
+      {
+         m_wndListCtrl.SetItemData(iItem, i);
+         m_wndListCtrl.SetItemText(iItem, 1, g_pszItemDataType[m_pParamList[i].iDataType]);
+         m_wndListCtrl.SetItemText(iItem, 2, m_pParamList[i].szDescription);
+      }
+   }
+
+       return TRUE;
+}
+
+
+//
+// Handler for OK button
+//
+
+void CAgentParamSelDlg::OnOK() 
+{
+   if (m_wndListCtrl.GetSelectedCount() == 0)
+   {
+      MessageBox(_T("You must select parameter from the list before pressing OK!"),
+                 _T("Warning"), MB_OK | MB_ICONEXCLAMATION);
+   }
+       else
+   {
+      m_dwSelectionIndex = m_wndListCtrl.GetItemData(m_wndListCtrl.GetSelectionMark());
+          CDialog::OnOK();
+   }
+}
+
+
+//
+// Handler for "Get..." button
+//
+
+void CAgentParamSelDlg::OnButtonGet() 
+{
+   if (m_wndListCtrl.GetSelectedCount() != 0)
+   {
+      CDataQueryDlg dlg;
+      DWORD dwIndex;
+
+      dwIndex = m_wndListCtrl.GetItemData(m_wndListCtrl.GetSelectionMark());
+      dlg.m_dwObjectId = m_pNode->dwId;
+      dlg.m_strNode = (LPCTSTR)m_pNode->szName;
+      dlg.m_strParameter = (LPCTSTR)m_pParamList[dwIndex].szName;
+      dlg.m_iOrigin = DS_NATIVE_AGENT;
+      dlg.DoModal();
+   }
+   m_wndListCtrl.SetFocus();
+}
diff --git a/src/console/win32/AgentParamSelDlg.h b/src/console/win32/AgentParamSelDlg.h
new file mode 100644 (file)
index 0000000..ff2479b
--- /dev/null
@@ -0,0 +1,53 @@
+#if !defined(AFX_AGENTPARAMSELDLG_H__04E7FF90_ABEA_40BC_A931_6AB70708E4C3__INCLUDED_)
+#define AFX_AGENTPARAMSELDLG_H__04E7FF90_ABEA_40BC_A931_6AB70708E4C3__INCLUDED_
+
+#include "..\..\..\INCLUDE\nxclapi.h"  // Added by ClassView
+#if _MSC_VER > 1000
+#pragma once
+#endif // _MSC_VER > 1000
+// AgentParamSelDlg.h : header file
+//
+
+/////////////////////////////////////////////////////////////////////////////
+// CAgentParamSelDlg dialog
+
+class CAgentParamSelDlg : public CDialog
+{
+// Construction
+public:
+       NXC_OBJECT *m_pNode;
+       DWORD m_dwSelectionIndex;
+       NXC_AGENT_PARAM *m_pParamList;
+       DWORD m_dwNumParams;
+       CAgentParamSelDlg(CWnd* pParent = NULL);   // standard constructor
+
+// Dialog Data
+       //{{AFX_DATA(CAgentParamSelDlg)
+       enum { IDD = IDD_SELECT_AGENT_PARAM };
+       CListCtrl       m_wndListCtrl;
+       //}}AFX_DATA
+
+
+// Overrides
+       // ClassWizard generated virtual function overrides
+       //{{AFX_VIRTUAL(CAgentParamSelDlg)
+       protected:
+       virtual void DoDataExchange(CDataExchange* pDX);    // DDX/DDV support
+       //}}AFX_VIRTUAL
+
+// Implementation
+protected:
+
+       // Generated message map functions
+       //{{AFX_MSG(CAgentParamSelDlg)
+       virtual BOOL OnInitDialog();
+       virtual void OnOK();
+       afx_msg void OnButtonGet();
+       //}}AFX_MSG
+       DECLARE_MESSAGE_MAP()
+};
+
+//{{AFX_INSERT_LOCATION}}
+// Microsoft Visual C++ will insert additional declarations immediately before the previous line.
+
+#endif // !defined(AFX_AGENTPARAMSELDLG_H__04E7FF90_ABEA_40BC_A931_6AB70708E4C3__INCLUDED_)
index 13a2c6d..177034e 100644 (file)
@@ -6,6 +6,7 @@
 #include "DCIPropPage.h"
 #include "MIBBrowserDlg.h"
 #include "InternalItemSelDlg.h"
+#include "AgentParamSelDlg.h"
 
 #ifdef _DEBUG
 #define new DEBUG_NEW
@@ -32,8 +33,14 @@ CDCIPropPage::CDCIPropPage()
        //}}AFX_DATA_INIT
    
    m_pNode = NULL;
+   m_pParamList = NULL;
+   m_dwNumParams = 0;
 }
 
+CDCIPropPage::~CDCIPropPage()
+{
+   safe_free(m_pParamList);
+}
 
 void CDCIPropPage::DoDataExchange(CDataExchange* pDX)
 {
@@ -102,6 +109,7 @@ void CDCIPropPage::OnButtonSelect()
    switch(m_iOrigin)
    {
       case DS_NATIVE_AGENT:
+         SelectAgentItem();
          break;
       case DS_SNMP_AGENT:
          SelectSNMPItem();
@@ -134,7 +142,7 @@ void CDCIPropPage::OnSelchangeComboOrigin()
 // Select SNMP parameter
 //
 
-void CDCIPropPage::SelectSNMPItem()
+void CDCIPropPage::SelectSNMPItem(void)
 {
    CMIBBrowserDlg dlg;
    TCHAR *pDot, szBuffer[1024];
@@ -168,7 +176,7 @@ void CDCIPropPage::SelectSNMPItem()
 // Select internal item (like Status)
 //
 
-void CDCIPropPage::SelectInternalItem()
+void CDCIPropPage::SelectInternalItem(void)
 {
    CInternalItemSelDlg dlg;
 
@@ -181,3 +189,45 @@ void CDCIPropPage::SelectInternalItem()
       m_wndEditName.SetFocus();
    }
 }
+
+
+//
+// Select agent item
+//
+
+void CDCIPropPage::SelectAgentItem(void)
+{
+   DWORD dwResult;
+
+   // Fetch list of items supported by current node from server
+   if (m_pParamList == NULL)
+   {
+      dwResult = DoRequestArg4(NXCGetSupportedParameters, g_hSession, 
+                               (void *)m_pNode->dwId, &m_dwNumParams, &m_pParamList,
+                               _T("Downloading supported parameters list..."));
+      if (dwResult != RCC_SUCCESS)
+         theApp.ErrorBox(dwResult, _T("Error retrieving supported parameters list: %s"));
+   }
+   else
+   {
+      dwResult = RCC_SUCCESS;
+   }
+
+   // If everything is OK, display selection dialog
+   if (dwResult == RCC_SUCCESS)
+   {
+      CAgentParamSelDlg dlg;
+
+      dlg.m_pNode = m_pNode;
+      dlg.m_dwNumParams = m_dwNumParams;
+      dlg.m_pParamList = m_pParamList;
+      if (dlg.DoModal() == IDOK)
+      {
+         m_wndEditName.SetWindowText(m_pParamList[dlg.m_dwSelectionIndex].szName);
+         SetDlgItemText(IDC_EDIT_DESCRIPTION,
+                        m_pParamList[dlg.m_dwSelectionIndex].szDescription);
+         m_wndTypeList.SelectString(-1, g_pszItemDataType[m_pParamList[dlg.m_dwSelectionIndex].iDataType]);
+         m_wndEditName.SetFocus();
+      }
+   }
+}
index 1c78039..01805cb 100644 (file)
@@ -19,6 +19,7 @@ class CDCIPropPage : public CPropertyPage
 public:
        NXC_OBJECT *m_pNode;
        CDCIPropPage();   // standard constructor
+   virtual ~CDCIPropPage();
 
 // Dialog Data
        //{{AFX_DATA(CDCIPropPage)
@@ -46,6 +47,9 @@ public:
 
 // Implementation
 protected:
+       NXC_AGENT_PARAM *m_pParamList;
+       DWORD m_dwNumParams;
+       void SelectAgentItem(void);
        void SelectInternalItem(void);
        void SelectSNMPItem(void);
 
index 946b560..a5ac6fb 100644 (file)
@@ -141,4 +141,5 @@ void CInternalItemSelDlg::OnButtonGet()
       dlg.m_iOrigin = DS_INTERNAL;
       dlg.DoModal();
    }
+   m_wndListCtrl.SetFocus();
 }
index 2237efc..896e9ed 100644 (file)
@@ -2,21 +2,21 @@
 
 [General Info]
 Version=1
-LastClass=CInternalItemSelDlg
+LastClass=CAgentParamSelDlg
 LastTemplate=CDialog
 NewFileInclude1=#include "stdafx.h"
 NewFileInclude2=#include "nxcon.h"
 LastPage=0
 
-ClassCount=75
+ClassCount=76
 Class1=CConsoleApp
 Class3=CMainFrame
 Class4=CChildFrame
 Class7=CEventBrowser
 Class9=CMapView
 
-ResourceCount=108
-Resource1=IDD_EDIT_RULE_ALARM (English (U.S.))
+ResourceCount=109
+Resource1=IDA_NETMAP (English (U.S.))
 Resource2=IDD_OBJECT_NODE_GENERAL
 Resource3=IDM_VIEW_SPECIFIC (English (U.S.))
 Resource4=IDD_SELECT_OBJECT
@@ -32,9 +32,9 @@ Resource7=IDD_NEW_USER
 Class12=CObjectBrowser
 Resource8=IDD_CREATE_CONTAINER
 Class13=CObjectPropDlg
-Resource9=IDD_CREATE_TG (English (U.S.))
-Resource10=IDA_TRAP_EDITOR (English (U.S.))
-Resource11=IDD_NEW_USER (English (U.S.))
+Resource9=IDD_EDIT_EVENT (English (U.S.))
+Resource10=IDD_SELECT_OBJECT (English (U.S.))
+Resource11=IDD_DCI_TRANSFORM (English (U.S.))
 Resource12=IDR_CTRLPANEL (English (U.S.))
 Resource13=IDR_EVENTS (English (U.S.))
 Resource14=IDR_MAPFRAME (English (U.S.))
@@ -42,33 +42,33 @@ Resource15=IDR_OBJECTS (English (U.S.))
 Resource16=IDD_DUMMY (English (U.S.))
 Class14=CEventEditor
 Class15=CEditEventDlg
-Resource17=IDD_SELECT_EVENT (English (U.S.))
+Resource17=IDA_OBJECT_BROWSER (English (U.S.))
 Class16=CDebugFrame
-Resource18=IDD_DCI_THRESHOLDS (English (U.S.))
+Resource18=IDD_EDIT_TRAP_ARG (English (U.S.))
 Resource19=IDD_OBJECT_PROPERTIES (English (U.S.))
 Resource20=IDD_SELECT_EVENT
 Class17=CObjectPreview
-Resource21=IDR_MAINFRAME (English (U.S.))
+Resource21=IDD_SELECT_USER (English (U.S.))
 Class18=CToolBox
 Class19=CObjectInfoBox
 Class20=CObjectSearchBox
-Resource22=IDD_CREATE_NODE (English (U.S.))
+Resource22=IDD_ABOUTBOX (English (U.S.))
 Class21=CEditBox
 Class22=COPGeneral
 Class23=CNodePropsGeneral
-Resource23=IDD_OBJECT_SECURITY (English (U.S.))
+Resource23=IDD_CREATE_CONTAINER (English (U.S.))
 Class24=CObjectPropCaps
 Class25=CObjectPropSheet
 Resource24=IDA_MDI_DEFAULT
 Class26=CRequestProcessingDlg
-Resource25=IDD_SELECT_USER (English (U.S.))
+Resource25=IDD_CREATE_NODE (English (U.S.))
 Resource26=IDD_PROGRESS (English (U.S.))
 Resource27=IDD_EDIT_RULE_ALARM
-Resource28=IDD_SELECT_OBJECT (English (U.S.))
+Resource28=IDR_MAINFRAME (English (U.S.))
 Class27=CObjectPropsGeneral
-Resource29=IDA_PACKAGE_MGR (English (U.S.))
+Resource29=IDD_SELECT_EVENT (English (U.S.))
 Class28=CObjectPropsSecurity
-Resource30=IDD_GRAPH_PROPERTIES (English (U.S.))
+Resource30=IDD_OBJECT_SECURITY (English (U.S.))
 Resource31=IDD_SELECT_USER
 Resource32=IDD_OBJECT_SECURITY
 Class29=CUserSelectDlg
@@ -85,30 +85,30 @@ Class33=CGroupPropDlg
 Resource39=IDD_CP_GENERAL
 Resource40=IDA_TRAP_EDITOR
 Resource41=IDM_VIEW_SPECIFIC
-Resource42=IDD_NEW_ACTION (English (U.S.))
+Resource42=IDA_ACTION_EDITOR (English (U.S.))
 Class34=CPasswordChangeDlg
 Class35=CNodeSummary
 Class36=CNetSummaryFrame
 Class37=CDataCollectionEditor
-Resource43=IDD_EDIT_TRAP (English (U.S.))
+Resource43=IDD_REQUEST_PROCESSING (English (U.S.))
 Class38=CDCIPropPage
-Resource44=IDD_EDIT_RULE_COMMENT (English (U.S.))
+Resource44=IDA_MDI_DEFAULT (English (U.S.))
 Class39=CDCIDataView
-Resource45=IDD_EDIT_RULE_SEVERITY (English (U.S.))
+Resource45=IDA_ALARM_BROWSER (English (U.S.))
 Class40=CGraph
 Class41=CGraphFrame
 Class42=CDCIThresholdsPage
-Resource46=IDA_ACTION_EDITOR (English (U.S.))
-Resource47=IDD_GROUP_PROPERTIES (English (U.S.))
+Resource46=IDD_MIB_BROWSER (English (U.S.))
+Resource47=IDD_CREATE_TEMPLATE (English (U.S.))
 Resource48=IDM_CONTEXT
 Class43=CThresholdDlg
-Resource49=IDD_THRESHOLD (English (U.S.))
+Resource49=IDD_GRAPH_PROPERTIES (English (U.S.))
 Resource50=IDD_EDIT_TRAP_ARG
 Class44=CMIBBrowserDlg
 Class45=CEventPolicyEditor
 Class46=CRuleList
 Class47=CRuleHeader
-Resource51=IDA_EVENT_EDITOR (English (U.S.))
+Resource51=IDD_THRESHOLD (English (U.S.))
 Resource52=IDD_CREATE_NODE
 Class48=CObjectSelDlg
 Resource53=IDD_OBJECT_CAPS
@@ -117,22 +117,22 @@ Class49=CRuleCommentDlg
 Resource55=IDD_DCI_COLLECTION
 Class50=CEventSelDlg
 Resource56=IDD_DATA_QUERY
-Resource57=IDD_SET_PASSWORD (English (U.S.))
+Resource57=IDD_DATA_QUERY (English (U.S.))
 Resource58=IDD_CREATE_TG
-Resource59=IDD_OBJECT_GENERAL (English (U.S.))
-Resource60=IDD_CP_GENERAL (English (U.S.))
+Resource59=IDD_SELECT_ACTION (English (U.S.))
+Resource60=IDA_EVENT_EDITOR (English (U.S.))
 Class51=CObjectPropsPresentation
-Resource61=IDD_CREATE_CONTAINER (English (U.S.))
+Resource61=IDA_PACKAGE_MGR (English (U.S.))
 Resource62=IDD_EDIT_RULE_COMMENT
 Class52=CRuleSeverityDlg
 Resource63=IDD_ACTION_PROPERTIES
 Class53=CRuleAlarmDlg
 Class54=CAlarmBrowser
-Resource64=IDD_REQUEST_PROCESSING (English (U.S.))
+Resource64=IDD_ACTION_PROPERTIES (English (U.S.))
 Resource65=IDD_DCI_TRANSFORM
-Resource66=IDD_CREATE_TEMPLATE (English (U.S.))
-Resource67=IDD_OBJECT_PRESENTATION (English (U.S.))
-Resource68=IDD_MIB_BROWSER (English (U.S.))
+Resource66=IDD_OBJECT_NODE_GENERAL (English (U.S.))
+Resource67=IDA_EPP (English (U.S.))
+Resource68=IDD_SELECT_INTERNAL_ITEM (English (U.S.))
 Class55=CConsolePropsGeneral
 Class56=CActionEditor
 Resource69=IDA_ACTION_EDITOR
@@ -143,18 +143,18 @@ Class58=CEditActionDlg
 Resource72=IDA_NETMAP
 Class59=CActionSelDlg
 Resource73=IDD_MIB_BROWSER
-Resource74=IDD_ACTION_PROPERTIES (English (U.S.))
-Resource75=IDD_DCI_TRANSFORM (English (U.S.))
+Resource74=IDA_TRAP_EDITOR (English (U.S.))
+Resource75=IDD_LOGIN (English (U.S.))
 Resource76=IDD_USER_PROPERTIES
 Class60=CCreateObjectDlg
 Class61=CCreateContainerDlg
 Resource77=IDR_MAINFRAME
 Class62=CCreateNodeDlg
-Resource78=IDA_GRAPH (English (U.S.))
-Resource79=IDD_EDIT_TRAP_ARG (English (U.S.))
-Resource80=IDD_DCI_COLLECTION (English (U.S.))
+Resource78=IDD_EDIT_RULE_COMMENT (English (U.S.))
+Resource79=IDD_OBJECT_GENERAL (English (U.S.))
+Resource80=IDD_EDIT_TRAP (English (U.S.))
 Class63=CDCITransformPage
-Resource81=IDD_DATA_QUERY (English (U.S.))
+Resource81=IDD_OBJECT_CAPS (English (U.S.))
 Class64=CPollNodeDlg
 Resource82=IDD_POLL_NODE (English (U.S.))
 Class65=CNodePoller
@@ -180,20 +180,22 @@ Class73=CColorSelector
 Class74=CPackageMgr
 Resource94=IDD_GROUP_PROPERTIES
 Resource95=IDD_GRAPH_PROPERTIES
-Resource96=IDD_ABOUTBOX (English (U.S.))
-Resource97=IDD_LOGIN (English (U.S.))
-Resource98=IDD_EDIT_EVENT (English (U.S.))
-Resource99=IDD_OBJECT_NODE_GENERAL (English (U.S.))
-Resource100=IDD_OBJECT_CAPS (English (U.S.))
-Resource101=IDD_SELECT_ACTION (English (U.S.))
-Resource102=IDA_MDI_DEFAULT (English (U.S.))
-Resource103=IDA_OBJECT_BROWSER (English (U.S.))
-Resource104=IDA_EPP (English (U.S.))
-Resource105=IDA_ALARM_BROWSER (English (U.S.))
-Resource106=IDA_NETMAP (English (U.S.))
-Resource107=IDD_USER_PROPERTIES (English (U.S.))
+Resource96=IDD_OBJECT_PRESENTATION (English (U.S.))
+Resource97=IDD_EDIT_RULE_SEVERITY (English (U.S.))
+Resource98=IDD_EDIT_RULE_ALARM (English (U.S.))
+Resource99=IDD_CP_GENERAL (English (U.S.))
+Resource100=IDD_NEW_ACTION (English (U.S.))
+Resource101=IDA_GRAPH (English (U.S.))
+Resource102=IDD_NEW_USER (English (U.S.))
+Resource103=IDD_USER_PROPERTIES (English (U.S.))
+Resource104=IDD_SET_PASSWORD (English (U.S.))
+Resource105=IDD_DCI_COLLECTION (English (U.S.))
+Resource106=IDD_DCI_THRESHOLDS (English (U.S.))
+Resource107=IDD_CREATE_TG (English (U.S.))
 Class75=CInternalItemSelDlg
-Resource108=IDD_SELECT_INTERNAL_ITEM
+Resource108=IDD_GROUP_PROPERTIES (English (U.S.))
+Class76=CAgentParamSelDlg
+Resource109=IDD_SELECT_AGENT_PARAM
 
 [CLS:CConsoleApp]
 Type=0
@@ -2806,7 +2808,16 @@ Control53=IDC_STATIC,static,1342308866
 Control54=IDC_STATIC,static,1342308866
 Control55=IDC_STATIC,static,1342308866
 
-[DLG:IDD_SELECT_INTERNAL_ITEM]
+[CLS:CInternalItemSelDlg]
+Type=0
+HeaderFile=InternalItemSelDlg.h
+ImplementationFile=InternalItemSelDlg.cpp
+BaseClass=CDialog
+Filter=D
+VirtualFilter=dWC
+LastObject=CInternalItemSelDlg
+
+[DLG:IDD_SELECT_INTERNAL_ITEM (English (U.S.))]
 Type=1
 Class=CInternalItemSelDlg
 ControlCount=4
@@ -2815,12 +2826,21 @@ Control2=IDOK,button,1342242817
 Control3=IDCANCEL,button,1342242816
 Control4=IDC_BUTTON_GET,button,1342242816
 
-[CLS:CInternalItemSelDlg]
+[DLG:IDD_SELECT_AGENT_PARAM]
+Type=1
+Class=CAgentParamSelDlg
+ControlCount=4
+Control1=IDC_LIST_PARAMS,SysListView32,1342242829
+Control2=IDOK,button,1342242817
+Control3=IDCANCEL,button,1342242816
+Control4=IDC_BUTTON_GET,button,1342242816
+
+[CLS:CAgentParamSelDlg]
 Type=0
-HeaderFile=InternalItemSelDlg.h
-ImplementationFile=InternalItemSelDlg.cpp
+HeaderFile=AgentParamSelDlg.h
+ImplementationFile=AgentParamSelDlg.cpp
 BaseClass=CDialog
 Filter=D
 VirtualFilter=dWC
-LastObject=CInternalItemSelDlg
+LastObject=CAgentParamSelDlg
 
index bfb39ac..1aaef92 100644 (file)
@@ -109,6 +109,10 @@ SOURCE=.\ActionSelDlg.cpp
 # End Source File
 # Begin Source File
 
+SOURCE=.\AgentParamSelDlg.cpp
+# End Source File
+# Begin Source File
+
 SOURCE=.\AlarmBrowser.cpp
 # End Source File
 # Begin Source File
@@ -410,6 +414,10 @@ SOURCE=.\ActionSelDlg.h
 # End Source File
 # Begin Source File
 
+SOURCE=.\AgentParamSelDlg.h
+# End Source File
+# Begin Source File
+
 SOURCE=.\AlarmBrowser.h
 # End Source File
 # Begin Source File
index 55cc10c..2410f67 100644 (file)
@@ -1500,6 +1500,19 @@ BEGIN
     RTEXT           "16",IDC_STATIC,121,176,8,8,SS_CENTERIMAGE
 END
 
+IDD_SELECT_INTERNAL_ITEM DIALOGEX 0, 0, 416, 154
+STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
+CAPTION "Available internal parameters"
+FONT 8, "MS Sans Serif"
+BEGIN
+    CONTROL         "List1",IDC_LIST_PARAMETERS,"SysListView32",LVS_REPORT | 
+                    LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE | 
+                    WS_TABSTOP,7,7,345,140,WS_EX_CLIENTEDGE
+    DEFPUSHBUTTON   "OK",IDOK,359,7,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,359,25,50,14
+    PUSHBUTTON      "&Get...",IDC_BUTTON_GET,359,44,50,14
+END
+
 
 #ifndef _MAC
 /////////////////////////////////////////////////////////////////////////////
@@ -1839,6 +1852,14 @@ BEGIN
         TOPMARGIN, 7
         BOTTOMMARGIN, 192
     END
+
+    IDD_SELECT_INTERNAL_ITEM, DIALOG
+    BEGIN
+        LEFTMARGIN, 7
+        RIGHTMARGIN, 409
+        TOPMARGIN, 7
+        BOTTOMMARGIN, 147
+    END
 END
 #endif    // APSTUDIO_INVOKED
 
@@ -1996,17 +2017,17 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK
 // Dialog
 //
 
-IDD_SELECT_INTERNAL_ITEM DIALOGEX 0, 0, 416, 154
+IDD_SELECT_AGENT_PARAM DIALOGEX 0, 0, 386, 229
 STYLE DS_MODALFRAME | WS_POPUP | WS_CAPTION | WS_SYSMENU
-CAPTION "Available internal parameters"
+CAPTION "Supported agent parameters"
 FONT 8, "MS Sans Serif"
 BEGIN
-    CONTROL         "List1",IDC_LIST_PARAMETERS,"SysListView32",LVS_REPORT | 
-                    LVS_SINGLESEL | LVS_SHOWSELALWAYS | LVS_AUTOARRANGE | 
-                    WS_TABSTOP,7,7,345,140,WS_EX_CLIENTEDGE
-    DEFPUSHBUTTON   "OK",IDOK,359,7,50,14
-    PUSHBUTTON      "Cancel",IDCANCEL,359,25,50,14
-    PUSHBUTTON      "&Get...",IDC_BUTTON_GET,359,44,50,14
+    CONTROL         "List1",IDC_LIST_PARAMS,"SysListView32",LVS_REPORT | 
+                    LVS_SINGLESEL | LVS_SHOWSELALWAYS | WS_TABSTOP,7,7,315,
+                    215,WS_EX_CLIENTEDGE
+    DEFPUSHBUTTON   "OK",IDOK,329,7,50,14
+    PUSHBUTTON      "Cancel",IDCANCEL,329,24,50,14
+    PUSHBUTTON      "&Get...",IDC_BUTTON_GET,329,41,50,14
 END
 
 
@@ -2018,12 +2039,12 @@ END
 #ifdef APSTUDIO_INVOKED
 GUIDELINES DESIGNINFO DISCARDABLE 
 BEGIN
-    IDD_SELECT_INTERNAL_ITEM, DIALOG
+    IDD_SELECT_AGENT_PARAM, DIALOG
     BEGIN
         LEFTMARGIN, 7
-        RIGHTMARGIN, 409
+        RIGHTMARGIN, 379
         TOPMARGIN, 7
-        BOTTOMMARGIN, 147
+        BOTTOMMARGIN, 222
     END
 END
 #endif    // APSTUDIO_INVOKED
index 6fb4c1f..6752c54 100644 (file)
 #define IDI_PACKAGE                     249
 #define IDI_DATABASE                    250
 #define IDD_SELECT_INTERNAL_ITEM        252
+#define IDD_SELECT_AGENT_PARAM          253
 #define ID_EDIT_BOX                     525
 #define IDC_EDIT_SERVER                 1000
 #define IDC_EDIT_LOGIN                  1001
 #define IDC_LIST_EVENTS                 1024
 #define IDC_LIST_ARGS                   1024
 #define IDC_LIST_PARAMETERS             1024
+#define IDC_LIST_PARAMS                 1024
 #define IDC_INFO_TEXT                   1025
 #define IDC_EDIT_CLASS                  1026
 #define IDC_CHECK_READ                  1027
 #ifdef APSTUDIO_INVOKED
 #ifndef APSTUDIO_READONLY_SYMBOLS
 #define _APS_3D_CONTROLS                     1
-#define _APS_NEXT_RESOURCE_VALUE        253
+#define _APS_NEXT_RESOURCE_VALUE        254
 #define _APS_NEXT_COMMAND_VALUE         32912
-#define _APS_NEXT_CONTROL_VALUE         1216
+#define _APS_NEXT_CONTROL_VALUE         1217
 #define _APS_NEXT_SYMED_VALUE           120
 #endif
 #endif
index ea88e89..a422244 100644 (file)
@@ -845,3 +845,54 @@ DWORD LIBNXCL_EXPORTABLE NXCWakeUpNode(NXC_SESSION hSession, DWORD dwObjectId)
    ((NXCL_Session *)hSession)->SendMsg(&msg);
    return ((NXCL_Session *)hSession)->WaitForRCC(dwRqId);
 }
+
+
+//
+// Retrieve list of supported agent parameters
+//
+
+DWORD LIBNXCL_EXPORTABLE NXCGetSupportedParameters(NXC_SESSION hSession, DWORD dwNodeId,
+                                                   DWORD *pdwNumParams, 
+                                                   NXC_AGENT_PARAM **ppParamList)
+{
+   CSCPMessage msg, *pResponce;
+   DWORD i, dwId, dwRqId, dwRetCode;
+
+   dwRqId = ((NXCL_Session *)hSession)->CreateRqId();
+
+   *pdwNumParams = 0;
+   *ppParamList = NULL;
+
+   // Build request message
+   msg.SetCode(CMD_GET_PARAMETER_LIST);
+   msg.SetId(dwRqId);
+   msg.SetVariable(VID_OBJECT_ID, dwNodeId);
+
+   // Send request
+   ((NXCL_Session *)hSession)->SendMsg(&msg);
+
+   // Wait for responce
+   pResponce = ((NXCL_Session *)hSession)->WaitForMessage(CMD_REQUEST_COMPLETED, dwRqId);
+   if (pResponce != NULL)
+   {
+      dwRetCode = pResponce->GetVariableLong(VID_RCC);
+      if (dwRetCode == RCC_SUCCESS)
+      {
+         *pdwNumParams = pResponce->GetVariableLong(VID_NUM_PARAMETERS);
+         *ppParamList = (NXC_AGENT_PARAM *)malloc(sizeof(NXC_AGENT_PARAM) * *pdwNumParams);
+         for(i = 0, dwId = VID_PARAM_LIST_BASE; i < *pdwNumParams; i++)
+         {
+            pResponce->GetVariableStr(dwId++, (*ppParamList)[i].szName, MAX_PARAM_NAME);
+            pResponce->GetVariableStr(dwId++, (*ppParamList)[i].szDescription, MAX_DB_STRING);
+            (*ppParamList)[i].iDataType = (int)pResponce->GetVariableShort(dwId++);
+         }
+      }
+      delete pResponce;
+   }
+   else
+   {
+      dwRetCode = RCC_TIMEOUT;
+   }
+
+   return dwRetCode;
+}