Changeset 367bf20 in nscp
- Timestamp:
- 04/03/08 19:47:01 (5 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- 9567d4b, eb30340
- Parents:
- b7ed6ac
- Files:
-
- 12 added
- 18 edited
-
AutoBuild.h (modified) (1 diff)
-
NSClient++-2005.sln (modified) (4 diffs)
-
NSClient++-2005.vcproj (modified) (1 diff)
-
NSClient++.cpp (modified) (3 diffs)
-
NSClient++.h (modified) (2 diffs)
-
StdAfx.h (modified) (2 diffs)
-
changelog (modified) (6 diffs)
-
include/com_helpers.hpp (added)
-
include/config.h (modified) (1 diff)
-
include/error_com.hpp (added)
-
include/filter_framework.hpp (modified) (6 diffs)
-
include/strEx.h (modified) (3 diffs)
-
lib-source/LuaCom/LuaCom.vcproj (added)
-
modules/CheckDisk/CheckDisk.cpp (modified) (1 diff)
-
modules/CheckEventLog/CheckEventLog-2005.vcproj (modified) (1 diff)
-
modules/CheckTaskSched/CheckTaskSched-2005.vcproj (added)
-
modules/CheckTaskSched/CheckTaskSched-2008.vcproj (added)
-
modules/CheckTaskSched/CheckTaskSched.cpp (added)
-
modules/CheckTaskSched/CheckTaskSched.def (added)
-
modules/CheckTaskSched/CheckTaskSched.h (added)
-
modules/CheckTaskSched/TaskSched.cpp (added)
-
modules/CheckTaskSched/TaskSched.h (added)
-
modules/CheckTaskSched/stdafx.cpp (added)
-
modules/CheckTaskSched/stdafx.h (added)
-
modules/CheckWMI/CheckWMI.cpp (modified) (4 diffs)
-
modules/CheckWMI/CheckWMI.h (modified) (1 diff)
-
modules/CheckWMI/WMIQuery.cpp (modified) (2 diffs)
-
modules/CheckWMI/WMIQuery.h (modified) (2 diffs)
-
modules/LUAScript/script_wrapper.hpp (modified) (1 diff)
-
scripts/test.lua (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
AutoBuild.h
rdd02c15 r367bf20 3 3 // change the FALSE to TRUE for autoincrement of build number 4 4 #define INCREMENT_VERSION TRUE 5 #define FILEVER 0,3,1,1 86 #define PRODUCTVER 0,3,1,1 87 #define STRFILEVER _T("0.3.1.1 8")8 #define STRPRODUCTVER _T("0.3.1.1 8")9 #define STRPRODUCTDATE _T("2008-03-2 0")5 #define FILEVER 0,3,1,19 6 #define PRODUCTVER 0,3,1,19 7 #define STRFILEVER _T("0.3.1.19") 8 #define STRPRODUCTVER _T("0.3.1.19") 9 #define STRPRODUCTDATE _T("2008-03-21") 10 10 #endif // AUTOBUILD_H -
NSClient++-2005.sln
r6d3bbc1 r367bf20 175 175 ProjectSection(ProjectDependencies) = postProject 176 176 {2286162D-7571-4735-BAC8-4A8D33A4F42D} = {2286162D-7571-4735-BAC8-4A8D33A4F42D} 177 EndProjectSection 178 EndProject 179 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LuaCom", "lib-source\LuaCom\LuaCom.vcproj", "{19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}" 180 ProjectSection(WebsiteProperties) = preProject 181 Debug.AspNetCompiler.Debug = "True" 182 Release.AspNetCompiler.Debug = "False" 183 EndProjectSection 184 EndProject 185 Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "lua-modules", "lua-modules", "{45D4AD47-393C-4E67-9B68-FCA621CD3120}" 186 ProjectSection(WebsiteProperties) = preProject 187 Debug.AspNetCompiler.Debug = "True" 188 Release.AspNetCompiler.Debug = "False" 189 EndProjectSection 190 EndProject 191 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "CheckWMI", "modules\CheckTaskSched\CheckTaskSched-2005.vcproj", "{F3401E75-60FB-4A0E-A18C-6505587D5B1A}" 192 ProjectSection(WebsiteProperties) = preProject 193 Debug.AspNetCompiler.Debug = "True" 194 Release.AspNetCompiler.Debug = "False" 177 195 EndProjectSection 178 196 EndProject … … 1021 1039 {D96F7075-F6CD-4921-B5D8-8488E2D24BDB}.Release|x64.ActiveCfg = Release|x64 1022 1040 {D96F7075-F6CD-4921-B5D8-8488E2D24BDB}.Release|x64.Build.0 = Release|x64 1041 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug|Any CPU.ActiveCfg = Debug|Win32 1042 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug|Itanium.ActiveCfg = Debug|Win32 1043 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 1044 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug|Mixed Platforms.Build.0 = Debug|Win32 1045 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug|Win32.ActiveCfg = Debug|Win32 1046 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug|Win32.Build.0 = Debug|Win32 1047 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug|x64.ActiveCfg = Debug|Win32 1048 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug-MemCheck|Any CPU.ActiveCfg = Debug|Win32 1049 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug-MemCheck|Itanium.ActiveCfg = Debug|Win32 1050 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug-MemCheck|Mixed Platforms.ActiveCfg = Debug|Win32 1051 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug-MemCheck|Mixed Platforms.Build.0 = Debug|Win32 1052 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug-MemCheck|Win32.ActiveCfg = Debug|Win32 1053 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug-MemCheck|Win32.Build.0 = Debug|Win32 1054 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Debug-MemCheck|x64.ActiveCfg = Debug|Win32 1055 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Distribution|Any CPU.ActiveCfg = Debug|Win32 1056 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Distribution|Itanium.ActiveCfg = Debug|Win32 1057 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Distribution|Mixed Platforms.ActiveCfg = Debug|Win32 1058 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Distribution|Mixed Platforms.Build.0 = Debug|Win32 1059 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Distribution|Win32.ActiveCfg = Debug|Win32 1060 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Distribution|Win32.Build.0 = Debug|Win32 1061 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Distribution|x64.ActiveCfg = Debug|Win32 1062 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Nightly|Any CPU.ActiveCfg = Release|Win32 1063 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Nightly|Itanium.ActiveCfg = Release|Win32 1064 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Nightly|Mixed Platforms.ActiveCfg = Release|Win32 1065 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Nightly|Mixed Platforms.Build.0 = Release|Win32 1066 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Nightly|Win32.ActiveCfg = Release|Win32 1067 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Nightly|Win32.Build.0 = Release|Win32 1068 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Nightly|x64.ActiveCfg = Release|Win32 1069 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Release|Any CPU.ActiveCfg = Release|Win32 1070 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Release|Itanium.ActiveCfg = Release|Win32 1071 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Release|Mixed Platforms.ActiveCfg = Release|Win32 1072 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Release|Mixed Platforms.Build.0 = Release|Win32 1073 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Release|Win32.ActiveCfg = Release|Win32 1074 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Release|Win32.Build.0 = Release|Win32 1075 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D}.Release|x64.ActiveCfg = Release|Win32 1076 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug|Any CPU.ActiveCfg = Debug|x64 1077 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug|Itanium.ActiveCfg = Debug|x64 1078 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 1079 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug|Mixed Platforms.Build.0 = Debug|x64 1080 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug|Win32.ActiveCfg = Debug|Win32 1081 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug|Win32.Build.0 = Debug|Win32 1082 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug|x64.ActiveCfg = Debug|x64 1083 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug|x64.Build.0 = Debug|x64 1084 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug-MemCheck|Any CPU.ActiveCfg = Debug-MemCheck|x64 1085 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug-MemCheck|Itanium.ActiveCfg = Debug-MemCheck|x64 1086 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug-MemCheck|Mixed Platforms.ActiveCfg = Debug-MemCheck|x64 1087 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug-MemCheck|Mixed Platforms.Build.0 = Debug-MemCheck|x64 1088 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug-MemCheck|Win32.ActiveCfg = Debug-MemCheck|Win32 1089 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug-MemCheck|Win32.Build.0 = Debug-MemCheck|Win32 1090 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug-MemCheck|x64.ActiveCfg = Debug-MemCheck|x64 1091 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Debug-MemCheck|x64.Build.0 = Debug-MemCheck|x64 1092 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Distribution|Any CPU.ActiveCfg = Distribution|x64 1093 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Distribution|Itanium.ActiveCfg = Distribution|x64 1094 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Distribution|Mixed Platforms.ActiveCfg = Distribution|x64 1095 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Distribution|Mixed Platforms.Build.0 = Distribution|x64 1096 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Distribution|Win32.ActiveCfg = Distribution|Win32 1097 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Distribution|Win32.Build.0 = Distribution|Win32 1098 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Distribution|x64.ActiveCfg = Distribution|x64 1099 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Distribution|x64.Build.0 = Distribution|x64 1100 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Nightly|Any CPU.ActiveCfg = Nightly|x64 1101 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Nightly|Itanium.ActiveCfg = Nightly|x64 1102 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Nightly|Mixed Platforms.ActiveCfg = Nightly|x64 1103 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Nightly|Mixed Platforms.Build.0 = Nightly|x64 1104 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Nightly|Win32.ActiveCfg = Nightly|Win32 1105 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Nightly|Win32.Build.0 = Nightly|Win32 1106 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Nightly|x64.ActiveCfg = Nightly|x64 1107 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Nightly|x64.Build.0 = Nightly|x64 1108 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Release|Any CPU.ActiveCfg = Release|x64 1109 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Release|Itanium.ActiveCfg = Release|x64 1110 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Release|Mixed Platforms.ActiveCfg = Release|x64 1111 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Release|Mixed Platforms.Build.0 = Release|x64 1112 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Release|Win32.ActiveCfg = Release|Win32 1113 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Release|Win32.Build.0 = Release|Win32 1114 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Release|x64.ActiveCfg = Release|x64 1115 {F3401E75-60FB-4A0E-A18C-6505587D5B1A}.Release|x64.Build.0 = Release|x64 1023 1116 EndGlobalSection 1024 1117 GlobalSection(SolutionProperties) = preSolution … … 1040 1133 {4241C6CF-EC01-4AD9-89B0-B75EBA8A5996} = {9757464B-C125-4307-A84A-F4181AE6A081} 1041 1134 {BBFF8362-C626-4838-B0A2-F695D638AD24} = {9757464B-C125-4307-A84A-F4181AE6A081} 1135 {F3401E75-60FB-4A0E-A18C-6505587D5B1A} = {9757464B-C125-4307-A84A-F4181AE6A081} 1042 1136 {0E2B21D9-F432-4127-8E92-7716B1072510} = {9A087442-7BB2-4CF0-9F58-5D1BC3C32CD2} 1043 1137 {A3CF4E23-1D1B-4D93-A16A-48C52D118560} = {9A087442-7BB2-4CF0-9F58-5D1BC3C32CD2} … … 1046 1140 {630857C0-6AD8-4CEE-B5F7-CA1DF620CA9A} = {C8DCE3D7-A802-4C5D-ABB1-B478F545B6E5} 1047 1141 {B6D08289-B8AE-4391-9D07-93B22618BE58} = {C8DCE3D7-A802-4C5D-ABB1-B478F545B6E5} 1142 {45D4AD47-393C-4E67-9B68-FCA621CD3120} = {C8DCE3D7-A802-4C5D-ABB1-B478F545B6E5} 1143 {19BF0AD8-0013-46C7-9E91-F60FE3B0A63D} = {45D4AD47-393C-4E67-9B68-FCA621CD3120} 1048 1144 EndGlobalSection 1049 1145 GlobalSection(DPCodeReviewSolutionGUID) = preSolution -
NSClient++-2005.vcproj
r6d3bbc1 r367bf20 2365 2365 </File> 2366 2366 <File 2367 RelativePath=".\include\com_helpers.hpp" 2368 > 2369 </File> 2370 <File 2367 2371 RelativePath=".\include\config.h" 2372 > 2373 </File> 2374 <File 2375 RelativePath=".\include\error.hpp" 2368 2376 > 2369 2377 </File> -
NSClient++.cpp
rd76af81 r367bf20 245 245 simpleSocket::WSAStartup(); 246 246 } catch (simpleSocket::SocketException e) { 247 LOG_ERROR_STD(_T(" Uncaught exception: ") + e.getMessage());247 LOG_ERROR_STD(_T("Socket exception: ") + e.getMessage()); 248 248 return false; 249 249 } catch (...) { 250 250 LOG_ERROR_STD(_T("Unknown exception iniating socket...")); 251 return false; 252 } 253 254 try { 255 com_helper_.initialize(); 256 } catch (com_helper::com_exception e) { 257 LOG_ERROR_STD(_T("COM exception: ") + e.getMessage()); 258 return false; 259 } catch (...) { 260 LOG_ERROR_STD(_T("Unknown exception iniating COM...")); 251 261 return false; 252 262 } … … 267 277 } catch (SettingsException e) { 268 278 NSC_LOG_ERROR_STD(_T("Failed to set settings file") + e.getMessage()); 279 } catch (...) { 280 LOG_ERROR_STD(_T("Unknown exception when loading settings")); 281 return false; 269 282 } 270 283 try { … … 285 298 try { 286 299 mainClient.unloadPlugins(); 287 } catch(NSPluginException &e) {300 } catch(NSPluginException e) { 288 301 std::wcout << _T("Exception raised: ") << e.error_ << _T(" in module: ") << e.file_ << std::endl;; 289 } 302 } catch(...) { 303 std::wcout << _T("UNknown exception raised: ") << std::endl;; 304 } 305 } 306 try { 307 com_helper_.unInitialize(); 308 } catch (com_helper::com_exception e) { 309 LOG_ERROR_STD(_T("COM exception: ") + e.getMessage()); 310 } catch (...) { 311 LOG_ERROR_STD(_T("Unknown exception uniniating COM...")); 290 312 } 291 313 try { 292 314 simpleSocket::WSACleanup(); 293 315 } catch (simpleSocket::SocketException e) { 294 LOG_ERROR_STD(_T("Uncaught exception: ") + e.getMessage()); 316 LOG_ERROR_STD(_T("Socket exception: ") + e.getMessage()); 317 } catch (...) { 318 LOG_ERROR_STD(_T("Unknown exception uniniating socket...")); 295 319 } 296 320 Settings::destroyInstance(); -
NSClient++.h
r2f01f93 r367bf20 29 29 #include <MutexRW.h> 30 30 #include <map> 31 #include <com_helpers.hpp> 31 32 32 33 … … 73 74 log_status debug_; 74 75 bool boot_; 76 com_helper::initialize_com com_helper_; 75 77 76 78 public: -
StdAfx.h
rb0ae738 r367bf20 19 19 * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * 20 20 ***************************************************************************/ 21 #if !defined(AFX_STDAFX_H__6B96F953_C431_11D3_BCD2_00A0D21A1A22__INCLUDED_)22 #define AFX_STDAFX_H__6B96F953_C431_11D3_BCD2_00A0D21A1A22__INCLUDED_23 24 #if _MSC_VER > 100025 21 #pragma once 26 #endif // _MSC_VER > 100027 22 28 23 #define _WINSOCKAPI_ 29 24 //#include <WinSock2.h> 30 25 26 #define _WIN32_DCOM 27 #include <objbase.h> 28 31 29 #define VC_EXTRALEAN // Exclude rarely-used stuff from Windows headers 32 30 #include <windows.h> 31 33 32 34 33 #define COMPILE_NEWAPIS_STUBS … … 51 50 #include <vld.h> 52 51 #endif 53 54 55 #endif // !defined(AFX_STDAFX_H__6B96F953_C431_11D3_BCD2_00A0D21A1A22__INCLUDED_) -
changelog
rb7ed6ac r367bf20 6 6 * "The message is blocked by User Interface Privilege Isolation, Administrative applications that need to see it can allow it through by calling ChangeWindowMessageFilter after making sure the necessary security precautions are in place. " 7 7 8 2008-03-21 8 2008-04-03 MickeM 9 * Moved COM init to "core" (from WMI module) 10 + Added new Check command: CheckTaskSched Use like so: 11 CheckTaskSched +filter-exit-code==1 ShowAll MaxWarn=1 MaxCrit=1 12 13 2008-03-21 MickeM 9 14 + Added command line support for process checks 10 15 New option: cmdLine will toggle so full command lines are used instead of just process names. … … 15 20 This is *NOT* case blind so might be hard to use, plan to add case blindness to it in the future. 16 21 : Sample command: check_nt ... -v PROCSTATE -l cmdLine,match=regexp,.*exp.* -d SHOWALL 17 * Ohh yeah... it is 2008 this year... not 2007, fixed a few entries in the changelog:)18 - BREAKING CHANGE! -- Removed TOOLHELPER API as PSAPI is simpler and toolhel is really only usefull on w9x (which I dont oficcaly support)19 20 2008-03-20 22 * Ohh yeah... it is 2008 this year... not 2007, fixed a few entries in the :) 23 - BREAKING CHANGE! -- Removed TOOLHELPER API as PSAPI is simpler and toolhelp is really only useful on w9x (which I don't officially support) 24 25 2008-03-20 MickeM 21 26 + Added host-lookupos for NSCA server (#149) 22 27 + Added option (cache_hostname=1|0) to cache the NSCA host name (Ie. only lookup once) … … 25 30 Added option debug_skip_data_collection to simulate this (just for kicks) 26 31 27 2008-03-18 28 * Added some more error mes ages to the NSCA module29 * Added support for srguments to LUA module.32 2008-03-18 MickeM 33 * Added some more error messages to the NSCA module 34 * Added support for arguments to LUA module. 30 35 syntax: function debug (command, args) -- args is a table with all arguments 31 36 … … 34 39 35 40 2008-03-08 MickeM 36 * Changed so log is now in unicode format41 * Changed so log is now in Unicode format 37 42 Hopefully this will make it simpler to diagnose PDH issues in "strange locales". 38 43 If anyone hates this let me know and I will add an option to use "old ansi log". 39 * Fixed so the console is logged as ANSI (properly) and all unicodes are discarded.40 This means "strang ness" in unicode and non-us-ascii chars on the console,41 so for details refer to the log-file which is proper unicode.44 * Fixed so the console is logged as ANSI (properly) and all Unicode's are discarded. 45 This means "strangeness" in Unicode and non-us-ascii chars on the console, 46 so for details refer to the log-file which is proper Unicode. 42 47 + Since log module is loaded "after" the client has booted I added a "hello" message that prints the current version 43 48 (if you find this annoying let me know, I will make it optional :) … … 48 53 49 54 2008-03-05 MickeM 50 + Added debug to new section [Eventlog], when enabled it will (log) w at lines matched what, this is a pretty big performance overhead so dont run with this one.55 + Added debug to new section [Eventlog], when enabled it will (log) what lines matched what, this is a pretty big performance overhead so don't run with this one. 51 56 + Added syntax to new section [Eventlog] used as a shorthand for the syntax to use as "default" (when no syntax=... option is given) 52 57 * Fixed an issue with eventlog and . matching. … … 54 59 + Added <> (same as ! and !=) as NRPE breaks the use of ! (in "all" numeric filters (eventlog)) 55 60 Try using: filter-eventType=<>warning to remove everything that is not a warning 56 * Fixed two spelling mis stakes in the SysTray module.61 * Fixed two spelling mistakes in the SysTray module. 57 62 * Fixed 64-bit issues with installer 58 63 * Fixed so installer uninstalls/installs the service -
include/config.h
rdd02c15 r367bf20 188 188 #define C_SYSTEM_SVC_ALL_4_DEFAULT _T("stopped") 189 189 190 #define C_TASKSCHED_SECTION _T("Task Scheduler") 191 #define C_TASKSCHED_SYNTAX _T("syntax") 192 #define C_TASKSCHED_SYNTAX_DEFAULT _T("%title% last run: %most-recent-run-time% (%exit-code%)") 193 190 194 // Log to File Settings 191 195 #define LOG_SECTION_TITLE _T("log") -
include/filter_framework.hpp
rb7ed6ac r367bf20 191 191 std::wstring value_; 192 192 filter_one() : hasFilter_(false) {} 193 filter_one(const filter_one &other) : hasFilter_(other.hasFilter_), filter(other.filter) {193 filter_one(const filter_one &other) : hasFilter_(other.hasFilter_), filter(other.filter), value_(other.value_) { 194 194 } 195 195 … … 262 262 } else if (t.first == _T("regexp")) { 263 263 regexp = t.second; 264 #else 265 } else if (t.first == _T("regexp")) { 266 throw parse_exception(_T("Regular expression support not enabled!") + value); 264 267 #endif 265 268 } else { … … 267 270 } 268 271 return *this; 272 } 273 std::wstring to_string() const { 274 if (sub.hasFilter()) 275 return _T("substring: '") + sub.getValue() + _T("'"); 276 #ifndef NO_BOOST_DEP 277 if (regexp.hasFilter()) 278 return _T("regexp: '") + regexp.getValue() + _T("'"); 279 #endif 280 if (exact.hasFilter()) 281 return _T("exact: '") + exact.getValue() + _T("'"); 282 return _T("MISSING VALUE"); 269 283 } 270 284 }; … … 325 339 return *this; 326 340 } 341 #define NSCP_FF_DEBUG_NUM(key) if (key.hasFilter()) return _T( # key ) + key.value_; 342 std::wstring to_string() const { 343 NSCP_FF_DEBUG_NUM(max); 344 NSCP_FF_DEBUG_NUM(min); 345 NSCP_FF_DEBUG_NUM(eq); 346 NSCP_FF_DEBUG_NUM(neq); 347 //NSCP_FF_DEBUG_NUM(inList); 348 return _T(" MISSING! "); 349 } 327 350 std::wstring getValue() const { 328 351 return value_; … … 355 378 } 356 379 357 bool hasFilter() {380 bool hasFilter() const { 358 381 return !chain.empty(); 359 382 } 360 bool get_inital_state() {383 bool get_inital_state() const { 361 384 return filterAll; 362 385 } … … 381 404 return matched; 382 405 } 406 std::wstring mode_2_string(filter_mode mode) const { 407 if (mode == plus) 408 return _T("+"); 409 if (mode == minus) 410 return _T("-"); 411 if (mode == normal) 412 return _T("."); 413 return _T("?"); 414 } 415 std::wstring debug() const { 416 std::wstringstream ss; 417 ss << _T("Initial state: ") << get_inital_state() << std::endl; 418 ss << _T("filters: ") << std::endl; 419 for (filterlist_type::const_iterator cit = chain.begin(); cit != chain.end(); ++cit ) 420 ss << _T(" ") << mode_2_string((*cit).first) << _T(": ") << (*cit).second.to_string() << std::endl; 421 return ss.str(); 422 } 383 423 384 424 }; -
include/strEx.h
r2f01f93 r367bf20 164 164 return buf; 165 165 } 166 inline std::wstring format_date( SYSTEMTIME &time, std::wstring format = _T("%Y-%m-%d %H:%M:%S")) {166 inline std::wstring format_date(const SYSTEMTIME &time, std::wstring format = _T("%Y-%m-%d %H:%M:%S")) { 167 167 TCHAR buf[51]; 168 168 … … 187 187 static const __int64 SECS_BETWEEN_EPOCHS = 11644473600; 188 188 static const __int64 SECS_TO_100NS = 10000000; 189 inline std::wstring format_filetime(unsigned long long filetime, std::wstring format ) {189 inline std::wstring format_filetime(unsigned long long filetime, std::wstring format = _T("%Y-%m-%d %H:%M:%S")) { 190 190 filetime -= (SECS_BETWEEN_EPOCHS * SECS_TO_100NS); 191 191 filetime /= SECS_TO_100NS; … … 292 292 strEx::replace(format, key, _T("0")); 293 293 294 inline std::wstring format_time_delta(st d::wstring format, struct tm *mtm) {294 inline std::wstring format_time_delta(struct tm *mtm, std::wstring format = _T("%Y years %m months %d days %H hours %M minutes")) { 295 295 // "Date: %Y-%m-%d %H:%M:%S" 296 296 MK_FORMAT_FTD(70, _T("%Y"), mtm->tm_year); -
modules/CheckDisk/CheckDisk.cpp
r6b690bf r367bf20 503 503 unsigned long long now = ((now_.dwHighDateTime * ((unsigned long long)MAXDWORD+1)) + (unsigned long long)now_.dwLowDateTime); 504 504 time_t value = (now-finder.info.ullLastWriteTime)/10000000; 505 message = strEx::itos(value/60) + _T("&") + strEx::format_time_delta( format, gmtime(&value));505 message = strEx::itos(value/60) + _T("&") + strEx::format_time_delta(gmtime(&value), format); 506 506 return NSCAPI::returnOK; 507 507 } -
modules/CheckEventLog/CheckEventLog-2005.vcproj
r8c7d67f r367bf20 211 211 Optimization="0" 212 212 AdditionalIncludeDirectories="../include;../../include" 213 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS ;NO_BOOST_DEP"213 PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS" 214 214 MinimalRebuild="true" 215 215 BasicRuntimeChecks="3" -
modules/CheckWMI/CheckWMI.cpp
r6b690bf r367bf20 51 51 NSC_LOG_ERROR_STD(_T("Failed to register command.")); 52 52 } 53 return wmiQuery.initialize();53 return true; 54 54 } 55 55 bool CheckWMI::unloadModule() { 56 wmiQuery.unInitialize();57 56 return true; 58 57 } … … 123 122 WMIQuery::result_type rows; 124 123 try { 124 WMIQuery wmiQuery; 125 125 rows = wmiQuery.execute(query); 126 126 } catch (WMIException e) { … … 191 191 WMIQuery::result_type rows; 192 192 try { 193 WMIQuery wmiQuery; 193 194 rows = wmiQuery.execute(query); 194 195 } catch (WMIException e) { … … 260 261 WMIQuery::result_type rows; 261 262 try { 263 WMIQuery wmiQuery; 262 264 rows = wmiQuery.execute(query); 263 265 } catch (WMIException e) { -
modules/CheckWMI/CheckWMI.h
r99e4d8f r367bf20 29 29 30 30 class CheckWMI { 31 private:32 WMIQuery wmiQuery;33 34 31 public: 35 32 CheckWMI(); -
modules/CheckWMI/WMIQuery.cpp
r99e4d8f r367bf20 26 26 #include <map> 27 27 28 WMIQuery::WMIQuery(void) : bInitialized(false)29 {30 }31 32 WMIQuery::~WMIQuery(void)33 {34 if (bInitialized)35 unInitialize();36 }37 38 39 bool WMIQuery::initialize()40 {41 HRESULT hRes = CoInitializeEx(NULL, COINIT_MULTITHREADED);42 if (FAILED(hRes)) {43 NSC_LOG_ERROR_STD(_T("CoInitialize failed: ") + error::format::from_system(hRes));44 return false;45 }46 bInitialized = true;47 hRes = CoInitializeSecurity(NULL,-1,NULL,NULL,RPC_C_AUTHN_LEVEL_PKT,RPC_C_IMP_LEVEL_IMPERSONATE,NULL,EOAC_NONE,NULL);48 if (FAILED(hRes)) {49 NSC_LOG_ERROR_STD(_T("CoInitializeSecurity failed: ") + error::format::from_system(hRes));50 return false;51 }52 return true;53 }54 void WMIQuery::unInitialize()55 {56 CoUninitialize();57 bInitialized = false;58 }59 60 28 std::wstring WMIQuery::sanitize_string(LPTSTR in) { 61 29 TCHAR *p = in; … … 70 38 WMIQuery::result_type WMIQuery::execute(std::wstring query) 71 39 { 72 if (!bInitialized) {73 initialize();74 }75 40 result_type ret; 76 41 -
modules/CheckWMI/WMIQuery.h
r99e4d8f r367bf20 61 61 class WMIQuery 62 62 { 63 private:64 bool bInitialized;65 66 63 public: 67 64 struct WMIResult { … … 147 144 } 148 145 }; 149 WMIQuery(void) ;150 ~WMIQuery(void) ;146 WMIQuery(void) {}; 147 ~WMIQuery(void) {}; 151 148 152 149 result_type execute(std::wstring query); 153 150 std::wstring sanitize_string(LPTSTR in); 154 155 bool initialize();156 void unInitialize();157 151 }; -
modules/LUAScript/script_wrapper.hpp
rb7ed6ac r367bf20 57 57 } 58 58 std::wstring extract_string(lua_State *L) { 59 return strEx::string_to_wstring(lua_tostring( L, lua_gettop( L ) )); 59 int top = lua_gettop(L); 60 if (lua_isstring(L, top)) 61 return strEx::string_to_wstring(lua_tostring( L, lua_gettop( L ) )); 62 return _T("<NOT_A_STRING>"); 60 63 } 61 64 std::wstring pop_string(lua_State *L) { 62 std::wstring ret = strEx::string_to_wstring(lua_tostring( L, lua_gettop( L ) )); 65 std::wstring ret; 66 int top = lua_gettop(L); 67 if (lua_isstring(L, top)) 68 ret = strEx::string_to_wstring(lua_tostring( L, top)); 69 else if (lua_isnil(L, top)) 70 ret = _T("<NIL>"); 71 else if (lua_istable(L, top)) 72 ret = _T("<TABLE>"); 73 else if (lua_isnumber(L, top)) 74 ret = _T("<NUMBER>"); 75 else if (lua_iscfunction(L, top)) 76 ret = _T("<C-FUNCTION>"); 77 else 78 ret = _T("<UNKNOWN>"); 63 79 lua_pop(L, 1); 64 80 return ret; -
scripts/test.lua
r8b206ee r367bf20 1 --require("luacom") 2 --require("luacom") 3 --require("luacom-lua5-13") 1 4 2 print('Loading test script...') 5 nscp.print('Loading test script...') 6 -- win = loadlib("win32.dll","luaopen_w32") 7 -- print(win) -- nil 8 require( 'w32' ) 9 nscp.print(w32) 10 nscp.print(w32.FindWindow) 3 11 4 register_command('check_something', 'something') 12 nscp.execute('version') 13 v = nscp.getSetting('NSCA Agent', 'interval', 'broken') 14 nscp.print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') 15 nscp.print('value: ' .. v) 16 nscp.print('~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~') 17 18 nscp.register('check_something', 'something') 19 nscp.register('lua_debug', 'debug') 20 nscp.register('foo', 'something') 5 21 6 22 function something (command) 7 print(command) 8 code, msg, perf = inject('CheckCPU','time=5','MaxCrit=5') 23 nscp.print(command) 24 --code, msg, perf = inject('CheckCPU','time=5','MaxCrit=5') 25 msg = 'hello' 26 perf = 'hello' 27 code = 'ok' 9 28 print(code .. ': ' .. msg .. ', ' .. perf) 29 collectgarbage () 30 10 31 return code, 'hello from LUA: ' .. msg, perf 11 32 end 33 34 35 function debug (command, args) 36 table.foreachi(args, print) 37 print ('Command was: ' .. command) 38 return 'ok', 'hello' 39 end
Note: See TracChangeset
for help on using the changeset viewer.








