Changeset 682ccd2 in nscp
- Timestamp:
- 04/11/12 18:34:18 (13 months ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2
- Children:
- 6533c1a
- Parents:
- 440c0cb
- Files:
-
- 12 edited
-
changelog (modified) (3 diffs)
-
files/old-settings.map (modified) (1 diff)
-
include/check_nt/server/parser.hpp (modified) (1 diff)
-
include/concurrent_queue.hpp (modified) (1 diff)
-
include/settings/settings_old.hpp (modified) (1 diff)
-
modules/CheckSystem/CheckSystem.cpp (modified) (2 diffs)
-
modules/NSClientServer/NSClientServer.cpp (modified) (3 diffs)
-
service/NSClient++.cpp (modified) (3 diffs)
-
service/cli_parser.hpp (modified) (3 diffs)
-
service/logger_impl.cpp (modified) (5 diffs)
-
version.hpp (modified) (1 diff)
-
version.txt (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
changelog
r440c0cb r682ccd2 4 4 * Fixa dependonservice LanManWorkStation (old win) 5 5 * Fix RtlStringFromGUID problem on NT4 6 7 2012-04-10 MickeM 8 * Fixed crash in new logger 9 * Fixed a few command line parsing issues (most notably test and --log-to-file) 10 * Changed default location for process dumps to be a non-elevated location (under common-appdata). 11 * Fixed (ish) check_nt issue (check_nt really really is broken... this will probably cause problems with people sending large payloads though) 12 13 2012-04-06 MickeM 14 * Easter break! 6 15 7 16 2012-04-04 MickeM … … 23 32 2012-03-27 MickeM 24 33 * Removed some annoying "error" messages 25 * Tweaked F GileLogger a bit to be more "modern"34 * Tweaked FileLogger a bit to be more "modern" 26 35 * Changed so file-name expansion is more efficient 27 36 * Changed so modules are defaulted to 0 in config. 28 * Log levels are case sens etive37 * Log levels are case sensitive 29 38 * Fixed so log level is not read from ini file 30 39 * improved plugin processing from ini files … … 32 41 2012-03-26 MickeM 33 42 * Fixed perfoamcen data parsing issue 34 * Fixed external scripts perfo amcendata issue43 * Fixed external scripts performance data issue 35 44 * Fixed boolen flag handling in settings (default generated as false regardless of actual state) 36 45 * Fixed so "advanced properties" are not generated with --update-defalts -
files/old-settings.map
r8d89d7a r682ccd2 53 53 NRPE/allow_arguments=/settings/NRPE/server/allow arguments 54 54 NRPE/allow_nasty_meta_chars=/settings/NRPE/server/allow nasty characters 55 NRPE/use_ssl=/settings/NRPE/server/ ssl55 NRPE/use_ssl=/settings/NRPE/server/use ssl 56 56 # NRPE/script_dir 57 57 -
include/check_nt/server/parser.hpp
re1d9a58 r682ccd2 21 21 buffer_.push_back(*begin); 22 22 if (*begin == '\n') { 23 found = true;24 23 break; 25 24 } 26 25 } 27 return boost::make_tuple( found, begin);26 return boost::make_tuple(true, begin); 28 27 } 29 28 -
include/concurrent_queue.hpp
r8d89d7a r682ccd2 42 42 } 43 43 44 popped_value=queue_.front(); 45 queue_.pop(); 44 if (!queue_.empty()) { 45 popped_value=queue_.front(); 46 queue_.pop(); 47 } 46 48 } 47 49 -
include/settings/settings_old.hpp
r8d89d7a r682ccd2 120 120 key_map::iterator it1 = keys_.find(new_key); 121 121 if (it1 != keys_.end()) { 122 get_logger()->debug(__FILE__, __LINE__, new_key.first + _T(".") + new_key.second + _T(" found in alias list"));122 //get_logger()->debug(__FILE__, __LINE__, new_key.first + _T(".") + new_key.second + _T(" found in alias list")); 123 123 return (*it1).second; 124 124 } -
modules/CheckSystem/CheckSystem.cpp
r523576e r682ccd2 90 90 , _T("PDH COUNTERS"), _T("")) 91 91 92 93 92 ; 94 95 93 96 94 settings.alias().add_key_to_settings() … … 98 96 _T("DEFAULT COUNTERS"), _T("Load the default counters: ") PDH_SYSTEM_KEY_CPU _T(", ") PDH_SYSTEM_KEY_MCB _T(", ") PDH_SYSTEM_KEY_MCL _T(" and ") PDH_SYSTEM_KEY_UPT _T(" If not you need to specify these manually. ") ) 99 97 100 (_T("default"), sh::bool_key(&default_counters, true),101 _T("DEFAULT COUNTERS"), _T("Load the default counters: ") PDH_SYSTEM_KEY_CPU _T(", ") PDH_SYSTEM_KEY_MCB _T(", ") PDH_SYSTEM_KEY_MCL _T(" and ") PDH_SYSTEM_KEY_UPT _T(" If not you need to specify these manually. ") )102 103 98 (_T("default buffer length"), sh::wstring_key(&data->buffer_length, _T("1h")), 104 99 _T("DEFAULT INTERVALL"), _T("Used to define the default intervall for range buffer checks (ie. CPU).")) 105 //106 // (_T("hostname cache"), sh::bool_key(&cacheNscaHost_),107 // _T("CACHE HOSTNAME"), _T(""))108 //109 // (_T("delay"), sh::string_fun_key<std::wstring>(boost::bind(&NSCAAgent::set_delay, this, _1), 0),110 // _T("DELAY"), _T(""))111 //112 // (_T("payload length"), sh::uint_key(&payload_length_, 512),113 // _T("PAYLOAD LENGTH"), _T("The password to use. Again has to be the same as the server or it wont work at all."))114 100 115 101 ; 116 102 117 //std::map<DWORD,std::wstring>::key_type 118 119 settings.alias().add_key_to_settings() 103 settings.alias().add_key_to_settings(_T("service mapping")) 120 104 121 105 (_T("BOOT_START"), sh::wstring_vector_key(&lookups_, SERVICE_BOOT_START, _T("ignored")), 122 _T("SERVICE_BOOT_START"), _T("TODO") )106 _T("SERVICE_BOOT_START"), _T("TODO"), true) 123 107 124 108 (_T("SYSTEM_START"), sh::wstring_vector_key(&lookups_, SERVICE_SYSTEM_START, _T("ignored")), 125 _T("SERVICE_SYSTEM_START"), _T("TODO") )109 _T("SERVICE_SYSTEM_START"), _T("TODO"), true) 126 110 127 111 (_T("AUTO_START"), sh::wstring_vector_key(&lookups_, SERVICE_AUTO_START, _T("started")), 128 _T("SERVICE_AUTO_START"), _T("TODO") )112 _T("SERVICE_AUTO_START"), _T("TODO"), true) 129 113 130 114 (_T("DEMAND_START"), sh::wstring_vector_key(&lookups_, SERVICE_DEMAND_START, _T("ignored")), 131 _T("SERVICE_DEMAND_START"), _T("TODO") )115 _T("SERVICE_DEMAND_START"), _T("TODO"), true) 132 116 133 117 (_T("DISABLED"), sh::wstring_vector_key(&lookups_, SERVICE_DISABLED, _T("stopped")), 134 _T("SERVICE_DISABLED"), _T("TODO") )118 _T("SERVICE_DISABLED"), _T("TODO"), true) 135 119 136 120 (_T("DELAYED"), sh::wstring_vector_key(&lookups_, NSCP_SERVICE_DELAYED, _T("ignored")), 137 _T("SERVICE_DELAYED"), _T("TODO") )121 _T("SERVICE_DELAYED"), _T("TODO"), true) 138 122 139 123 ; -
modules/NSClientServer/NSClientServer.cpp
r440c0cb r682ccd2 58 58 ; 59 59 60 61 settings.alias().add_key_to_settings() 62 (_T("thread pool"), sh::uint_key(&info_.thread_pool_size, 10), 63 _T("THREAD POOL"), _T(""), true) 64 65 (_T("socket queue size"), sh::int_key(&info_.back_log, 0), 66 _T("LISTEN QUEUE"), _T("Number of sockets to queue before starting to refuse new incoming connections. This can be used to tweak the amount of simultaneous sockets that the server accepts."), true) 67 68 (_T("use ssl"), sh::bool_key(&info_.use_ssl, false), 69 _T("ENABLE SSL ENCRYPTION"), _T("This option controls if SSL should be enabled."), true) 70 71 (_T("certificate"), sh::wpath_key(&info_.certificate, _T("${certificate-path}/nrpe_dh_512.pem")), 72 _T("SSL CERTIFICATE"), _T(""), true) 73 74 ; 75 76 77 60 78 settings.alias().add_parent(_T("/settings/default/socket")).add_key_to_settings() 61 62 (_T("thread pool"), sh::uint_key(&info_.thread_pool_size, 10),63 _T("THREAD POOL"), _T(""))64 79 65 80 (_T("bind to"), sh::string_key(&info_.address), 66 81 _T("BIND TO ADDRESS"), _T("Allows you to bind server to a specific local address. This has to be a dotted ip address not a host name. Leaving this blank will bind to all available IP addresses.")) 67 68 (_T("socket queue size"), sh::int_key(&info_.back_log, 0),69 _T("LISTEN QUEUE"), _T("Number of sockets to queue before starting to refuse new incoming connections. This can be used to tweak the amount of simultaneous sockets that the server accepts."))70 82 71 83 (_T("allowed hosts"), sh::string_fun_key<std::wstring>(boost::bind(&socket_helpers::allowed_hosts_manager::set_source, &info_.allowed_hosts, _1), _T("127.0.0.1")), … … 78 90 _T("TIMEOUT"), _T("Timeout when reading packets on incoming sockets. If the data has not arrived within this time we will bail out.")) 79 91 80 (_T("use ssl"), sh::bool_key(&info_.use_ssl, false),81 _T("ENABLE SSL ENCRYPTION"), _T("This option controls if SSL should be enabled."))82 83 (_T("certificate"), sh::wpath_key(&info_.certificate, _T("${certificate-path}/nrpe_dh_512.pem")),84 _T("SSL CERTIFICATE"), _T(""))85 86 92 ; 87 93 … … 90 96 (_T("password"), sh::string_fun_key<std::wstring>(boost::bind(&check_nt::server::handler::set_password, info_.request_handler, _1), _T("")), 91 97 _T("PASSWORD"), _T("Password used to authenticate againast server")) 98 92 99 ; 93 100 -
service/NSClient++.cpp
r440c0cb r682ccd2 431 431 432 432 (_T("archive folder"), sh::wpath_key(&crash_folder, CRASH_ARCHIVE_FOLDER), 433 CRASH_ARCHIVE_FOLDER_KEY, _T("The folder to archive crash dumps in"))433 _T("CRASH ARCHIVE LOCATION"), _T("The folder to archive crash dumps in")) 434 434 ; 435 435 … … 538 538 std::wstring file = NSCPlugin::get_plugin_file(v.second); 539 539 std::wstring alias = v.first; 540 if (!alias.empty()) {541 LOG_DEBUG_CORE_STD(_T("Processing plugin: ") + file + _T(" as ") + alias);542 } else {543 LOG_DEBUG_CORE_STD(_T("Processing plugin: ") + file);544 }540 // if (!alias.empty()) { 541 // LOG_DEBUG_CORE_STD(_T("Processing plugin: ") + file + _T(" as ") + alias); 542 // } else { 543 // LOG_DEBUG_CORE_STD(_T("Processing plugin: ") + file); 544 // } 545 545 try { 546 546 addPlugin(pluginPath / boost::filesystem::wpath(file), alias); … … 1410 1410 std::wstring::size_type pend = file.find('}', pstart); 1411 1411 std::wstring key = file.substr(pstart+1, pend-2); 1412 LOG_DEBUG_CORE(_T("Found key: ") + key);1412 //LOG_DEBUG_CORE(_T("Found key: ") + key); 1413 1413 1414 1414 std::wstring tmp = file; -
service/cli_parser.hpp
r440c0cb r682ccd2 178 178 179 179 po::options_description all("Allowed options"); 180 all.add(root).add(common).add(service).add(settings).add(client) ;180 all.add(root).add(common).add(service).add(settings).add(client).add(test).add(unittest); 181 181 std::cout << all << std::endl; 182 182 … … 204 204 205 205 int parse_test(int argc, wchar_t* argv[]) { 206 207 po::options_description all("Allowed options (test)"); 208 all.add(common).add(test); 209 210 po::variables_map vm; 211 po::store(po::parse_command_line(argc, argv, all), vm); 212 po::notify(vm); 213 214 if (log_level.empty()) 215 log_level = _T("debug"); 216 217 if (process_common_options("test", all)) 218 return 1; 219 220 if (vm.count("log-to-file") == 0) { 221 nsclient::logging::logger::set_backend("console"); 222 } 223 224 try { 225 po::options_description all("Allowed options (settings)"); 226 all.add(common).add(settings); 206 try { 207 208 po::options_description all("Allowed options (test)"); 209 all.add(common).add(test); 227 210 228 211 po::variables_map vm; … … 230 213 po::notify(vm); 231 214 232 if (process_common_options("settings", all)) 215 if (log_level.empty()) 216 log_level = _T("debug"); 217 218 if (process_common_options("test", all)) 233 219 return 1; 220 221 if (vm.count("log-to-file") == 0) { 222 nsclient::logging::logger::set_backend("console"); 223 } 234 224 235 225 nsclient::simple_client client(core_); -
service/logger_impl.cpp
r440c0cb r682ccd2 269 269 270 270 log_impl_type background_logger_; 271 bool running_; 271 272 272 273 public: 273 274 274 threaded_logger(log_impl_type background_logger) : background_logger_(background_logger) {} 275 threaded_logger(log_impl_type background_logger) : background_logger_(background_logger), running_(false) {} 276 ~threaded_logger() { 277 shutdown(); 278 } 275 279 276 280 void do_log(const std::string &data) { … … 287 291 std::string data; 288 292 while (true) { 289 log_queue_.wait_and_pop(data); 290 if (data == QUIT_MESSAGE) { 291 break; 292 } else if (data == CONFIGURE_MESSAGE) { 293 if (background_logger_) 294 background_logger_->configure(); 295 } else { 296 if (background_logger_) 297 background_logger_->do_log(data); 298 subscribers_.notify(data); 293 try { 294 log_queue_.wait_and_pop(data); 295 if (data == QUIT_MESSAGE) { 296 break; 297 } else if (data == CONFIGURE_MESSAGE) { 298 if (background_logger_) 299 background_logger_->configure(); 300 } else { 301 if (background_logger_) 302 background_logger_->do_log(data); 303 subscribers_.notify(data); 304 } 305 } catch (const std::exception &e) { 306 log_fatal(std::string("Failed to process log message: ") + e.what()); 307 } catch (...) { 308 log_fatal("Failed to process log message"); 299 309 } 300 310 } … … 306 316 bool startup() { 307 317 thread_ = boost::thread(boost::bind(&threaded_logger::thread_proc, this)); 318 running_ = true; 308 319 return true; 309 320 } 310 321 bool shutdown() { 322 if (!running_) 323 return true; 311 324 push(QUIT_MESSAGE); 312 325 if (!thread_.timed_join(boost::posix_time::seconds(5))) { … … 314 327 return false; 315 328 } 329 running_ = false; 316 330 return true; 317 331 } … … 346 360 } 347 361 nsclient::logging::logging_interface_impl *old = logger_impl_ ; 348 logger_impl_ = tmp; 362 if (old != NULL && tmp != NULL) { 363 tmp->set_console_log(old->get_console_log()); 364 tmp->set_log_level(old->get_log_level()); 365 } 366 logger_impl_ = tmp; 349 367 delete old; 350 368 old = NULL; -
version.hpp
r440c0cb r682ccd2 1 1 #ifndef VERSION_HPP 2 2 #define VERSION_HPP 3 #define PRODUCTVER 0,4,0,15 64 #define STRPRODUCTVER "0,4,0,15 6"5 #define STRPRODUCTDATE "2012-04- 05"3 #define PRODUCTVER 0,4,0,159 4 #define STRPRODUCTVER "0,4,0,159" 5 #define STRPRODUCTDATE "2012-04-11" 6 6 #endif // VERSION_HPP -
version.txt
r440c0cb r682ccd2 1 1 version=0.4.0 2 build=15 63 date=2012-04- 052 build=159 3 date=2012-04-11
Note: See TracChangeset
for help on using the changeset viewer.








