Changeset 3f69109 in nscp
- Timestamp:
- 12/11/07 21:34:14 (6 years ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2, stable
- Children:
- 47b843a
- Parents:
- 5ca3931
- Files:
-
- 5 added
- 9 edited
-
AutoBuild.h (modified) (1 diff)
-
NSC.dist (modified) (2 diffs)
-
NSClient++-2005.sln (modified) (3 diffs)
-
changelog (modified) (1 diff)
-
include/PDHCounter.cpp (modified) (1 diff)
-
include/PDHCounter.h (modified) (3 diffs)
-
modules/CheckSystem/PDHCollector.cpp (modified) (3 diffs)
-
modules/LUAScript/LUAScript-2005.vcproj (added)
-
modules/LUAScript/LUAScript.cpp (added)
-
modules/LUAScript/LUAScript.h (added)
-
modules/LUAScript/stdafx.cpp (added)
-
modules/LUAScript/stdafx.h (added)
-
modules/NRPEListener/NRPEListener-2005.vcproj (modified) (1 diff)
-
modules/NSCAAgent/NSCAAgent-2005.vcproj (modified) (20 diffs)
Legend:
- Unmodified
- Added
- Removed
-
AutoBuild.h
r5ca3931 r3f69109 3 3 // change the FALSE to TRUE for autoincrement of build number 4 4 #define INCREMENT_VERSION TRUE 5 #define FILEVER 0,3,0, 66 #define PRODUCTVER 0,3,0, 67 #define STRFILEVER _T("0.3.0. 6")8 #define STRPRODUCTVER _T("0.3.0. 6")9 #define STRPRODUCTDATE _T("2007-12- 05")5 #define FILEVER 0,3,0,12 6 #define PRODUCTVER 0,3,0,12 7 #define STRFILEVER _T("0.3.0.12") 8 #define STRPRODUCTVER _T("0.3.0.12") 9 #define STRPRODUCTDATE _T("2007-12-11") 10 10 #endif // AUTOBUILD_H -
NSC.dist
r23c63eb r3f69109 20 20 ; RemoteConfiguration IS AN EXTREM EARLY IDEA SO DONT USE FOR PRODUCTION ENVIROMNEMTS! 21 21 ;RemoteConfiguration.dll 22 ; NSCA Agent is a new beta module use with care! 23 ;NSCAAgent.dll 22 24 23 25 [Settings] … … 178 180 ; myotherfile.ini 179 181 ; real.ini 182 183 [NSCA Agent] 184 ;# CHECK INTERVALL (in seconds) 185 ; How often we should run the checks and submit the results. 186 interval=5 187 ; 188 ;# ENCRYPTION METHOD 189 ; This option determines the method by which the send_nsca client will encrypt the packets it sends 190 ; to the nsca daemon. The encryption method you choose will be a balance between security and 191 ; performance, as strong encryption methods consume more processor resources. 192 ; You should evaluate your security needs when choosing an encryption method. 193 ; 194 ; Note: The encryption method you specify here must match the decryption method the nsca daemon uses 195 ; (as specified in the nsca.cfg file)!! 196 ; Values: 197 ; 0 = None (Do NOT use this option) 198 ; -- only 0 is supported as of now, but will change in the future -- 199 ;encryption_method=0 200 ; 201 ;# BIND TO ADDRESS 202 ; Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. 203 ; Leaving this blank will bind to "one" local interface. 204 ; -- not supported as of now -- 205 ;bind_to_address= 206 ; 207 ;# NAGIOS SERVER ADDRESS 208 ; The address to the nagios server to submit results to. 209 ;nsca_host=192.168.0.1 210 ; 211 ;# NAGIOS SERVER PORT 212 ; The port to the nagios server to submit results to. 213 ;nsca_port=5667 214 215 ; The checks to run everytime we submit results back to nagios 216 ; 217 [NSCA Commands] 218 my_cpu_check=checkCPU warn=80 crit=90 time=20m time=10s time=4 219 my_mem_check=checkMem MaxWarn=80% MaxCrit=90% ShowAll type=page 220 my_svc_check=checkServiceState CheckAll -
NSClient++-2005.sln
r5ca3931 r3f69109 3 3 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NSClient++", "NSClient++-2005.vcproj", "{2286162D-7571-4735-BAC8-4A8D33A4F42D}" 4 4 ProjectSection(ProjectDependencies) = postProject 5 {BBFF8362-C626-4838-B0A2-F695D638AD24} = {BBFF8362-C626-4838-B0A2-F695D638AD24} 6 {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45} = {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45} 7 {BA246C01-063A-4548-8957-32D5CC76171B} = {BA246C01-063A-4548-8957-32D5CC76171B} 8 {05DE66AC-E55C-43B3-849F-7EC695D8B8D0} = {05DE66AC-E55C-43B3-849F-7EC695D8B8D0} 9 {2FF60AF6-09AA-49AB-B414-2E8FD01655C6} = {2FF60AF6-09AA-49AB-B414-2E8FD01655C6} 10 {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F} = {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F} 11 {08D6246D-1B4A-47A3-965D-296DCC54A4E8} = {08D6246D-1B4A-47A3-965D-296DCC54A4E8} 12 {2FCAF54B-AAD3-4F59-895A-8F9CEAFDC65D} = {2FCAF54B-AAD3-4F59-895A-8F9CEAFDC65D} 13 {8F1C3E39-D6C6-4414-AAD2-FE03C9A8655F} = {8F1C3E39-D6C6-4414-AAD2-FE03C9A8655F} 5 14 {626EB00E-A4D2-4B02-9BF4-4C655CA2B7E4} = {626EB00E-A4D2-4B02-9BF4-4C655CA2B7E4} 6 {8F1C3E39-D6C6-4414-AAD2-FE03C9A8655F} = {8F1C3E39-D6C6-4414-AAD2-FE03C9A8655F}7 {2FCAF54B-AAD3-4F59-895A-8F9CEAFDC65D} = {2FCAF54B-AAD3-4F59-895A-8F9CEAFDC65D}8 {08D6246D-1B4A-47A3-965D-296DCC54A4E8} = {08D6246D-1B4A-47A3-965D-296DCC54A4E8}9 {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F} = {62B685D7-3A2E-4F3E-B2B8-B17F20C0217F}10 {2FF60AF6-09AA-49AB-B414-2E8FD01655C6} = {2FF60AF6-09AA-49AB-B414-2E8FD01655C6}11 {05DE66AC-E55C-43B3-849F-7EC695D8B8D0} = {05DE66AC-E55C-43B3-849F-7EC695D8B8D0}12 {BA246C01-063A-4548-8957-32D5CC76171B} = {BA246C01-063A-4548-8957-32D5CC76171B}13 {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45} = {E6E588AB-EFEF-481C-9AF7-DCDCB95CFF45}14 {BBFF8362-C626-4838-B0A2-F695D638AD24} = {BBFF8362-C626-4838-B0A2-F695D638AD24}15 15 EndProjectSection 16 16 EndProject … … 38 38 EndProject 39 39 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "NSCAAgent", "modules\NSCAAgent\NSCAAgent-2005.vcproj", "{6F55C9BF-57F6-4A15-A058-C83A52F539EE}" 40 EndProject 41 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LUAScript", "modules\LUAScript\LUAScript-2005.vcproj", "{26B84883-BE52-40E6-9BEE-55AD056D5751}" 42 ProjectSection(ProjectDependencies) = postProject 43 {B6D08289-B8AE-4391-9D07-93B22618BE58} = {B6D08289-B8AE-4391-9D07-93B22618BE58} 44 EndProjectSection 45 EndProject 46 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "LUA", "..\..\LUA\LUA\LUA.vcproj", "{B6D08289-B8AE-4391-9D07-93B22618BE58}" 40 47 EndProject 41 48 Global … … 556 563 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Release|x64.ActiveCfg = Release|x64 557 564 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Release|x64.Build.0 = Release|x64 565 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|Any CPU.ActiveCfg = Debug|x64 566 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|Itanium.ActiveCfg = Debug|x64 567 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|Mixed Platforms.ActiveCfg = Debug|x64 568 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|Mixed Platforms.Build.0 = Debug|x64 569 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|Win32.ActiveCfg = Debug|Win32 570 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|Win32.Build.0 = Debug|Win32 571 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|x64.ActiveCfg = Debug|x64 572 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug|x64.Build.0 = Debug|x64 573 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug-MemCheck|Any CPU.ActiveCfg = Debug-MemCheck|x64 574 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug-MemCheck|Itanium.ActiveCfg = Debug-MemCheck|x64 575 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug-MemCheck|Mixed Platforms.ActiveCfg = Debug-MemCheck|x64 576 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug-MemCheck|Mixed Platforms.Build.0 = Debug-MemCheck|x64 577 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug-MemCheck|Win32.ActiveCfg = Debug-MemCheck|Win32 578 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug-MemCheck|Win32.Build.0 = Debug-MemCheck|Win32 579 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug-MemCheck|x64.ActiveCfg = Debug-MemCheck|x64 580 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Debug-MemCheck|x64.Build.0 = Debug-MemCheck|x64 581 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Distribution|Any CPU.ActiveCfg = Distribution|x64 582 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Distribution|Itanium.ActiveCfg = Distribution|x64 583 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Distribution|Mixed Platforms.ActiveCfg = Distribution|x64 584 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Distribution|Mixed Platforms.Build.0 = Distribution|x64 585 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Distribution|Win32.ActiveCfg = Distribution|Win32 586 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Distribution|Win32.Build.0 = Distribution|Win32 587 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Distribution|x64.ActiveCfg = Distribution|x64 588 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Distribution|x64.Build.0 = Distribution|x64 589 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Nightly|Any CPU.ActiveCfg = Nightly|x64 590 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Nightly|Itanium.ActiveCfg = Nightly|x64 591 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Nightly|Mixed Platforms.ActiveCfg = Nightly|x64 592 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Nightly|Mixed Platforms.Build.0 = Nightly|x64 593 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Nightly|Win32.ActiveCfg = Nightly|Win32 594 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Nightly|Win32.Build.0 = Nightly|Win32 595 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Nightly|x64.ActiveCfg = Nightly|x64 596 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Nightly|x64.Build.0 = Nightly|x64 597 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Release|Any CPU.ActiveCfg = Release|x64 598 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Release|Itanium.ActiveCfg = Release|x64 599 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Release|Mixed Platforms.ActiveCfg = Release|x64 600 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Release|Mixed Platforms.Build.0 = Release|x64 601 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Release|Win32.ActiveCfg = Release|Win32 602 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Release|Win32.Build.0 = Release|Win32 603 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Release|x64.ActiveCfg = Release|x64 604 {26B84883-BE52-40E6-9BEE-55AD056D5751}.Release|x64.Build.0 = Release|x64 605 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug|Any CPU.ActiveCfg = Debug|Win32 606 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug|Itanium.ActiveCfg = Debug|Win32 607 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug|Mixed Platforms.ActiveCfg = Debug|Win32 608 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug|Mixed Platforms.Build.0 = Debug|Win32 609 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug|Win32.ActiveCfg = Debug|Win32 610 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug|Win32.Build.0 = Debug|Win32 611 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug|x64.ActiveCfg = Debug|Win32 612 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug-MemCheck|Any CPU.ActiveCfg = Debug|Win32 613 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug-MemCheck|Itanium.ActiveCfg = Debug|Win32 614 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug-MemCheck|Mixed Platforms.ActiveCfg = Debug|Win32 615 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug-MemCheck|Mixed Platforms.Build.0 = Debug|Win32 616 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug-MemCheck|Win32.ActiveCfg = Debug|Win32 617 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug-MemCheck|Win32.Build.0 = Debug|Win32 618 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Debug-MemCheck|x64.ActiveCfg = Debug|Win32 619 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Distribution|Any CPU.ActiveCfg = Debug|Win32 620 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Distribution|Itanium.ActiveCfg = Debug|Win32 621 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Distribution|Mixed Platforms.ActiveCfg = Debug|Win32 622 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Distribution|Mixed Platforms.Build.0 = Debug|Win32 623 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Distribution|Win32.ActiveCfg = Debug|Win32 624 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Distribution|Win32.Build.0 = Debug|Win32 625 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Distribution|x64.ActiveCfg = Debug|Win32 626 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Nightly|Any CPU.ActiveCfg = Release|Win32 627 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Nightly|Itanium.ActiveCfg = Release|Win32 628 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Nightly|Mixed Platforms.ActiveCfg = Release|Win32 629 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Nightly|Mixed Platforms.Build.0 = Release|Win32 630 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Nightly|Win32.ActiveCfg = Release|Win32 631 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Nightly|Win32.Build.0 = Release|Win32 632 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Nightly|x64.ActiveCfg = Release|Win32 633 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Release|Any CPU.ActiveCfg = Release|Win32 634 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Release|Itanium.ActiveCfg = Release|Win32 635 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Release|Mixed Platforms.ActiveCfg = Release|Win32 636 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Release|Mixed Platforms.Build.0 = Release|Win32 637 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Release|Win32.ActiveCfg = Release|Win32 638 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Release|Win32.Build.0 = Release|Win32 639 {B6D08289-B8AE-4391-9D07-93B22618BE58}.Release|x64.ActiveCfg = Release|Win32 558 640 EndGlobalSection 559 641 GlobalSection(SolutionProperties) = preSolution -
changelog
r5ca3931 r3f69109 5 5 * Add module for relaying events 6 6 * Add API for rehashing the daemon (or implement it the API is there but does nothing) 7 8 2007-12-11 MickeM 9 + Added support for index-lookups of PDH counters (hopefully *all* local problems are now fixed (yeah right)) 10 11 2007-12-10 MickeM 12 + Added intial draft for LUA module 7 13 8 14 2007-12-09 MickeM -
include/PDHCounter.cpp
rdc65e35 r3f69109 21 21 #include "stdafx.h" 22 22 #include "pdhcounter.h" 23 24 PDH::PDHResolver::fpPdhLookupPerfNameByIndex PDH::PDHResolver::pPdhLookupPerfNameByIndex = NULL; 25 HMODULE PDH::PDHResolver::PDH_ = NULL; -
include/PDHCounter.h
r5ca3931 r3f69109 28 28 29 29 namespace PDH { 30 31 32 30 33 class PDHException { 31 34 private: … … 45 48 ret += _T(": ") + error::format::from_module(_T("PDH.DLL"), pdhStatus_); 46 49 } 50 return ret; 51 } 52 }; 53 54 class PDHResolver { 55 public: 56 //typedef PDH_FUNCTION (*fpPdhLookupPerfNameByIndex)(IN LPCWSTR szMachineName,IN DWORD dwNameIndex,IN LPWSTR szNameBuffer,IN LPDWORD pcchNameBufferSize); 57 typedef PDH_STATUS (WINAPI *fpPdhLookupPerfNameByIndex)(LPCWSTR,DWORD,LPWSTR,LPDWORD); 58 static fpPdhLookupPerfNameByIndex pPdhLookupPerfNameByIndex; 59 static HMODULE PDH_; 60 private: 61 static void lookup_function() { 62 if (pPdhLookupPerfNameByIndex != NULL) 63 return; 64 PDH_ = ::LoadLibrary(_TEXT("PDH")); 65 66 if (PDH_ == NULL) { 67 throw PDHException(_T("LoadLibrary for PDH failed: ")+ error::lookup::last_error()); 68 } 69 #ifdef UNICODE 70 //*(FARPROC *)&pPdhLookupPerfNameByIndex 71 pPdhLookupPerfNameByIndex = (fpPdhLookupPerfNameByIndex)::GetProcAddress(PDH_, "PdhLookupPerfNameByIndexW"); 72 #else 73 pPdhLookupPerfNameByIndex = (fpPdhLookupPerfNameByIndex)::GetProcAddress(PDH_, "PdhLookupPerfNameByIndexA"); 74 #endif 75 if (pPdhLookupPerfNameByIndex == NULL) { 76 throw PDHException(_T("Failed to find function: PdhLookupPerfNameByIndex!")+ error::lookup::last_error()); 77 } 78 } 79 public: 80 static PDH_STATUS PdhLookupPerfNameByIndex(LPCTSTR szMachineName,DWORD dwNameIndex,LPTSTR szNameBuffer,LPDWORD pcchNameBufferSize) { 81 PDHResolver::lookup_function(); 82 if (pPdhLookupPerfNameByIndex == NULL) 83 throw PDHException(_T("Failed to initalize PdhLookupPerfNameByIndex :(")); 84 return pPdhLookupPerfNameByIndex(szMachineName,dwNameIndex,szNameBuffer,pcchNameBufferSize); 85 } 86 #define PDH_INDEX_BUF_LEN 2048 87 static std::wstring PdhLookupPerfNameByIndex(LPCTSTR szMachineName, DWORD dwNameIndex) { 88 TCHAR *buffer = new TCHAR[PDH_INDEX_BUF_LEN+1]; 89 DWORD bufLen = PDH_INDEX_BUF_LEN; 90 PDH_STATUS status = PDHResolver::PdhLookupPerfNameByIndex(szMachineName,dwNameIndex,buffer,&bufLen); 91 if (status != ERROR_SUCCESS) { 92 delete [] buffer; 93 throw PDHException(_T("RESOLVER"), _T("PdhLookupPerfNameByIndex: Could not find index: ") + strEx::itos(dwNameIndex), status); 94 } 95 std::wstring ret = buffer; 96 delete [] buffer; 47 97 return ret; 48 98 } … … 211 261 return counter; 212 262 } 263 std::wstring lookupIndex(DWORD index) { 264 return PDHResolver::PdhLookupPerfNameByIndex(NULL, index); 265 } 213 266 PDHCounter* addCounter(std::wstring name) { 214 267 PDHCounter *counter = new PDHCounter(name); -
modules/CheckSystem/PDHCollector.cpp
r5ca3931 r3f69109 66 66 settings.setFile(NSCModuleHelper::getBasePath(), _T("counters.defs"), true); 67 67 std::wstring section = NSCModuleHelper::getSettingsString(C_SYSTEM_SECTION_TITLE, C_SYSTEM_FORCE_LANGUAGE, C_SYSTEM_FORCE_LANGUAGE_DEFAULT); 68 bool bUseIndex = false; 68 69 69 70 try { … … 79 80 NSC_DEBUG_MSG_STD(_T("Autodetected NT4, using NT4 PDH counters.")); 80 81 prefix = _T("NT4"); 82 bUseIndex = false; 81 83 langId = systemInfo::GetSystemDefaultLangID(); 82 84 } else if (systemInfo::isAboveW2K(osVer)) { 83 85 NSC_DEBUG_MSG_STD(_T("Autodetected w2k or later, using w2k PDH counters.")); 86 bUseIndex = true; 84 87 prefix = _T("W2K"); 85 88 langId = systemInfo::GetSystemDefaultUILanguage(); … … 107 110 return -1; 108 111 } 109 pdh.addCounter(settings.getString(section, prefix + _T("_") + C_SYSTEM_MEM_PAGE_LIMIT, C_SYSTEM_MEM_PAGE_LIMIT_DEFAULT), &memCmtLim); 110 pdh.addCounter(settings.getString(section, prefix + _T("_") + C_SYSTEM_MEM_PAGE, C_SYSTEM_MEM_PAGE_DEFAULT), &memCmt); 111 pdh.addCounter(settings.getString(section, prefix + _T("_") + C_SYSTEM_UPTIME, C_SYSTEM_UPTIME_DEFAULT), &upTime); 112 pdh.addCounter(settings.getString(section, prefix + _T("_") + C_SYSTEM_CPU, C_SYSTEM_MEM_CPU_DEFAULT), &cpu); 113 try { 112 113 try { 114 std::wstring proc; 115 std::wstring uptime; 116 std::wstring memCl; 117 std::wstring memCb; 118 if (bUseIndex) { 119 NSC_DEBUG_MSG_STD(_T("Using index to retrive counternames")); 120 proc = _T("\\") + pdh.lookupIndex(238) + _T("(_total)\\") + pdh.lookupIndex(6); 121 uptime = _T("\\") + pdh.lookupIndex(2) + _T("\\") + pdh.lookupIndex(674); 122 memCl = _T("\\") + pdh.lookupIndex(4) + _T("\\") + pdh.lookupIndex(30); 123 memCb = _T("\\") + pdh.lookupIndex(4) + _T("\\") + pdh.lookupIndex(26); 124 } else { 125 proc = settings.getString(section, prefix + _T("_") + C_SYSTEM_CPU, C_SYSTEM_MEM_CPU_DEFAULT); 126 uptime = settings.getString(section, prefix + _T("_") + C_SYSTEM_UPTIME, C_SYSTEM_UPTIME_DEFAULT); 127 memCl = settings.getString(section, prefix + _T("_") + C_SYSTEM_MEM_PAGE_LIMIT, C_SYSTEM_MEM_PAGE_LIMIT_DEFAULT); 128 memCb = settings.getString(section, prefix + _T("_") + C_SYSTEM_MEM_PAGE, C_SYSTEM_MEM_PAGE_DEFAULT); 129 } 130 NSC_DEBUG_MSG_STD(_T("Found counternames: CPU: ") + proc); 131 NSC_DEBUG_MSG_STD(_T("Found counternames: UPTIME: ") + uptime); 132 NSC_DEBUG_MSG_STD(_T("Found counternames: MCL: ") + memCl); 133 NSC_DEBUG_MSG_STD(_T("Found counternames: MCB: ") + memCb); 134 pdh.addCounter(proc, &cpu); 135 pdh.addCounter(uptime, &upTime); 136 pdh.addCounter(memCl, &memCmtLim); 137 pdh.addCounter(memCb, &memCmt); 114 138 pdh.open(); 115 139 } catch (const PDH::PDHException &e) { 116 140 NSC_LOG_ERROR_STD(_T("Failed to open performance counters: ") + e.getError()); 141 pdh.removeAllCounters(); 117 142 NSC_LOG_ERROR_STD(_T("Trying to use default (English) counters")); 118 pdh.removeAllCounters();143 SetThreadLocale(MAKELCID(MAKELANGID(LANG_ENGLISH,SUBLANG_ENGLISH_US),SORT_DEFAULT)); 119 144 pdh.addCounter(C_SYSTEM_MEM_PAGE_LIMIT_DEFAULT, &memCmtLim); 120 145 pdh.addCounter(C_SYSTEM_MEM_PAGE_DEFAULT, &memCmt); -
modules/NRPEListener/NRPEListener-2005.vcproj
r3f569d3 r3f69109 517 517 Name="Nightly|Win32" 518 518 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 519 IntermediateDirectory="$( ConfigurationName)"519 IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" 520 520 ConfigurationType="2" 521 521 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" -
modules/NSCAAgent/NSCAAgent-2005.vcproj
r5ca3931 r3f69109 70 70 Name="VCLinkerTool" 71 71 AdditionalDependencies="ws2_32.lib" 72 OutputFile=" ../../Debug/modules/$(ProjectName).dll"72 OutputFile="$(OutDir)\$(ProjectName).dll" 73 73 LinkIncremental="2" 74 74 ModuleDefinitionFile="NSCAAgent.def" … … 110 110 ConfigurationType="2" 111 111 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" 112 CharacterSet=" 2"112 CharacterSet="1" 113 113 > 114 114 <Tool … … 152 152 <Tool 153 153 Name="VCLinkerTool" 154 AdditionalDependencies=" Pdh.lib"155 OutputFile=" ../../Debug/modules/$(ProjectName).dll"154 AdditionalDependencies="ws2_32.lib" 155 OutputFile="$(OutDir)\$(ProjectName).dll" 156 156 LinkIncremental="2" 157 157 ModuleDefinitionFile="NSCAAgent.def" … … 193 193 ConfigurationType="2" 194 194 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" 195 CharacterSet=" 2"195 CharacterSet="1" 196 196 > 197 197 <Tool … … 231 231 <Tool 232 232 Name="VCLinkerTool" 233 AdditionalDependencies=" Pdh.lib"234 OutputFile=" ../../Release/modules/$(ProjectName).dll"233 AdditionalDependencies="ws2_32.lib" 234 OutputFile="$(OutDir)\$(ProjectName).dll" 235 235 LinkIncremental="1" 236 236 ModuleDefinitionFile="NSCAAgent.def" … … 273 273 ConfigurationType="2" 274 274 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" 275 CharacterSet=" 2"275 CharacterSet="1" 276 276 > 277 277 <Tool … … 312 312 <Tool 313 313 Name="VCLinkerTool" 314 AdditionalDependencies=" Pdh.lib"315 OutputFile=" ../../Release/modules/$(ProjectName).dll"314 AdditionalDependencies="ws2_32.lib" 315 OutputFile="$(OutDir)\$(ProjectName).dll" 316 316 LinkIncremental="1" 317 317 ModuleDefinitionFile="NSCAAgent.def" … … 354 354 ConfigurationType="2" 355 355 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" 356 CharacterSet=" 2"356 CharacterSet="1" 357 357 > 358 358 <Tool … … 392 392 <Tool 393 393 Name="VCLinkerTool" 394 AdditionalDependencies=" Pdh.lib"395 OutputFile=" ../../Dist/modules/$(ProjectName).dll"394 AdditionalDependencies="ws2_32.lib" 395 OutputFile="$(OutDir)\$(ProjectName).dll" 396 396 LinkIncremental="1" 397 397 ModuleDefinitionFile="NSCAAgent.def" … … 434 434 ConfigurationType="2" 435 435 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" 436 CharacterSet=" 2"436 CharacterSet="1" 437 437 > 438 438 <Tool … … 473 473 <Tool 474 474 Name="VCLinkerTool" 475 AdditionalDependencies=" Pdh.lib"476 OutputFile=" ../../Dist/modules/$(ProjectName).dll"475 AdditionalDependencies="ws2_32.lib" 476 OutputFile="$(OutDir)\$(ProjectName).dll" 477 477 LinkIncremental="1" 478 478 ModuleDefinitionFile="NSCAAgent.def" … … 511 511 <Configuration 512 512 Name="Nightly|Win32" 513 OutputDirectory="$( ConfigurationName)"514 IntermediateDirectory="$( ConfigurationName)"513 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 514 IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" 515 515 ConfigurationType="2" 516 516 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" 517 CharacterSet=" 2"517 CharacterSet="1" 518 518 > 519 519 <Tool … … 553 553 <Tool 554 554 Name="VCLinkerTool" 555 AdditionalDependencies=" Pdh.lib"556 OutputFile=" ../../Dist/modules/$(ProjectName).dll"555 AdditionalDependencies="ws2_32.lib" 556 OutputFile="$(OutDir)\$(ProjectName).dll" 557 557 LinkIncremental="1" 558 558 ModuleDefinitionFile="NSCAAgent.def" 559 GenerateDebugInformation=" true"559 GenerateDebugInformation="false" 560 560 SubSystem="2" 561 561 OptimizeReferences="2" … … 591 591 <Configuration 592 592 Name="Nightly|x64" 593 OutputDirectory="$( PlatformName)\$(ConfigurationName)"593 OutputDirectory="$(SolutionDir)$(PlatformName)\$(ConfigurationName)\modules" 594 594 IntermediateDirectory="$(PlatformName)\$(ConfigurationName)" 595 595 ConfigurationType="2" 596 596 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" 597 CharacterSet=" 2"597 CharacterSet="1" 598 598 > 599 599 <Tool … … 634 634 <Tool 635 635 Name="VCLinkerTool" 636 AdditionalDependencies=" Pdh.lib"637 OutputFile=" ../../Dist/modules/$(ProjectName).dll"636 AdditionalDependencies="ws2_32.lib" 637 OutputFile="$(OutDir)\$(ProjectName).dll" 638 638 LinkIncremental="1" 639 639 ModuleDefinitionFile="NSCAAgent.def" 640 GenerateDebugInformation=" true"640 GenerateDebugInformation="false" 641 641 SubSystem="2" 642 642 OptimizeReferences="2" … … 676 676 ConfigurationType="2" 677 677 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" 678 CharacterSet=" 2"678 CharacterSet="1" 679 679 > 680 680 <Tool … … 717 717 <Tool 718 718 Name="VCLinkerTool" 719 AdditionalDependencies=" Pdh.lib"720 OutputFile=" ../../Debug/modules/$(ProjectName).dll"719 AdditionalDependencies="ws2_32.lib" 720 OutputFile="$(OutDir)\$(ProjectName).dll" 721 721 LinkIncremental="2" 722 722 ModuleDefinitionFile="NSCAAgent.def" … … 758 758 ConfigurationType="2" 759 759 InheritedPropertySheets="$(VCInstallDir)VCProjectDefaults\UpgradeFromVC71.vsprops" 760 CharacterSet=" 2"760 CharacterSet="1" 761 761 > 762 762 <Tool … … 800 800 <Tool 801 801 Name="VCLinkerTool" 802 AdditionalDependencies=" Pdh.lib"803 OutputFile=" ../../Debug/modules/$(ProjectName).dll"802 AdditionalDependencies="ws2_32.lib" 803 OutputFile="$(OutDir)\$(ProjectName).dll" 804 804 LinkIncremental="2" 805 805 ModuleDefinitionFile="NSCAAgent.def" … … 1543 1543 <FileConfiguration 1544 1544 Name="Debug|Win32" 1545 > 1546 <Tool 1547 Name="VCCLCompilerTool" 1548 UsePrecompiledHeader="0" 1549 /> 1550 </FileConfiguration> 1551 <FileConfiguration 1552 Name="Debug|x64" 1553 > 1554 <Tool 1555 Name="VCCLCompilerTool" 1556 UsePrecompiledHeader="0" 1557 /> 1558 </FileConfiguration> 1559 <FileConfiguration 1560 Name="Release|Win32" 1561 > 1562 <Tool 1563 Name="VCCLCompilerTool" 1564 UsePrecompiledHeader="0" 1565 /> 1566 </FileConfiguration> 1567 <FileConfiguration 1568 Name="Release|x64" 1569 > 1570 <Tool 1571 Name="VCCLCompilerTool" 1572 UsePrecompiledHeader="0" 1573 /> 1574 </FileConfiguration> 1575 <FileConfiguration 1576 Name="Distribution|Win32" 1577 > 1578 <Tool 1579 Name="VCCLCompilerTool" 1580 UsePrecompiledHeader="0" 1581 /> 1582 </FileConfiguration> 1583 <FileConfiguration 1584 Name="Distribution|x64" 1585 > 1586 <Tool 1587 Name="VCCLCompilerTool" 1588 UsePrecompiledHeader="0" 1589 /> 1590 </FileConfiguration> 1591 <FileConfiguration 1592 Name="Nightly|Win32" 1593 > 1594 <Tool 1595 Name="VCCLCompilerTool" 1596 UsePrecompiledHeader="0" 1597 /> 1598 </FileConfiguration> 1599 <FileConfiguration 1600 Name="Nightly|x64" 1601 > 1602 <Tool 1603 Name="VCCLCompilerTool" 1604 UsePrecompiledHeader="0" 1605 /> 1606 </FileConfiguration> 1607 <FileConfiguration 1608 Name="Debug-MemCheck|Win32" 1609 > 1610 <Tool 1611 Name="VCCLCompilerTool" 1612 UsePrecompiledHeader="0" 1613 /> 1614 </FileConfiguration> 1615 <FileConfiguration 1616 Name="Debug-MemCheck|x64" 1545 1617 > 1546 1618 <Tool
Note: See TracChangeset
for help on using the changeset viewer.








