Changeset 04ef932 in nscp


Ignore:
Timestamp:
08/10/11 07:37:24 (22 months ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
54ac968
Parents:
e11d494
Message:

2011-08-10

  • Fixed so it builds and runs on linux (but parser had issues so disabled som grammar rules whichneeds to be enabled again)
  • Added a lot of freatures and cleand up the PythonScript module
  • Started to merge som features from PythonScript back to Lua script


2011-08-07

  • Fixed a lot of issues with PythonScript module adding suport for alias and "raw command processing"
  • Fixed issue with loading plugins and aliases as well as duplicate plugin detection


2011-08-01

Files:
7 added
35 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    re11d494 r04ef932  
    3434SET(PROTOBUF_DIR "${INC_PROTOBUF_DIR}" CACHE PATH "Path to google protocol buffer root") 
    3535IF(WIN32 AND MSVC) 
    36   SET(PROTOBUF_INCLUDE_DIR "${PROTOBUF_DIR}/src" "Path to google protocol buffer source") 
     36  SET(PROTOBUF_INCLUDE_DIR "${PROTOBUF_DIR}/src") 
    3737  SET(PROTOBUF_LIBRARYDIR "${INC_PROTOBUF_LIBRARYDIR}") 
    3838  SET(PROTOBUF_LIBRARY_PREFIX "") 
     
    4242# TODO 
    4343ENDIF(WIN32 AND MSVC) 
     44 
     45 
    4446# ### ### ### ### 
    4547# Crypto++ 
     
    8688INCLUDE(${BUILD_CMAKE_FOLDER}/functions.cmake) 
    8789 
     90 
     91FIND_PACKAGE(PythonInterpEx) 
     92FIND_PACKAGE(PythonLibsEx) 
     93IF (NOT PYTHONINTERP_FOUND) 
     94  MESSAGE(FATAL_ERROR "Could not find python which is required for building") 
     95ELSE (NOT PYTHONINTERP_FOUND) 
     96  message(STATUS "Found python in: ${PYTHON_EXECUTABLE}") 
     97ENDIF (NOT PYTHONINTERP_FOUND) 
     98IF (PYTHONLIBSEX_FOUND) 
     99  MESSAGE(STATUS "Found python (lib) in: ${PYTHON_LIBRARY}") 
     100ENDIF (PYTHONLIBSEX_FOUND) 
     101 
     102 
    88103SET(VERSION_TXT ${CMAKE_CURRENT_SOURCE_DIR}/version.txt) 
    89 IF(${INCREASE_BUILD} STREQUAL 1) 
     104IF("${INCREASE_BUILD}" STREQUAL "1") 
    90105EXECUTE_PROCESS( 
    91106  COMMAND ${PYTHON_EXECUTABLE} 
     
    98113  ) 
    99114  MESSAGE(STATUS "===================== Bumping version") 
    100 ENDIF(${INCREASE_BUILD} STREQUAL 1) 
     115ENDIF("${INCREASE_BUILD}" STREQUAL "1") 
    101116 
    102117EXECUTE_PROCESS( 
     
    186201if(BREAKPAD_FOUND) 
    187202  MESSAGE(STATUS "Found google breakpad") 
    188   SET(NSCP_GLOBAL_DEFINES ${NSCP_GLOBAL_DEFINES} -DUSE_BREAK_PAD) 
     203  SET(NSCP_GLOBAL_DEFINES ${NSCP_GLOBAL_DEFINES} -DUSE_BREAK_PAD -DBOOST_FILESYSTEM_VERSION=2) 
     204  INCLUDE_DIRECTORIES("${BREAKPAD_INCLUDE_DIR}") 
    189205else(BREAKPAD_FOUND) 
    190206  MESSAGE(WARNING "Breakpad was not found in: ${BREAKPAD_EXCEPTION_HANDLER_INCLUDE_DIR}/${BREAKPAD_EXCEPTION_HANDLER_LIBRARIES}") 
     
    193209FIND_PACKAGE(OpenSSL) 
    194210if(OPENSSL_FOUND) 
    195   MESSAGE(STATUS "Found OpenSSL") 
     211  MESSAGE(STATUS "Found OpenSSL: ${OPENSSL_INCLUDE_DIR}") 
    196212  SET(NSCP_GLOBAL_DEFINES ${NSCP_GLOBAL_DEFINES} -DUSE_SSL) 
    197213else(OPENSSL_FOUND) 
     
    199215endif(OPENSSL_FOUND) 
    200216 
    201 FIND_PACKAGE(Boost COMPONENTS system filesystem thread regex date_time program_options REQUIRED) 
     217FIND_PACKAGE(Boost COMPONENTS system filesystem thread regex date_time program_options python REQUIRED) 
    202218if(Boost_FOUND) 
    203219  MESSAGE(STATUS "Found boost in: ${Boost_INCLUDE_DIRS} / ${Boost_LIBRARY_DIRS}") 
     
    212228  ENDIF(WIN32) 
    213229else(Boost_FOUND) 
    214   MESSAGE(FATAL_ERROR, "boost NOT fround: ${Boost_ERROR_REASON}") 
     230  MESSAGE(FATAL_ERROR "boost NOT fround: ${Boost_ERROR_REASON}") 
    215231endif(Boost_FOUND) 
    216232 
    217233if(PROTOBUF_FOUND) 
    218   message(STATUS "Found proto in: ${PROTOBUF_LIBRARY} (${PROTOBUF_PROTOC_EXECUTABLE})") 
    219   INCLUDE_DIRECTORIES(${PROTOBUF_INCLUDE_DIR}) 
     234  message(STATUS "Found proto in: ${PROTOBUF_INCLUDE_DIR} / ${PROTOBUF_LIBRARY} (${PROTOBUF_PROTOC_EXECUTABLE})") 
     235  INCLUDE_DIRECTORIES("${PROTOBUF_INCLUDE_DIR}") 
    220236else(PROTOBUF_FOUND) 
    221   message(FATAL_ERROR, "Protocol buffers NOT found (${PROTOBUF_LIBRARYDIR}, )") 
     237  message(FATAL_ERROR "Protocol buffers NOT found (${PROTOBUF_LIBRARYDIR})") 
    222238endif(PROTOBUF_FOUND) 
    223239 
     
    299315ENDIF(NOT WIN32) 
    300316 
    301 FIND_PACKAGE(PythonInterp) 
    302 IF (NOT PYTHONINTERP_FOUND) 
    303   MESSAGE(FATAL_ERROR "Could not find python which is required for building") 
    304 ELSE (NOT PYTHONINTERP_FOUND) 
    305   message(STATUS "Found python in: ${PYTHON_EXECUTABLE}") 
    306 ENDIF (NOT PYTHONINTERP_FOUND) 
    307  
    308  
    309317SET(NSCP_GLOBAL_DEFINES ${NSCP_GLOBAL_DEFINES} -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0403) 
    310318# TODO: Fix this issue! (crypto++ and masm) 
     
    367375 
    368376SET(NSCP_DEF_PLUGIN_LIB 
    369   ${Boost_LIBRARIES} 
     377# ${Boost_LIBRARIES} 
    370378  ${CMAKE_THREAD_LIBS_INIT} 
     379  ${Boost_PROGRAM_OPTIONS_LIBRARY} 
     380  ${Boost_THREAD_LIBRARY} 
    371381  ${EXTRA_LIBS} 
    372382  ${PROTOBUF_LIBRARY} 
     
    453463  ${BUILD_TARGET_EXE_PATH}/postbuild.py 
    454464) 
     465CONFIGURE_FILE( 
     466  ${BUILD_PYTHON_FOLDER}/config.py 
     467  ${BUILD_TARGET_EXE_PATH}/config.py 
     468) 
  • build.cmake

    r7ec3dd1 r04ef932  
    1111    MESSAGE(STATUS "Detected x64") 
    1212    SET(INC_NSCP_LIBRARYDIR D:/source/lib/x64)   
     13    SET(PYTHON_ROOT c:/python/27x64)   
    1314  ELSE() 
    1415    MESSAGE(STATUS "Detected w32") 
    1516    SET(INC_NSCP_LIBRARYDIR D:/source/lib/x86) 
     17    SET(PYTHON_ROOT c:/python/27)  
    1618  ENDIF() 
    1719 
    1820  SET(INC_GOOGLE_BREAKPAD_DIR "D:/source/libraries/google-breakpad-svn") 
    1921     
    20   SET(INC_BOOST_INCLUDEDIR "${INC_NSCP_INCLUDEDIR}") 
     22  SET(INC_BOOST_INCLUDEDIR "D:/source/include/boost-1_47") 
    2123  SET(INC_BOOST_LIBRARYDIR "${INC_NSCP_LIBRARYDIR}") 
    2224  SET(INC_PROTOBUF_LIBRARYDIR "${INC_NSCP_LIBRARYDIR}") 
     
    3537 
    3638  SET(INC_OPENSSL_INCLUDEDIR "/usr/include/") 
     39  SET(PROTOBUF_INCLUDE_DIR "/usr/include/") 
    3740 
    3841ENDIF(WIN32) 
  • build/cmake/NSCPPBuffer.cmake

    r1f24a1c r04ef932  
    9797        ARGS --cpp_out  ${CMAKE_CURRENT_BINARY_DIR} --proto_path ${CMAKE_CURRENT_SOURCE_DIR} ${ABS_FIL} 
    9898        DEPENDS ${ABS_FIL} 
    99         COMMENT "Running protocol buffer compiler on ${FIL}" VERBATIM ) 
     99        COMMENT "Running protocol buffer compiler on ${FIL} - ${PROTOBUF_PROTOC_EXECUTABLE}" VERBATIM ) 
    100100 
    101101      SET_SOURCE_FILES_PROPERTIES(${${VAR}} ${INCL} PROPERTIES GENERATED TRUE) 
  • build/python/postbuild.py

    re11d494 r04ef932  
    66 
    77 
    8 BREAKPAD_FOUND = "${BREAKPAD_FOUND}" 
    9 BREAKPAD_FOUND = "FALSE" 
    10 BREAKPAD_DUMPSYMS_EXE = "${BREAKPAD_DUMPSYMS_EXE}" 
    11 BUILD_TARGET_EXE_PATH = "${BUILD_TARGET_EXE_PATH}" 
    12 BUILD_PYTHON_FOLDER = "${BUILD_PYTHON_FOLDER}" 
    13 VERSION = "${VERSION_SERIES}.${VERSION_MAJOR}.${VERSION_MINOR}" 
    14 CMAKE_CL_64 = "${CMAKE_CL_64}" 
    15 ARCHIVE_FOLDER = "${ARCHIVE_FOLDER}" 
    16 VERSION_TXT = "${VERSION_TXT}" 
    17 VERSION_ARCH = "${VERSION_ARCH}" 
     8execfile("config.py") 
    189 
    1910sys.path.append(BUILD_PYTHON_FOLDER) 
     
    2314version.read() 
    2415datestr = version.datestr() 
     16vstring = version.version() 
    2517 
    2618def rename_and_move(file, target): 
     
    6658    os.mkdir(target_archives) 
    6759 
    68   for f in find_by_pattern(BUILD_TARGET_EXE_PATH, '*.msi'): 
     60  for f in find_by_pattern(BUILD_TARGET_EXE_PATH, '*%s*.msi'%vstring): 
    6961    rename_and_move(f, target_installer) 
    70   for f in find_by_pattern(BUILD_TARGET_EXE_PATH, '*.zip'): 
     62  for f in find_by_pattern(BUILD_TARGET_EXE_PATH, '*%s*.zip'%vstring): 
    7163    rename_and_move(f, target_archives) 
    7264   
  • changelog

    re11d494 r04ef932  
    66 * Fixa dependonservice LanManWorkStation (old win) 
    77 * Fix RtlStringFromGUID problem on NT4 
     8 
     92011-08-10 
     10 * Fixed so it builds and runs on linux (but parser had issues so disabled som grammar rules whichneeds to be enabled again) 
     11 * Added a lot of freatures and cleand up the PythonScript module 
     12 * Started to merge som features from PythonScript back to Lua script 
     13  
     142011-08-07 
     15 * Fixed a lot of issues with PythonScript module adding suport for alias and "raw command processing" 
     16 * Fixed issue with loading plugins and aliases as well as duplicate plugin detection 
     17  
     182011-08-01 
     19 * Added new module: PythonScript 
    820 
    9212011-07-25 
  • helpers/installers/installer/CMakeLists.txt

    r7ec3dd1 r04ef932  
    3535  "NagiosPlugins.vbs_script lib" 
    3636  "wrapper.vbs_script lib" 
     37 
     38  "test.py.vbs_script lib" 
     39  "test_second.py.vbs_script lib" 
    3740   
    3841  counters.defs_files 
  • helpers/installers/installer/Product.wxs

    re11d494 r04ef932  
    3636    <Media Id="1" Cabinet="Product.cab" EmbedCab="yes" CompressionLevel="high" /> 
    3737    <Directory Id="TARGETDIR" Name="SourceDir"> 
    38       <Directory Id="$(var.ProgramFiles)"> 
    39         <Directory Id="INSTALLLOCATION" Name="$(var.App.Path)"> 
    40           <Component Id="MainClient" Guid="F6636DB0-A0B9-4dd2-B74C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    41             <File Id="NSClientEXE" Name="nscp.exe" DiskId="1" KeyPath="yes" 
     38      <Directory Id="$(var.ProgramFiles)"> 
     39        <Directory Id="INSTALLLOCATION" Name="$(var.App.Path)"> 
     40          <Component Id="MainClient" Guid="F6636DB0-A0B9-4dd2-B74C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     41            <File Id="NSClientEXE" Name="nscp.exe" DiskId="1" KeyPath="yes" 
    4242                Source="$(var.Source)/nscp.exe" Vital="yes"> 
    43               <Shortcut Id="StartmenuNSClientTest" Directory="ProgramMenuDir" 
     43              <Shortcut Id="StartmenuNSClientTest" Directory="ProgramMenuDir" 
    4444                Name="$(var.App.Title) ($(var.arch), test)" WorkingDirectory="INSTALLDIR" Icon="nscp.exe" 
    4545                Advertise="yes" IconIndex="0" Arguments="--test" Description="Run $(var.App.Title) in test mode" /> 
    46               <fire:FirewallException Id="FWX1" Name="NSClient++ Monitoring Agent" Scope="any" IgnoreFailure="yes" /> 
    47             </File> 
    48             <ServiceInstall Id="SWCNSCP" 
     46              <fire:FirewallException Id="FWX1" Name="NSClient++ Monitoring Agent" Scope="any" IgnoreFailure="yes" /> 
     47            </File> 
     48            <ServiceInstall Id="SWCNSCP" 
    4949              Name="[SERVICE_NAME]" DisplayName="$(var.App.Title) ($(var.arch))" 
    5050              Type="ownProcess" Start="auto" ErrorControl="normal" Interactive="no" 
    5151              Description="Monitoring agent for nagios (and others) used to respond to status queries" 
    5252              Arguments="--service --run --name [SERVICE_NAME]" /> 
    53             <ServiceControl Id="StartSWCNSCP" Name="[SERVICE_NAME]" Start="install" Stop="both" Wait="yes" Remove="uninstall" /> 
    54             <RemoveFolder Id="RemoveMenuShortcuts" Directory="ProgramMenuDir" On="uninstall" /> 
    55           </Component> 
    56           <Component Id="Shortcuts" Guid="E6636DB0-A0B9-4dd2-B74C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    57             <Shortcut Id="StartmenuNSClientStart" Directory="ProgramMenuDir" Name="Start $(var.App.Title) ($(var.arch))" 
     53            <ServiceControl Id="StartSWCNSCP" Name="[SERVICE_NAME]" Start="install" Stop="both" Wait="yes" Remove="uninstall" /> 
     54            <RemoveFolder Id="RemoveMenuShortcuts" Directory="ProgramMenuDir" On="uninstall" /> 
     55          </Component> 
     56          <Component Id="Shortcuts" Guid="E6636DB0-A0B9-4dd2-B74C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     57            <Shortcut Id="StartmenuNSClientStart" Directory="ProgramMenuDir" Name="Start $(var.App.Title) ($(var.arch))" 
    5858                  WorkingDirectory='INSTALLDIR' Icon="nscp.exe" IconIndex="0" 
    5959                  Arguments="--service --name [SERVICE_NAME] --start" Description="Start the $(var.App.Title) service" /> 
    60             <Shortcut Id="StartmenuNSClientStop" Directory="ProgramMenuDir" Name="Stop $(var.App.Title) ($(var.arch))" 
     60            <Shortcut Id="StartmenuNSClientStop" Directory="ProgramMenuDir" Name="Stop $(var.App.Title) ($(var.arch))" 
    6161                  WorkingDirectory='INSTALLDIR' Icon="nscp.exe" IconIndex="0" 
    6262                  Arguments="--service --name [SERVICE_NAME] --stop" Description="Stop the $(var.App.Title) service" /> 
    63             <Shortcut Id="StarmentNSCHelp" Directory="ProgramMenuDir" Name="Documentation" 
     63            <Shortcut Id="StarmentNSCHelp" Directory="ProgramMenuDir" Name="Documentation" 
    6464                  Target="[HELP_LINK]" Icon="doc.ico" 
    6565                  Description="Visit the NSClient++ WIKI for documentation"> 
    66             </Shortcut> 
    67             <RegistryValue Root="HKCU" Key="Software\NSClient++\Installer" Name="shortcuts" Type="integer" Value="1" KeyPath="yes"/> 
    68           </Component> 
    69           <Component Id="Helpers" Guid="A6636DB0-A0B9-4dd2-B74C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    70             <!-- 
     66            </Shortcut> 
     67            <RegistryValue Root="HKCU" Key="Software\NSClient++\Installer" Name="shortcuts" Type="integer" Value="1" KeyPath="yes"/> 
     68          </Component> 
     69          <Component Id="Helpers" Guid="A6636DB0-A0B9-4dd2-B74C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     70            <!-- 
    7171            <File Id="NSClientTRAY" Name="nstray.exe" DiskId="1" 
    7272                Source="$(var.Source)/nstray.exe" Vital="yes"> 
     
    7676            </File> 
    7777            --> 
    78             <File Id="ErrorReporter" Name="reporter.exe" DiskId="1" Source="$(var.Source)/reporter.exe" Vital="yes" /> 
    79             <!-- 
     78            <File Id="ErrorReporter" Name="reporter.exe" DiskId="1" Source="$(var.Source)/reporter.exe" Vital="yes" /> 
     79            <!-- 
    8080              <File Id="NSClientINI" Name="NSC.ini" LongName="NSC.ini" DiskId="1" Source="$(var.Path.ini)/NSC.ini" Vital="yes"/> 
    8181            --> 
    82           </Component> 
    83           <Component Id="RandomFiles" Guid="B4636DB0-A0B9-4dd2-B74C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    84             <File Id="Changelog" Name="changelog.txt" DiskId="1" Source="$(var.Source)/changelog" Vital="no" /> 
    85             <File Id="Counters" Name="counters.defs" DiskId="1" Source="$(var.Source)/counters.defs" Vital="no" /> 
    86             <File Id="License" Name="license.txt" DiskId="1" Source="$(var.Source)/license.txt" Vital="no" KeyPath="yes" /> 
    87             <File Id="settingsMap" Name="old-settings.map" DiskId="1" Source="$(var.Source)/old-settings.map" Vital="no" /> 
    88  
    89             <RemoveFile Id="LogFile1" Name="nsclient.log" On="uninstall" /> 
    90             <RemoveFile Id="LogFile2" Name="nsc.log" On="uninstall" /> 
    91             <RemoveFile Id="OldConfig" Name="nsc.old" On="uninstall" /> 
    92             <RemoveFile Id="NewConfig" Name="nsc.new" On="uninstall" /> 
    93           </Component> 
    94           <Component Id="NagiosDocumentation" Guid="9B490E67-5472-4267-889C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    95             <File Id="doc.usage.nagios" Name="Nagios Usage Guide.pdf" DiskId="1" Source="$(var.Source)/docs/Nagios Usage Guide.pdf" Vital="no" KeyPath="yes"> 
    96               <Shortcut Id="Startmenu.doc.nagios" Directory="ProgramMenuDir" Name="Nagios Usage Guide" Advertise="yes"  
     82          </Component> 
     83          <Component Id="RandomFiles" Guid="B4636DB0-A0B9-4dd2-B74C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     84            <File Id="Changelog" Name="changelog.txt" DiskId="1" Source="$(var.Source)/changelog" Vital="no" /> 
     85            <File Id="Counters" Name="counters.defs" DiskId="1" Source="$(var.Source)/counters.defs" Vital="no" /> 
     86            <File Id="License" Name="license.txt" DiskId="1" Source="$(var.Source)/license.txt" Vital="no" KeyPath="yes" /> 
     87            <File Id="settingsMap" Name="old-settings.map" DiskId="1" Source="$(var.Source)/old-settings.map" Vital="no" /> 
     88 
     89            <RemoveFile Id="LogFile1" Name="nsclient.log" On="uninstall" /> 
     90            <RemoveFile Id="LogFile2" Name="nsc.log" On="uninstall" /> 
     91            <RemoveFile Id="OldConfig" Name="nsc.old" On="uninstall" /> 
     92            <RemoveFile Id="NewConfig" Name="nsc.new" On="uninstall" /> 
     93          </Component> 
     94          <Component Id="NagiosDocumentation" Guid="9B490E67-5472-4267-889C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     95            <File Id="doc.usage.nagios" Name="Nagios Usage Guide.pdf" DiskId="1" Source="$(var.Source)/docs/Nagios Usage Guide.pdf" Vital="no" KeyPath="yes"> 
     96              <Shortcut Id="Startmenu.doc.nagios" Directory="ProgramMenuDir" Name="Nagios Usage Guide" Advertise="yes" 
    9797                    WorkingDirectory="INSTALLDIR" Description="Nagios Usage Guide"/> 
    98             </File> 
    99           </Component> 
    100           <Component Id="ReferenceDocumentation" Guid="8B490E67-5472-4267-889C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    101             <File Id="doc.reference" Name="NSClient++ Reference Manual.pdf" DiskId="1" Source="$(var.Source)/docs/NSClient++ Reference Manual.pdf" Vital="no" KeyPath="yes"> 
    102               <Shortcut Id="Startmenu.doc.ref" Directory="ProgramMenuDir" Name="NSClient++ Reference Manual" Advertise="yes"  
     98            </File> 
     99          </Component> 
     100          <Component Id="ReferenceDocumentation" Guid="8B490E67-5472-4267-889C-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     101            <File Id="doc.reference" Name="NSClient++ Reference Manual.pdf" DiskId="1" Source="$(var.Source)/docs/NSClient++ Reference Manual.pdf" Vital="no" KeyPath="yes"> 
     102              <Shortcut Id="Startmenu.doc.ref" Directory="ProgramMenuDir" Name="NSClient++ Reference Manual" Advertise="yes" 
    103103                    WorkingDirectory="INSTALLDIR" Description="NSClient++ Reference Manual"/> 
    104             </File> 
    105           </Component> 
    106           <Directory Id="INSTALLLOCATION_SECURITY" Name="security"> 
    107             <Component Id="NRPEServerCert" Guid="5A0246F8-5167-45db-2E46-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    108               <File Id="NRPECert" Name="nrpe_dh_512.pem" DiskId="1" Source="$(var.Source)/security/nrpe_dh_512.pem" Vital="no"/> 
    109             </Component> 
    110           </Directory> 
    111           <Directory Id="INSTALLLOCATION_MODS" Name="modules"> 
    112             <Component Id="NRPEServer" Guid="5A0246F8-5167-45db-B246-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    113               <File Id="NRPEListenerDLL" Name="NRPEListener.dll" DiskId="1" Source="$(var.Source)/modules/NRPEServer.dll" Vital="no" /> 
    114               <File Id="NRPEClientDLL" Name="NRPEClient.dll" DiskId="1" Source="$(var.Source)/modules/NRPEClient.dll" Vital="no" /> 
    115             </Component> 
    116             <Component Id="NSCListener" Guid="6DAF8BB9-9A56-48f5-B2C5-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    117               <File Id="NSCListenerDLL" Name="NSClientListener.dll" DiskId="1" Source="$(var.Source)/modules/NSClientServer.dll" Vital="no" /> 
    118             </Component> 
    119             <Component Id="NSCA" Guid="8820A304-C596-4393-A72F-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    120               <File Id="NSCAAgentDLL" Name="NSCAAgent.dll" DiskId="1" Source="$(var.Source)/modules/NSCAAgent.dll" Vital="no" /> 
    121               <File Id="SchedulerDLL" Name="Scheduler.dll" DiskId="1" Source="$(var.Source)/modules/Scheduler.dll" Vital="no" /> 
    122             </Component> 
    123             <Component Id="Plugins" Guid="9B490E67-5472-4266-96DC-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    124               <!-- NOT PORTED MODULES ! 
     104            </File> 
     105          </Component> 
     106          <Directory Id="INSTALLLOCATION_SECURITY" Name="security"> 
     107            <Component Id="NRPEServerCert" Guid="5A0246F8-5167-45db-2E46-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     108              <File Id="NRPECert" Name="nrpe_dh_512.pem" DiskId="1" Source="$(var.Source)/security/nrpe_dh_512.pem" Vital="no"/> 
     109            </Component> 
     110          </Directory> 
     111          <Directory Id="INSTALLLOCATION_MODS" Name="modules"> 
     112            <Component Id="NRPEServer" Guid="5A0246F8-5167-45db-B246-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     113              <File Id="NRPEListenerDLL" Name="NRPEListener.dll" DiskId="1" Source="$(var.Source)/modules/NRPEServer.dll" Vital="no" /> 
     114              <File Id="NRPEClientDLL" Name="NRPEClient.dll" DiskId="1" Source="$(var.Source)/modules/NRPEClient.dll" Vital="no" /> 
     115            </Component> 
     116            <Component Id="NSCListener" Guid="6DAF8BB9-9A56-48f5-B2C5-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     117              <File Id="NSCListenerDLL" Name="NSClientListener.dll" DiskId="1" Source="$(var.Source)/modules/NSClientServer.dll" Vital="no" /> 
     118            </Component> 
     119            <Component Id="NSCA" Guid="8820A304-C596-4393-A72F-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     120              <File Id="NSCAAgentDLL" Name="NSCAAgent.dll" DiskId="1" Source="$(var.Source)/modules/NSCAAgent.dll" Vital="no" /> 
     121              <File Id="SchedulerDLL" Name="Scheduler.dll" DiskId="1" Source="$(var.Source)/modules/Scheduler.dll" Vital="no" /> 
     122            </Component> 
     123            <Component Id="PythonScript" Guid="8820A304-C696-4393-A72F-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     124              <File Id="PythonScript" Name="PythonScript.dll" DiskId="1" Source="$(var.Source)/modules/PythonScript.dll" Vital="no" /> 
     125            </Component> 
     126            <Component Id="Plugins" Guid="9B490E67-5472-4266-96DC-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     127              <!-- NOT PORTED MODULES ! 
    125128                <File Id="ModRemoteConfiguration.dll" Name="RmtCfg.dll" LongName="RemoteConfiguration.dll" DiskId="1" Source="$(var.Source)/modules/RemoteConfiguration.dll" Vital="no" /> 
    126129                <File Id="ModSysTray.dll" Name="SysTray.dll" LongName="SysTray.dll" DiskId="1" Source="$(var.Source)/modules/SysTray.dll" Vital="no" /> 
    127130                <File Id="A_DebugLogMetrics.dll" Name="ADebug.dll" LongName="A_DebugLogMetrics.dll" DiskId="1" Source="$(var.Source)/modules/A_DebugLogMetrics.dll" Vital="no" /> 
    128131              --> 
    129               <File Id="ModCheckEventLog.dll" Name="CheckEventLog.dll" DiskId="1" Source="$(var.Source)/modules/CheckEventLog.dll" Vital="no" /> 
    130               <File Id="ModCheckExternalScripts.dll" Name="CheckExternalScripts.dll" DiskId="1" Source="$(var.Source)/modules/CheckExternalScripts.dll" Vital="no" /> 
    131               <File Id="ModCheckHelpers.dll" Name="CheckHelpers.dll" DiskId="1" Source="$(var.Source)/modules/CheckHelpers.dll" Vital="no" /> 
    132               <File Id="ModCheckSystem.dll" Name="CheckSystem.dll" DiskId="1" Source="$(var.Source)/modules/CheckSystem.dll" Vital="no" /> 
    133               <File Id="ModCheckWMI.dll" Name="CheckWMI.dll" DiskId="1" Source="$(var.Source)/modules/CheckWMI.dll" Vital="no" /> 
    134               <File Id="ModFileLogger.dll" Name="FileLogger.dll" DiskId="1" Source="$(var.Source)/modules/FileLogger.dll" Vital="no" /> 
    135               <File Id="ModLUAScript.dll" Name="LUAScript.dll" DiskId="1" Source="$(var.Source)/modules/LUAScript.dll" Vital="no" /> 
    136               <File Id="ModCheckNSCP.dll" Name="CheckNSCP.dll" DiskId="1" Source="$(var.Source)/modules/CheckNSCP.dll" Vital="no" /> 
    137               <File Id="ModCheckDisk.dll" Name="CheckDisk.dll" DiskId="1" Source="$(var.Source)/modules/CheckDisk.dll" Vital="no" /> 
    138               <File Id="ModCheckTaskSched.dll" Name="CheckTaskSched.dll" DiskId="1" Source="$(var.Source)/modules/CheckTaskSched.dll" Vital="no" /> 
    139               <File Id="ModCheckTaskSched2.dll" Name="CheckTaskSched2.dll" DiskId="1" Source="$(var.Source)/modules/CheckTaskSched2.dll" Vital="no" /> 
    140             </Component> 
    141           </Directory> 
    142           <Directory Id="INSTALLLOCATION_SCRIPTS" Name="scripts"> 
    143             <Component Id="Scripts" Guid="9B490E67-5472-4268-96DF-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    144               <File Id="script001" Name="check_60s.bat" DiskId="1" Source="$(var.Source)/scripts/check_60s.bat" Vital="no" /> 
    145               <File Id="script002" Name="check_battery.vbs" DiskId="1" Source="$(var.Source)/scripts/check_battery.vbs" Vital="no" /> 
    146               <File Id="script003" Name="check_no_rdp.bat" DiskId="1" Source="$(var.Source)/scripts/check_no_rdp.bat" Vital="no" /> 
    147               <File Id="script004" Name="check_printer.vbs" DiskId="1" Source="$(var.Source)/scripts/check_printer.vbs" Vital="no" /> 
    148               <File Id="script005" Name="check_ok.bat" DiskId="1" Source="$(var.Source)/scripts/check_ok.bat" Vital="no" /> 
    149               <File Id="script006" Name="check_files.vbs" DiskId="1" Source="$(var.Source)/scripts/check_files.vbs" Vital="no" /> 
    150               <File Id="script007" Name="check_ping.bat" DiskId="1" Source="$(var.Source)/scripts/check_ping.bat" Vital="no" /> 
    151               <File Id="script008" Name="check_updates.vbs" DiskId="1" Source="$(var.Source)/scripts/check_updates.vbs" Vital="no" /> 
    152               <File Id="sample002" Name="check_test.ps1" DiskId="1" Source="$(var.Source)/scripts/check_test.ps1" Vital="no" /> 
    153               <File Id="sample003" Name="check_test.vbs" DiskId="1" Source="$(var.Source)/scripts/check_test.vbs" Vital="no" /> 
    154               <!-- 
     132              <File Id="ModCheckEventLog.dll" Name="CheckEventLog.dll" DiskId="1" Source="$(var.Source)/modules/CheckEventLog.dll" Vital="no" /> 
     133              <File Id="ModCheckExternalScripts.dll" Name="CheckExternalScripts.dll" DiskId="1" Source="$(var.Source)/modules/CheckExternalScripts.dll" Vital="no" /> 
     134              <File Id="ModCheckHelpers.dll" Name="CheckHelpers.dll" DiskId="1" Source="$(var.Source)/modules/CheckHelpers.dll" Vital="no" /> 
     135              <File Id="ModCheckSystem.dll" Name="CheckSystem.dll" DiskId="1" Source="$(var.Source)/modules/CheckSystem.dll" Vital="no" /> 
     136              <File Id="ModCheckWMI.dll" Name="CheckWMI.dll" DiskId="1" Source="$(var.Source)/modules/CheckWMI.dll" Vital="no" /> 
     137              <File Id="ModFileLogger.dll" Name="FileLogger.dll" DiskId="1" Source="$(var.Source)/modules/FileLogger.dll" Vital="no" /> 
     138              <File Id="ModLUAScript.dll" Name="LUAScript.dll" DiskId="1" Source="$(var.Source)/modules/LUAScript.dll" Vital="no" /> 
     139              <File Id="ModCheckNSCP.dll" Name="CheckNSCP.dll" DiskId="1" Source="$(var.Source)/modules/CheckNSCP.dll" Vital="no" /> 
     140              <File Id="ModCheckDisk.dll" Name="CheckDisk.dll" DiskId="1" Source="$(var.Source)/modules/CheckDisk.dll" Vital="no" /> 
     141              <File Id="ModCheckTaskSched.dll" Name="CheckTaskSched.dll" DiskId="1" Source="$(var.Source)/modules/CheckTaskSched.dll" Vital="no" /> 
     142              <File Id="ModCheckTaskSched2.dll" Name="CheckTaskSched2.dll" DiskId="1" Source="$(var.Source)/modules/CheckTaskSched2.dll" Vital="no" /> 
     143            </Component> 
     144          </Directory> 
     145          <Directory Id="INSTALLLOCATION_SCRIPTS" Name="scripts"> 
     146            <Component Id="Scripts" Guid="9B490E67-5472-4268-96DF-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     147              <File Id="script001" Name="check_60s.bat" DiskId="1" Source="$(var.Source)/scripts/check_60s.bat" Vital="no" /> 
     148              <File Id="script002" Name="check_battery.vbs" DiskId="1" Source="$(var.Source)/scripts/check_battery.vbs" Vital="no" /> 
     149              <File Id="script003" Name="check_no_rdp.bat" DiskId="1" Source="$(var.Source)/scripts/check_no_rdp.bat" Vital="no" /> 
     150              <File Id="script004" Name="check_printer.vbs" DiskId="1" Source="$(var.Source)/scripts/check_printer.vbs" Vital="no" /> 
     151              <File Id="script005" Name="check_ok.bat" DiskId="1" Source="$(var.Source)/scripts/check_ok.bat" Vital="no" /> 
     152              <File Id="script006" Name="check_files.vbs" DiskId="1" Source="$(var.Source)/scripts/check_files.vbs" Vital="no" /> 
     153              <File Id="script007" Name="check_ping.bat" DiskId="1" Source="$(var.Source)/scripts/check_ping.bat" Vital="no" /> 
     154              <File Id="script008" Name="check_updates.vbs" DiskId="1" Source="$(var.Source)/scripts/check_updates.vbs" Vital="no" /> 
     155              <File Id="sample002" Name="check_test.ps1" DiskId="1" Source="$(var.Source)/scripts/check_test.ps1" Vital="no" /> 
     156              <File Id="sample003" Name="check_test.vbs" DiskId="1" Source="$(var.Source)/scripts/check_test.vbs" Vital="no" /> 
     157              <!-- 
    155158                Scripts missing 
    156159              <File Id="lua001" Name="test.lua" LongName="test.lua" DiskId="1" Source="$(var.Source)/scripts/test.lua" Vital="no" /> 
    157160              --> 
    158             </Component> 
    159             <Directory Id="INSTALLLOCATION_SCRIPTS_LIB" Name="lib"> 
    160               <Component Id="ScriptLibs" Guid="9B490E67-5472-4267-96DF-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
    161                 <File Id="lib001" Name="NagiosPlugins.vbs" DiskId="1" Source="$(var.Source)/scripts/lib/NagiosPlugins.vbs" Vital="no" /> 
    162                 <File Id="lib002" Name="wrapper.vbs" DiskId="1" Source="$(var.Source)/scripts/lib/wrapper.vbs" Vital="no" /> 
    163               </Component> 
    164             </Directory> 
    165           </Directory> 
    166         </Directory> 
    167       </Directory> 
     161            </Component> 
     162            <Directory Id="INSTALLLOCATION_SCRIPTS_LIB" Name="lib"> 
     163              <Component Id="ScriptLibs" Guid="9B490E67-5472-4267-96DF-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     164                <File Id="lib001" Name="NagiosPlugins.vbs" DiskId="1" Source="$(var.Source)/scripts/lib/NagiosPlugins.vbs" Vital="no" /> 
     165                <File Id="lib002" Name="wrapper.vbs" DiskId="1" Source="$(var.Source)/scripts/lib/wrapper.vbs" Vital="no" /> 
     166              </Component> 
     167            </Directory> 
     168            <Directory Id="INSTALLLOCATION_SCRIPTS_PYTHON" Name="python"> 
     169              <Component Id="PythonScripts" Guid="8820A304-C697-4393-A72F-$(var.Postfix.GUID)" Win64="$(var.Win64)"> 
     170                <File Id="P_script_001" Name="test.py" DiskId="1" Source="$(var.Source)/scripts/python/test.py" Vital="no" /> 
     171                <File Id="P_script_002" Name="test_second.py" DiskId="1" Source="$(var.Source)/scripts/python/test_second.py" Vital="no" /> 
     172              </Component> 
     173            </Directory> 
     174          </Directory> 
     175        </Directory> 
     176      </Directory> 
    168177 
    169178      <!-- ### Start Menu Items ### --> 
     
    197206          <ComponentRef Id="NSCListener" /> 
    198207        </Feature> 
    199         <Feature Id="NSCAPlugin" Title="NSCA plugin" Description="Plugin to submit passive results to an NSCA server" Level="1" Absent="disallow"> 
    200           <ComponentRef Id="NSCA" /> 
    201         </Feature> 
    202         <Feature Id="SampleScripts" Title="Sample Scripts" Description="Some sample client-side scripts to use with NRPE" Level="1" Absent="disallow"> 
     208        <Feature Id="NSCAPlugin" Title="NSCA plugin" Description="Plugin to submit passive results to an NSCA server" Level="1" Absent="disallow"> 
     209          <ComponentRef Id="NSCA" /> 
     210        </Feature> 
     211        <Feature Id="PythonScript" Title="Python Scripting" Description="Python scripting requires python to be installed)" Level="1" Absent="disallow"> 
     212          <ComponentRef Id="PythonScript" /> 
     213          <ComponentRef Id="PythonScripts" /> 
     214        </Feature> 
     215        <Feature Id="SampleScripts" Title="Sample Scripts" Description="Some sample client-side scripts to use with NRPE" Level="1" Absent="disallow"> 
    203216          <ComponentRef Id="Scripts" /> 
    204217          <ComponentRef Id="ScriptLibs" /> 
  • helpers/settings_manager/CMakeLists.txt

    r3bdaf18 r04ef932  
    3737  ) 
    3838ENDIF(WIN32) 
     39 
     40ADD_DEFINITIONS(${NSCP_GLOBAL_DEFINES}) 
     41 
    3942add_library (${TARGET} ${service_SRCS}) 
    4043 
  • include/file_helpers.hpp

    rd66ccee r04ef932  
    4040    } 
    4141    static std::wstring get_filename(boost::filesystem::wpath path) { 
    42       return path.leaf(); 
     42      return path.filename(); 
    4343    } 
    4444    static std::wstring get_path(std::wstring file) { 
     
    4848    static std::wstring get_filename(std::wstring file) { 
    4949      boost::filesystem::wpath path = file; 
    50       return path.leaf(); 
     50      return path.filename(); 
    5151    } 
    5252  }; 
     
    5959      if (boost::filesystem::is_directory(path)) 
    6060        return pattern_type(path, _T("")); 
    61       return pattern_type(path.branch_path(), path.leaf() /*filename()*/); 
     61      return pattern_type(path.branch_path(), path.filename()); 
    6262    } 
    6363    static pattern_type split_path_ex(std::wstring path) { 
  • include/nsca/nsca_packet.hpp

    rd66ccee r04ef932  
    153153      data->crc32_value= swap_bytes::hton<u_int32_t>(0); 
    154154 
    155       ZeroMemory(data->get_host_ptr(), host.size()+1); 
     155      memset(data->get_host_ptr(), 0, host.size()+1); 
    156156      host.copy(data->get_host_ptr(), host.size()); 
    157       ZeroMemory(data->get_desc_ptr(nsca::length::host_length), service.size()+1); 
     157      memset(data->get_desc_ptr(nsca::length::host_length), 0, service.size()+1); 
    158158      service.copy(data->get_desc_ptr(nsca::length::host_length), service.size()); 
    159       ZeroMemory(data->get_result_ptr(nsca::length::host_length, nsca::length::desc_length), result.size()+1); 
     159      memset(data->get_result_ptr(nsca::length::host_length, nsca::length::desc_length), 0, result.size()+1); 
    160160      result.copy(data->get_result_ptr(nsca::length::host_length, nsca::length::desc_length), result.size()); 
    161161 
  • include/nscapi/functions.hpp

    r7ec3dd1 r04ef932  
    141141      boost::tokenizer<boost::escaped_list_separator<wchar_t>, std::wstring::const_iterator, std::wstring> tok(perf, boost::escaped_list_separator<wchar_t>(L'\\', L' ', L'\'')); 
    142142      BOOST_FOREACH(std::wstring s, tok) { 
     143        if (s.size() == 0) 
     144          break; 
    143145        strEx::splitVector items = strEx::splitV(s, _T(";")); 
    144         if (items.size() < 3) 
     146        if (items.size() < 1) { 
     147          ::PluginCommand::PerformanceData* perfData = resp->add_perf(); 
     148          perfData->set_type(PluginCommand::PerformanceData_Type_STRING); 
     149          std::pair<std::wstring,std::wstring> fitem = strEx::split(_T(""), _T("=")); 
     150          perfData->set_alias("invalid"); 
     151          ::PluginCommand::PerformanceData_StringValue* stringPerfData = perfData->mutable_string_value(); 
     152          stringPerfData->set_value("invalid performance data"); 
    145153          break; 
     154        } 
    146155 
    147156        ::PluginCommand::PerformanceData* perfData = resp->add_perf(); 
     
    158167          floatPerfData->set_unit(to_string(fitem.second.substr(pend))); 
    159168        } 
    160         floatPerfData->set_warning(trim_to_double(items[1])); 
    161         floatPerfData->set_critical(trim_to_double(items[2])); 
     169        if (items.size() > 2) { 
     170          floatPerfData->set_warning(trim_to_double(items[1])); 
     171          floatPerfData->set_critical(trim_to_double(items[2])); 
     172        } 
    162173        if (items.size() >= 5) { 
    163174          floatPerfData->set_minimum(trim_to_double(items[3])); 
     
    165176        } 
    166177      } 
     178//      std::wcout << _T("Converting performance data") << perf << _T(" -- ") << utf8::cvt<std::wstring>(build_performance_data(*resp)) << std::endl; 
    167179    } 
    168180    static std::string build_performance_data(::PluginCommand::Response const &payload) { 
  • include/nscapi/nscapi_core_wrapper.cpp

    r7ec3dd1 r04ef932  
    184184  message.SerializeToString(&request); 
    185185 
     186  return InjectCommand(command.c_str(), request, result); 
     187} 
     188 
     189NSCAPI::nagiosReturn nscapi::core_wrapper::InjectCommand(const std::wstring command, std::string request, std::string & result)  
     190{ 
     191  if (!fNSAPIInject) 
     192    throw nscapi::nscapi_exception(_T("NSCore has not been initiated...")); 
    186193  char *buffer = NULL; 
    187194  unsigned int buffer_size = 0; 
    188  
    189195  NSCAPI::nagiosReturn retC = InjectCommandRAW(command.c_str(), request.c_str(), request.size(), &buffer, &buffer_size); 
    190196 
     
    209215  return retC; 
    210216} 
    211  
    212217/** 
    213218 * A wrapper around the InjetCommand that is simpler to use. 
  • include/nscapi/nscapi_core_wrapper.hpp

    rd66ccee r04ef932  
    134134    NSCAPI::nagiosReturn InjectCommandRAW(const wchar_t* command, const char *request, const unsigned int request_len, char **response, unsigned int *response_len); 
    135135    void DestroyBuffer(char**buffer); 
     136    NSCAPI::nagiosReturn InjectCommand(const std::wstring command, std::string request, std::string & result); 
    136137    NSCAPI::nagiosReturn InjectCommand(const std::wstring command, const std::list<std::wstring> argument, std::string & result); 
    137138    NSCAPI::nagiosReturn InjectSimpleCommand(const std::wstring command, const std::list<std::wstring> argument, std::wstring & message, std::wstring & perf); 
  • include/parsers/helpers.cpp

    r1f24a1c r04ef932  
    11#include <parsers/helpers.hpp> 
    22 
    3 #include <time.h> 
     3#include <boost/date_time.hpp> 
    44 
    55namespace parsers { 
     
    1010      return now; 
    1111    } 
     12    namespace pt = boost::posix_time; 
     13    namespace gt = boost::gregorian; 
     14    namespace dt = boost::date_time; 
     15 
     16    inline std::time_t to_time_t(pt::ptime t) {  
     17      if( t == dt::neg_infin )  
     18        return 0;  
     19      else if( t == dt::pos_infin )  
     20        return LONG_MAX;  
     21      pt::ptime start(gt::date(1970,1,1));  
     22      return (t-start).total_seconds();  
     23    }  
     24 
     25 
     26 
    1227    void constants::reset() { 
    13       __time64_t utctime; 
    14       _time64(&utctime); 
    15       now = utctime; 
     28      now = to_time_t(pt::second_clock::local_time()); 
     29//      __time64_t utctime; 
     30//      _time64(&utctime); 
     31//      now = utctime; 
    1632//      struct tm localtime; 
    1733//      _localtime64_s(&localtime, &utctime); 
  • include/parsers/where.cpp

    re11d494 r04ef932  
    1 #pragma once 
    2  
    31#include <list> 
    42#include <iostream>  
  • include/socket_helpers.hpp

    rd66ccee r04ef932  
    126126    void read_with_timeout(AsyncReadStream& sock, RawSocket& rawSocket, const MutableBufferSequence& buffers, boost::posix_time::time_duration duration) { 
    127127      boost::optional<boost::system::error_code> timer_result; 
    128       boost::asio::deadline_timer timer(sock.io_service()); 
     128      boost::asio::deadline_timer timer(sock.get_io_service()); 
    129129      timer.expires_from_now(duration); 
    130130      timer.async_wait(boost::bind(set_result, &timer_result, _1)); 
     
    133133      async_read(sock, buffers, boost::bind(set_result, &read_result, _1)); 
    134134 
    135       sock.io_service().reset(); 
    136       while (sock.io_service().run_one()) { 
     135      sock.get_io_service().reset(); 
     136      while (sock.get_io_service().run_one()) { 
    137137        if (read_result) 
    138138          timer.cancel(); 
     
    148148    void write_with_timeout(AsyncWriteStream& sock, RawSocket& rawSocket, const MutableBufferSequence& buffers, boost::posix_time::time_duration duration) { 
    149149      boost::optional<boost::system::error_code> timer_result; 
    150       boost::asio::deadline_timer timer(sock.io_service()); 
     150      boost::asio::deadline_timer timer(sock.get_io_service()); 
    151151      timer.expires_from_now(duration); 
    152152      timer.async_wait(boost::bind(set_result, &timer_result, _1)); 
     
    155155      async_write(sock, buffers, boost::bind(set_result, &read_result, _1)); 
    156156 
    157       sock.io_service().reset(); 
    158       while (sock.io_service().run_one()) { 
     157      sock.get_io_service().reset(); 
     158      while (sock.get_io_service().run_one()) { 
    159159        if (read_result) 
    160160          timer.cancel(); 
  • include/strEx.h

    r3bdaf18 r04ef932  
    3636#include <cctype> 
    3737 
     38#ifdef __GNUC__ 
     39#include <iconv.h> 
     40#include <errno.h> 
     41#endif 
     42 
    3843#include <boost/lexical_cast.hpp> 
    3944#include <boost/date_time.hpp> 
     
    817822  } 
    818823} 
    819  
     824/* 
     825#ifdef __GNUC__ 
     826size_t Wcslen(const wchar_t*w) 
     827{ 
     828  size_t size=0; 
     829  while (*w++) 
     830    size++; 
     831  return size; 
     832} 
     833#endif 
     834#ifdef WIN32 
     835#define Wcslen wcslen 
     836#endif 
     837*/ 
    820838namespace utf8 { 
    821839  /** Converts a std::wstring into a std::string with UTF-8 encoding. */ 
     
    853871    WideCharToMultiByte(CP_UTF8, 0, str.c_str(), static_cast<int>(str.length()), const_cast<char*>(buf.c_str()), nChars, NULL, NULL); 
    854872    return buf; 
     873#else 
     874    size_t wideSize = sizeof(wchar_t)*str.length(); 
     875    size_t outbytesLeft = wideSize+sizeof(char); //We cannot know how many wide character there is yet 
     876 
     877    //Copy the instring 
     878    char *inString = (char*)new wchar_t[str.length()+1]; 
     879    memcpy(inString, str.c_str(), wideSize+sizeof(wchar_t)); 
     880 
     881    //Create buffer for output 
     882    char *outString = new char[outbytesLeft]; 
     883    memset(outString, 0, sizeof(char)*(outbytesLeft)); 
     884 
     885    char *inPointer = inString; 
     886    char *outPointer = outString; 
     887 
     888    iconv_t convDesc = iconv_open("UTF-8", "WCHAR_T"); 
     889    iconv(convDesc, &inPointer, &wideSize, &outPointer, &outbytesLeft); 
     890    iconv_close(convDesc); 
     891 
     892    std::string retval(outString); 
     893 
     894    //Cleanup 
     895    delete[] inString; 
     896    delete[] outString; 
     897 
     898    return retval; 
    855899#endif 
    856900  } 
     
    870914    MultiByteToWideChar(CP_UTF8, 0, str.c_str(), static_cast<int>(str.length()), const_cast<wchar_t*>(buf.c_str()), nChars); 
    871915    return buf; 
     916#else 
     917    size_t utf8Length = str.length(); 
     918    size_t outbytesLeft = utf8Length*sizeof(wchar_t); 
     919 
     920    //Copy the instring 
     921    char *inString = new char[str.length()+1]; 
     922    strcpy(inString, str.c_str()); 
     923 
     924    //Create buffer for output 
     925    char *outString = (char*)new wchar_t[utf8Length+1]; 
     926    memset(outString, 0, sizeof(wchar_t)*(utf8Length+1)); 
     927 
     928    char *inPointer = inString; 
     929    char *outPointer = outString; 
     930 
     931    iconv_t convDesc = iconv_open("WCHAR_T", "UTF-8"); 
     932    iconv(convDesc, &inPointer, &utf8Length, &outPointer, &outbytesLeft); 
     933    iconv_close(convDesc); 
     934 
     935    std::wstring retval( (wchar_t *)outString ); 
     936 
     937    //Cleanup 
     938    delete[] inString; 
     939    delete[] outString; 
     940 
     941    return retval; 
    872942#endif 
    873943  } 
  • include/unicode_char.hpp

    rd66ccee r04ef932  
    1111#define _T(x) L ## x 
    1212#endif 
    13  
     13#include <unicode/ustring.h> 
    1414#endif 
    1515 
    16 #include <unicode/ustring.h> 
  • libs/protobuf/log.proto.h

    re11d494 r04ef932  
    11#pragma once 
    22 
    3 #include "D:/source/nscp/build/x64/libs/protobuf/log.pb.h" 
     3#include "/mnt/nscp/build/linux/libs/protobuf/log.pb.h" 
    44 
  • modules/CheckNSCP/CheckNSCP.cpp

    re11d494 r04ef932  
    2222 
    2323#include <file_helpers.hpp> 
     24#include <unicode_char.hpp> 
    2425 
    2526#include <settings/client/settings_client.hpp> 
     
    8586 
    8687int CheckNSCP::get_crashes(std::wstring &last_crash) { 
     88#ifdef WIN32 
    8789  if (!file_helpers::checks::is_directory(crashFolder)) { 
    8890    return 0; 
     
    109111    last_crash = last_file; 
    110112  return count; 
     113#else 
     114  return 0; 
     115#endif 
    111116} 
    112117 
     
    125130  std::wstring last_crash; 
    126131  int crash_count = get_crashes(last_crash); 
    127   if (crash_count > 0) 
    128     strEx::append_list(msg, strEx::itos(crash_count) + _T(" crash(es), last crash: ") + last_crash, _T(", ")); 
     132  if (crash_count > 0){ 
     133    std::wstring tmp = strEx::itos(crash_count) + _T(" crash(es), last crash: ") + last_crash; 
     134    strEx::append_list(msg, tmp, _T(", ")); 
     135  } 
    129136 
    130137  std::wstring last_error; 
    131138  int err_count = get_errors(last_error); 
    132   if (err_count > 0) 
    133     strEx::append_list(msg, strEx::itos(err_count) + _T(" error(s), last error: ") + last_error, _T(", ")); 
     139  if (err_count > 0) { 
     140    std::wstring tmp = strEx::itos(err_count) + _T(" error(s), last error: ") + last_error; 
     141    strEx::append_list(msg, tmp, _T(", ")); 
     142  } 
    134143 
    135144  if (msg.empty()) 
  • modules/LUAScript/LUAScript.cpp

    rd66ccee r04ef932  
    4646  try { 
    4747 
     48    root_ = get_core()->getBasePath(); 
     49 
    4850    sh::settings_registry settings(get_settings_proxy()); 
    4951    settings.set_alias(alias, _T("lua")); 
     
    5254      (_T("LUA SCRIPT SECTION"), _T("Section for the LUAScripts module.")) 
    5355 
    54       (_T("scripts"), sh::fun_values_path(boost::bind(&LUAScript::loadScript, this, _1)),  
     56      (_T("scripts"), sh::fun_values_path(boost::bind(&LUAScript::loadScript, this, _1, _2)),  
    5557      _T("LUA SCRIPTS SECTION"), _T("A list of scripts available to run from the LuaSCript module.")) 
    5658      ; 
     
    6264//      addAllScriptsFrom(scriptDirectory_); 
    6365//    } 
    64     root_ = get_core()->getBasePath(); 
     66 
     67 
     68 
     69 
     70    BOOST_FOREACH(script_container &script, scripts_) { 
     71      try { 
     72        boost::shared_ptr<script_wrapper::lua_script> instance = boost::shared_ptr<script_wrapper::lua_script>(new script_wrapper::lua_script(script)); 
     73        instance->pre_load(this); 
     74        instances_.push_back(instance); 
     75      } catch (script_wrapper::LUAException e) { 
     76        NSC_LOG_ERROR_STD(_T("Could not load script ") + script.to_wstring() + _T(": ") + e.getMessage()); 
     77      } 
     78    } 
    6579 
    6680    //  } catch (nrpe::server::nrpe_exception &e) { 
     
    8195 
    8296void LUAScript::register_command(script_wrapper::lua_script* script, std::wstring command, std::wstring function) { 
    83   NSC_LOG_MESSAGE(_T("Script loading: ") + script->get_script() + _T(": ") + command); 
     97  NSC_LOG_MESSAGE(_T("Script loading: ") + script->get_wscript() + _T(": ") + command); 
    8498  commands_[command] = lua_func(script, function); 
    8599} 
    86100 
    87 bool LUAScript::loadScript(const std::wstring file) { 
     101boost::optional<boost::filesystem::wpath> LUAScript::find_file(std::wstring file) { 
     102  std::list<boost::filesystem::wpath> checks; 
     103  checks.push_back(file); 
     104  checks.push_back(root_ / _T("scripts") / _T("lua") / file); 
     105  checks.push_back(root_ / _T("scripts") / file); 
     106  checks.push_back(root_ / _T("lua") / file); 
     107  checks.push_back(root_ / file); 
     108  BOOST_FOREACH(boost::filesystem::wpath c, checks) { 
     109    NSC_DEBUG_MSG_STD(_T("Looking for: ") + c.string()); 
     110    if (boost::filesystem::exists(c)) 
     111      return boost::optional<boost::filesystem::wpath>(c); 
     112  } 
     113  NSC_LOG_ERROR(_T("Script not found: ") + file); 
     114  return boost::optional<boost::filesystem::wpath>(); 
     115} 
     116 
     117bool LUAScript::loadScript(std::wstring alias, std::wstring file) { 
    88118  try { 
    89     std::wstring file_ = file; 
     119    if (file.empty()) { 
     120      file = alias; 
     121      alias = _T(""); 
     122    } 
    90123 
    91     if (!file_helpers::checks::exists(file_)) { 
    92       file_ = root_ + file; 
    93       if (!file_helpers::checks::exists(file_)) { 
    94         NSC_LOG_ERROR(_T("Script not found: ") + file + _T(" (") + file_ + _T(")")); 
    95         return false; 
    96       } 
    97     } 
    98     NSC_DEBUG_MSG_STD(_T("Loading script: ") + file + _T(" (") + file_ + _T(")")); 
    99     script_wrapper::lua_script *script = new script_wrapper::lua_script(file_); 
    100     script->pre_load(this); 
    101     scripts_.push_back(script); 
     124    boost::optional<boost::filesystem::wpath> ofile = find_file(file); 
     125    if (!ofile) 
     126      return false; 
     127    script_container::push(scripts_, alias, *ofile); 
     128    NSC_DEBUG_MSG_STD(_T("Adding script: ") + ofile->string() + _T(" as ") + alias + _T(")")); 
    102129    return true; 
    103   } catch (script_wrapper::LUAException e) { 
    104     NSC_LOG_ERROR_STD(_T("Could not load script: ") + file + _T(", ") + e.getMessage()); 
    105130  } catch (...) { 
    106131    NSC_LOG_ERROR_STD(_T("Could not load script: (Unknown exception) ") + file); 
     
    111136 
    112137bool LUAScript::unloadModule() { 
    113   for (script_list::const_iterator cit = scripts_.begin(); cit != scripts_.end() ; ++cit) { 
    114     delete (*cit); 
    115   } 
    116   scripts_.clear(); 
     138  instances_.clear(); 
    117139  return true; 
    118140} 
     
    129151  bool error = false; 
    130152  commands_.clear(); 
    131   for (script_list::const_iterator cit = scripts_.begin(); cit != scripts_.end() ; ++cit) { 
     153  for (script_list::const_iterator cit = instances_.begin(); cit != instances_.end() ; ++cit) { 
    132154    try { 
    133155      (*cit)->reload(this); 
    134156    } catch (script_wrapper::LUAException e) { 
    135157      error = true; 
    136       message += _T("Exception when reloading script: ") + (*cit)->get_script() + _T(": ") + e.getMessage(); 
    137       NSC_LOG_ERROR_STD(_T("Exception when reloading script: ") + (*cit)->get_script() + _T(": ") + e.getMessage()); 
     158      message += _T("Exception when reloading script: ") + (*cit)->get_wscript() + _T(": ") + e.getMessage(); 
     159      NSC_LOG_ERROR_STD(_T("Exception when reloading script: ") + (*cit)->get_wscript() + _T(": ") + e.getMessage()); 
    138160    } catch (...) { 
    139161      error = true; 
    140       message += _T("Unhandeled Exception when reloading script: ") + (*cit)->get_script(); 
    141       NSC_LOG_ERROR_STD(_T("Unhandeled Exception when reloading script: ") + (*cit)->get_script()); 
     162      message += _T("Unhandeled Exception when reloading script: ") + (*cit)->get_wscript(); 
     163      NSC_LOG_ERROR_STD(_T("Unhandeled Exception when reloading script: ") + (*cit)->get_wscript()); 
    142164    } 
    143165  } 
  • modules/LUAScript/LUAScript.h

    r3bdaf18 r04ef932  
    2626#include "script_wrapper.hpp" 
    2727 
     28#include <boost/optional.hpp> 
     29 
     30#include <scripts/functions.hpp> 
     31 
     32 
    2833class LUAScript : public nscapi::impl::SimpleCommand, public script_wrapper::lua_handler, public nscapi::impl::simple_plugin { 
    2934private: 
     
    4146  }; 
    4247 
     48  script_container::list_type scripts_; 
     49 
    4350  typedef std::map<std::wstring,lua_func> cmd_list; 
    44   typedef std::list<script_wrapper::lua_script*> script_list; 
     51  typedef std::list<boost::shared_ptr<script_wrapper::lua_script> > script_list; 
    4552 
    4653  cmd_list commands_; 
    47   script_list scripts_; 
    48   std::wstring root_; 
     54  script_list instances_; 
     55  boost::filesystem::wpath root_; 
    4956 
    5057public: 
     
    7178  bool hasCommandHandler(); 
    7279  bool hasMessageHandler(); 
    73   bool loadScript(const std::wstring script); 
     80  boost::optional<boost::filesystem::wpath> find_file(std::wstring file); 
     81  bool loadScript(std::wstring alias, std::wstring file); 
    7482  NSCAPI::nagiosReturn handleCommand(const std::wstring command, std::list<std::wstring> arguments, std::wstring &message, std::wstring &perf); 
    7583  //NSCAPI::nagiosReturn RunLUA(const unsigned int argLen, wchar_t **char_args, std::wstring &message, std::wstring &perf); 
  • modules/LUAScript/script_wrapper.hpp

    rd66ccee r04ef932  
    1010#include "luna.h" 
    1111 
     12#include <scripts/functions.hpp> 
    1213 
    1314namespace script_wrapper { 
     
    304305  class lua_script { 
    305306    Lua_State L; 
    306     std::wstring script_; 
    307   public: 
    308     lua_script(const std::wstring file) : script_(file) { 
     307    std::string script_; 
     308    std::string alias_; 
     309  public: 
     310    lua_script(const script_container &script) : script_(utf8::cvt<std::string>(script.script.string())), alias_(utf8::cvt<std::string>(script.alias)) { 
    309311      load(); 
    310312    } 
     
    312314      luaL_openlibs(L); 
    313315      nsclient_wrapper::luaopen(L); 
    314       //Luna<Account>::Register(L); 
    315       //lua_register(L, "register_command", register_command); 
    316  
    317       if (luaL_loadfile(L, strEx::wstring_to_string(script_).c_str()) != 0) { 
    318         throw LUAException(_T("Failed to load script: ") + script_ + _T(": ") + s2w(lua_tostring(L, -1))); 
    319       } 
    320  
    321     } 
    322     std::wstring get_script() const { 
     316      if (luaL_loadfile(L, script_.c_str()) != 0) { 
     317        throw LUAException(_T("Failed to load script: ") + get_wscript() + _T(": ") + s2w(lua_tostring(L, -1))); 
     318      } 
     319 
     320    } 
     321    std::wstring get_wscript() const { 
     322      return utf8::cvt<std::wstring>(script_); 
     323    } 
     324    std::string get_script() const { 
    323325      return script_; 
    324326    } 
     
    333335      lua_manager::set_script(L, this); 
    334336      if (lua_pcall(L, 0, 0, 0) != 0) { 
    335         throw LUAException(_T("Failed to parse script: ") + script_ + _T(": ") + s2w(lua_tostring(L, -1))); 
     337        throw LUAException(_T("Failed to parse script: ") + get_wscript() + _T(": ") + s2w(lua_tostring(L, -1))); 
    336338      } 
    337339    } 
     
    368370      if (!lua_isfunction(L, -1)) { 
    369371        lua_pop(L, 1); // remove function from LUA stack 
    370         throw LUAException(_T("Failed to run script: ") + script_ + _T(": Function not found: handle")); 
     372        throw LUAException(_T("Failed to run script: ") + get_wscript() + _T(": Function not found: handle")); 
    371373      } 
    372374      lua_pushstring(L, w2s(cmd).c_str());  
     
    382384      if (lua_pcall(L, 2, LUA_MULTRET, 0) != 0) { 
    383385        std::wstring err = strEx::string_to_wstring(lua_tostring(L, -1)); 
    384         NSC_LOG_ERROR_STD(_T("Failed to call main function in script: ") + script_ + _T(": ") + err); 
     386        NSC_LOG_ERROR_STD(_T("Failed to call main function in script: ") + get_wscript() + _T(": ") + err); 
    385387        lua_pop(L, 1); // remove error message 
    386388        return NSCAPI::returnUNKNOWN; 
  • modules/NRPEClient/CMakeLists.txt

    rd66ccee r04ef932  
    3030 
    3131add_library(${TARGET} MODULE ${SRCS}) 
     32INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) 
    3233 
    3334target_link_libraries(${TARGET} 
  • modules/NRPEServer/CMakeLists.txt

    rd66ccee r04ef932  
    4444 
    4545add_library(${TARGET} MODULE ${SRCS}) 
     46INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) 
    4647 
    4748target_link_libraries(${TARGET} 
  • modules/NSCAAgent/CMakeLists.txt

    rd66ccee r04ef932  
    3838 
    3939add_library(${TARGET} MODULE ${SRCS}) 
     40INCLUDE_DIRECTORIES(${OPENSSL_INCLUDE_DIR}) 
    4041 
    4142target_link_libraries(${TARGET} 
  • scripts/CMakeLists.txt

    r7ec3dd1 r04ef932  
    55FILE (GLOB scripts_PS1 "*.ps1") 
    66FILE (GLOB scripts_LIB "lib/*.vbs") 
     7FILE (GLOB scripts_PYT "python/*.py") 
     8FILE (GLOB scripts_LUA "lua/*.lua") 
    79 
    810SET(script_ALL ${scripts_BAT} ${scripts_VBS} ${scripts_PS1}) 
     
    2022  copy_single_file("script lib" lib/${filename} scripts/lib) 
    2123ENDFOREACH(file ${scripts_LIB}) 
     24 
     25FOREACH(file ${scripts_PYT}) 
     26  get_filename_component(filename ${file} NAME) 
     27  #MESSAGE(STATUS " + lib - ${filename}") 
     28  copy_single_file("script python" python/${filename} scripts/python) 
     29ENDFOREACH(file ${scripts_PYT}) 
     30 
     31FOREACH(file ${scripts_LUA}) 
     32  get_filename_component(filename ${file} NAME) 
     33  #MESSAGE(STATUS " + lib - ${filename}") 
     34  copy_single_file("script lua" lua/${filename} lua/python) 
     35ENDFOREACH(file ${scripts_LUA}) 
  • service/CMakeLists.txt

    r7ec3dd1 r04ef932  
    8585ENDIF(BREAKPAD_FOUND) 
    8686 
     87ADD_DEFINITIONS(${NSCP_GLOBAL_DEFINES}) 
     88 
    8789add_executable (${TARGET} ${service_SRCS}) 
    8890 
    89 MESSAGE(STATUS "Extra: ${EXTRA_LIBS}") 
     91MESSAGE(STATUS "All libraries: ${Boost_FILESYSTEM_LIBRARY}, ${NSCP_DEF_PLUGIN_LIB}, ${EXTRA_LIBS}") 
    9092 
    9193target_link_libraries(${TARGET} 
  • service/NSCPlugin.cpp

    r1ecd26f r04ef932  
    446446 
    447447bool NSCPlugin::is_duplicate( boost::filesystem::wpath file, std::wstring alias ) { 
    448   if (alias.empty()) 
     448  if (alias.empty() && alias_.empty()) 
    449449    return module_.get_file() == dll::dll::fix_module_name(file); 
    450   return module_.get_file() == dll::dll::fix_module_name(file) || alias == alias_; 
    451 } 
     450  if (alias.empty() || alias_.empty()) 
     451    return false; 
     452  return module_.get_file() == dll::dll::fix_module_name(file) && alias == alias_; 
     453} 
  • service/NSClient++.cpp

    r7ec3dd1 r04ef932  
    390390 
    391391  settings::string_list list = settings_manager::get_settings()->get_keys(MAIN_MODULES_SECTION); 
    392   BOOST_FOREACH(std::wstring key, list) { 
    393     std::wstring val = settings_manager::get_settings()->get_string(MAIN_MODULES_SECTION, key); 
    394     if ((key.length() > 4) && (key.substr(key.length()-4) == _T(".dll")) ) 
    395       key = key.substr(0, key.length()-4); 
    396     if (val.empty() || val == _T("enabled")) { 
    397       ret.insert(plugin_alias_list_type::value_type(_T(""), key)); 
    398     } else if (val == _T("disabled") && !active) { 
    399       ret.insert(plugin_alias_list_type::value_type(_T("disabled"), key)); 
    400     } else if (val == _T("disabled")) { 
    401     } else { 
    402       ret.insert(plugin_alias_list_type::value_type(key, val)); 
    403     } 
     392  BOOST_FOREACH(std::wstring plugin, list) { 
     393    std::wstring alias = settings_manager::get_settings()->get_string(MAIN_MODULES_SECTION, plugin); 
     394    if (plugin == _T("enabled")) { 
     395      plugin = alias; 
     396      alias = _T(""); 
     397    } else if ((active && plugin == _T("disabled")) || (active && alias == _T("disabled"))) 
     398      continue; 
     399    else if (plugin == _T("disabled")) { 
     400      plugin = alias; 
     401      alias = _T(""); 
     402    } else if (alias == _T("disabled")) { 
     403      alias = _T(""); 
     404    } 
     405    if (!alias.empty()) { 
     406      std::wstring tmp = plugin; 
     407      plugin = alias; 
     408      alias = tmp; 
     409    } 
     410    LOG_DEBUG_CORE_STD(_T("Found: ") + plugin + _T(" as ") + alias); 
     411    if (plugin.length() > 4 && plugin.substr(plugin.length()-4) == _T(".dll")) 
     412      plugin = plugin.substr(0, plugin.length()-4); 
     413    ret.insert(plugin_alias_list_type::value_type(alias, plugin)); 
    404414  } 
    405415  if (!active) { 
     
    459469    BOOST_FOREACH(v, plugins) { 
    460470      try { 
    461         addPlugin(pluginPath / v.second, _T("")); 
     471        addPlugin(pluginPath / v.second, v.first); 
    462472      } catch (NSPluginException &e) { 
    463473        LOG_CRITICAL_CORE_STD(_T("Failed to register plugin: ") + e.what()); 
     
    974984NSClientT::plugin_type NSClientT::addPlugin(boost::filesystem::wpath file, std::wstring alias) { 
    975985  { 
    976     LOG_DEBUG_CORE_STD(_T("addPlugin(") + file.string() + _T(", ") + alias + _T(")")); 
     986    LOG_DEBUG_CORE_STD(_T("addPlugin(") + file.string() + _T(" as ") + alias + _T(")")); 
    977987    // Check if this is a duplicate plugin (if so return that instance) 
    978988    boost::unique_lock<boost::shared_mutex> writeLock(m_mutexRW, boost::get_system_time() + boost::posix_time::seconds(10)); 
  • service/settings_logger_impl.cpp

    r1ecd26f r04ef932  
    1 #pragma once 
    2  
    31#include "settings_logger_impl.hpp" 
    42#include "NSClient++.h" 
  • service/simple_client.hpp

    r7ec3dd1 r04ef932  
    4343          break; 
    4444        } else if (s == _T("plugins")) { 
    45           log(_T("Listing plugins...")); 
     45          log(_T("Plugins: ")); 
    4646          core_->listPlugins(); 
    47         } else if (s == _T("list")) { 
    48           log(_T("Listing commands...")); 
     47        } else if (s == _T("list") || s == _T("commands")) { 
     48          log(_T("Commands:")); 
    4949          std::list<std::wstring> lst = core_->list_commands(); 
    5050          for (std::list<std::wstring>::const_iterator cit = lst.begin(); cit!=lst.end();++cit) 
    51             std::wcout << *cit << _T(": ") << core_->describeCommand(*cit) << std::endl; 
    52           log(_T("Listing commands...Done")); 
     51            log(_T("| ") + *cit + _T(": ") + core_->describeCommand(*cit)); 
    5352        } else if (s == _T("debug off")) { 
    5453          log(_T("Setting debug log off...")); 
  • tools/error_reporter/CMakeLists.txt

    rd66ccee r04ef932  
    33SET(TARGET reporter) 
    44 
    5 PROJECT(reporter) 
     5IF(BREAKPAD_FOUND) 
     6  PROJECT(reporter) 
    67 
    7 ADD_DEFINITIONS(${NSCP_GLOBAL_DEFINES}) 
     8  ADD_DEFINITIONS(${NSCP_GLOBAL_DEFINES}) 
    89 
    9 SET(reporter_SRCS 
    10   StdAfx.cpp 
    11   reporter.cpp 
    12 ) 
     10  SET(reporter_SRCS 
     11    StdAfx.cpp 
     12    reporter.cpp 
     13  ) 
    1314 
    14 IF(WIN32) 
    15   SET(reporter_SRCS ${reporter_SRCS} 
    16     ${NSCP_INCLUDEDIR}/ServiceCmd.cpp 
    17      
    18 # /breakpad//common 
    19 # /breakpad//crash_report_sender 
     15  IF(WIN32) 
     16    SET(reporter_SRCS ${reporter_SRCS} 
     17      ${NSCP_INCLUDEDIR}/ServiceCmd.cpp 
     18       
     19  # /breakpad//common 
     20  # /breakpad//crash_report_sender 
    2021 
    21     reporter.h 
    22     StdAfx.h 
     22      reporter.h 
     23      StdAfx.h 
     24    ) 
     25    SET(EXTRA_LIBS Wininet.lib) 
     26  ENDIF(WIN32) 
     27 
     28  add_executable (${TARGET} ${reporter_SRCS}) 
     29  target_link_libraries(${TARGET} 
     30    ${Boost_FILESYSTEM_LIBRARY} 
     31    ${Boost_SYSTEM_LIBRARY} 
     32  # ${NSCP_DEF_PLUGIN_LIB} 
     33    ${BREAKPAD_COMMON_LIBRARY} 
     34    ${BREAKPAD_CRASH_REPORT_SENDER_LIBRARY} 
     35    ${EXTRA_LIBS} 
    2336  ) 
    24   SET(EXTRA_LIBS Wininet.lib) 
    25 ENDIF(WIN32) 
     37  SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "tools") 
    2638 
    27 add_executable (${TARGET} ${reporter_SRCS}) 
    28 target_link_libraries(${TARGET} 
    29   ${Boost_FILESYSTEM_LIBRARY} 
    30   ${Boost_SYSTEM_LIBRARY} 
    31 # ${NSCP_DEF_PLUGIN_LIB} 
    32   ${BREAKPAD_COMMON_LIBRARY} 
    33   ${BREAKPAD_CRASH_REPORT_SENDER_LIBRARY} 
    34   ${EXTRA_LIBS} 
    35 ) 
    36 SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "tools") 
     39  SOURCE_GROUP("Common Files" REGULAR_EXPRESSION .*include/.*) 
     40  SOURCE_GROUP("Parser" REGULAR_EXPRESSION .*include/parser/.*) 
     41  SOURCE_GROUP("NSCP API" REGULAR_EXPRESSION .*include/nscapi/.*) 
     42  SOURCE_GROUP("Settings" REGULAR_EXPRESSION .*include/settings/.*) 
    3743 
    38 SOURCE_GROUP("Common Files" REGULAR_EXPRESSION .*include/.*) 
    39 SOURCE_GROUP("Parser" REGULAR_EXPRESSION .*include/parser/.*) 
    40 SOURCE_GROUP("NSCP API" REGULAR_EXPRESSION .*include/nscapi/.*) 
    41 SOURCE_GROUP("Settings" REGULAR_EXPRESSION .*include/settings/.*) 
    42  
    43 INSTALL(TARGETS ${TARGET} RUNTIME DESTINATION .) 
    44 INSTALL(CODE "SET(PDB_FULL_PATH ${BUILD_TARGET_EXE_PATH}/${TARGET}.pdb)") 
    45 INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX} TYPE EXECUTABLE FILES \${PDB_FULL_PATH})") 
     44  INSTALL(TARGETS ${TARGET} RUNTIME DESTINATION .) 
     45  INSTALL(CODE "SET(PDB_FULL_PATH ${BUILD_TARGET_EXE_PATH}/${TARGET}.pdb)") 
     46  INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX} TYPE EXECUTABLE FILES \${PDB_FULL_PATH})") 
     47ENDIF(BREAKPAD_FOUND) 
  • version.hpp

    re11d494 r04ef932  
    11#ifndef VERSION_HPP 
    22#define VERSION_HPP 
    3 #define PRODUCTVER     0,4,0,77 
    4 #define STRPRODUCTVER  "0,4,0,77" 
    5 #define STRPRODUCTDATE "2011-07-06" 
     3#define PRODUCTVER     0,4,0,83 
     4#define STRPRODUCTVER  "0,4,0,83" 
     5#define STRPRODUCTDATE "2011-08-07" 
    66#endif // VERSION_HPP 
  • version.txt

    re11d494 r04ef932  
    11version=0.4.0 
    2 build=77 
    3 date=2011-07-06 
     2build=83 
     3date=2011-08-07 
Note: See TracChangeset for help on using the changeset viewer.