Changeset c74d7b6 in nscp


Ignore:
Timestamp:
02/21/12 23:29:34 (16 months ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
84cdb9b
Parents:
72eea1f
Message:
  • Added new module CauseCrash? which has a single command CrashClient? to allow the service to be crashed remotly *WARNING* Dont use this command, it is for debugging and testing purpouses only
  • Fixed issue with BreakPad? which was disabled
  • Fixed some unix issues (sorry but hudson's stopped emailing me again:( )
  • Fixed service --install (now sets correct options)
  • Fixed service --install (now sets description correctly)
  • Fixed log level defined in protobuf (now same as rest of the system)
  • Fixed some issues with the check_nscp command
Files:
7 added
12 edited

Legend:

Unmodified
Added
Removed
  • changelog

    r72eea1f rc74d7b6  
    55 * Fix RtlStringFromGUID problem on NT4 
    66 
    7 2012-02-19 MickeM 
     72012-02-21 MickeM 
     8 * Added new module CauseCrash which has a single command CrashClient to allow the service to be crashed remotly 
     9   *WARNING* Dont use this command, it is for debugging and testing purpouses only 
     10 * Fixed issue with BreakPad which was disabled 
     11 * Fixed some unix issues (sorry but hudson's stopped emailing me again:( ) 
     12 * Fixed service --install (now sets correct options) 
     13 * Fixed service --install (now sets description correctly) 
     14 * Fixed log level defined in protobuf (now same as rest of the system) 
     15 * Fixed some issues with the check_nscp command 
     16 
     172012-02-20 MickeM 
    818 * Fixed NRPE buffer issue 
    919 * Added test case for 65K NRPE buffer length as well as 1Mb  
  • include/ServiceCmd.cpp

    rd66ccee rc74d7b6  
    394394 
    395395    TCHAR* d = new TCHAR[desc.length()+2]; 
    396     wcsncpy(d, desc.c_str(), desc.length()); 
     396    wcsncpy(d, desc.c_str(), desc.length()+1); 
    397397    descr.lpDescription = d; 
    398398    BOOL bResult = FChangeServiceConfig2(schService, SERVICE_CONFIG_DESCRIPTION, &descr); 
  • include/net/net.hpp

    re396b2f rc74d7b6  
    9393  }; 
    9494 
    95   typedef public base_url<std::string, std::stringstream, string_traits> url; 
    96   typedef public base_url<std::wstring, std::wstringstream, wstring_traits> wurl; 
     95  typedef base_url<std::string, std::stringstream, string_traits> url; 
     96  typedef base_url<std::wstring, std::wstringstream, wstring_traits> wurl; 
    9797 
    9898  inline wurl url_to_wide(const url &u) { 
  • include/nscapi/settings_object.hpp

    r76540c3 rc74d7b6  
    3636 
    3737 
    38     template<class object_type = default_object_type, class object_reader = default_object_reader<default_object_type> > 
     38    template<class t_object_type, class object_reader> 
    3939    struct object_handler : boost::noncopyable { 
    40       typedef boost::optional<object_type> optional_object; 
    41       typedef std::map<std::wstring, object_type> object_list_type; 
    42       typedef object_handler<object_type, object_reader> my_type; 
     40      typedef boost::optional<t_object_type> optional_object; 
     41      typedef std::map<std::wstring, t_object_type> object_list_type; 
     42      typedef object_handler<t_object_type, object_reader> my_type; 
    4343 
    4444      object_list_type object_list; 
     
    5151      } 
    5252 
    53       object_type add(boost::shared_ptr<nscapi::settings_proxy> proxy, std::wstring path, std::wstring alias, std::wstring value, bool is_template = false) { 
    54         object_type object; 
     53      t_object_type add(boost::shared_ptr<nscapi::settings_proxy> proxy, std::wstring path, std::wstring alias, std::wstring value, bool is_template = false) { 
     54        t_object_type object; 
    5555        object.alias = alias; 
    5656        object.value = value; 
     
    6262 
    6363        if (!object.parent.empty() && object.parent != alias & object.parent != object.alias) { 
    64           object_type parent; 
     64          t_object_type parent; 
    6565          optional_object tmp = find_object(object.parent); 
    6666          if (!tmp) { 
     
    8080 
    8181      void rebuild(boost::shared_ptr<nscapi::settings_proxy> proxy) { 
    82         std::list<object_type> tmp; 
    83         BOOST_FOREACH(object_list_type::value_type t, object_list) { 
     82        std::list<t_object_type> tmp; 
     83        BOOST_FOREACH(const typename object_list_type::value_type &t, object_list) { 
    8484          tmp.push_back(t.second); 
    8585        } 
    8686        object_list.clear(); 
    87         BOOST_FOREACH(const &object_item o, tmp) { 
     87        BOOST_FOREACH(const t_object_type &o, tmp) { 
    8888          std::wstring::size_type pos = o.path.find_last_of(_T("/")); 
    8989          if (pos == std::wstring::npos) 
     
    9595 
    9696      optional_object find_object(std::wstring alias) { 
    97         object_list_type::const_iterator cit = object_list.find(alias); 
     97        typename object_list_type::const_iterator cit = object_list.find(alias); 
    9898        if (cit != object_list.end()) 
    9999          return optional_object(cit->second); 
     
    105105 
    106106      bool has_object(std::wstring alias) { 
    107         object_list_type::const_iterator cit = object_list.find(alias); 
     107        typename object_list_type::const_iterator cit = object_list.find(alias); 
    108108        if (cit != object_list.end()) 
    109109          return true; 
     
    118118        std::wstringstream ss; 
    119119        ss << _T("Objects: "); 
    120         BOOST_FOREACH(object_list_type::value_type t, object_list) { 
     120        BOOST_FOREACH(const typename object_list_type::value_type &t, object_list) { 
    121121          ss << _T(", ") << t.first << _T(" = {") << t.second.to_wstring() + _T("} "); 
    122122        } 
    123123        ss << _T("Templates: "); 
    124         BOOST_FOREACH(object_list_type::value_type t, template_list) { 
     124        BOOST_FOREACH(const typename object_list_type::value_type &t, template_list) { 
    125125          ss << _T(", ") << t.first << _T(" = {") << t.second.to_wstring() + _T("} "); 
    126126        } 
     
    128128      } 
    129129 
    130       void add_object(object_type object) { 
     130      void add_object(t_object_type object) { 
    131131        object_reader::post_process_object(object); 
    132         object_list_type::iterator cit = template_list.find(object.alias); 
     132        typename object_list_type::iterator cit = template_list.find(object.alias); 
    133133        if (cit != template_list.end()) 
    134134          template_list.erase(cit); 
    135135        object_list[object.alias] = object; 
    136136      } 
    137       void add_template(object_type object) { 
    138         object_list_type::const_iterator cit = object_list.find(object.alias); 
     137      void add_template(t_object_type object) { 
     138        typename object_list_type::const_iterator cit = object_list.find(object.alias); 
    139139        if (cit != object_list.end()) 
    140140          return; 
  • libs/protobuf/plugin.proto

    r9b9be81 rc74d7b6  
    312312  message Entry { 
    313313    enum Level { 
    314       LOG_DEBUG =  0; 
    315       LOG_INFO  = 10; 
    316       LOG_WARNING = 20; 
    317       LOG_ERROR = 30; 
    318       LOG_CRITICAL  = 40; 
     314      LOG_DEBUG = 500; 
     315      LOG_INFO  = 150; 
     316      LOG_WARNING =  50; 
     317      LOG_ERROR =  10; 
     318      LOG_CRITICAL  =   1; 
    319319    }; 
    320320    required Level  level = 1; 
  • modules/CheckNSCP/CheckNSCP.cpp

    r8013c0c rc74d7b6  
    4343 
    4444    settings.alias().add_key_to_settings() 
    45       (_T("archive folder"), sh::wstring_key(&crashFolder, CRASH_ARCHIVE_FOLDER), 
     45      (_T("archive folder"), sh::wpath_key(&crashFolder, CRASH_ARCHIVE_FOLDER), 
    4646      CRASH_ARCHIVE_FOLDER_KEY, _T("The archive folder for crash dunpes.")) 
    4747      ; 
     
    9090int CheckNSCP::get_crashes(std::wstring &last_crash) { 
    9191#ifdef WIN32 
     92  NSC_DEBUG_MSG(_T("Crash folder is: ") + crashFolder); 
    9293  if (!file_helpers::checks::is_directory(crashFolder)) { 
    9394    return 0; 
  • modules/NSCAClient/NSCAClient.cpp

    r72eea1f rc74d7b6  
    116116          iter++; 
    117117        } 
    118       } catch (exception& e) { 
    119         cerr << "Error: " << e.what() << endl; 
     118      } catch (const std::exception& e) { 
     119        NSC_LOG_ERROR_STD(_T("Failed to resolve: ") + utf8::to_unicode(e.what())); 
    120120      } 
    121121 
  • service/NSClient++.cpp

    r523576e rc74d7b6  
    632632      LOG_ERROR_CORE(_T("No crash handling configured")); 
    633633    } else { 
    634       //g_exception_manager->StartMonitoring(); 
     634      g_exception_manager->StartMonitoring(); 
    635635    } 
    636636  } 
  • service/cli_parser.hpp

    r523576e rc74d7b6  
    331331      return 0; 
    332332    } catch(std::exception & e) { 
    333       mainClient.log_error(__FILE__, __LINE__, std::string("Unable to parse command line (settings): ") + e.what()); 
     333      std::cerr << std::string("Unable to parse command line (settings): ") << e.what() << "\n"; 
    334334      return 1; 
    335335    } 
  • service/service_manager.hpp

    r3bdaf18 rc74d7b6  
    2626      } 
    2727      static std::wstring get_default_arguments() { 
    28         return _T("--service --run"); 
     28        return _T("service --run"); 
    2929      } 
    3030      inline void print_msg(std::wstring str) { 
     
    4242          serviceControll::Install(service_name_, service_description, get_default_service_deps(), SERVICE_WIN32_OWN_PROCESS, args); 
    4343        } catch (const serviceControll::SCException& e) { 
    44           print_error(_T("Service installation failed: ") + e.error_); 
     44          print_error(_T("Service installation failed of '") + service_name_ + _T("' failed: ") + e.error_); 
    4545          return -1; 
    4646        } 
  • version.hpp

    r72eea1f rc74d7b6  
    11#ifndef VERSION_HPP 
    22#define VERSION_HPP 
    3 #define PRODUCTVER     0,4,0,136 
    4 #define STRPRODUCTVER  "0,4,0,136" 
     3#define PRODUCTVER     0,4,0,137 
     4#define STRPRODUCTVER  "0,4,0,137" 
    55#define STRPRODUCTDATE "2012-02-20" 
    66#endif // VERSION_HPP 
  • version.txt

    r72eea1f rc74d7b6  
    11version=0.4.0 
    2 build=136 
     2build=137 
    33date=2012-02-20 
Note: See TracChangeset for help on using the changeset viewer.