Changeset 35254d1 in nscp
- Timestamp:
- 01/15/12 23:32:36 (17 months ago)
- Branches:
- master, 0.4.0, 0.4.1, 0.4.2
- Children:
- 89838be
- Parents:
- ba63b95
- Files:
-
- 1 added
- 8 edited
-
build/python/postbuild.py (modified) (3 diffs)
-
changelog (modified) (1 diff)
-
helpers/installers/ui/WixUI_MondoNSCP.wxs (modified) (3 diffs)
-
include/nsca/nsca_packet.hpp (modified) (3 diffs)
-
include/settings/settings_dummy.hpp (added)
-
modules/NRPEServer/handler_impl.cpp (modified) (2 diffs)
-
service/NSClient++.cpp (modified) (1 diff)
-
service/cli_parser.hpp (modified) (2 diffs)
-
service/settings_client.hpp (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
build/python/postbuild.py
rd48afa1 r35254d1 16 16 vstring = version.version() 17 17 18 targets = None 19 20 def build_targets(str): 21 targets = {} 22 for itm in str.split(';'): 23 tmp = itm.split('=') 24 if len(tmp) == 0: 25 continue 26 elif len(tmp) == 1: 27 targets['nscp'] = tmp[0] 28 else: 29 targets[tmp[0]] = tmp[1] 30 return targets 31 32 33 34 def find_target(key=None): 35 global targets 36 if not targets: 37 targets = build_targets(TARGET_SITE) 38 if not key: 39 key = 'nscp' 40 if not key in targets: 41 return None 42 return targets[key] 43 44 18 45 def scp_file(file): 19 46 tfile = os.path.basename(file) … … 22 49 if '_' in name: 23 50 (name, tag) = name.split('_') 24 if globals().has_key('TARGET_SITE_%s'%tag):25 target = globals().get('TARGET_SITE_%s'%tag)51 target = find_target(tag) 52 if target: 26 53 print 'Found tagged installer %s for %s'%(tfile, tag) 27 54 else: … … 29 56 else: 30 57 print 'Found normal installer %s'%tfile 31 target = TARGET_SITE58 target = find_target() 32 59 if target: 33 60 print 'Uploading name: %s to %s'%(tfile, target) -
changelog
rba63b95 r35254d1 5 5 * Fixa dependonservice LanManWorkStation (old win) 6 6 * Fix RtlStringFromGUID problem on NT4 7 8 2012-01-15 MickeM 9 * Fixed installer "back" issues 10 * Fixed payload truncation for NRPe and NSCA 11 * Improved the installer target tagging functions in the python installer 12 13 2012-01-13 MickeM 14 * Fixed some issues with the trac configuration generator 7 15 8 16 2012-01-12 MickeM -
helpers/installers/ui/WixUI_MondoNSCP.wxs
r53c1a6e r35254d1 98 98 <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="1">WixUI_InstallMode = "Change"</Publish> 99 99 <Publish Dialog="CustomizeDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallCustom"</Publish> 100 <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value=" InvalidConfigureationDlg" Order="4">CONF_HAS_ERRORS = "1"</Publish>101 <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value=" SelectConfigurationDlg" Order="3">CONF_OLD_FOUND="0"</Publish>102 <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value=" ConfigureDlg" Order="2">CONF_CAN_CHANGE = "1"</Publish>103 <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value=" VerifyReadyDlg" Order="1">1</Publish>100 <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="3">1</Publish> 101 <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="ConfigureDlg" Order="4">CONF_CAN_CHANGE = "1"</Publish> 102 <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="SelectConfigurationDlg" Order="5">CONF_OLD_FOUND="0"</Publish> 103 <Publish Dialog="CustomizeDlg" Control="Next" Event="NewDialog" Value="InvalidConfigureationDlg" Order="6">CONF_HAS_ERRORS = "1"</Publish> 104 104 105 105 <Publish Dialog="InvalidConfigureationDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">WixUI_InstallMode = "Change" OR WixUI_InstallMode = "InstallCustom"</Publish> … … 107 107 <Publish Dialog="InvalidConfigureationDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="3">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish> 108 108 <Publish Dialog="InvalidConfigureationDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="4">WixUI_InstallMode = "Update"</Publish> 109 <Publish Dialog="InvalidConfigureationDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" >1</Publish>109 <Publish Dialog="InvalidConfigureationDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="5">1</Publish> 110 110 111 111 <Publish Dialog="SelectConfigurationDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">WixUI_InstallMode = "Change" OR WixUI_InstallMode = "InstallCustom"</Publish> … … 113 113 <Publish Dialog="SelectConfigurationDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="3">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish> 114 114 <Publish Dialog="SelectConfigurationDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="4">WixUI_InstallMode = "Update"</Publish> 115 <Publish Dialog="SelectConfigurationDlg" Control="Next" Event="NewDialog" Value="ConfigureDlg" >1</Publish>115 <Publish Dialog="SelectConfigurationDlg" Control="Next" Event="NewDialog" Value="ConfigureDlg" Order="5">1</Publish> 116 116 117 <Publish Dialog="ConfigureDlg" Control="Back" Event="NewDialog" Value=" SelectConfigurationDlg" Order="1">CONF_OLD_FOUND="0"</Publish>118 <Publish Dialog="ConfigureDlg" Control="Back" Event="NewDialog" Value=" CustomizeDlg" Order="2">WixUI_InstallMode = "Change" OR WixUI_InstallMode = "InstallCustom"</Publish>119 <Publish Dialog="ConfigureDlg" Control="Back" Event="NewDialog" Value=" SetupTypeDlg" Order="3">WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete"</Publish>120 <Publish Dialog="ConfigureDlg" Control="Back" Event="NewDialog" Value=" MaintenanceTypeDlg" Order="4">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish>121 <Publish Dialog="ConfigureDlg" Control=" Back" Event="NewDialog" Value="WelcomeDlg" Order="5">WixUI_InstallMode = "Update"</Publish>122 <Publish Dialog="ConfigureDlg" Control=" Next" Event="NewDialog" Value="VerifyReadyDlg">1</Publish>117 <Publish Dialog="ConfigureDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">WixUI_InstallMode = "Change" OR WixUI_InstallMode = "InstallCustom"</Publish> 118 <Publish Dialog="ConfigureDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete"</Publish> 119 <Publish Dialog="ConfigureDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="3">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish> 120 <Publish Dialog="ConfigureDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="4">WixUI_InstallMode = "Update"</Publish> 121 <Publish Dialog="ConfigureDlg" Control="Next" Event="NewDialog" Value="VerifyReadyDlg" Order="5">1</Publish> 122 <Publish Dialog="ConfigureDlg" Control="Back" Event="NewDialog" Value="SelectConfigurationDlg" Order="6">CONF_OLD_FOUND="0"</Publish> 123 123 124 124 <!-- END: Modified to handle configuration dialog --> 125 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value=" InvalidConfigureationDlg" Order="1">CONF_HAS_ERRORS = "1"</Publish>126 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value=" ConfigureDlg" Order="2">CONF_OLD_FOUND="0" OR CONF_CAN_CHANGE="1"</Publish>127 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value=" CustomizeDlg" Order="3">WixUI_InstallMode = "Change" OR WixUI_InstallMode = "InstallCustom"</Publish>128 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value=" SetupTypeDlg" Order="4">WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete"</Publish>129 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value=" MaintenanceTypeDlg" Order="5">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish>130 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value=" WelcomeDlg" Order="6">WixUI_InstallMode = "Update"</Publish>125 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="CustomizeDlg" Order="1">WixUI_InstallMode = "Change" OR WixUI_InstallMode = "InstallCustom"</Publish> 126 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="SetupTypeDlg" Order="2">WixUI_InstallMode = "InstallTypical" OR WixUI_InstallMode = "InstallComplete"</Publish> 127 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="MaintenanceTypeDlg" Order="3">WixUI_InstallMode = "Repair" OR WixUI_InstallMode = "Remove"</Publish> 128 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="WelcomeDlg" Order="4">WixUI_InstallMode = "Update"</Publish> 129 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="ConfigureDlg" Order="5">CONF_OLD_FOUND="0" OR CONF_CAN_CHANGE="1"</Publish> 130 <Publish Dialog="VerifyReadyDlg" Control="Back" Event="NewDialog" Value="InvalidConfigureationDlg" Order="6">CONF_HAS_ERRORS = "1"</Publish> 131 131 132 132 <Publish Dialog="MaintenanceWelcomeDlg" Control="Next" Event="NewDialog" Value="MaintenanceTypeDlg">1</Publish> -
include/nsca/nsca_packet.hpp
rba63b95 r35254d1 162 162 throw nsca::nsca_exception("Invalid crc: " + nstr::to_string(crc32) + " != " + nstr::to_string(calculated_crc32)); 163 163 } 164 165 void get_buffer(std::string &buffer) const { 166 // FIXME: This is crap and needs rewriting. No std::string and beetter zero handling... 164 void validate_lengths() const { 167 165 if (service.length() >= nsca::length::desc_length) 168 166 throw nsca::nsca_exception("Description field to long: " + nstr::to_string(service.length()) + " > " + nstr::to_string(nsca::length::desc_length)); … … 171 169 if (result.length() >= get_payload_length()) 172 170 throw nsca::nsca_exception("Result field to long: " + nstr::to_string(result.length()) + " > " + nstr::to_string(get_payload_length())); 171 } 172 173 static void copy_string(char* data, const std::string &value, std::string::size_type max_length) { 174 memset(data, 0, max_length); 175 value.copy(data, value.size()>max_length?max_length:value.size()); 176 } 177 178 void get_buffer(std::string &buffer) const { 179 nsca::data::data_packet *data = reinterpret_cast<nsca::data::data_packet*>(&*buffer.begin()); 173 180 if (buffer.size() < get_packet_length()) 174 181 throw nsca::nsca_exception("Buffer is to short: " + nstr::to_string(buffer.length()) + " > " + nstr::to_string(get_packet_length())); 175 176 nsca::data::data_packet *data = reinterpret_cast<nsca::data::data_packet*>(&*buffer.begin());177 182 178 183 data->packet_version=swap_bytes::hton<int16_t>(nsca::data::version3); … … 181 186 data->crc32_value= swap_bytes::hton<u_int32_t>(0); 182 187 183 memset(data->get_host_ptr(), 0, host.size()+1); 184 host.copy(data->get_host_ptr(), host.size()); 185 memset(data->get_desc_ptr(nsca::length::host_length), 0, service.size()+1); 186 service.copy(data->get_desc_ptr(nsca::length::host_length), service.size()); 187 memset(data->get_result_ptr(nsca::length::host_length, nsca::length::desc_length), 0, result.size()+1); 188 result.copy(data->get_result_ptr(nsca::length::host_length, nsca::length::desc_length), result.size()); 188 copy_string(data->get_host_ptr(), host, nsca::length::host_length); 189 copy_string(data->get_desc_ptr(nsca::length::host_length), service, nsca::length::desc_length); 190 copy_string(data->get_result_ptr(nsca::length::host_length, nsca::length::desc_length), result, get_payload_length()); 189 191 190 192 unsigned int calculated_crc32=calculate_crc32(buffer.c_str(),buffer.size()); -
modules/NRPEServer/handler_impl.cpp
ra78a985 r35254d1 28 28 } 29 29 } 30 //TODO REMOVE THIS31 //return NRPEPacket(NRPEPacket::responsePacket, NRPEPacket::version2, NSCAPI::returnUNKNOWN, _T("TEST TEST TEST"), buffer_length_);32 30 33 31 NSCAPI::nagiosReturn ret = -3; … … 52 50 return nrpe::packet::create_response(NSCAPI::returnUNKNOWN, _T("UNKNOWN: Internal error."), p.get_payload_length()); 53 51 } 54 std::wstring data = msg; 55 if (!perf.empty()&&!noPerfData_) { 56 data += _T("|") + perf; 57 } 58 if (data.length() >= p.get_payload_length()-1) { 59 //NSC_LOG_ERROR(_T("Truncating returndata as it is bigger then NRPE allowes :(")); 60 data = data.substr(0,p.get_payload_length()-2); 52 std::wstring data; 53 if (msg.length() > p.get_payload_length()) { 54 data = msg.substr(0, p.get_payload_length()-1); 55 } else if (perf.empty() || noPerfData_) { 56 data = msg; 57 } else if (msg.length() + perf.length() + 1 > p.get_payload_length()) { 58 data = msg; 59 } else { 60 data = msg + _T("|") + perf; 61 61 } 62 62 return nrpe::packet::create_response(ret, data, p.get_payload_length()); -
service/NSClient++.cpp
rba63b95 r35254d1 938 938 939 939 NSCAPI::errorReturn NSClientT::reload(const wchar_t *module) { 940 { 940 if (module == _T("service")) { 941 boot_start_plugins() 942 943 } else { 941 944 std::wstring m = module; 942 945 boost::unique_lock<boost::shared_mutex> writeLock(m_mutexRW, boost::get_system_time() + boost::posix_time::seconds(10)); -
service/cli_parser.hpp
rba63b95 r35254d1 51 51 52 52 settings.add_options() 53 ("settings", po::value<std::wstring>(), "Override (temporarily) settings subsystem to use") 53 54 ("migrate-to", po::value<std::wstring>(), "Migrate (copy) settings from current store to target store") 54 55 ("migrate-from", po::value<std::wstring>(), "Migrate (copy) settings from current store to target store") … … 246 247 if (vm.count("switch")) { 247 248 client.switch_context(vm["switch"].as<std::wstring>()); 249 ret = 0; 250 } 251 if (vm.count("settings")) { 252 client.set_current(vm["settings"].as<std::wstring>()); 248 253 ret = 0; 249 254 } -
service/settings_client.hpp
r9c06054 r35254d1 97 97 BOOST_FOREACH(std::wstring path, s) { 98 98 std::wcout << _T("== ") << path << _T(" ==") << std::endl; 99 settings::settings_core::path_description desc = settings_manager::get_core()->get_registred_path(path); 100 if (!desc.description.empty()) 101 std::wcout << desc.description << std::endl; 102 std::wcout << std::endl; 99 103 settings::string_list k = settings_manager::get_core()->get_reg_keys(path); 100 104 bool first = true; … … 105 109 std::wcout << _T("'''Normal settings'''") << std::endl; 106 110 first = false; 111 strEx::replace(desc.description, _T("\n"), _T("\n|| || ||")); 112 if (desc.defValue.empty()) 113 desc.defValue = _T(" "); 107 114 std::wcout << _T("||") << key << _T("||") << desc.defValue << _T("||") << desc.title << _T(": ") << desc.description << std::endl; 108 115 }
Note: See TracChangeset
for help on using the changeset viewer.








