- Changes in logging and debug output
[public/netxms.git] / src / console / win32 / globals.cpp
1 /*
2 ** NetXMS - Network Management System
3 ** Windows Console
4 ** Copyright (C) 2004 Victor Kirhenshtein
5 **
6 ** This program is free software; you can redistribute it and/or modify
7 ** it under the terms of the GNU General Public License as published by
8 ** the Free Software Foundation; either version 2 of the License, or
9 ** (at your option) any later version.
10 **
11 ** This program is distributed in the hope that it will be useful,
12 ** but WITHOUT ANY WARRANTY; without even the implied warranty of
13 ** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 ** GNU General Public License for more details.
15 **
16 ** You should have received a copy of the GNU General Public License
17 ** along with this program; if not, write to the Free Software
18 ** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
19 **
20 ** $module: globals.cpp
21 ** This file contain all global vartiables
22 **
23 **/
24
25 #include "stdafx.h"
26 #include "nxcon.h"
27
28
29 //
30 // Connection parameters
31 //
32
33 char g_szServer[MAX_SERVER_NAME_LEN] = "localhost";
34 char g_szLogin[MAX_LOGIN_NAME_LEN] = "";
35 char g_szPassword[MAX_PASSWORD_LEN] = "";
36 DWORD g_dwEncryptionMethod = CSCP_ENCRYPTION_NONE;
37
38
39 //
40 // Global configurable parameters
41 //
42
43 DWORD g_dwOptions = 0;
44 char g_szWorkDir[MAX_PATH] = "";
45
46
47 //
48 // Server image list
49 //
50
51 NXC_IMAGE_LIST *g_pSrvImageList = NULL;
52
53
54 //
55 // Image lists with object images
56 //
57
58 CImageList *g_pObjectSmallImageList = NULL;
59 CImageList *g_pObjectNormalImageList = NULL;
60
61
62 //
63 // Global string constants
64 //
65
66 char *g_szStatusText[] = { "NORMAL", "WARNING", "MINOR", "MAJOR", "CRITICAL", "UNKNOWN", "UNMANAGED", "DISABLED", "TESTING" };
67 char *g_szStatusTextSmall[] = { "Normal", "Warning", "Minor", "Major", "Critical", "Unknown", "Unmanaged", "Disabled", "Testing" };
68 char *g_szObjectClass[] = { "Generic", "Subnet", "Node", "Interface", "Network", "Container", "Zone", "ServiceRoot" };
69 char *g_szActionType[] = { "Execute", "Remote", "E-Mail", "SMS" };
70 char *g_szInterfaceTypes[] = {
71 "Unknown",
72 "Other",
73 "Regular 1822",
74 "HDH 1822",
75 "DDN X.25",
76 "RFC877 X.25",
77 "Ethernet CSMA/CD",
78 "ISO 802.3 CSMA/CD",
79 "ISO 802.4 Token Bus",
80 "ISO 802.5 Token Ring",
81 "ISO 802.6 MAN",
82 "StarLan",
83 "PROTEON 10 Mbps",
84 "PROTEON 80 Mbps",
85 "Hyper Channel",
86 "FDDI",
87 "LAPB",
88 "SDLC",
89 "DS1",
90 "E1",
91 "ISDN BRI",
92 "ISDN PRI",
93 "Proprietary Serial Pt-to-Pt",
94 "PPP",
95 "Software Loopback",
96 "EON (CLNP over IP)",
97 "Ethernet 3 Mbps",
98 "NSIP (XNS over IP)",
99 "SLIP",
100 "DS3",
101 "SMDS",
102 "Frame Relay"
103 };
104
105
106 //
107 // Status color table
108 //
109
110 COLORREF g_statusColorTable[9] =
111 {
112 RGB(0, 127, 0), // Normal
113 RGB(255, 255, 0), // Warning
114 RGB(249, 131, 0), // Minor
115 RGB(248, 63, 1), // Major
116 RGB(200, 0, 0), // Critical
117 RGB(61, 12, 187), // Unknown
118 RGB(255, 255, 130), // Unmanaged
119 RGB(91, 0, 6), // Disabled
120 RGB(255, 135, 255) // Testing
121 };
122
123
124 //
125 // Data collection item texts
126 //
127
128 char *g_pszItemOrigin[] = { "Internal", "Agent", "SNMP" };
129 char *g_pszItemOriginLong[] = { "Internal", "NetXMS Agent", "SNMP Agent" };
130 char *g_pszItemDataType[] = { "Integer", "Unsigned Integer", "Int64", "Unsigned Int64", "String", "Float" };
131 char *g_pszItemStatus[] = { "Active", "Disabled", "Not supported" };
132 char *g_pszThresholdOperation[] = { "<", "<=", "=", ">=", ">", "!=", "~", "!~" };
133 char *g_pszThresholdOperationLong[] = { "less", "less or equal", "equal", "greater or equal", "greater", "not equal", "like", "not like" };
134 char *g_pszThresholdFunction[] = { "last", "average", "deviation" };
135 char *g_pszThresholdFunctionLong[] = { "last polled value", "average value", "mean deviation" };
136
137
138 //
139 // SNMP codes
140 //
141
142 CODE_TO_TEXT g_ctSnmpMibStatus[] =
143 {
144 { MIB_STATUS_MANDATORY, "Mandatory" },
145 { MIB_STATUS_OPTIONAL, "Optional" },
146 { MIB_STATUS_OBSOLETE, "Obsolete" },
147 { MIB_STATUS_DEPRECATED, "Deprecated" },
148 { MIB_STATUS_CURRENT, "Current" },
149 { 0, NULL } // End of list
150 };
151 CODE_TO_TEXT g_ctSnmpMibAccess[] =
152 {
153 { MIB_ACCESS_READONLY, "Read" },
154 { MIB_ACCESS_READWRITE, "Read/Write" },
155 { MIB_ACCESS_WRITEONLY, "Write" },
156 { MIB_ACCESS_NOACCESS, "None" },
157 { MIB_ACCESS_NOTIFY, "Notify" },
158 { MIB_ACCESS_CREATE, "Create" },
159 { 0, NULL } // End of list
160 };
161 CODE_TO_TEXT g_ctSnmpMibType[] =
162 {
163 { TYPE_OTHER, "Other" },
164 { TYPE_OBJID, "Object ID" },
165 { TYPE_OCTETSTR, "Octet String" },
166 { TYPE_INTEGER, "Integer" },
167 { TYPE_NETADDR, "Net Address" },
168 { TYPE_IPADDR, "IP Address" },
169 { TYPE_COUNTER, "Counter" },
170 { TYPE_GAUGE, "Gauge" },
171 { TYPE_TIMETICKS, "Timeticks" },
172 { TYPE_OPAQUE, "Opaque" },
173 { TYPE_NULL, "Null" },
174 { TYPE_COUNTER64, "Counter 64bit" },
175 { TYPE_BITSTRING, "Bit String" },
176 { TYPE_NSAPADDRESS, "NSAP Address" },
177 { TYPE_UINTEGER, "Unsigned Integer" },
178 { TYPE_UNSIGNED32, "Unsigned Integer 32bit" },
179 { TYPE_INTEGER32, "Integer 32bit" },
180 { TYPE_TRAPTYPE, "TRAPTYPE" },
181 { TYPE_NOTIFTYPE, "NOTIFTYPE" },
182 { TYPE_OBJGROUP, "Object Group" },
183 { TYPE_NOTIFGROUP, "NOTIFGROUP" },
184 { TYPE_MODID, "Module ID" },
185 { TYPE_AGENTCAP, "AGENTCAP" },
186 { TYPE_MODCOMP, "MODCOMP" },
187 { 0, NULL } // End of list
188 };
189
190
191 //
192 // Default object image list
193 //
194
195 DWORD g_dwDefImgListSize = 0;
196 DEF_IMG *g_pDefImgList = NULL;
197
198
199 //
200 // Action list
201 //
202
203 DWORD g_dwNumActions = 0;
204 NXC_ACTION *g_pActionList = NULL;
205 HANDLE g_mutexActionListAccess = INVALID_HANDLE_VALUE;
206
207
208 //
209 // Container categories list
210 //
211
212 NXC_CC_LIST *g_pCCList = NULL;