Changeset 276
- Timestamp:
- 07/28/10 22:00:41 (19 months ago)
- Location:
- branches/stable
- Files:
-
- 10 edited
-
AutoBuild.h (modified) (1 diff)
-
NSClient++-2005.sln (modified) (4 diffs)
-
changelog (modified) (2 diffs)
-
include/Socket.h (modified) (5 diffs)
-
include/checkHelpers.hpp (modified) (3 diffs)
-
include/config.h (modified) (1 diff)
-
include/strEx.h (modified) (2 diffs)
-
modules/CheckEventLog/CheckEventLog-2005.vcproj (modified) (4 diffs)
-
modules/NSCAAgent/NSCAThread.cpp (modified) (4 diffs)
-
modules/NSCAAgent/NSCAThread.h (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
branches/stable/AutoBuild.h
r272 r276 3 3 // change the FALSE to TRUE for autoincrement of build number 4 4 #define INCREMENT_VERSION TRUE 5 #define FILEVER 0,3,8, 786 #define PRODUCTVER 0,3,8, 787 #define STRFILEVER _T("0.3.8. 78")8 #define STRPRODUCTVER _T("0.3.8. 78")9 #define STRPRODUCTDATE _T("2010-0 6-02")5 #define FILEVER 0,3,8,89 6 #define PRODUCTVER 0,3,8,89 7 #define STRFILEVER _T("0.3.8.89") 8 #define STRPRODUCTVER _T("0.3.8.89") 9 #define STRPRODUCTDATE _T("2010-07-28") 10 10 #endif // AUTOBUILD_H -
branches/stable/NSClient++-2005.sln
r225 r276 268 268 EndProject 269 269 Global 270 GlobalSection(SubversionScc) = preSolution271 Svn-Managed = True272 Manager = AnkhSVN - Subversion Support for Visual Studio273 EndGlobalSection274 270 GlobalSection(SolutionConfigurationPlatforms) = preSolution 275 271 Debug|Any CPU = Debug|Any CPU … … 451 447 {BA246C01-063A-4548-8957-32D5CC76171B}.Debug|Mixed Platforms.Build.0 = Debug|x64 452 448 {BA246C01-063A-4548-8957-32D5CC76171B}.Debug|Win32.ActiveCfg = Debug|Win32 453 {BA246C01-063A-4548-8957-32D5CC76171B}.Debug|Win32.Build.0 = Debug|Win32454 449 {BA246C01-063A-4548-8957-32D5CC76171B}.Debug|x64.ActiveCfg = Debug|x64 455 450 {BA246C01-063A-4548-8957-32D5CC76171B}.Debug|x64.Build.0 = Debug|x64 … … 869 864 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Debug|Mixed Platforms.Build.0 = Debug|x64 870 865 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Debug|Win32.ActiveCfg = Debug|Win32 866 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Debug|Win32.Build.0 = Debug|Win32 871 867 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Debug|x64.ActiveCfg = Debug|x64 872 868 {6F55C9BF-57F6-4A15-A058-C83A52F539EE}.Debug|x64.Build.0 = Debug|x64 … … 1582 1578 {10A0052D-542B-47AD-85C3-1A3DD45BF2ED} = {FC917E21-188A-44EE-9EF2-7C1274C2D719} 1583 1579 EndGlobalSection 1580 GlobalSection(SubversionScc) = preSolution 1581 Svn-Managed = True 1582 Manager = AnkhSVN - Subversion Support for Visual Studio 1583 EndGlobalSection 1584 1584 GlobalSection(DPCodeReviewSolutionGUID) = preSolution 1585 1585 DPCodeReviewSolutionGUID = {00000000-0000-0000-0000-000000000000} -
branches/stable/changelog
r272 r276 6 6 * Fix depend onservice LanManWorkStation (old win) 7 7 * Fix RtlStringFromGUID problem on NT4 8 9 2010-07-28 MickeM 10 * Fixed issue with NSCA server and closing sockets (no flushes the datat before) 11 * Fixed issue with performance data units beeing incorrect: 12 before: B, K, M, G, ... noew: B, KB, MB, GB, ... 13 * Fixed syntax errors in performance data extra ';' dropped and spaces added propperly 14 Result now looks like so: ... |'C:\ %'=42%;10;5 'C:\'=229.66GB;39.06;19.53;0;390.62 'D:\ %'=99%;10;5 'D:\'=3.39GB;20.55;10.27;0;205.54 15 * Fixed issues with caluclating netmask (also added support for spaces and tabs in the hostlist string. 8 16 9 17 2010-06-02 MickeM … … 279 287 * Rebuilt installer UI (still missing write config function) 280 288 * Added debug entry to log filename used by debug log metrics. 281 * Fixed so alias will not require the allow_nasty_meta chars option set under external sripts module.289 * Fixed so alias will not require the allow_nasty_meta_chars option set under external sripts module. 282 290 283 291 2009-03-02 MickeM -
branches/stable/include/Socket.h
r183 r276 227 227 virtual void close() { 228 228 if (socket_) 229 closesocket(socket_);229 ::closesocket(socket_); 230 230 socket_ = NULL; 231 } 232 virtual void setLinger(int timeout) { 233 if (this->setsockopt(SOL_SOCKET, SO_LINGER, (const char*)&timeout, sizeof(timeout)) == SOCKET_ERROR) 234 throw SocketException(_T("Failed to set linger on socket: "), ::WSAGetLastError()); 235 } 236 virtual int setsockopt(int level, int optname, const char * optval, int optlen) { 237 return ::setsockopt(socket_, level, optname, optval, optlen); 231 238 } 232 239 virtual void setNonBlock() { … … 236 243 FD_SET(socket_, &excp_); 237 244 this->ioctlsocket(FIONBIO, &NoBlock); 245 } 246 virtual void setBlock() { 247 unsigned long Block = 0; 248 FD_SET(socket_, &read_); 249 FD_SET(socket_, &write_); 250 FD_SET(socket_, &excp_); 251 this->ioctlsocket(FIONBIO, &Block); 238 252 } 239 253 virtual bool canRead(long timeout = -1) { … … 751 765 if (masklen > 32) 752 766 masklen = 32; 753 return (~((unsigned int)0))>>(32-masklen);767 return ::ntohl((0xffffffff >> (32 - masklen )) << (32 - masklen)); 754 768 } 755 769 void lookupList() { … … 771 785 (*it).in_addr = ::inet_addr(strEx::wstring_to_string((*it).host).c_str()); // simpleSocket::Socket::getHostByAddrAsIN((*it).host); 772 786 /* 773 std::cerr << "Added: " 774 + simpleSocket::Socket::inet_ntoa((*it).in_addr) 775 + " with mask " 776 + simpleSocket::Socket::inet_ntoa((*it).mask) 777 + " from " 778 + (*it).record << 787 std::wcerr << _T("Added: ") 788 << simpleSocket::Socket::inet_ntoa((*it).in_addr) 789 << _T(" with mask ") 790 << simpleSocket::Socket::inet_ntoa((*it).mask) 791 //<< _T("(") << (*it).mask << _T(")") 792 << _T(" from ") 793 << (*it).record << 779 794 std::endl; 780 795 */ 796 797 781 798 } catch (simpleSocket::SocketException e) { 782 799 std::wcerr << _T("Filed to lookup host: ") << e.getMessage() << std::endl; … … 788 805 void setAllowedHosts(const std::list<std::wstring> list, bool cachedAddresses) { 789 806 for (std::list<std::wstring>::const_iterator it = list.begin(); it != list.end(); ++it) { 790 allowedHosts_.push_back(host_record( *it));807 allowedHosts_.push_back(host_record(strEx::trim(*it, _T(" \t")))); 791 808 } 792 809 cachedAddresses_ = cachedAddresses; -
branches/stable/include/checkHelpers.hpp
r268 r276 24 24 #include <strEx.h> 25 25 26 #define MAKE_PERFDATA(alias, value, unit, warn, crit) _T("'") + alias + _T("'=") + value + unit + _T(";") + warn + _T(";") + crit + _T("; ")27 #define MAKE_PERFDATA_EX(alias, value, unit, warn, crit, xmin, xmax) _T("'") + alias + _T("'=") + value + unit + _T(";") + warn + _T(";") + crit + _T(";") + xmin + _T(";") + xmax + _T("; ")26 #define MAKE_PERFDATA(alias, value, unit, warn, crit) _T("'") + alias + _T("'=") + value + unit + _T(";") + warn + _T(";") + crit 27 #define MAKE_PERFDATA_EX(alias, value, unit, warn, crit, xmin, xmax) _T("'") + alias + _T("'=") + value + unit + _T(";") + warn + _T(";") + crit + _T(";") + xmin + _T(";") + xmax 28 28 29 29 namespace checkHolders { … … 159 159 tstr = getAlias() + _T(": ") + TContents::toStringShort(value); 160 160 } 161 if (perfData) 161 if (perfData) { 162 if (!perf.empty()) 163 perf += _T(" "); 162 164 perf += gatherPerfData(value); 165 } 163 166 if (!message.empty() && !tstr.empty()) 164 167 message += _T(", "); … … 744 747 return 745 748 MAKE_PERFDATA(alias + _T(" %"), THandler::print_unformated(value_p), _T("%"), THandler::print_unformated(warn_p), THandler::print_unformated(crit_p)) 746 + 749 + _T(" ") + 747 750 MAKE_PERFDATA_EX(alias, THandler::print_perf(value.value, unit), unit, THandler::print_perf(warn_v, unit), THandler::print_perf(crit_v, unit), 748 751 THandler::print_perf(0, unit), THandler::print_perf(value.total, unit)) -
branches/stable/include/config.h
r266 r276 199 199 #define NSCA_STRLEN _T("string_length") 200 200 #define NSCA_STRLEN_DEFAULT 512 201 #define NSCA_CHUNK _T("chunk") 202 #define NSCA_CHUNK_DEFAULT 0 203 201 204 202 205 #define C_SYSTEM_SVC_ALL_0 _T("check_all_services[SERVICE_BOOT_START]") -
branches/stable/include/strEx.h
r267 r276 421 421 double cpy = static_cast<double>(i); 422 422 TCHAR postfix[] = _T(BKMG_RANGE); 423 if (unit.length() != 1)423 if (unit.length() == 0) 424 424 return itos(cpy); 425 425 for (int i=0;i<BKMG_SIZE;i++) { … … 446 446 idx++; 447 447 } 448 if (idx > 0) 449 return std::wstring(1, postfix[idx]) + _T("B"); 448 450 return std::wstring(1, postfix[idx]); 449 451 } -
branches/stable/modules/CheckEventLog/CheckEventLog-2005.vcproj
r263 r276 1555 1555 > 1556 1556 <FileConfiguration 1557 Name="Release|Win32" 1558 > 1559 <Tool 1560 Name="VCCLCompilerTool" 1561 UsePrecompiledHeader="0" 1562 /> 1563 </FileConfiguration> 1564 <FileConfiguration 1565 Name="Release|x64" 1566 > 1567 <Tool 1568 Name="VCCLCompilerTool" 1569 UsePrecompiledHeader="0" 1570 /> 1571 </FileConfiguration> 1572 <FileConfiguration 1573 Name="Debug|Win32" 1574 > 1575 <Tool 1576 Name="VCCLCompilerTool" 1577 UsePrecompiledHeader="0" 1578 /> 1579 </FileConfiguration> 1580 <FileConfiguration 1557 1581 Name="Debug|x64" 1582 > 1583 <Tool 1584 Name="VCCLCompilerTool" 1585 UsePrecompiledHeader="0" 1586 /> 1587 </FileConfiguration> 1588 <FileConfiguration 1589 Name="Distribution|Win32" 1590 > 1591 <Tool 1592 Name="VCCLCompilerTool" 1593 UsePrecompiledHeader="0" 1594 /> 1595 </FileConfiguration> 1596 <FileConfiguration 1597 Name="Distribution|x64" 1598 > 1599 <Tool 1600 Name="VCCLCompilerTool" 1601 UsePrecompiledHeader="0" 1602 /> 1603 </FileConfiguration> 1604 <FileConfiguration 1605 Name="Nightly|Win32" 1606 > 1607 <Tool 1608 Name="VCCLCompilerTool" 1609 UsePrecompiledHeader="0" 1610 /> 1611 </FileConfiguration> 1612 <FileConfiguration 1613 Name="Nightly|x64" 1614 > 1615 <Tool 1616 Name="VCCLCompilerTool" 1617 UsePrecompiledHeader="0" 1618 /> 1619 </FileConfiguration> 1620 <FileConfiguration 1621 Name="Debug-MemCheck|Win32" 1622 > 1623 <Tool 1624 Name="VCCLCompilerTool" 1625 UsePrecompiledHeader="0" 1626 /> 1627 </FileConfiguration> 1628 <FileConfiguration 1629 Name="Debug-MemCheck|x64" 1630 > 1631 <Tool 1632 Name="VCCLCompilerTool" 1633 UsePrecompiledHeader="0" 1634 /> 1635 </FileConfiguration> 1636 <FileConfiguration 1637 Name="OP5|Win32" 1638 > 1639 <Tool 1640 Name="VCCLCompilerTool" 1641 UsePrecompiledHeader="0" 1642 /> 1643 </FileConfiguration> 1644 <FileConfiguration 1645 Name="OP5|x64" 1558 1646 > 1559 1647 <Tool … … 1571 1659 > 1572 1660 <FileConfiguration 1661 Name="Release|Win32" 1662 > 1663 <Tool 1664 Name="VCCLCompilerTool" 1665 UsePrecompiledHeader="0" 1666 /> 1667 </FileConfiguration> 1668 <FileConfiguration 1669 Name="Release|x64" 1670 > 1671 <Tool 1672 Name="VCCLCompilerTool" 1673 UsePrecompiledHeader="0" 1674 /> 1675 </FileConfiguration> 1676 <FileConfiguration 1677 Name="Debug|Win32" 1678 > 1679 <Tool 1680 Name="VCCLCompilerTool" 1681 UsePrecompiledHeader="0" 1682 /> 1683 </FileConfiguration> 1684 <FileConfiguration 1573 1685 Name="Debug|x64" 1686 > 1687 <Tool 1688 Name="VCCLCompilerTool" 1689 UsePrecompiledHeader="0" 1690 /> 1691 </FileConfiguration> 1692 <FileConfiguration 1693 Name="Distribution|Win32" 1694 > 1695 <Tool 1696 Name="VCCLCompilerTool" 1697 UsePrecompiledHeader="0" 1698 /> 1699 </FileConfiguration> 1700 <FileConfiguration 1701 Name="Distribution|x64" 1702 > 1703 <Tool 1704 Name="VCCLCompilerTool" 1705 UsePrecompiledHeader="0" 1706 /> 1707 </FileConfiguration> 1708 <FileConfiguration 1709 Name="Nightly|Win32" 1710 > 1711 <Tool 1712 Name="VCCLCompilerTool" 1713 UsePrecompiledHeader="0" 1714 /> 1715 </FileConfiguration> 1716 <FileConfiguration 1717 Name="Nightly|x64" 1718 > 1719 <Tool 1720 Name="VCCLCompilerTool" 1721 UsePrecompiledHeader="0" 1722 /> 1723 </FileConfiguration> 1724 <FileConfiguration 1725 Name="Debug-MemCheck|Win32" 1726 > 1727 <Tool 1728 Name="VCCLCompilerTool" 1729 UsePrecompiledHeader="0" 1730 /> 1731 </FileConfiguration> 1732 <FileConfiguration 1733 Name="Debug-MemCheck|x64" 1734 > 1735 <Tool 1736 Name="VCCLCompilerTool" 1737 UsePrecompiledHeader="0" 1738 /> 1739 </FileConfiguration> 1740 <FileConfiguration 1741 Name="OP5|Win32" 1742 > 1743 <Tool 1744 Name="VCCLCompilerTool" 1745 UsePrecompiledHeader="0" 1746 /> 1747 </FileConfiguration> 1748 <FileConfiguration 1749 Name="OP5|x64" 1574 1750 > 1575 1751 <Tool … … 1977 2153 </File> 1978 2154 <File 1979 RelativePath=".\test.cpp"1980 >1981 </File>1982 <File1983 2155 RelativePath="..\..\include\utils.cpp" 1984 2156 > … … 2141 2313 > 2142 2314 <FileConfiguration 2315 Name="Release|Win32" 2316 > 2317 <Tool 2318 Name="VCCLCompilerTool" 2319 UsePrecompiledHeader="0" 2320 /> 2321 </FileConfiguration> 2322 <FileConfiguration 2323 Name="Release|x64" 2324 > 2325 <Tool 2326 Name="VCCLCompilerTool" 2327 UsePrecompiledHeader="0" 2328 /> 2329 </FileConfiguration> 2330 <FileConfiguration 2331 Name="Debug|Win32" 2332 > 2333 <Tool 2334 Name="VCCLCompilerTool" 2335 UsePrecompiledHeader="0" 2336 /> 2337 </FileConfiguration> 2338 <FileConfiguration 2143 2339 Name="Debug|x64" 2340 > 2341 <Tool 2342 Name="VCCLCompilerTool" 2343 UsePrecompiledHeader="0" 2344 /> 2345 </FileConfiguration> 2346 <FileConfiguration 2347 Name="Distribution|Win32" 2348 > 2349 <Tool 2350 Name="VCCLCompilerTool" 2351 UsePrecompiledHeader="0" 2352 /> 2353 </FileConfiguration> 2354 <FileConfiguration 2355 Name="Distribution|x64" 2356 > 2357 <Tool 2358 Name="VCCLCompilerTool" 2359 UsePrecompiledHeader="0" 2360 /> 2361 </FileConfiguration> 2362 <FileConfiguration 2363 Name="Nightly|Win32" 2364 > 2365 <Tool 2366 Name="VCCLCompilerTool" 2367 UsePrecompiledHeader="0" 2368 /> 2369 </FileConfiguration> 2370 <FileConfiguration 2371 Name="Nightly|x64" 2372 > 2373 <Tool 2374 Name="VCCLCompilerTool" 2375 UsePrecompiledHeader="0" 2376 /> 2377 </FileConfiguration> 2378 <FileConfiguration 2379 Name="Debug-MemCheck|Win32" 2380 > 2381 <Tool 2382 Name="VCCLCompilerTool" 2383 UsePrecompiledHeader="0" 2384 /> 2385 </FileConfiguration> 2386 <FileConfiguration 2387 Name="Debug-MemCheck|x64" 2388 > 2389 <Tool 2390 Name="VCCLCompilerTool" 2391 UsePrecompiledHeader="0" 2392 /> 2393 </FileConfiguration> 2394 <FileConfiguration 2395 Name="OP5|Win32" 2396 > 2397 <Tool 2398 Name="VCCLCompilerTool" 2399 UsePrecompiledHeader="0" 2400 /> 2401 </FileConfiguration> 2402 <FileConfiguration 2403 Name="OP5|x64" 2144 2404 > 2145 2405 <Tool -
branches/stable/modules/NSCAAgent/NSCAThread.cpp
r261 r276 82 82 payload_length_ = NSCModuleHelper::getSettingsInt(NSCA_AGENT_SECTION_TITLE, NSCA_STRLEN, NSCA_STRLEN_DEFAULT); 83 83 read_timeout_ = NSCModuleHelper::getSettingsInt(NSCA_AGENT_SECTION_TITLE, NSCA_READ_TIMEOUT, NSCA_READ_TIMEOUT_DEFAULT); 84 resultInterval = NSCModuleHelper::getSettingsInt(NSCA_AGENT_SECTION_TITLE, NSCA_CHUNK, NSCA_CHUNK_DEFAULT); 84 85 std::wstring report = NSCModuleHelper::getSettingsString(NSCA_AGENT_SECTION_TITLE, NSCA_REPORT, NSCA_REPORT_DEFAULT); 85 86 report_ = parse_report_string(report); … … 222 223 if (!results.empty()) { 223 224 try { 224 send(results); 225 if (resultInterval != 0) { 226 while (!results.empty()) { 227 std::list<Command::Result> chunk; 228 for (int i=0;i<resultInterval&&!results.empty();++i) { 229 chunk.push_back(results.front()); 230 results.pop_front(); 231 } 232 send(chunk); 233 } 234 } else 235 send(results); 225 236 } catch (...) { 226 237 NSC_LOG_ERROR_STD(_T("Unknown exception when sending commands to server...")); … … 314 325 return; 315 326 } 327 socket.setBlock(); 316 328 317 329 try { 318 330 for (std::list<Command::Result>::const_iterator cit = results.begin(); cit != results.end(); ++cit) { 319 331 try { 320 socket.send ((*cit).getBuffer(crypt_inst, timeDelta_, payload_length_));332 socket.sendAll((*cit).getBuffer(crypt_inst, timeDelta_, payload_length_)); 321 333 } catch (NSCAPacket::NSCAException &e) { 322 NSC_LOG_ERROR_STD(_T("Failed to make command: ") + e.getMessage() ); 334 NSC_LOG_ERROR_STD(_T("Failed to build command: ") + e.getMessage() ); 335 } catch (simpleSocket::SocketException &e) { 336 NSC_LOG_ERROR_STD(_T("Failed to send command: ") + e.getMessage() ); 323 337 } 324 338 } … … 330 344 return; 331 345 } 346 socket.setLinger(30); 332 347 socket.close(); 333 348 } catch (simpleSocket::SocketException &e) { -
branches/stable/modules/NSCAAgent/NSCAThread.h
r188 r276 237 237 int report_; 238 238 unsigned int read_timeout_; 239 int resultInterval; 239 240 240 241 public:
Note: See TracChangeset
for help on using the changeset viewer.







