Changeset 9853bc3 in nscp
- Timestamp:
- 11/29/11 14:03:54 (19 months ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2
- Children:
- f33c12f
- Parents:
- 96c1461
- Files:
-
- 8 edited
-
changelog (modified) (1 diff)
-
modules/NRPEClient/NRPEClient.cpp (modified) (3 diffs)
-
modules/NSCAClient/NSCAClient.cpp (modified) (2 diffs)
-
modules/NSCAClient/NSCAClient.h (modified) (1 diff)
-
modules/NSCPClient/NSCPClient.cpp (modified) (1 diff)
-
modules/PythonScript/PythonScript.cpp (modified) (1 diff)
-
modules/Scheduler/Scheduler.cpp (modified) (1 diff)
-
modules/SyslogClient/SyslogClient.cpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
changelog
r96c1461 r9853bc3 5 5 * Fixa dependonservice LanManWorkStation (old win) 6 6 * Fix RtlStringFromGUID problem on NT4 7 8 2011-11-27 MickeM 9 * Fixed some NSCA issues (reading from new conf) 10 * Fixed some linux build issues (related to refactoring) 7 11 8 12 2011-11-27 MickeM -
modules/NRPEClient/NRPEClient.cpp
r96c1461 r9853bc3 82 82 ; 83 83 84 settings.alias( _T("/targets/default")).add_key_to_settings()84 settings.alias().add_key_to_settings(_T("targets/default")) 85 85 86 86 (_T("timeout"), sh::uint_key(&timeout, 30), … … 386 386 #else 387 387 NSC_LOG_ERROR_STD(_T("SSL not avalible (compiled without USE_SSL)")); 388 return boost:: tie(NSCAPI::returnUNKNOWN, _T("SSL support not available (compiled without USE_SSL)"));388 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("SSL support not available (compiled without USE_SSL)")); 389 389 #endif 390 390 } else … … 392 392 return boost::make_tuple(static_cast<int>(packet.getResult()), packet.getPayload()); 393 393 } catch (nrpe::nrpe_packet_exception &e) { 394 return boost:: tie(NSCAPI::returnUNKNOWN, _T("NRPE Packet errro: ") + e.wwhat());394 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("NRPE Packet errro: ") + e.wwhat()); 395 395 } catch (std::runtime_error &e) { 396 396 NSC_LOG_ERROR_STD(_T("Socket error: ") + utf8::to_unicode(e.what())); 397 return boost:: tie(NSCAPI::returnUNKNOWN, _T("Socket error: ") + utf8::to_unicode(e.what()));397 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("Socket error: ") + utf8::to_unicode(e.what())); 398 398 } catch (std::exception &e) { 399 399 NSC_LOG_ERROR_STD(_T("Error: ") + utf8::to_unicode(e.what())); 400 return boost:: tie(NSCAPI::returnUNKNOWN, _T("Error: ") + utf8::to_unicode(e.what()));400 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("Error: ") + utf8::to_unicode(e.what())); 401 401 } catch (...) { 402 return boost:: tie(NSCAPI::returnUNKNOWN, _T("Unknown error -- REPORT THIS!"));402 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("Unknown error -- REPORT THIS!")); 403 403 } 404 404 } -
modules/NSCAClient/NSCAClient.cpp
r96c1461 r9853bc3 94 94 ; 95 95 96 settings.alias( _T("/targets/default")).add_key_to_settings()96 settings.alias().add_key_to_settings(_T("targets/default")) 97 97 98 98 (_T("timeout"), sh::uint_key(&timeout, 30), … … 441 441 } catch (nsca::nsca_encrypt::encryption_exception &e) { 442 442 NSC_LOG_ERROR_STD(_T("NSCA Error: ") + utf8::to_unicode(e.what())); 443 return boost:: tie(NSCAPI::returnUNKNOWN, _T("NSCA error: ") + utf8::to_unicode(e.what()));443 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("NSCA error: ") + utf8::to_unicode(e.what())); 444 444 } catch (std::runtime_error &e) { 445 445 NSC_LOG_ERROR_STD(_T("Socket error: ") + utf8::to_unicode(e.what())); 446 return boost:: tie(NSCAPI::returnUNKNOWN, _T("Socket error: ") + utf8::to_unicode(e.what()));446 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("Socket error: ") + utf8::to_unicode(e.what())); 447 447 } catch (std::exception &e) { 448 448 NSC_LOG_ERROR_STD(_T("Error: ") + utf8::to_unicode(e.what())); 449 return boost:: tie(NSCAPI::returnUNKNOWN, _T("Error: ") + utf8::to_unicode(e.what()));449 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("Error: ") + utf8::to_unicode(e.what())); 450 450 } catch (...) { 451 return boost:: tie(NSCAPI::returnUNKNOWN, _T("Unknown error -- REPORT THIS!"));451 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("Unknown error -- REPORT THIS!")); 452 452 } 453 453 } -
modules/NSCAClient/NSCAClient.h
r96c1461 r9853bc3 57 57 connection_data(nscapi::functions::destination_container recipient, nscapi::functions::destination_container sender) { 58 58 timeout = recipient.get_int_data("timeout", 30); 59 buffer_length = recipient.get_int_data("payload length", 1024);59 buffer_length = recipient.get_int_data("payload length", 512); 60 60 password = recipient.get_string_data("password"); 61 61 encryption = recipient.get_string_data("encryption"); -
modules/NSCPClient/NSCPClient.cpp
r96c1461 r9853bc3 87 87 ; 88 88 89 settings.alias( _T("/targets/default")).add_key_to_settings()89 settings.alias().add_key_to_settings(_T("targets/default")) 90 90 91 91 (_T("timeout"), sh::uint_key(&timeout, 30), -
modules/PythonScript/PythonScript.cpp
rf7a074d r9853bc3 193 193 if (!has_init) { 194 194 has_init = true; 195 Py_Initialize(); 195 196 PyEval_InitThreads(); 196 Py_Initialize(); 197 198 //PyThreadState *mainThreadState = PyThreadState_Get(); 199 //PyThreadState_Clear 200 //PyGILState_Release(mainThreadState); 201 197 202 do_init = true; 198 203 } 199 204 200 205 try { 201 script_wrapper::thread_locker locker; 202 try { 203 204 PyRun_SimpleString("import cStringIO"); 205 PyRun_SimpleString("import sys"); 206 PyRun_SimpleString("sys.stderr = cStringIO.StringIO()"); 207 208 if (do_init) 209 initNSCP(); 210 211 BOOST_FOREACH(script_container &script, scripts_) { 212 instances_.push_back(boost::shared_ptr<python_script>(new python_script(get_id(), utf8::cvt<std::string>(alias), script))); 206 { 207 script_wrapper::thread_locker locker; 208 try { 209 210 PyRun_SimpleString("import cStringIO"); 211 PyRun_SimpleString("import sys"); 212 PyRun_SimpleString("sys.stderr = cStringIO.StringIO()"); 213 214 if (do_init) 215 initNSCP(); 216 217 } catch( error_already_set e) { 218 script_wrapper::log_exception(); 213 219 } 214 220 215 } catch( error_already_set e) {216 script_wrapper::log_exception();217 221 } 222 BOOST_FOREACH(script_container &script, scripts_) { 223 instances_.push_back(boost::shared_ptr<python_script>(new python_script(get_id(), utf8::cvt<std::string>(alias), script))); 224 } 225 PyEval_ReleaseLock(); 226 218 227 } catch (std::exception &e) { 219 228 NSC_LOG_ERROR_STD(_T("Exception: Failed to load python scripts: ") + utf8::cvt<std::wstring>(e.what())); -
modules/Scheduler/Scheduler.cpp
rf7a074d r9853bc3 158 158 std::string response; 159 159 NSCAPI::nagiosReturn code = GET_CORE()->simple_query(item.command.c_str(), item.arguments, response); 160 if (nscapi::report::matches(item.report, code)) { 160 if (code == NSCAPI::returnIgnored) { 161 NSC_LOG_ERROR_STD(_T("Command was not found: ") + item.command.c_str()); 162 nscapi::functions::create_simple_submit_request(item.channel, item.command, NSCAPI::returnUNKNOWN, _T("Command was not found: ") + item.command, _T(""), response); 163 std::string result; 164 GET_CORE()->submit_message(item.channel, response, result); 165 } else if (nscapi::report::matches(item.report, code)) { 161 166 // @todo: allow renaming of commands here item.alias, 162 167 // @todo this is broken, fix this (uses the wrong message) -
modules/SyslogClient/SyslogClient.cpp
r96c1461 r9853bc3 115 115 ; 116 116 117 settings.alias( _T("/targets/default")).add_key_to_settings()117 settings.alias().add_key_to_settings(_T("targets/default")) 118 118 119 119 (_T("severity"), sh::wpath_key(&severity, _T("error")), … … 430 430 } catch (std::runtime_error &e) { 431 431 NSC_LOG_ERROR_STD(_T("Socket error: ") + utf8::to_unicode(e.what())); 432 return boost:: tie(NSCAPI::returnUNKNOWN, _T("Socket error: ") + utf8::to_unicode(e.what()));432 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("Socket error: ") + utf8::to_unicode(e.what())); 433 433 } catch (std::exception &e) { 434 434 NSC_LOG_ERROR_STD(_T("Error: ") + utf8::to_unicode(e.what())); 435 return boost:: tie(NSCAPI::returnUNKNOWN, _T("Error: ") + utf8::to_unicode(e.what()));435 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("Error: ") + utf8::to_unicode(e.what())); 436 436 } catch (...) { 437 return boost:: tie(NSCAPI::returnUNKNOWN, _T("Unknown error -- REPORT THIS!"));437 return boost::make_tuple(NSCAPI::returnUNKNOWN, _T("Unknown error -- REPORT THIS!")); 438 438 } 439 439 }
Note: See TracChangeset
for help on using the changeset viewer.








