Changeset 7ec3dd1 in nscp


Ignore:
Timestamp:
06/16/11 23:00:44 (3 years ago)
Author:
Michael Medin <michael@…>
Branches:
master, 0.4.0, 0.4.1, 0.4.2
Children:
e11d494
Parents:
3bdaf18
Message:

various fixes and changes here and there
Mainly build related (been trying to fix symbol dumper problems) as well as tweaks for the up-coming "nightly release")

Files:
7 added
1 deleted
37 edited

Legend:

Unmodified
Added
Removed
  • CMakeLists.txt

    r3bdaf18 r7ec3dd1  
    8787 
    8888SET(VERSION_TXT ${CMAKE_CURRENT_SOURCE_DIR}/version.txt) 
    89  
     89IF(${INCREASE_BUILD} STREQUAL 1) 
    9090EXECUTE_PROCESS( 
    9191  COMMAND ${PYTHON_EXECUTABLE} 
     
    9393    --file ${VERSION_TXT}  
    9494    --display  
    95     --generate-hpp "${BUILD_PYTHON_FOLDER}/version.hpp" 
     95    --update build 
     96    --generate-hpp ${CMAKE_CURRENT_SOURCE_DIR}/version.hpp 
    9697  OUTPUT_VARIABLE TMP_VERSION_OUT 
    9798  ) 
     99  MESSAGE(STATUS "===================== Bumping version") 
     100ENDIF(${INCREASE_BUILD} STREQUAL 1) 
     101 
     102EXECUTE_PROCESS( 
     103  COMMAND ${PYTHON_EXECUTABLE} 
     104    "${BUILD_PYTHON_FOLDER}/version.py"  
     105    --file ${VERSION_TXT}  
     106    --display  
     107    --generate-hpp ${CMAKE_CURRENT_SOURCE_DIR}/version.hpp 
     108  OUTPUT_VARIABLE TMP_VERSION_OUT 
     109  ) 
     110   
    98111IF(TMP_VERSION_OUT STREQUAL "") 
    99112  MESSAGE(FATA_ERROR, "Failed to generate version from: ${PYTHON_EXECUTABLE} ${BUILD_PYTHON_FOLDER}/version.py --file ${VERSION_TXT} --display ") 
     
    104117STRING(REGEX REPLACE ".*([0-9]+)\\.([0-9]+)\\.([0-9]+)\\.([0-9]+).*" "\\4" VERSION_BUILD ${TMP_VERSION_OUT}) 
    105118MESSAGE(STATUS "Version: ${VERSION_SERIES}.${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}") 
     119IF(WIN32) 
     120  SET(VERSION_ARCH Win32) 
     121  IF(CMAKE_CL_64) 
     122    SET(VERSION_ARCH x64) 
     123  ENDIF(CMAKE_CL_64) 
     124ELSE(WIN32) 
     125  SET(VERSION_ARCH Unknown) 
     126ENDIF(WIN32) 
     127 
    106128 
    107129SET(CPACK_PACKAGE_DESCRIPTION_SUMMARY "NSClient++") 
     
    110132#SET(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_SOURCE_DIR}/Copyright.txt") 
    111133 
    112 SET(CPACK_PACKAGE_VERSION_MAJOR ${VERSION_SERIES}) 
    113 SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MAJOR}) 
    114 SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_MINOR}) 
     134SET(CPACK_PACKAGE_VERSION_MAJOR "${VERSION_SERIES}.${VERSION_MAJOR}") 
     135SET(CPACK_PACKAGE_VERSION_MINOR ${VERSION_MINOR}) 
     136SET(CPACK_PACKAGE_VERSION_PATCH ${VERSION_BUILD}) 
    115137 
    116138SET(CPACK_PACKAGE_INSTALL_DIRECTORY "CMake ${CMake_VERSION_MAJOR}.${CMake_VERSION_MINOR}") 
     
    444466  ENDIF("${CMAKE_SYSTEM_PROCESSOR}" STREQUAL "x86_64" AND NOT APPLE) 
    445467ENDIF(CMAKE_COMPILER_IS_GNUCXX) 
     468 
     469CONFIGURE_FILE( 
     470  ${BUILD_PYTHON_FOLDER}/postbuild.py 
     471  ${BUILD_TARGET_EXE_PATH}/postbuild.py 
     472) 
  • build.cmake

    rb7d17f8 r7ec3dd1  
    1616  ENDIF() 
    1717 
    18   SET(INC_GOOGLE_BREAKPAD_DIR "D:/source/google-breakpad-svn") 
     18  SET(INC_GOOGLE_BREAKPAD_DIR "D:/source/libraries/google-breakpad-svn") 
    1919     
    2020  SET(INC_BOOST_INCLUDEDIR "${INC_NSCP_INCLUDEDIR}") 
     
    2929 
    3030  SET(INC_LUA_DIR "D:/source/libraries/lua-5.1.4") 
     31   
     32  SET(ARCHIVE_FOLDER "D:/archive") 
    3133 
    3234ELSE(WIN32) 
  • build/batch/batch_build_win.bat

    rd66ccee r7ec3dd1  
    1010 
    1111title Generating x64  
    12 cmake -G "Visual Studio 8 2005 Win64" ../../trunk 
    13 cmake -G "Visual Studio 8 2005 Win64" ../../trunk 
     12cmake -D INCREASE_BUILD=1 -G "Visual Studio 8 2005 Win64" ../../trunk 
     13cmake -D INCREASE_BUILD=0 -G "Visual Studio 8 2005 Win64" ../../trunk 
    1414if %ERRORLEVEL% == 1 goto :error 
    1515 
     
    2222if %ERRORLEVEL% == 1 goto :error 
    2323 
     24title Postbuild x64 
     25postbuild.py 
     26if %ERRORLEVEL% == 1 goto :error 
     27 
    2428cd %ROOT%\w32 
    2529if %ERRORLEVEL% == 1 goto :error 
    2630 
    2731title Generating w32 
    28 cmake -G "Visual Studio 8 2005" ../../trunk 
    29 cmake -G "Visual Studio 8 2005" ../../trunk 
     32cmake -D INCREASE_BUILD=0 -G "Visual Studio 8 2005" ../../trunk 
     33cmake -D INCREASE_BUILD=0 -G "Visual Studio 8 2005" ../../trunk 
    3034if %ERRORLEVEL% == 1 goto :error 
    3135 
     
    3842if %ERRORLEVEL% == 1 goto :error 
    3943 
     44title Postbuild w32 
     45postbuild.py 
     46if %ERRORLEVEL% == 1 goto :error 
     47 
     48title Done! 
     49 
    4050exit /b 0 
    4151goto :eof 
  • build/cmake/FindGoogleBreakpad.cmake

    r1f24a1c r7ec3dd1  
    2828ENDIF(NOT BREAKPAD_LIBRARY_SUFFIX_DEBUG) 
    2929 
    30 MESSAGE(STATUS "Breakpad config: ${BREAKPAD_LIBRARY_PREFIX}...${BREAKPAD_LIBRARY_SUFFIX}, ${BREAKPAD_LIBRARY_PREFIX_DEBUG}...${BREAKPAD_LIBRARY_SUFFIX_DEBUG}" ) 
     30MESSAGE("Breakpad config: ${BREAKPAD_LIBRARY_PREFIX}...${BREAKPAD_LIBRARY_SUFFIX}, ${BREAKPAD_LIBRARY_PREFIX_DEBUG}...${BREAKPAD_LIBRARY_SUFFIX_DEBUG}" ) 
    3131SET(BREAKPAD_FOUND TRUE) 
    3232FOREACH(COMPONENT ${GoogleBreakpad_FIND_COMPONENTS}) 
    3333    string(TOUPPER ${COMPONENT} UPPERCOMPONENT) 
    34   FIND_LIBRARY(BREAKPAD_${UPPERCOMPONENT}_LIBRARY_RELEASE NAMES ${BREAKPAD_LIBRARY_PREFIX}${COMPONENT}${BREAKPAD_LIBRARY_SUFFIX}) 
    35   FIND_LIBRARY(BREAKPAD_${UPPERCOMPONENT}_LIBRARY_DEBUG NAMES ${BREAKPAD_LIBRARY_PREFIX_DEBUG}${COMPONENT}${BREAKPAD_LIBRARY_SUFFIX_DEBUG}) 
     34  FIND_LIBRARY(BREAKPAD_${UPPERCOMPONENT}_LIBRARY_RELEASE  
     35    NAMES ${BREAKPAD_LIBRARY_PREFIX}${COMPONENT}${BREAKPAD_LIBRARY_SUFFIX}) 
     36  FIND_LIBRARY(BREAKPAD_${UPPERCOMPONENT}_LIBRARY_DEBUG  
     37    NAMES ${BREAKPAD_LIBRARY_PREFIX_DEBUG}${COMPONENT}${BREAKPAD_LIBRARY_SUFFIX_DEBUG}) 
    3638  IF(BREAKPAD_${UPPERCOMPONENT}_LIBRARY_RELEASE AND BREAKPAD_${UPPERCOMPONENT}_LIBRARY_DEBUG) 
    3739    SET(BREAKPAD_${UPPERCOMPONENT}_FOUND TRUE) 
     
    4446  ENDIF(BREAKPAD_${UPPERCOMPONENT}_LIBRARY_RELEASE AND BREAKPAD_${UPPERCOMPONENT}_LIBRARY_DEBUG) 
    4547ENDFOREACH(COMPONENT) 
     48IF(BREAKPAD_FOUND) 
     49  MESSAGE("Looking for dump-symbols in: ${BREAKPAD_INCLUDE_DIR}/tools/windows/binaries" ) 
     50  FIND_PROGRAM(BREAKPAD_DUMPSYMS_EXE  
     51    dump_syms.exe NAMES dump_syms dumpsyms 
     52    PATHS ENV PATH ${BREAKPAD_INCLUDE_DIR}/tools/windows/binaries 
     53    ) 
     54  MESSAGE("Looking for dump-symbols in: ${BREAKPAD_INCLUDE_DIR}/tools/windows/binaries: ${BREAKPAD_DUMPSYMS_EXE}" ) 
     55  IF(BREAKPAD_DUMPSYMS_EXE) 
     56    SET(BREAKPAD_DUMPSYMS_EXE_FOUND TRUE) 
     57  ELSE(BREAKPAD_DUMPSYMS_EXE) 
     58    SET(BREAKPAD_DUMPSYMS_EXE_FOUND FALSE) 
     59    SET(BREAKPAD_FOUND FALSE) 
     60  ENDIF(BREAKPAD_DUMPSYMS_EXE) 
     61ELSE(BREAKPAD_FOUND) 
     62  MESSAGE("NOT looking for dump-symbols in: ${BREAKPAD_INCLUDE_DIR}/tools/windows/binaries" ) 
     63ENDIF(BREAKPAD_FOUND) 
  • build/cmake/functions.cmake

    r197b263 r7ec3dd1  
    1818  ENDFOREACH(_CURRENT_MODULE ${TMP_LIST}) 
    1919ENDMACRO(LOAD_SECTIONS) 
     20 
     21 
     22MACRO(copy_single_file alias src destDir) 
     23  GET_FILENAME_COMPONENT(TARGET ${src} NAME) 
     24  SET(source_file ${CMAKE_CURRENT_SOURCE_DIR}/${src}) 
     25  IF(${destDir} STREQUAL ".") 
     26    SET(target_file ${CMAKE_BINARY_DIR}/${TARGET}) 
     27  ELSE(${destDir} STREQUAL ".") 
     28    SET(target_file ${CMAKE_BINARY_DIR}/${destDir}/${TARGET}) 
     29  ENDIF(${destDir} STREQUAL ".") 
     30  #message(STATUS " - Copying ${source_file} to ${target_file}...") 
     31  ADD_CUSTOM_COMMAND(OUTPUT ${target_file} 
     32    DEPENDS ${source_file} 
     33    COMMAND cmake  
     34    ARGS -E copy "${source_file}" "${target_file}" 
     35    OUTPUT ${target_file} 
     36    COMMENT Copying ${source_file} to ${target_file} 
     37    ) 
     38  ADD_CUSTOM_TARGET(${TARGET}_${alias} ALL DEPENDS ${target_file}) 
     39  SET_TARGET_PROPERTIES(${TARGET}_${alias} PROPERTIES FOLDER "files/${alias}") 
     40  INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES \"${source_file}\")") 
     41ENDMACRO(copy_single_file) 
     42 
  • build/cmake/module.cmake

    rd66ccee r7ec3dd1  
    55 
    66SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER ${MODULE_SUBFOLDER}) 
     7#IF(BREAKPAD_FOUND) 
     8# ADD_CUSTOM_COMMAND(TARGET ${TARGET}  
     9#   POST_BUILD  
     10#   COMMAND ${BREAKPAD_DUMPSYMS_EXE} ${BUILD_TARGET_LIB_PATH}/${TARGET}.pdb > ${BUILD_TARGET_LIB_PATH}/${TARGET}.sym 
     11#   COMMENT Building symbols into ${BUILD_TARGET_LIB_PATH}/${TARGET}.sym 
     12#   ) 
     13#ENDIF(BREAKPAD_FOUND) 
    714 
    815INSTALL(TARGETS ${TARGET} LIBRARY DESTINATION ${MODULE_SUBFOLDER}) 
    9 INSTALL(CODE "SET(PDB_FULL_PATH ${BUILD_TARGET_LIB_PATH}/${TARGET}.pdb)") 
    10 INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${MODULE_SUBFOLDER} TYPE EXECUTABLE FILES \${PDB_FULL_PATH})") 
    11  
     16#IF(BREAKPAD_FOUND) 
     17# INSTALL(CODE "SET(PDB_FULL_PATH ${BUILD_TARGET_LIB_PATH}/${TARGET}.pdb)") 
     18# INSTALL(CODE "SET(SYM_FULL_PATH ${BUILD_TARGET_LIB_PATH}/${TARGET}.sym)") 
     19# INSTALL(CODE "ADD_CUSTOM_COMMAND(OUTPUT \${SYM_FULL_PATH} COMMAND ${BREAKPAD_DUMPSYMS_EXE} \${PDB_FULL_PATH} > \${SYM_FULL_PATH})") 
     20# INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${MODULE_SUBFOLDER} TYPE EXECUTABLE FILES \${SYM_FULL_PATH})") 
     21#ENDIF(BREAKPAD_FOUND) 
  • build/cmake/wix.cmake

    rb7d17f8 r7ec3dd1  
    194194        OUTPUT    ${_target} 
    195195        COMMAND   ${WIX_LIGHT} 
    196         ARGS      ${WIX_LINK_FLAGS_A}  
     196        ARGS      ${WIX_LINK_FLAGS_A} 
     197              -b ${CMAKE_CURRENT_SOURCE_DIR} 
    197198              -ext WixUIExtension  
    198199              -ext WixFirewallExtension  
     
    224225    SET(WIX_OBJ_LIST) 
    225226    WIX_COMPILE("${_sources}" WIX_OBJ_LIST "${_dependencies}") 
    226     WIX_LINK(${_target}.msi WIX_OBJ_LIST "${_loc_files}") 
    227     ADD_CUSTOM_TARGET(${_target}  
    228       DEPENDS ${_target}.msi 
     227    SET(TNAME "${_target}-${VERSION_SERIES}.${VERSION_MAJOR}.${VERSION_MINOR}.${VERSION_BUILD}-${VERSION_ARCH}.msi") 
     228    WIX_LINK(${TNAME} WIX_OBJ_LIST "${_loc_files}") 
     229    ADD_CUSTOM_TARGET(${_target}_installer  
     230      ALL 
     231      DEPENDS ${TNAME} 
    229232      SOURCES ${_sources} 
    230233      ) 
  • build/python/version.py

    rd66ccee r7ec3dd1  
    55from datetime import date 
    66from optparse import OptionParser 
     7from VersionHandler import VersionHandler 
    78 
    8 class Version: 
    9   def __init__(self, file): 
    10     self.file = file 
    11     self.major = 0 
    12     self.minor = 0 
    13     self.revision = 0 
    14     self.build = 1 
    15     self.touch() 
    16      
    17   def read(self): 
    18     try: 
    19       f = open(self.file, 'r') 
    20       lines = f.readlines() 
    21       f.close() 
    22       for line in lines: 
    23         self.readline(line) 
    24        
    25         #if line.find(' PRODUCTVER ') != -1: 
    26         # m = re.search('.*(\d),(\d),(\d),(\d).*', line) 
    27         # print 'Parsed: %s as %s'%(line, m.groups()) 
    28         # return (int(m.group(1)), int(m.group(2)), int(m.group(3)), int(m.group(4))) 
    29     except IOError as e: 
    30       print 'File not found: %s (%s)'%(self.file, e) 
    31       sys.exit(1) 
    32      
    33   def readline(self, line): 
    34     line = line.strip('\r\n\t ') 
    35     if len(line) == 0: 
    36       return 
    37     try: 
    38       m = re.search('(.*)=(.*)$', line) 
    39       if not m: 
    40         print 'Failed to parse line: %s'%(line.strip('\n\t ')) 
    41         return 
    42       self.set(m.group(1), m.group(2)) 
    43     except IndexError as e: 
    44       print 'Failed to parse line: %s (%s)'%(line.strip('\n\t '),e) 
     9parser = OptionParser() 
     10parser.add_option("-f", "--file", dest="filename", 
     11          help="File to update version in", metavar="FILE") 
     12parser.add_option("-g", "--generate-hpp", dest="targetHPP", 
     13          help="Generate a HPP file") 
     14parser.add_option("-c", "--create", action="store_true", dest="create", 
     15          help="Create a new file") 
     16parser.add_option("-d", "--display", action="store_true", dest="display", 
     17          help="Display the current version") 
     18parser.add_option("-u", "--update", 
     19          dest="update", default='build', 
     20          help="Update a file (major, minor, revision, build)") 
    4521 
    46   def set(self,k,v): 
    47     if k == 'version': 
    48       m = re.search('.*(\d).(\d).(\d).*', v) 
    49       (self.major, self.minor, self.revision) = [int(e) for e in m.groups()] 
    50     elif k == 'build': 
    51       self.build = int(v) 
    52     elif k == 'date': 
    53       self.date = v 
    54        
    55   def touch(self): 
    56     today = date.today() 
    57     self.date = today.isoformat() 
    58      
    59   def version(self): 
    60     return '%d.%d.%d.%d'%(self.major, self.minor, self.revision, self.build) 
    61      
    62   def __str__(self): 
    63     return 'version: %s, date %s'%(self.version(), self.date) 
     22(options, args) = parser.parse_args() 
     23version = None 
     24if options.filename and options.create: 
     25  version = VersionHandler(options.filename) 
     26  version.create() 
     27elif options.filename and options.update: 
     28  version = VersionHandler(options.filename) 
     29  version.read() 
     30  version.increment(options.update) 
     31  version.touch() 
     32  version.write() 
     33else: 
     34  parser.print_help() 
    6435 
    65   def __repr__(self): 
    66     return 'version: %s, date %s'%(self.version(), self.date) 
    67  
    68   def increment(self, key): 
    69     if key == 'build': 
    70       self.build += 1 
    71     elif key == 'revision': 
    72       self.revision += 1 
    73       self.build = 0 
    74     elif key == 'minor': 
    75       self.minor += 1 
    76       self.revision = 0 
    77       self.build = 0 
    78     elif key == 'major': 
    79       self.major += 1 
    80       self.minor = 0 
    81       self.revision = 0 
    82       self.build = 0 
    83      
    84   def print_version(self): 
    85     print '%d.%d.%d.%d'%(self.major, self.minor, self.revision, self.build) 
    86    
    87   def write_hpp(self, file): 
    88     f = open(file, 'w') 
    89     (ignored, filename) = os.path.split(file) 
    90     name = filename.upper().replace('.', '_') 
    91  
    92     f.write('#ifndef %s\n'%name) 
    93     f.write('#define %s\n'%name) 
    94      
    95     f.write('#define PRODUCTVER     %d,%d,%d,%d\n'%(self.major, self.minor, self.revision, self.build)) 
    96     f.write('#define STRPRODUCTVER  "%d,%d,%d,%d"\n'%(self.major, self.minor, self.revision, self.build)) 
    97     f.write('#define STRPRODUCTDATE "%s"\n'%(self.date)) 
    98      
    99     f.write('#endif // %s\n'%name) 
    100     f.close() 
    101  
    102 def run(): 
    103   parser = OptionParser() 
    104   parser.add_option("-f", "--file", dest="filename", 
    105             help="File to update version in", metavar="FILE") 
    106   parser.add_option("-g", "--generate-hpp", dest="targetHPP", 
    107             help="Generate a HPP file") 
    108   parser.add_option("-c", "--create", action="store_true", dest="create", 
    109             help="Create a new file") 
    110   parser.add_option("-d", "--display", action="store_true", dest="display", 
    111             help="Display the current version") 
    112   parser.add_option("-u", "--update", 
    113             dest="update", default='build', 
    114             help="Update a file (major, minor, revision, build)") 
    115  
    116   (options, args) = parser.parse_args() 
    117   version = None 
    118   if options.filename and options.create: 
    119     version = Version(options.filename) 
    120     version.create() 
    121   elif options.filename and options.update: 
    122     version = Version(options.filename) 
    123     version.read() 
    124     version.increment(options.update) 
    125   else: 
    126     parser.print_help() 
    127  
    128   if options.targetHPP: 
    129     version.write_hpp(options.targetHPP) 
    130   if options.display: 
    131     version.print_version() 
     36if options.targetHPP: 
     37  version.write_hpp(options.targetHPP) 
     38if options.display: 
     39  version.print_version() 
    13240 
    13341     
    134 run() 
  • docs/CMakeLists.txt

    r3bdaf18 r7ec3dd1  
    11cmake_minimum_required(VERSION 2.6) 
    22 
    3 MACRO(copy_single_file src destDir) 
    4   GET_FILENAME_COMPONENT(TARGET ${src} NAME) 
    5   SET(target_file ${CMAKE_BINARY_DIR}/${destDir}/${TARGET}) 
    6   ADD_CUSTOM_COMMAND(OUTPUT ${target_file} 
    7     DEPENDS ${src} 
    8     COMMAND cmake  
    9     ARGS -E copy ${src} ${target_file} 
    10     COMMENT Copying ${src} to ${target_file} 
    11     ) 
    12   #ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${src}) 
    13   #SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "files/scripts") 
    14   INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES ${src})") 
    15 ENDMACRO(copy_single_file) 
    16  
    17 copy_single_file("Nagios Usage Guide.pdf" docs) 
    18 copy_single_file("NSClient++ Reference Manual.pdf" docs) 
     3copy_single_file(docs "Nagios Usage Guide.pdf" docs) 
     4copy_single_file(docs "NSClient++ Reference Manual.pdf" docs) 
  • files/CMakeLists.txt

    r3bdaf18 r7ec3dd1  
    11cmake_minimum_required(VERSION 2.6) 
    22 
    3 MACRO(copy_single_file src destDir) 
    4   GET_FILENAME_COMPONENT(TARGET ${src} NAME) 
    5   SET(target_file ${CMAKE_BINARY_DIR}/${destDir}/${TARGET}) 
    6   ADD_CUSTOM_COMMAND(OUTPUT ${target_file} 
    7     DEPENDS ${src} 
    8     COMMAND cmake  
    9     ARGS -E copy ${src} ${target_file} 
    10     COMMENT Copying ${src} to ${target_file} 
    11     ) 
    12   #ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${src}) 
    13   #SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "files/scripts") 
    14   INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES ${src})") 
    15 ENDMACRO(copy_single_file) 
    16  
    17 copy_single_file(license.txt .) 
    18 copy_single_file(nrpe_dh_512.pem security) 
    19 copy_single_file(old-settings.map .) 
    20 copy_single_file(counters.defs .) 
    21 #copy_single_file(../changelog .) 
     3copy_single_file(files license.txt .) 
     4copy_single_file(files nrpe_dh_512.pem security) 
     5copy_single_file(files old-settings.map .) 
     6copy_single_file(files counters.defs .) 
     7copy_single_file(files ../changelog .) 
  • files/old-settings.map

    rb7d17f8 r7ec3dd1  
    1313modules/CheckExternalScripts.dll=/modules/CheckExternalScripts 
    1414modules/NSCAAgent.dll=/modules/NSCAAgent 
     15modules/NSCAAgent.dll=/modules/Scheduler 
    1516modules/LUAScript.dll=/modules/LUAScript 
    1617modules/NRPEClient.dll=/modules/NRPEClient 
  • helpers/installers/installer/CMakeLists.txt

    rd66ccee r7ec3dd1  
    11cmake_minimum_required(VERSION 2.6) 
    22 
    3 SET(TARGET nsclient_installer) 
     3SET(ALIAS NSCP) 
     4SET(TARGET ${ALIAS}_installer) 
    45   
    56PROJECT(${TARGET}) 
     
    1718  nscp 
    1819  main_dll 
     20   
     21  check_60s.bat_scripts 
     22  check_battery.vbs_scripts 
     23  check_files.vbs_scripts 
     24  check_long.bat_scripts 
     25  check_no_rdp.bat_scripts 
     26  check_ok.bat_scripts 
     27  check_ping.bat_scripts 
     28  check_printer.vbs_scripts 
     29  check_test.bat_scripts 
     30  check_test.ps1_scripts 
     31  check_test.vbs_scripts 
     32  check_updates.vbs_scripts 
     33  powershell.ps1_scripts 
     34   
     35  "NagiosPlugins.vbs_script lib" 
     36  "wrapper.vbs_script lib" 
     37   
     38  counters.defs_files 
     39  license.txt_files 
     40  nrpe_dh_512.pem_files 
     41  old-settings.map_files 
     42  changelog_files 
     43   
     44  "Nagios Usage Guide.pdf_docs" 
     45  "NSClient++ Reference Manual.pdf_docs" 
    1946) 
    2047#GET_FILENAME_COMPONENT(_tmp_FILE WixUI_en-us.wxl ABSOLUTE) 
     
    2451) 
    2552 
    26 #MESSAGE(STATUS "Wix source: ${SRCS}") 
    27 #WIX_COMPILE(SRCS WIX_OBJS WixUI_en-us.wxl) 
    28 #MESSAGE(STATUS "Wix obj: ${WIX_OBJS}") 
    29  
    30 #SET (WIX_FULLOBJLIST ${WIXOBJ_LIST} ) 
    31 #SET (WIX_DEST ${TARGET}.msi) 
    32  
    33 SET(ARCH Win32) 
    34 IF(CMAKE_CL_64) 
    35   SET(ARCH x64) 
    36 ENDIF(CMAKE_CL_64) 
    37  
    38  
    39 SET(WIX_CANDLE_FLAGS -dboost=true -darch=${ARCH} -dVersion.Major=1 -dVersion.Minor=1 -dVersion.Revision=1 -dVersion.Build=1  
     53SET(WIX_CANDLE_FLAGS -dboost=true -darch=${VERSION_ARCH}  
     54  -dVersion.Major=${VERSION_SERIES} -dVersion.Minor=${VERSION_MAJOR} -dVersion.Revision=${VERSION_MINOR} -dVersion.Build=${VERSION_BUILD}  
    4055  -dSource=${NSCP_PROJECT_BINARY_DIR} -dHelpers=${NSCP_PROJECT_BINARY_DIR}/installer-dlls 
    4156  ) 
     
    4459   
    4560SOURCE_GROUP(Sources FILES ${SRCS}) 
    46 ADD_WIX_INSTALLER(${TARGET} "${SRCS}" "${DEPENDENCIES}" "${LOCALIZATIONS}") 
     61ADD_WIX_INSTALLER(${ALIAS} "${SRCS}" "${DEPENDENCIES}" "${LOCALIZATIONS}") 
    4762 
    4863ADD_DEPENDENCIES(${TARGET} ${MAIN_NSCP_TARGET} ${ALL_MODULE_NAMES} ${ALL_TOOL_NAMES} ${ALL_INSTALLERS_DLLS_NAMES}) 
  • helpers/installers/installer/Product.wxs

    rb7d17f8 r7ec3dd1  
    1111    <?define ProgramFiles = "ProgramFilesFolder" ?> 
    1212    <?define Win64 = "no" ?> 
    13     <?define Plattform = "Intel" ?> 
     13    <?define Plattform = "x86" ?> 
    1414  <?endif?> 
    1515 
     
    240240    <!-- ### Icons --> 
    241241    <Icon Id="nscp.exe" SourceFile="$(var.Source)/nscp.exe" /> 
    242     <Icon Id="doc.ico" SourceFile="$(var.Source)/res/help.ico"/> 
     242    <Icon Id="doc.ico" SourceFile="../../../resources/help.ico"/> 
    243243  </Product> 
    244244</Wix> 
  • include/nscapi/functions.hpp

    r3bdaf18 r7ec3dd1  
    6464        return PluginCommand::Response_Code_CRITCAL; 
    6565      return PluginCommand::Response_Code_UNKNOWN; 
     66    } 
     67    static LogMessage::Message_Level log_to_gpb(NSCAPI::messageTypes ret) { 
     68      if (ret == NSCAPI::critical) 
     69        return ::LogMessage::Message_Level_LOG_CRITICAL; 
     70      if (ret == NSCAPI::debug) 
     71        return ::LogMessage::Message_Level_LOG_DEBUG; 
     72      if (ret == NSCAPI::error) 
     73        return ::LogMessage::Message_Level_LOG_ERROR; 
     74      if (ret == NSCAPI::log) 
     75        return ::LogMessage::Message_Level_LOG_INFO; 
     76      if (ret == NSCAPI::warning) 
     77        return ::LogMessage::Message_Level_LOG_WARNING; 
     78      return ::LogMessage::Message_Level_LOG_ERROR; 
     79    } 
     80    static NSCAPI::messageTypes gpb_to_log(LogMessage::Message_Level ret) { 
     81      if (ret == ::LogMessage::Message_Level_LOG_CRITICAL) 
     82        return NSCAPI::critical; 
     83      if (ret == ::LogMessage::Message_Level_LOG_DEBUG) 
     84        return NSCAPI::debug; 
     85      if (ret == ::LogMessage::Message_Level_LOG_ERROR) 
     86        return NSCAPI::error; 
     87      if (ret == ::LogMessage::Message_Level_LOG_INFO) 
     88        return NSCAPI::log; 
     89      if (ret == ::LogMessage::Message_Level_LOG_WARNING) 
     90        return NSCAPI::warning; 
     91      return NSCAPI::error; 
    6692    } 
    6793 
  • include/nscapi/nscapi_core_wrapper.cpp

    r3bdaf18 r7ec3dd1  
    6868    if ((msgType == NSCAPI::debug) && (!logDebug())) 
    6969      return; 
    70     LogMessage::Message_Level msgType = ::LogMessage::Message_Level_LOG_WARNING; 
    71     if (msgType == NSCAPI::warning) 
    72       msgType = ::LogMessage::Message_Level_LOG_WARNING; 
    7370    std::string str; 
    7471    try { 
    7572      LogMessage::LogMessage message; 
    7673      LogMessage::Message *msg = message.add_message(); 
    77       msg->set_level(msgType); 
     74      msg->set_level(nscapi::functions::log_to_gpb(msgType)); 
    7875      msg->set_file(file); 
    7976      msg->set_line(line); 
     
    193190 
    194191  if (buffer_size > 0 && buffer != NULL) { 
    195     PluginCommand::ResponseMessage rsp_msg; 
     192    //PluginCommand::ResponseMessage rsp_msg; 
    196193    result = std::string(buffer, buffer_size); 
    197194  } 
  • include/nscapi/nscapi_plugin_wrapper.cpp

    rd66ccee r7ec3dd1  
    252252  try { 
    253253    PluginCommand::ResponseMessage message; 
     254    if (result.size() == 0) { 
     255      nscapi::plugin_singleton->get_core()->Message(NSCAPI::error, __FILE__, __LINE__, _T("Return data is empty cant parse response!")); 
     256      return NSCAPI::returnUNKNOWN; 
     257    } 
    254258    message.ParseFromString(result); 
    255259    if (message.payload_size() != 1) { 
    256       //NSC_LOG_ERROR_STD(_T("Unsupported payload size: ") + to_wstring(request_message.payload_size())); 
     260      nscapi::plugin_singleton->get_core()->Message(NSCAPI::error, __FILE__, __LINE__, _T("Unsupported payload size: ") + to_wstring(message.payload_size())); 
     261      //NSC_LOG_ERROR_STD(); 
    257262      return NSCAPI::returnIgnored; 
    258263    } 
     
    266271    std::wstring msg = utf8::cvt<std::wstring>(payload.message()); 
    267272    std::wstring perf = utf8::cvt<std::wstring>(::nscapi::functions::build_performance_data(payload)); 
    268     NSCAPI::nagiosReturn ret = handleSimpleNotification(channel, command, code, msg, perf); 
     273    return handleSimpleNotification(channel, command, code, msg, perf); 
    269274  } catch (std::exception &e) { 
    270     std::cout << "Failed to parse data from: " << strEx::strip_hex(result) << e.what() <<  std::endl;; 
     275    nscapi::plugin_singleton->get_core()->Message(NSCAPI::error, __FILE__, __LINE__, utf8::cvt<std::wstring>("Failed to parse data from: " + strEx::strip_hex(result) + ": " + e.what())); 
    271276  } catch (...) { 
    272     std::cout << "Failed to parse data from: " << strEx::strip_hex(result) << std::endl;; 
    273   } 
    274  
    275   return -1; 
    276 } 
     277    nscapi::plugin_singleton->get_core()->Message(NSCAPI::error, __FILE__, __LINE__, utf8::cvt<std::wstring>("Failed to parse data from: " + strEx::strip_hex(result))); 
     278  } 
     279  return NSCAPI::returnUNKNOWN; 
     280} 
  • include/service/win32_service.hpp

    r3bdaf18 r7ec3dd1  
    151151        service_ctrl_dispatch_ex(dwCtrlCode, 0, NULL, NULL); 
    152152      } catch (service_helper::service_exception e) { 
    153         handle_error(__LINE__, __FILEW__, _T("Unknown service error: ") + e.what()); 
     153        handle_error(__LINE__, __FILE__, _T("Unknown service error: ") + e.what()); 
    154154      } catch (...) { 
    155         handle_error(__LINE__, __FILEW__, _T("Unknown service error!")); 
     155        handle_error(__LINE__, __FILE__, _T("Unknown service error!")); 
    156156      } 
    157157    } 
     
    188188        return 0; 
    189189      } catch (service_helper::service_exception e) { 
    190         handle_error(__LINE__, __FILEW__, _T("Unknown service error: ") + e.what()); 
     190        handle_error(__LINE__, __FILE__, _T("Unknown service error: ") + e.what()); 
    191191      } catch (...) { 
    192         handle_error(__LINE__, __FILEW__, _T("Unknown service error!")); 
     192        handle_error(__LINE__, __FILE__, _T("Unknown service error!")); 
    193193      } 
    194194      return 0; 
     
    198198        TBase::get_global_instance()->_service_main(dwArgc, lpszArgv); 
    199199      } catch (service_helper::service_exception e) { 
    200         handle_error(__LINE__, __FILEW__, _T("Unknown service error: ") + e.what()); 
     200        handle_error(__LINE__, __FILE__, _T("Unknown service error: ") + e.what()); 
    201201      } catch (...) { 
    202         handle_error(__LINE__, __FILEW__, _T("Unknown service error!")); 
     202        handle_error(__LINE__, __FILE__, _T("Unknown service error!")); 
    203203      } 
    204204    } 
     
    211211      OutputDebugString(s); 
    212212    } 
    213     static void handle_error(unsigned int line, wchar_t *file, std::wstring message) { 
    214       TBase::get_global_instance()->handle_error(line, file, message); 
     213    static void handle_error(const int line, const char* file, std::wstring message) { 
     214      TBase::get_global_instance()->log_error(file, line, message); 
    215215    } 
    216216 
  • include/settings/macros.h

    r1ecd26f r7ec3dd1  
    9696 
    9797#define CHECK_DISK_SECTION "/settings/check/disk" 
    98  
    9998  namespace settings_def { 
    10099    DEFINE_SETTING_I(PAYLOAD_LEN, DEFAULT_SECTION, "payload length", 4096); 
     
    107106    DESCRIBE_SETTING(SYSTRAY_EXE, "TODO", "TODO"); 
    108107  } 
    109  
    110   // NSClient Setting headlines 
    111   namespace nsclient { 
    112     DEFINE_PATH(SECTION, NSCLIENT_SECTION); 
    113     //DESCRIBE_SETTING(SECTION, "NSCLIENT SECTION", "Section for NSClient (NSClientListsner.dll) (check_nt) protocol options."); 
    114  
    115     DEFINE_SETTING_S(ALLOWED_HOSTS, NSCLIENT_SECTION, GENERIC_KEY_ALLOWED_HOSTS, ""); 
    116     DESCRIBE_SETTING(ALLOWED_HOSTS, "ALLOWED HOST ADDRESSES", "This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon. If you leave this blank the global version will be used instead."); 
    117  
    118     DEFINE_SETTING_I(PORT, NSCLIENT_SECTION, "port", 12489); 
    119     //DESCRIBE_SETTING(PORT, "NSCLIENT PORT NUMBER", "This is the port the NSClientListener.dll will listen to."); 
    120  
    121     DEFINE_SETTING_S(BINDADDR, NSCLIENT_SECTION, GENERIC_KEY_BIND_TO, ""); 
    122     //DESCRIBE_SETTING(BINDADDR, "BIND TO ADDRESS", "Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. Leaving this blank will bind to all avalible IP adresses."); 
    123  
    124     DEFINE_SETTING_I(READ_TIMEOUT, NSCLIENT_SECTION, GENERIC_KEY_SOCK_READ_TIMEOUT, 30); 
    125     //DESCRIBE_SETTING(READ_TIMEOUT, "SOCKET TIMEOUT", "Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out."); 
    126  
    127     DEFINE_SETTING_I(LISTENQUE, NSCLIENT_SECTION, GENERIC_KEY_SOCK_LISTENQUE, 0); 
    128     //DESCRIBE_SETTING_ADVANCED(LISTENQUE, "LISTEN QUEUE", "Number of sockets to queue before starting to refuse new incoming connections. This can be used to tweak the amount of simultaneous sockets that the server accepts."); 
    129  
    130     DEFINE_SETTING_S(VERSION, NSCLIENT_SECTION, "version", "auto"); 
    131     //DESCRIBE_SETTING(VERSION, "VERSION", "The version number to return for the CLIENTVERSION check (useful to \"simulate\" an old/different version of the client, auto will be generated from the compiled version string inside NSClient++"); 
    132  
    133     DEFINE_SETTING_B(CACHE_ALLOWED, NSCLIENT_SECTION, GENERIC_KEY_SOCK_CACHE_ALLOWED, false); 
    134     //DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false."); 
    135  
    136     DEFINE_SETTING_S(MASTER_KEY, NSCLIENT_SECTION, GENERIC_KEY_PWD_MASTER_KEY, "This is a secret key that you should change"); 
    137     //DESCRIBE_SETTING(MASTER_KEY, "MASTER KEY", "The secret \"key\" used when (de)obfuscating passwords."); 
    138  
    139     DEFINE_SETTING_S(PWD, NSCLIENT_SECTION, GENERIC_KEY_PWD, ""); 
    140     //DESCRIBE_SETTING(PWD, "PASSWORD", "This is the password (-s) that is required to access NSClient remotely. If you leave this blank everyone will be able to access the daemon remotly."); 
    141  
    142     DEFINE_SETTING_S(OBFUSCATED_PWD, NSCLIENT_SECTION, GENERIC_KEY_OBFUSCATED_PWD, ""); 
    143     //DESCRIBE_SETTING(OBFUSCATED_PWD, "OBFUSCATED PASSWORD", "This is the same as the password option but here you can store the password in an obfuscated manner. *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the password. Its just a bit harder to do it at first glance."); 
    144  
    145   } 
    146  
     108/* 
     109 
     110  */ 
     111/* 
    147112  // NSClient Setting headlines 
    148113  namespace nrpe { 
     
    177142    DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false."); 
    178143 
    179     DEFINE_SETTING_B(KEYUSE_SSL, NRPE_SECTION_PROTOCOL, GENERIC_KEY_USE_SSL, true); 
     144    //DEFINE_SETTING_B(KEYUSE_SSL, NRPE_SECTION_PROTOCOL, GENERIC_KEY_USE_SSL, true); 
    180145    //DESCRIBE_SETTING(KEYUSE_SSL, "USE SSL SOCKET", "This option controls if SSL should be used on the socket."); 
    181146 
    182     DEFINE_SETTING_I(PAYLOAD_LENGTH, NRPE_SECTION_PROTOCOL, "payload length", 1024); 
     147    //DEFINE_SETTING_I(PAYLOAD_LENGTH, NRPE_SECTION_PROTOCOL, "payload length", 1024); 
    183148    //DESCRIBE_SETTING_ADVANCED(PAYLOAD_LENGTH, "PAYLOAD LENGTH", "Length of payload to/from the NRPE agent. This is a hard specific value so you have to \"configure\" (read recompile) your NRPE agent to use the same value for it to work."); 
    184149 
    185     DEFINE_SETTING_B(ALLOW_PERFDATA, NRPE_SECTION, "performance data", true); 
     150    //DEFINE_SETTING_B(ALLOW_PERFDATA, NRPE_SECTION, "performance data", true); 
    186151    //DESCRIBE_SETTING_ADVANCED(ALLOW_PERFDATA, "PERFORMANCE DATA", "Send performance data back to nagios (set this to 0 to remove all performance data)."); 
    187152 
    188     DEFINE_SETTING_I(CMD_TIMEOUT, NRPE_SECTION, "command timeout", 60); 
     153    //DEFINE_SETTING_I(CMD_TIMEOUT, NRPE_SECTION, "command timeout", 60); 
    189154    //DESCRIBE_SETTING(CMD_TIMEOUT, "COMMAND TIMEOUT", "This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off."); 
    190155 
     
    196161 
    197162  } 
    198  
     163*/ 
     164/* 
    199165  namespace protocol_def { 
    200166    DEFINE_SETTING_S(ALLOWED_HOSTS, DEFAULT_PROTOCOL_SECTION, GENERIC_KEY_ALLOWED_HOSTS, ""); 
     
    213179    //DESCRIBE_SETTING(OBFUSCATED_PWD, "OBFUSCATED PASSWORD", "This is the same as the password option but here you can store the password in an obfuscated manner. *NOTICE* obfuscation is *NOT* the same as encryption, someone with access to this file can still figure out the password. Its just a bit harder to do it at first glance."); 
    214180  } 
     181   
    215182  namespace event_log { 
    216183    DEFINE_PATH(SECTION, EVENT_LOG_SECTION); 
     
    229196    //DESCRIBE_SETTING(BUFFER_SIZE, "BUFFER SIZE", "The size of the bugfer to use when getting messages this affects the speed and maximum size of messages you can recieve."); 
    230197  } 
    231  
     198  */ 
     199/* 
    232200  namespace external_scripts { 
    233201    DEFINE_PATH(SECTION, EXTSCRIPT_SECTION); 
     
    259227 
    260228  } 
    261  
     229*/ 
     230/* 
    262231  namespace check_system { 
    263232 
     
    324293 
    325294  } 
    326  
     295  */ 
     296/* 
    327297  namespace nsca { 
    328298    DEFINE_PATH(SECTION, NSCA_SECTION); 
     
    411381 
    412382  } 
    413  
     383*/ 
     384/* 
    414385  namespace task_scheduler { 
    415386    DEFINE_PATH(SECTION, TASK_SCHED_SECTION); 
     
    424395    DESCRIBE_SETTING_ADVANCED(SECTION, "LUA SECTION", "A list of LUA script to load at startup. In difference to \"external checks\" all LUA scripts are loaded at startup. Names have no meaning since the script (on boot) submit which commands are available and tie that to various functions."); 
    425396  } 
    426  
     397  */ 
     398/* 
    427399  namespace log { 
    428400    DEFINE_PATH(SECTION, LOG_SECTION); 
     
    444416    //DESCRIBE_SETTING_ADVANCED(DEBUG_LOG, "DEBUG LOGGING", "Enable debug logging can help track down errors and find problems but will impact overall perfoamnce negativly."); 
    445417  } 
     418  */ 
    446419} 
  • include/settings/settings_old.hpp

    rb7d17f8 r7ec3dd1  
    2424    public: 
    2525 
    26       typedef std::map<std::wstring,std::wstring> path_map; 
    27       typedef std::map<settings_core::key_path_type,settings_core::key_path_type> key_map; 
     26      typedef std::multimap<std::wstring,std::wstring> path_map; 
     27      typedef std::multimap<settings_core::key_path_type,settings_core::key_path_type> key_map; 
    2828      typedef std::pair<std::wstring,std::wstring> section_key_type; 
    2929      typedef std::pair<settings_core::key_path_type,settings_core::key_path_type> keys_key_type; 
     
    8888 
    8989      void add(std::wstring path_new, std::wstring path_old) { 
    90         sections_[path_new] = path_old; 
     90        sections_.insert(path_map::value_type(path_new, path_old)); 
    9191      } 
    9292      void add(std::wstring path_new, std::wstring key_new, std::wstring path_old, std::wstring key_old) { 
    9393        settings_core::key_path_type new_key(path_new, key_new); 
    9494        settings_core::key_path_type old_key(path_old, key_old); 
    95         keys_[new_key] = old_key; 
     95        keys_.insert(key_map::value_type(new_key, old_key)); 
    9696      } 
    9797      std::wstring path(std::wstring path_new) { 
  • libs/protobuf/log.proto.h

    rd66ccee r7ec3dd1  
    11#pragma once 
    22 
    3 #include "D:/source/nscp/build/x64/libs/protobuf/log.pb.h" 
     3#include "D:/source/nscp/build/w32/libs/protobuf/log.pb.h" 
    44 
  • modules/CheckEventLog/CheckEventLog.cpp

    rd66ccee r7ec3dd1  
    814814        if (err == ERROR_INSUFFICIENT_BUFFER) { 
    815815          if (!buffer_error_reported) { 
    816             NSC_LOG_ERROR_STD(_T("EvenlogBuffer is too small change the value of ") + setting_keys::event_log::BUFFER_SIZE_PATH + _T("=") + strEx::itos(dwNeeded+1) + _T(": ") + error::lookup::last_error(err)); 
     816            NSC_LOG_ERROR_STD(_T("EvenlogBuffer is too small change the value of buffer_length=") + strEx::itos(dwNeeded+1) + _T(": ") + error::lookup::last_error(err)); 
    817817            buffer_error_reported = true; 
    818818          } 
  • modules/CheckSystem/PDHCollector.cpp

    rc391984 r7ec3dd1  
    2121#include "PDHCollector.h" 
    2222#include <sysinfo.h> 
    23  
     23#include "settings.hpp" 
    2424 
    2525PDHCollector::PDHCollector() : hStopEvent_(NULL)/*, data_(NULL)*/ { 
  • modules/CheckTaskSched/CheckTaskSched.cpp

    r3bdaf18 r7ec3dd1  
    3030 
    3131#include <settings/client/settings_client.hpp> 
     32#include "settings.hpp" 
    3233 
    3334 
  • modules/CheckTaskSched2/CheckTaskSched2.cpp

    r3bdaf18 r7ec3dd1  
    3030 
    3131#include <settings/client/settings_client.hpp> 
    32  
     32#include "../CheckTaskSched/settings.hpp" 
    3333 
    3434CheckTaskSched2 gCheckTaskSched2; 
  • modules/FileLogger/FileLogger.cpp

    r3bdaf18 r7ec3dd1  
    4242} 
    4343FileLogger::~FileLogger() { 
     44} 
     45namespace setting_keys { 
     46 
     47  namespace log { 
     48    DEFINE_PATH(SECTION, LOG_SECTION); 
     49    //DESCRIBE_SETTING_ADVANCED(SECTION, "LOG SECTION", "Configure loggning properties."); 
     50 
     51    DEFINE_SETTING_S(FILENAME, LOG_SECTION, "file", "nsclient.log"); 
     52    //DESCRIBE_SETTING_ADVANCED(FILENAME, "SYNTAX", "The file to write log data to. If no directory is used this is relative to the NSClient++ binary."); 
     53 
     54    DEFINE_SETTING_S(ROOT, LOG_SECTION, "root", "auto"); 
     55    //DESCRIBE_SETTING_ADVANCED(ROOT, "TODO", "TODO"); 
     56 
     57    DEFINE_SETTING_S(DATEMASK, LOG_SECTION, "date format", "%Y-%m-%d %H:%M:%S"); 
     58    //DESCRIBE_SETTING_ADVANCED(DATEMASK, "DATEMASK", "The date format used when logging to a file."); 
     59 
     60    DEFINE_SETTING_S(LOG_MASK, LOG_SECTION, "log mask", "normal"); 
     61    //DESCRIBE_SETTING_ADVANCED(LOG_MASK, "LOG MASK", "The log mask information, error, warning, critical, debug"); 
     62 
     63    DEFINE_SETTING_B(DEBUG_LOG, LOG_SECTION, "debug", false); 
     64    //DESCRIBE_SETTING_ADVANCED(DEBUG_LOG, "DEBUG LOGGING", "Enable debug logging can help track down errors and find problems but will impact overall perfoamnce negativly."); 
     65  } 
    4466} 
    4567 
  • modules/NRPEClient/NRPEClient.cpp

    r3bdaf18 r7ec3dd1  
    3232 
    3333 
     34namespace setting_keys { 
     35 
     36  // NSClient Setting headlines 
     37  namespace nrpe { 
     38    DEFINE_PATH(SECTION, NRPE_SECTION_PROTOCOL); 
     39    //DESCRIBE_SETTING(SECTION, "NRPE SECTION", "Section for NRPE (NRPEListener.dll) (check_nrpe) protocol options."); 
     40 
     41 
     42    DEFINE_PATH(CH_SECTION, NRPE_CLIENT_HANDLER_SECTION); 
     43    //DESCRIBE_SETTING(CH_SECTION, "CLIENT HANDLER SECTION", "..."); 
     44 
     45    DEFINE_SETTING_S(ALLOWED_HOSTS, NRPE_SECTION_PROTOCOL, GENERIC_KEY_ALLOWED_HOSTS, ""); 
     46    DESCRIBE_SETTING(ALLOWED_HOSTS, "ALLOWED HOST ADDRESSES", "This is a comma-delimited list of IP address of hosts that are allowed to talk to NSClient deamon. If you leave this blank the global version will be used instead."); 
     47 
     48    DEFINE_SETTING_I(PORT, NRPE_SECTION_PROTOCOL, "port", 5666); 
     49    //DESCRIBE_SETTING(PORT, "NSCLIENT PORT NUMBER", "This is the port the NSClientListener.dll will listen to."); 
     50 
     51    DEFINE_SETTING_S(BINDADDR, NRPE_SECTION_PROTOCOL, GENERIC_KEY_BIND_TO, ""); 
     52    //DESCRIBE_SETTING(BINDADDR, "BIND TO ADDRESS", "Allows you to bind server to a specific local address. This has to be a dotted ip adress not a hostname. Leaving this blank will bind to all avalible IP adresses."); 
     53 
     54    DEFINE_SETTING_I(READ_TIMEOUT, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_READ_TIMEOUT, 30); 
     55    //DESCRIBE_SETTING(READ_TIMEOUT, "SOCKET TIMEOUT", "Timeout when reading packets on incoming sockets. If the data has not arrived withint this time we will bail out."); 
     56 
     57    DEFINE_SETTING_I(LISTENQUE, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_LISTENQUE, 0); 
     58    //DESCRIBE_SETTING_ADVANCED(LISTENQUE, "LISTEN QUEUE", "Number of sockets to queue before starting to refuse new incoming connections. This can be used to tweak the amount of simultaneous sockets that the server accepts."); 
     59 
     60    DEFINE_SETTING_I(THREAD_POOL, NRPE_SECTION_PROTOCOL, "thread pool", 10); 
     61    //DESCRIBE_SETTING_ADVANCED(THREAD_POOL, "THREAD POOL", ""); 
     62 
     63 
     64 
     65    DEFINE_SETTING_B(CACHE_ALLOWED, NRPE_SECTION_PROTOCOL, GENERIC_KEY_SOCK_CACHE_ALLOWED, false); 
     66    DESCRIBE_SETTING_ADVANCED(CACHE_ALLOWED, "ALLOWED HOSTS CACHING", "Used to cache looked up hosts if you check dynamic/changing hosts set this to false."); 
     67 
     68    //DEFINE_SETTING_B(KEYUSE_SSL, NRPE_SECTION_PROTOCOL, GENERIC_KEY_USE_SSL, true); 
     69    //DESCRIBE_SETTING(KEYUSE_SSL, "USE SSL SOCKET", "This option controls if SSL should be used on the socket."); 
     70 
     71    DEFINE_SETTING_I(PAYLOAD_LENGTH, NRPE_SECTION_PROTOCOL, "payload length", 1024); 
     72    //DESCRIBE_SETTING_ADVANCED(PAYLOAD_LENGTH, "PAYLOAD LENGTH", "Length of payload to/from the NRPE agent. This is a hard specific value so you have to \"configure\" (read recompile) your NRPE agent to use the same value for it to work."); 
     73 
     74    //DEFINE_SETTING_B(ALLOW_PERFDATA, NRPE_SECTION, "performance data", true); 
     75    //DESCRIBE_SETTING_ADVANCED(ALLOW_PERFDATA, "PERFORMANCE DATA", "Send performance data back to nagios (set this to 0 to remove all performance data)."); 
     76 
     77    //DEFINE_SETTING_I(CMD_TIMEOUT, NRPE_SECTION, "command timeout", 60); 
     78    //DESCRIBE_SETTING(CMD_TIMEOUT, "COMMAND TIMEOUT", "This specifies the maximum number of seconds that the NRPE daemon will allow plug-ins to finish executing before killing them off."); 
     79 
     80    DEFINE_SETTING_B(ALLOW_ARGS, NRPE_SECTION, "allow arguments", false); 
     81    //DESCRIBE_SETTING(ALLOW_ARGS, "COMMAND ARGUMENT PROCESSING", "This option determines whether or not the NRPE daemon will allow clients to specify arguments to commands that are executed."); 
     82 
     83    DEFINE_SETTING_B(ALLOW_NASTY, NRPE_SECTION, "allow nasy characters", false); 
     84    //DESCRIBE_SETTING(ALLOW_NASTY, "COMMAND ALLOW NASTY META CHARS", "This option determines whether or not the NRPE daemon will allow clients to specify nasty (as in |`&><'\"\\[]{}) characters in arguments."); 
     85 
     86  } 
     87} 
    3488namespace sh = nscapi::settings_helper; 
    3589 
  • modules/NRPEServer/NRPEServer.cpp

    rd66ccee r7ec3dd1  
    2727 
    2828#include <settings/client/settings_client.hpp> 
     29#include "settings.hpp" 
    2930 
    3031 
  • resources/CMakeLists.txt

    rd66ccee r7ec3dd1  
    77 
    88MESSAGE(STATUS "Copying resources:") 
    9 copy_single_file(help.ico ${CMAKE_BINARY_DIR}/res) 
     9copy_single_file(icons help.ico ${CMAKE_BINARY_DIR}/res) 
  • scripts/CMakeLists.txt

    r3bdaf18 r7ec3dd1  
    11cmake_minimum_required(VERSION 2.6) 
    2  
    3  
    4 MACRO(copy_single_file src destDir) 
    5   GET_FILENAME_COMPONENT(TARGET ${src} NAME) 
    6   SET(target_file ${CMAKE_BINARY_DIR}/${destDir}/${TARGET}) 
    7   ADD_CUSTOM_COMMAND(OUTPUT ${target_file} 
    8     DEPENDS ${src} 
    9     COMMAND cmake  
    10     ARGS -E copy ${src} ${target_file} 
    11     COMMENT Copying ${src} to ${target_file} 
    12     ) 
    13   #ADD_CUSTOM_TARGET(${TARGET} ALL DEPENDS ${src}) 
    14   #SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "files/scripts") 
    15   INSTALL(CODE "FILE(INSTALL DESTINATION \${CMAKE_INSTALL_PREFIX}/${destDir} TYPE EXECUTABLE FILES ${src})") 
    16 ENDMACRO(copy_single_file) 
    172 
    183FILE (GLOB scripts_BAT "*.bat") 
     
    2510FOREACH(file ${script_ALL}) 
    2611  get_filename_component(filename ${file} NAME) 
    27   MESSAGE(STATUS " + ${filename}") 
    28   copy_single_file(${file} scripts) 
    29   #FILE(COPY ${file} DESTINATION ${CMAKE_BINARY_DIR}/scripts) 
     12  #MESSAGE(STATUS " + ${filename} (${file})") 
     13  copy_single_file(scripts ${filename} scripts) 
    3014ENDFOREACH(file ${script_ALL}) 
    3115 
     
    3317FOREACH(file ${scripts_LIB}) 
    3418  get_filename_component(filename ${file} NAME) 
    35   MESSAGE(STATUS " + lib - ${filename}") 
    36   copy_single_file(${file} scripts/lib) 
    37   #FILE(COPY ${file} DESTINATION ${CMAKE_BINARY_DIR}/scripts/lib) 
     19  #MESSAGE(STATUS " + lib - ${filename}") 
     20  copy_single_file("script lib" lib/${filename} scripts/lib) 
    3821ENDFOREACH(file ${scripts_LIB}) 
  • service/CMakeLists.txt

    r3bdaf18 r7ec3dd1  
    77LINK_DIRECTORIES(${BOOST_LIB_DIRS}) 
    88#INCLUDE_DIRECTORIES(${NSCP_INCLUDEDIR}) 
    9  
    10 SET(VERSION_HPP ${CMAKE_CURRENT_SOURCE_DIR}/version.hpp) 
    11  
    12 ADD_CUSTOM_TARGET( 
    13   "${TARGET}_VERSION" 
    14   COMMAND ${PYTHON_EXECUTABLE} 
    15     "${BUILD_PYTHON_FOLDER}/version.py" 
    16     --file ${VERSION_TXT} 
    17     --generate-hpp ${VERSION_HPP} 
    18     --update build 
    19   ) 
    209 
    2110SET(service_SRCS 
     
    9786 
    9887add_executable (${TARGET} ${service_SRCS}) 
    99 add_dependencies(${TARGET} ${TARGET}_VERSION) 
    10088 
    10189MESSAGE(STATUS "Extra: ${EXTRA_LIBS}") 
     
    10896) 
    10997SET_TARGET_PROPERTIES(${TARGET} PROPERTIES FOLDER "core") 
    110 SET_TARGET_PROPERTIES(${TARGET}_VERSION PROPERTIES FOLDER "core") 
    11198#IF(WIN32) 
    11299# SET_TARGET_PROPERTIES(${TARGET} PROPERTIES LINK_FLAGS "/MANIFESTUAC:\"level='requireAdministrator' uiAccess='false'\" /SUBSYSTEM:WINDOWS") 
  • service/NSClient++.cpp

    rd66ccee r7ec3dd1  
    4343#include <settings/client/settings_client.hpp> 
    4444#include "cli_parser.hpp" 
     45#include "../version.hpp" 
    4546 
    4647#include "../libs/protobuf/plugin.proto.h" 
     
    5354 
    5455NSClient mainClient;  // Global core instance. 
     56 
     57 
     58void NSClientT::log_debug(const char* file, const int line, std::wstring message) { 
     59  std::string s = nsclient::logger_helper::create_debug(file, line, message); 
     60  mainClient.reportMessage(s); 
     61} 
     62void NSClientT::log_error(const char* file, const int line, std::wstring message) { 
     63  std::string s = nsclient::logger_helper::create_error(file, line, message); 
     64  mainClient.reportMessage(s); 
     65} 
     66void NSClientT::log_error(const char* file, const int line, std::string message) { 
     67  std::string s = nsclient::logger_helper::create_error(file, line, utf8::cvt<std::wstring>(message)); 
     68  mainClient.reportMessage(s); 
     69} 
     70void NSClientT::log_info(const char* file, const int line, std::wstring message) { 
     71  std::string s = nsclient::logger_helper::create_info(file, line, message); 
     72  mainClient.reportMessage(s); 
     73} 
    5574 
    5675#define LOG_CRITICAL_CORE(msg) { std::string s = nsclient::logger_helper::create_error(__FILE__, __LINE__, msg); mainClient.reportMessage(s); } 
     
    10451064 
    10461065    PluginCommand::ResponseMessage rsp_msg; 
     1066 
    10471067    rsp_msg.ParseFromString(response); 
    10481068    if (rsp_msg.payload_size() != 1) { 
     
    11241144  } 
    11251145  try { 
    1126     LOG_ERROR_CORE_STD(_T("Notifying: ") + strEx::strip_hex(to_wstring(std::string(result,result_len)))); 
     1146    //LOG_ERROR_CORE_STD(_T("Notifying: ") + strEx::strip_hex(to_wstring(std::string(result,result_len)))); 
    11271147    bool found = false; 
    11281148    BOOST_FOREACH(nsclient::channels::plugin_type p, channels_.get(channel)) { 
     
    11641184 
    11651185bool NSClientT::logDebug() { 
    1166   if (debug_ == log_unknown) { 
    1167     debug_ = log_looking; 
     1186  if (debug_ == log_state_unknown) { 
     1187    debug_ = log_state_looking; 
    11681188    try { 
    11691189      if (settings_manager::get_settings_no_wait()->get_bool(_T("log"), _T("debug"), false) == 1) 
    1170         debug_ = log_debug; 
     1190        debug_ = log_state_debug; 
    11711191      else 
    1172         debug_ = log_nodebug; 
     1192        debug_ = log_state_nodebug; 
    11731193    } catch (settings::settings_exception e) { 
    1174       debug_ = log_unknown; 
     1194      debug_ = log_state_unknown; 
    11751195      return false; 
    11761196    } 
    1177   } else if (debug_ == log_looking)  
     1197  } else if (debug_ == log_state_looking)  
    11781198    return false; 
    1179   return (debug_ == log_debug); 
     1199  return (debug_ == log_state_debug); 
    11801200} 
    11811201 
  • service/NSClient++.h

    r3bdaf18 r7ec3dd1  
    9696  //boost::shared_mutex m_mutexRWcmdDescriptions; 
    9797  //cmdMap cmdDescriptions_; 
    98   enum log_status {log_unknown, log_looking, log_debug, log_nodebug }; 
     98  enum log_status {log_state_unknown, log_state_looking, log_state_debug, log_state_nodebug }; 
    9999  log_status debug_; 
    100100  std::wstring context_; 
     
    117117  typedef std::multimap<std::wstring,std::wstring> plugin_alias_list_type; 
    118118  // c-tor, d-tor 
    119   NSClientT(void) : debug_(log_unknown), enable_shared_session_(false), commands_(this), channels_(this), next_plugin_id_(0), service_name_(DEFAULT_SERVICE_NAME) { 
     119  NSClientT(void) : debug_(log_state_unknown), enable_shared_session_(false), commands_(this), channels_(this), next_plugin_id_(0), service_name_(DEFAULT_SERVICE_NAME) { 
    120120    logger_master_.start_slave(); 
    121121  } 
     
    123123  void enableDebug(bool debug = true) { 
    124124    if (debug) 
    125       debug_ = log_debug; 
     125      debug_ = log_state_debug; 
    126126    else 
    127       debug_ = log_nodebug; 
     127      debug_ = log_state_nodebug; 
    128128  } 
    129129 
     
    145145  // Service API 
    146146  static NSClient* get_global_instance(); 
     147  /* 
    147148  void handle_error(unsigned int line, const char *file, std::wstring message) { 
    148149    std::string s = nsclient::logger_helper::create_error(file, line, message); 
    149150    reportMessage(s.c_str()); 
    150151  } 
     152  */ 
    151153  void handle_startup(std::wstring service_name); 
    152154  void handle_shutdown(std::wstring service_name); 
     
    222224    void load_all_plugins(int mode); 
    223225 
     226    static void log_debug(const char* file, const int line, std::wstring message); 
     227    static void log_error(const char* file, const int line, std::wstring message); 
     228    static void log_error(const char* file, const int line, std::string message); 
     229    static void log_info(const char* file, const int line, std::wstring message); 
     230 
     231 
    224232 
    225233  private: 
  • service/cli_parser.hpp

    r3bdaf18 r7ec3dd1  
    6969 
    7070      if (vm.count("debug")) { 
    71         std::wcout << _T("Enabling debug mode")<<std::endl; 
    7271        core_->enableDebug(true); 
     72        core_->log_debug(__FILE__, __LINE__, _T("Enabling debug mode")); 
    7373      } 
    7474 
     
    102102      } 
    103103    } catch(std::exception & e) { 
    104       std::cerr << "Unable to parse command line: " << e.what() << std::endl; 
     104      core_->log_error(__FILE__, __LINE__, std::string("Unable to parse command line: ") + e.what()); 
    105105      return 1; 
    106106    } catch (...) { 
    107       std::cerr << "Unhanded Exception" << std::endl; 
     107      core_->log_error(__FILE__, __LINE__, "Unhanded Exception"); 
    108108      return 1; 
    109109    } 
     
    172172      return ret; 
    173173    } catch(std::exception & e) { 
    174       std::cerr << "Unable to parse command line (settings): " << e.what() << std::endl; 
     174      mainClient.log_error(__FILE__, __LINE__, std::string("Unable to parse command line (settings): ") + e.what()); 
    175175      return 1; 
    176176    } 
     
    193193      bool debug = false; 
    194194      if (vm.count("debug")) { 
    195         std::wcout << _T("----"); 
    196195        debug = true; 
    197196      } 
     
    200199        name = vm["name"].as<std::wstring>(); 
    201200      } else { 
    202         std::wcout << _T("TODO retrieve name from service here") << std::endl; 
     201        mainClient.log_info(__FILE__, __LINE__, _T("TODO retrieve name from service here")); 
    203202      } 
    204203      std::wstring desc; 
     
    206205        desc = vm["description"].as<std::wstring>(); 
    207206      } else { 
    208         std::wcout << _T("TODO retrieve name from service here") << std::endl; 
     207        mainClient.log_info(__FILE__, __LINE__, _T("TODO retrieve name from service here")); 
    209208      } 
    210209      if (debug) { 
    211         std::wcout << _T("Service name: ") << name << std::endl; 
    212         std::wcout << _T("Service description: ") << desc << std::endl; 
     210        mainClient.log_info(__FILE__, __LINE__, _T("Service name: ") + name); 
     211        mainClient.log_info(__FILE__, __LINE__, _T("Service description: ") + desc); 
    213212      } 
    214213 
     
    218217          mainClient.start_and_wait(name); 
    219218        } catch (...) { 
    220           std::wcerr << _T("Unknown exception in service") << std::endl; 
     219          mainClient.log_error(__FILE__, __LINE__, _T("Unknown exception in service")); 
    221220        } 
    222221      } else { 
     
    241240      return 0; 
    242241    } catch(std::exception & e) { 
    243       std::cerr << "Unable to parse command line (settings): " << e.what() << std::endl; 
     242      mainClient.log_error(__FILE__, __LINE__, std::string("Unable to parse command line (settings): ") + e.what()); 
    244243      return 1; 
    245244    } 
  • service/core_api.cpp

    rd66ccee r7ec3dd1  
    1818#include <charEx.h> 
    1919#include <config.h> 
     20#include "../version.hpp" 
    2021#include <arrayBuffer.h> 
    2122#include <settings/settings_core.hpp> 
  • service/logger.hpp

    r3bdaf18 r7ec3dd1  
    1111 
    1212#include "NSCPlugin.h" 
     13#include <nscapi/functions.hpp> 
    1314 
    1415using namespace nscp::helpers; 
     
    141142      } 
    142143 
    143       std::wstring render_log_level(int l) { 
    144         switch (l) { 
     144      std::wstring render_log_level(::LogMessage::Message_Level l) { 
     145        int code = nscapi::functions::gpb_to_log(l); 
     146        switch (code) { 
    145147          case NSCAPI::critical: 
    146148            return _T("c"); 
     
    157159        } 
    158160      } 
     161      std::wstring rpad(std::wstring str, int len) { 
     162        if (str.length() > len) 
     163          return str.substr(str.length()-len); 
     164        return std::wstring(len-str.length(), L' ') + str; 
     165      } 
     166      std::wstring lpad(std::wstring str, int len) { 
     167        if (str.length() > len) 
     168          return str.substr(0, len); 
     169        return str + std::wstring(len-str.length(), L' '); 
     170      } 
    159171 
    160172      std::wstring render_console_message(std::string data) { 
     
    170182            if (!str.empty()) 
    171183              str += _T(" -- "); 
    172             str += render_log_level(msg.level()) + _T(" ") + to_wstring(msg.file()) + _T(":") + to_wstring(msg.line()) + _T(" ") + to_wstring(msg.message()); 
     184            str += render_log_level(msg.level()) + _T(" ") + rpad(to_wstring(msg.file()), 40) + _T(":") + lpad(to_wstring(msg.line()),4) + _T(" ") + to_wstring(msg.message()); 
    173185          } 
    174186          return str; 
  • service/simple_client.hpp

    rc391984 r7ec3dd1  
    1616      core_->enableDebug(true); 
    1717      if (!core_->initCore(true)) { 
    18         std::wcout << _T("Service *NOT* started!") << std::endl; 
     18        core_->log_error(__FILE__, __LINE__, _T("Service failed to start")); 
    1919        return; 
    2020      } 
    2121 
    2222      if (core_->get_service_control().is_started()) 
    23         std::wcerr << "Service seems to be started (Sockets and such will probably not work)..." << std::endl; 
     23        core_->log_info(__FILE__, __LINE__, _T("Service seems to be started (Sockets and such will probably not work)...")); 
    2424 
    2525      //std::wcout << _T("Using settings from: ") << settings_manager::get_core()->get_settings_type_desc() << std::endl; 
    26       std::wcout << _T("Enter command to inject or exit to terminate...") << std::endl; 
     26      core_->log_info(__FILE__, __LINE__, _T("Enter command to inject or exit to terminate...")); 
    2727/* 
    2828      Settings::get_settings()->clear_cache(); 
     
    4040        std::getline(std::wcin, s); 
    4141        if (s == _T("exit")) { 
    42           std::wcout << _T("Exiting...") << std::endl; 
     42          log(_T("Exiting...")); 
    4343          break; 
    4444        } else if (s == _T("plugins")) { 
    45           std::wcout << _T("Listing plugins...") << std::endl; 
     45          log(_T("Listing plugins...")); 
    4646          core_->listPlugins(); 
    4747        } else if (s == _T("list")) { 
    48           std::wcout << _T("Listing commands...") << std::endl; 
     48          log(_T("Listing 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) 
    5151            std::wcout << *cit << _T(": ") << core_->describeCommand(*cit) << std::endl; 
    52           std::wcout << _T("Listing commands...Done") << std::endl; 
     52          log(_T("Listing commands...Done")); 
    5353        } else if (s == _T("debug off")) { 
    54           std::wcout << _T("Setting debug log off...") << std::endl; 
     54          log(_T("Setting debug log off...")); 
    5555          core_->enableDebug(false); 
    5656        } else if (s == _T("debug on")) { 
    57           std::wcout << _T("Setting debug log on...") << std::endl; 
     57          log(_T("Setting debug log on...")); 
    5858          core_->enableDebug(true); 
    5959        } else if (s == _T("reattach")) { 
    60           std::wcout << _T("Reattaching to session 0") << std::endl; 
     60          log(_T("Reattaching to session 0")); 
    6161          core_->startTrayIcon(0); 
    6262        } else if (s == _T("assert")) { 
  • version.txt

    r87cf3c4 r7ec3dd1  
    11version=0.4.0 
    2 build=33 
    3 date=2009-11-01 
    4  
    5  
    6  
     2build=48 
     3date=2011-05-20 
Note: See TracChangeset for help on using the changeset viewer.