Changeset 1cc8566 in nscp
- Timestamp:
- 05/19/12 11:54:59 (13 months ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2
- Children:
- 81dbd0c
- Parents:
- c630d09
- Files:
-
- 7 edited
-
changelog (modified) (1 diff)
-
files/old-settings.map (modified) (1 diff)
-
include/pdh/counters.hpp (modified) (1 diff)
-
include/pdh/query.hpp (modified) (1 diff)
-
include/pdh/resolver.hpp (modified) (2 diffs)
-
modules/CheckExternalScripts/commands.hpp (modified) (1 diff)
-
modules/CheckSystem/CheckSystem.cpp (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
changelog
rc630d09 r1cc8566 4 4 * Fixa dependonservice LanManWorkStation (old win) 5 5 * Fix RtlStringFromGUID problem on NT4 6 7 2012-05-19 MickeM 8 * Fixed issue with checking rate counters (such as disk idle %) 9 * Fixed (I think) the negative denominator counter issue 10 * Fixed so indexes are only converted on \\123\\ and not also \\123 hello world\\ which caused some issues with numeric counter variables. 6 11 7 12 2012-05-13 MickeM -
files/old-settings.map
r682ccd2 r1cc8566 36 36 37 37 log/file=/settings/log/file name 38 log/date_mask=/settings/log/date mask38 log/date_mask=/settings/log/date format 39 39 # log/debug=/settings/log/level 40 40 # log/debug -
include/pdh/counters.hpp
rd6c3131 r1cc8566 105 105 hCounter_ = NULL; 106 106 } 107 void collect() { 107 PDH::PDHError collect() { 108 PDH::PDHError status; 108 109 if (hCounter_ == NULL) 109 return ;110 return status; 110 111 if (!listener_) 111 return ;112 return status; 112 113 DWORD format = listener_->getFormat(); 113 PDH::PDHError status = PDH::PDHFactory::get_impl()->PdhGetFormattedCounterValue(hCounter_, format, NULL, &data_); 114 if (status.is_negative_denominator()) { 115 Sleep(500); 116 status = PDH::PDHFactory::get_impl()->PdhGetFormattedCounterValue(hCounter_, format, NULL, &data_); 114 status = PDH::PDHFactory::get_impl()->PdhGetFormattedCounterValue(hCounter_, format, NULL, &data_); 115 if (!status.is_error()) { 116 listener_->collect(*this); 117 117 } 118 if (status.is_error()) { 119 throw PDHException(name_, _T("PdhGetFormattedCounterValue failed {format: ") + strEx::itos(format) + _T("}"), status); 120 } 121 listener_->collect(*this); 118 return status; 122 119 } 123 120 double getDoubleValue() const { -
include/pdh/query.hpp
rd6c3131 r1cc8566 100 100 collect(); 101 101 for (CounterList::iterator it = counters_.begin(); it != counters_.end(); it++) { 102 (*it)->collect(); 102 PDH::PDHError status = (*it)->collect(); 103 if (status.is_negative_denominator()) { 104 Sleep(500); 105 collect(); 106 status = (*it)->collect(); 107 } 108 if (status.is_error()) { 109 throw PDHException(_T("Failed to poll counter: "), status); 110 } 103 111 } 104 112 } -
include/pdh/resolver.hpp
rf0e6036 r1cc8566 76 76 return status.is_ok(); 77 77 } 78 static bool is_speacial_char(wchar_t c) { 79 return c == L'\\' || c == L'(' || c == L')'; 80 } 78 81 79 82 static bool PDHResolver::expand_index(std::wstring &counter) { … … 88 91 if (p2 <= p1) 89 92 return false; 93 if (p1 > 0) { 94 if (!is_speacial_char(counter[p1-1])) { 95 pos = p2; 96 continue; 97 } 98 } 99 if (p2 < counter.size()) { 100 if (!is_speacial_char(counter[p2+1])) { 101 pos = p2; 102 continue; 103 } 104 } 90 105 unsigned int index = strEx::stoi(counter.substr(p1, p2-p1)); 91 106 std::wstring sindex = PDH::PDHResolver::lookupIndex(index); -
modules/CheckExternalScripts/commands.hpp
rc630d09 r1cc8566 89 89 strEx::parse_command(str, command, arguments); 90 90 } catch (const std::exception &e) { 91 NSC_LOG_ ERROR(_T("Failed to parse arguments for command '") + alias + _T("', using old split string method: ") + utf8::to_unicode(e.what()) + _T(": ") + str);91 NSC_LOG_MESSAGE(_T("Failed to parse arguments for command '") + alias + _T("', using old split string method: ") + utf8::to_unicode(e.what()) + _T(": ") + str); 92 92 strEx::splitList list = strEx::splitEx(str, _T(" ")); 93 93 if (list.size() > 0) { -
modules/CheckSystem/CheckSystem.cpp
rd6c3131 r1cc8566 1346 1346 Sleep(1000); 1347 1347 } 1348 pdh.collect();1349 1348 pdh.gatherData(); 1350 1349 pdh.close();
Note: See TracChangeset
for help on using the changeset viewer.








