Parameters System.ProcessList and Process.Count(*) implemented in Solaris subagent
[public/netxms.git] / src / agent / subagents / sunos / main.cpp
1 /*
2 ** NetXMS subagent for SunOS/Solaris
3 ** Copyright (C) 2004 Victor Kirhenshtein
4 **
5 ** This program is free software; you can redistribute it and/or modify
6 ** it under the terms of the GNU General Public License as published by
7 ** the Free Software Foundation; either version 2 of the License, or
8 ** (at your option) any later version.
9 **
10 ** This program is distributed in the hope that it will be useful,
11 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
12 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 ** GNU General Public License for more details.
14 **
15 ** You should have received a copy of the GNU General Public License
16 ** along with this program; if not, write to the Free Software
17 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18 **
19 ** $module: main.cpp
20 **
21 **/
22
23 #include "sunos_subagent.h"
24
25
26 //
27 // Hanlder functions
28 //
29
30 LONG H_DiskInfo(char *pszParam, char *pArg, char *pValue);
31 LONG H_NetIfList(char *pszParam, char *pArg, NETXMS_VALUES_LIST *pValue);
32 LONG H_ProcessCount(char *pszParam, char *pArg, char *pValue);
33 LONG H_ProcessList(char *pszParam, char *pArg, NETXMS_VALUES_LIST *pValue);
34
35
36 //
37 // Called by master agent at unload
38 //
39
40 static void UnloadHandler(void)
41 {
42 }
43
44
45 //
46 // Subagent information
47 //
48
49 static NETXMS_SUBAGENT_PARAM m_parameters[] =
50 {
51 { "Disk.Free(*)", H_DiskInfo, (char *)DISK_FREE },
52 { "Disk.Total(*)", H_DiskInfo, (char *)DISK_TOTAL },
53 { "Disk.Used(*)", H_DiskInfo, (char *)DISK_USED },
54 { "Process.Count(*)", H_ProcessCount, NULL }
55 };
56 static NETXMS_SUBAGENT_ENUM m_enums[] =
57 {
58 { "Net.InterfaceList", H_NetIfList, NULL },
59 { "System.ProcessList", H_ProcessList, NULL }
60 };
61
62 static NETXMS_SUBAGENT_INFO m_info =
63 {
64 NETXMS_SUBAGENT_INFO_MAGIC,
65 _T("SUNOS"), NETXMS_VERSION_STRING, UnloadHandler,
66 sizeof(m_parameters) / sizeof(NETXMS_SUBAGENT_PARAM),
67 m_parameters,
68 sizeof(m_enums) / sizeof(NETXMS_SUBAGENT_ENUM),
69 m_enums
70 };
71
72
73 //
74 // Entry point for NetXMS agent
75 //
76
77 extern "C" BOOL NxSubAgentInit(NETXMS_SUBAGENT_INFO **ppInfo, TCHAR *pszConfigFile)
78 {
79 *ppInfo = &m_info;
80 return TRUE;
81 }