diff --git a/vim/bundle/icinga2/.gitattributes b/vim/bundle/icinga2/.gitattributes new file mode 100644 index 0000000..a6ab5f7 --- /dev/null +++ b/vim/bundle/icinga2/.gitattributes @@ -0,0 +1,2 @@ +debian/ export-ignore +.gitattributes export-ignore diff --git a/vim/bundle/icinga2/.gitignore b/vim/bundle/icinga2/.gitignore new file mode 100644 index 0000000..5364974 --- /dev/null +++ b/vim/bundle/icinga2/.gitignore @@ -0,0 +1,14 @@ +.vagrant +.idea +*.patch +*.komodoproject +*.playground +.*.swp +.*.swo +build/ +build-debug/ +build-release/ +build32/ +build64/ +debug/ +release/ diff --git a/vim/bundle/icinga2/.mailmap b/vim/bundle/icinga2/.mailmap new file mode 100644 index 0000000..b9786ac --- /dev/null +++ b/vim/bundle/icinga2/.mailmap @@ -0,0 +1,16 @@ + + +Gunnar Beutner + + + +Jean-Marcel Flach +Dolf Schimmel +Markus Waldmüller +Claudio Kuenzler + + + + + + diff --git a/vim/bundle/icinga2/.travis.yml b/vim/bundle/icinga2/.travis.yml new file mode 100644 index 0000000..7f3aa88 --- /dev/null +++ b/vim/bundle/icinga2/.travis.yml @@ -0,0 +1,29 @@ +sudo: false + +language: cpp + +cache: ccache + +compiler: + - gcc + +addons: + apt_packages: + - libboost-all-dev + - flex + - bison + - libssl-dev + - libpq-dev + - libmysqlclient-dev + - libedit-dev + - libyajl-dev + - libwxbase3.0-dev + - libwxgtk3.0-dev + +before_script: + - mkdir build + - cd build + - cmake .. -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=/tmp/icinga2 + +script: + - make && make test && make install && /tmp/icinga2/sbin/icinga2 --version diff --git a/vim/bundle/icinga2/AUTHORS b/vim/bundle/icinga2/AUTHORS new file mode 100644 index 0000000..6d26233 --- /dev/null +++ b/vim/bundle/icinga2/AUTHORS @@ -0,0 +1,116 @@ +Adam James +Alexander A. Klimov +Alexander Fuhr +Alexander Schomburg +Alexander Wirt +Andres Ivanov +Andrew Meyer +Arnd Hannemann +Assaf Flatto +Bastian Guse +Benedikt Heine +Bernd Erk +Berthold Cogel +Blerim Sheqa +Brian De Wolf +Brian Dockter +Bruno Lingner +Bård Dahlmo-Lerbæk +Carlos Cesario +Carsten Köbke +Christian Birk +Christian Harke +Christian Jonak +Christian Lehmann +Claudio Kuenzler +Conrad Clement +Daniel Helgenberger +Daniil Yaroslavtsev +David Beck +Dinesh Majrekar +Dirk Goetz +Dolf Schimmel +Eduard Güldner +Edvin Seferovic +Eric Lippmann +Evgeni Golov +Ferdi Gueran +Gaël Beaudoin +Gerd von Egidy +Gunnar Beutner +Hannes Van de Vel +Heike Jurzik +Hendrik Röder +Ian Kelling +Ildar Hizbulin +James Pharaoh +Jan Andres +Jan Wagner +Jason Young +Jean-Louis Dupond +Jean-Marcel Flach +Jens Schanz +Jeremy Armstrong +Jesse Morgan +Jo Goossens +Johannes Meyer +Jonas Meurer +Joseph L. Casale +Julian Brost +Jérôme Drouet +Lars Engels +Lee Clemens +Lennart Betz +Louis Sautier +Luca Lesinigo +Malte Rabenseifner +Manuel Reiter +Marcus van Dam +Marius Sturm +Markus Frosch +Markus Waldmüller +Martin Stiborsky +Mathieu Lutfy +Matthaus Owens +Max Zhang +Mhd Sulhan +Michael Friedrich +Michael Kraus +Mirco Bauer +Mirko Nardin +Nicolas Limage +Pall Sigurdsson +Paul Richards +Per von Zweigbergk +Petr Ruzicka +Phil Hutchinson +Philipp Dallig +Ralph Breier +Reto Zeder +Ricardo Bartels +Rune Darrud +Sam Kottler +Sebastian Brückner +Sebastian Chrostek +Simon Murray +Simon Ruderich +Siyalrach Anton Thomas +Stefan Triep +Stephan Platz +Stephan Tesch +Steve McMaster +Thomas Gelf +Thomas Widhalm +Tim Hardeck +Timo Buhrmester +Tobias Birnbaum +Tobias von der Krone +Tom Geissler +Uwe Ebel +Valentin Hoebel +Vytenis Darulis +Wolfgang Nieder +Yannick Charton +Yohan Jarosz +Zoltan Nagy +Élie Bouttier diff --git a/vim/bundle/icinga2/CMakeLists.txt b/vim/bundle/icinga2/CMakeLists.txt new file mode 100644 index 0000000..7282d17 --- /dev/null +++ b/vim/bundle/icinga2/CMakeLists.txt @@ -0,0 +1,344 @@ +# Icinga 2 +# Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +cmake_minimum_required(VERSION 2.6) +set(BOOST_MIN_VERSION "1.41.0") + +project(icinga2) +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake") +list(APPEND CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/third-party/cmake") + +if(NOT CMAKE_BUILD_TYPE) + set(CMAKE_BUILD_TYPE Release CACHE STRING + "Choose the type of build, options are: None Debug Release RelWithDebInfo MinSizeRel." + FORCE) +endif() + +option(ICINGA2_WITH_MYSQL "Build the MySQL IDO module" ON) +option(ICINGA2_WITH_PGSQL "Build the PostgreSQL IDO module" ON) +option(ICINGA2_WITH_CHECKER "Build the checker module" ON) +option(ICINGA2_WITH_COMPAT "Build the compat module" ON) +option(ICINGA2_WITH_DEMO "Build the demo module" OFF) +option(ICINGA2_WITH_HELLO "Build the hello module" OFF) +option(ICINGA2_WITH_LIVESTATUS "Build the Livestatus module" ON) +option(ICINGA2_WITH_NOTIFICATION "Build the notification module" ON) +option(ICINGA2_WITH_PERFDATA "Build the perfdata module" ON) +option(ICINGA2_WITH_STUDIO "Build the Icinga Studio application" OFF) +option(ICINGA2_WITH_TESTS "Run unit tests" ON) + +file(STRINGS icinga2.spec VERSION_LINE REGEX "^Version: ") +string(REPLACE "Version: " "" ICINGA2_VERSION ${VERSION_LINE}) + +include(GNUInstallDirs) +include(InstallConfig) + +set(ICINGA2_USER "icinga" CACHE STRING "Icinga 2 user") +set(ICINGA2_GROUP "icinga" CACHE STRING "Icinga 2 group") +set(ICINGA2_COMMAND_GROUP "icingacmd" CACHE STRING "Icinga 2 command group") +set(ICINGA2_RUNDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}/run" CACHE STRING "/run directory") +set(ICINGA2_PLUGINDIR "/usr/lib/nagios/plugins" CACHE STRING "Path for the check plugins") +set(ICINGA2_GIT_VERSION_INFO ON CACHE BOOL "Whether to use git describe") +set(ICINGA2_UNITY_BUILD ON CACHE BOOL "Whether to perform a unity build") +set(ICINGA2_LTO_BUILD OFF CACHE BOOL "Whether to use LTO") + +site_name(ICINGA2_BUILD_HOST_NAME) +set(ICINGA2_BUILD_COMPILER_NAME "${CMAKE_CXX_COMPILER_ID}") + +if(NOT CMAKE_CXX_COMPILER_VERSION) + execute_process(COMMAND ${CMAKE_CXX_COMPILER} -dumpversion + OUTPUT_VARIABLE CMAKE_CXX_COMPILER_VERSION OUTPUT_STRIP_TRAILING_WHITESPACE) +endif() + +set(ICINGA2_BUILD_COMPILER_VERSION "${CMAKE_CXX_COMPILER_VERSION}") + +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING" ICINGA2_LICENSE_GPL) +file(READ "${CMAKE_CURRENT_SOURCE_DIR}/COPYING.Exceptions" ICINGA2_LICENSE_ADDITIONS) +set(ICINGA2_LICENSE "${ICINGA2_LICENSE_GPL}\n\n---\n\n${ICINGA2_LICENSE_ADDITIONS}") +file(WRITE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt" ${ICINGA2_LICENSE}) + +file(STRINGS icinga2.spec SPEC_VERSION REGEX "^Version:") +string(LENGTH "${SPEC_VERSION}" SPEC_VERSION_LENGTH) +math(EXPR SPEC_VERSION_LENGTH "${SPEC_VERSION_LENGTH} - 9") +string(SUBSTRING ${SPEC_VERSION} 9 ${SPEC_VERSION_LENGTH} SPEC_VERSION) + +configure_file(icinga-spec-version.h.cmake icinga-spec-version.h) + +include(GetGitRevisionDescription) +git_describe(GIT_VERSION --tags) +if(EXISTS ${CMAKE_CURRENT_SOURCE_DIR}/icinga-version.h.force) + configure_file(icinga-version.h.force ${CMAKE_CURRENT_BINARY_DIR}/icinga-version.h COPYONLY) +else() + if(NOT ICINGA2_GIT_VERSION_INFO OR GIT_VERSION MATCHES "-NOTFOUND$") + file(STRINGS icinga2.spec SPEC_REVISION REGEX "^%define revision ") + string(LENGTH "${SPEC_REVISION}" SPEC_REVISION_LENGTH) + math(EXPR SPEC_REVISION_LENGTH "${SPEC_REVISION_LENGTH} - 17") + string(SUBSTRING ${SPEC_REVISION} 17 ${SPEC_REVISION_LENGTH} SPEC_REVISION) + + set(GIT_VERSION "r${SPEC_VERSION}-${SPEC_REVISION}") + endif() + configure_file(icinga-version.h.cmake icinga-version.h) +endif() + +if(WIN32) + set(Boost_USE_STATIC_LIBS ON) + add_definitions(-DBOOST_ALL_NO_LIB) + add_definitions(/bigobj) +endif() + +if(NOT DEFINED LOGROTATE_HAS_SU) + set(LOGROTATE_HAS_SU OFF) + find_program(LOGROTATE_BINARY logrotate) + execute_process(COMMAND ${LOGROTATE_BINARY} ERROR_VARIABLE LOGROTATE_OUTPUT) + if(LOGROTATE_OUTPUT) + string(REGEX REPLACE "^logrotate ([0-9.]*).*" "\\1" LOGROTATE_VERSION + ${LOGROTATE_OUTPUT}) + message(STATUS "Found logrotate (found version \"${LOGROTATE_VERSION}\")") + if("${LOGROTATE_VERSION}" VERSION_GREATER "3.7.9") + set(LOGROTATE_HAS_SU ON) + endif() + endif() +endif() +if(LOGROTATE_HAS_SU) + set(LOGROTATE_USE_SU "\n\tsu ${ICINGA2_USER} ${ICINGA2_GROUP}") +endif() + +find_package(Boost ${BOOST_MIN_VERSION} COMPONENTS thread system program_options regex REQUIRED) + +link_directories(${Boost_LIBRARY_DIRS}) +include_directories(${Boost_INCLUDE_DIRS}) + +find_package(OpenSSL REQUIRED) +include_directories(${OPENSSL_INCLUDE_DIR}) + +find_package(YAJL) + +if(NOT YAJL_FOUND) + include_directories(${icinga2_BINARY_DIR}/third-party/yajl/include) + link_directories(${icinga2_BINARY_DIR}/third-party/yajl) + set(YAJL_LIBRARIES "yajl") +endif() + +find_package(Editline) +set(HAVE_EDITLINE "${EDITLINE_FOUND}") + +find_package(Termcap) +set(HAVE_TERMCAP "${TERMCAP_FOUND}") + +include_directories( + ${CMAKE_CURRENT_SOURCE_DIR} ${CMAKE_CURRENT_SOURCE_DIR}/lib + ${CMAKE_CURRENT_BINARY_DIR} ${CMAKE_CURRENT_BINARY_DIR}/lib +) + +set(CMAKE_MACOSX_RPATH 1) + +if(CMAKE_CXX_COMPILER_ID MATCHES "Clang") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Qunused-arguments -g") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -Qunused-arguments -g") +endif() + +if(CMAKE_C_COMPILER_ID STREQUAL "SunPro") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -mt") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -mt -library=stlport4") +endif() + +if(CMAKE_C_COMPILER_ID STREQUAL "GNU") + if(CMAKE_SYSTEM_NAME MATCHES AIX) + set(CMAKE_CXX_FLAGS "${CMAKE_C_FLAGS} -g -lpthread") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -lpthread") + elseif(CMAKE_SYSTEM_NAME MATCHES "kOpenBSD.*|OpenBSD.*") + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pthread") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pthread") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -lpthread") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -lpthread") + else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g -pthread") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -g -pthread") + endif() + + if(NOT CMAKE_SYSTEM_NAME MATCHES AIX AND NOT CMAKE_SYSTEM_NAME MATCHES OpenBSD AND NOT CMAKE_SYSTEM_NAME MATCHES SunOS) + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -Wl,--gc-sections -Wl,--no-export-dynamic -Bsymbolic-functions -Wl,--dynamic-list-cpp-typeinfo -Wl,--dynamic-list-data") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,--gc-sections -Wl,--no-export-dynamic -Bsymbolic-functions -Wl,--dynamic-list-cpp-typeinfo -Wl,--dynamic-list-data") + endif() +endif() + +include(CheckCXXCompilerFlag) + +if(ICINGA2_LTO_BUILD) + check_cxx_compiler_flag("-flto" CXX_FLAG_LTO) + + if(NOT CXX_FLAG_LTO) + message(WARNING "Compiler does not support LTO, falling back to non-LTO build") + else() + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -flto") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -flto") + set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -flto") + set(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -flto") + endif() +endif() + +include(CheckCCompilerFlag) + +check_c_compiler_flag(-fvisibility-inlines-hidden HAVE_VISIBILITY_INLINES_HIDDEN) + +if(HAVE_VISIBILITY_INLINES_HIDDEN) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility-inlines-hidden") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility-inlines-hidden") +endif() + +check_c_compiler_flag(-fvisibility=hidden HAVE_VISIBILITY_HIDDEN) + +if(HAVE_VISIBILITY_HIDDEN) + set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fvisibility=hidden") + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fvisibility=hidden") +endif() + +if(MSVC) + add_definitions(-D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE -D_SCL_SECURE_NO_WARNINGS) +endif() + +set(LIBRARY_OUTPUT_PATH ${CMAKE_BINARY_DIR}/Bin/${CMAKE_BUILD_TYPE} CACHE PATH "Library output path") +set(EXECUTABLE_OUTPUT_PATH ${CMAKE_BINARY_DIR}/Bin/${CMAKE_BUILD_TYPE} CACHE PATH "Executable output path") + +include(CheckSymbolExists) +include(CheckFunctionExists) +include(CheckLibraryExists) +include(CheckIncludeFileCXX) + +check_symbol_exists(__COUNTER__ "" HAVE_COUNTER_MACRO) + +if(NOT HAVE_COUNTER_MACRO) +message(FATAL_ERROR "Your C/C++ compiler does not support the __COUNTER__ macro.") +endif() + +set(CMAKE_C_FLAGS_DEBUG "${CMAKE_C_FLAGS_DEBUG} -DI2_DEBUG") +set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DI2_DEBUG") + +check_function_exists(vfork HAVE_VFORK) +check_function_exists(backtrace_symbols HAVE_BACKTRACE_SYMBOLS) +check_function_exists(pipe2 HAVE_PIPE2) +check_function_exists(nice HAVE_NICE) +check_library_exists(dl dladdr "dlfcn.h" HAVE_DLADDR) +check_library_exists(execinfo backtrace_symbols "" HAVE_LIBEXECINFO) +check_include_file_cxx(cxxabi.h HAVE_CXXABI_H) + +if(HAVE_LIBEXECINFO) + set(HAVE_BACKTRACE_SYMBOLS TRUE) +endif() + +if(CMAKE_CXX_COMPILER_ID STREQUAL "GNU") + exec_program(${CMAKE_CXX_COMPILER} + ARGS -dumpversion + OUTPUT_VARIABLE _ICINGA2_COMPILER_VERSION + ) + + if("${CMAKE_CXX_COMPILER_VERSION}" VERSION_LESS "4.6.0") + message(FATAL_ERROR "Your version of GCC (${CMAKE_CXX_COMPILER_VERSION}) is too old for building Icinga 2 (GCC >= 4.6.0 is required).") + endif() +endif() + +if(NOT MSVC) + set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=c++0x") + + check_cxx_source_compiles("class Base { public: virtual void test(void) { } }; class Derived : public Base { virtual void test(void) override { } }; int main(){}" CXX_FEATURE_OVERRIDE) + + if(NOT CXX_FEATURE_OVERRIDE) + add_definitions("-Doverride=") + endif() +endif() + +configure_file(config.h.cmake ${CMAKE_CURRENT_BINARY_DIR}/config.h ESCAPE_QUOTES) + +install( + FILES README.md COPYING COPYING.Exceptions AUTHORS ChangeLog NEWS + DESTINATION ${CMAKE_INSTALL_DOCDIR} +) + +include(CTest) +enable_testing() + +set_property(GLOBAL PROPERTY USE_FOLDERS ON) + +add_subdirectory(third-party) +add_subdirectory(tools) +add_subdirectory(lib) +add_subdirectory(icinga-app) +add_subdirectory(etc) +add_subdirectory(itl) +add_subdirectory(doc) +add_subdirectory(agent) +add_subdirectory(plugins) +add_subdirectory(choco) + +if(MSVC) + add_subdirectory(icinga-installer) +endif() + +if(ICINGA2_WITH_STUDIO) + add_subdirectory(icinga-studio) +endif() + +if(ICINGA2_WITH_TESTS) + add_subdirectory(test) +endif() + +set(CPACK_PACKAGE_NAME "Icinga 2") +set(CPACK_PACKAGE_VENDOR "Icinga Development Team") +set(CPACK_PACKAGE_VERSION ${ICINGA2_VERSION}) +set(CPACK_PACKAGE_INSTALL_DIRECTORY "ICINGA2") +set(CPACK_PACKAGE_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icinga-app\\\\icinga.ico") +set(CPACK_RESOURCE_FILE_LICENSE "${CMAKE_CURRENT_BINARY_DIR}/LICENSE.txt") + +set(CPACK_PACKAGE_EXECUTABLES "Icinga2SetupAgent;Icinga 2 Agent Wizard;icinga-studio;Icinga Studio") +set(CPACK_WIX_PRODUCT_ICON "${CMAKE_CURRENT_SOURCE_DIR}/icinga-app\\\\icinga.ico") +set(CPACK_WIX_UPGRADE_GUID "52F2BEAA-4DF0-4C3E-ABDC-C0F61DE4DF8A") +set(CPACK_WIX_EXTENSIONS "WixUtilExtension") +set(CPACK_WIX_UI_BANNER "${CMAKE_CURRENT_SOURCE_DIR}/icinga-installer/bannrbmp.bmp") +set(CPACK_WIX_UI_DIALOG "${CMAKE_CURRENT_SOURCE_DIR}/icinga-installer/dlgbmp.bmp") +set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/icinga-installer/icinga2.wixpatch.Debug") +set(CPACK_WIX_PATCH_FILE "${CMAKE_CURRENT_BINARY_DIR}/icinga-installer/icinga2.wixpatch") + +set(CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS_SKIP TRUE) +include(InstallRequiredSystemLibraries) + +if(WIN32) + if(CMAKE_VS_PLATFORM_NAME STREQUAL "x64") + set(NSCP_URL "https://github.com/mickem/nscp/releases/download/0.4.4.19/NSCP-0.4.4.19-x64.msi") + set(NSCP_SHA256 "36c487777e9488cbf7a15db3a87f63ff6d6af46398d6f36b25734041e3e13900") + else() + set(NSCP_URL "https://github.com/mickem/nscp/releases/download/0.4.4.19/NSCP-0.4.4.19-Win32.msi") + set(NSCP_SHA256 "f05bc00712966901531d5a9354c57e95c34eb65b4748cf3ebc305ccc8fa29cce") + endif() + + set(NSCP_SHA256SUM "") + if (EXISTS ${CMAKE_CURRENT_BINARY_DIR}/NSCP.msi) + file(SHA256 ${CMAKE_CURRENT_BINARY_DIR}/NSCP.msi NSCP_SHA256SUM) + endif() + + if (NOT EXISTS ${CMAKE_CURRENT_BINARY_DIR}/NSCP.msi OR NOT ${NSCP_SHA256SUM} STREQUAL ${NSCP_SHA256}) + file(DOWNLOAD ${NSCP_URL} ${CMAKE_CURRENT_BINARY_DIR}/NSCP.msi SHOW_PROGRESS) + endif() + + install(FILES ${CMAKE_CURRENT_BINARY_DIR}/NSCP.msi DESTINATION ${CMAKE_INSTALL_SBINDIR}) + + install( + PROGRAMS ${CMAKE_INSTALL_SYSTEM_RUNTIME_LIBS} + ${OPENSSL_INCLUDE_DIR}/../bin/libeay32.dll ${OPENSSL_INCLUDE_DIR}/../bin/ssleay32.dll + DESTINATION ${CMAKE_INSTALL_SBINDIR} + ) +endif() + +include(CPack) diff --git a/vim/bundle/icinga2/COPYING b/vim/bundle/icinga2/COPYING new file mode 100644 index 0000000..7e14f38 --- /dev/null +++ b/vim/bundle/icinga2/COPYING @@ -0,0 +1,339 @@ + GNU GENERAL PUBLIC LICENSE + Version 2, June 1991 + + Copyright (C) 1989, 1991 Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +License is intended to guarantee your freedom to share and change free +software--to make sure the software is free for all its users. This +General Public License applies to most of the Free Software +Foundation's software and to any other program whose authors commit to +using it. (Some other Free Software Foundation software is covered by +the GNU Lesser General Public License instead.) You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +this service if you wish), that you receive source code or can get it +if you want it, that you can change the software or use pieces of it +in new free programs; and that you know you can do these things. + + To protect your rights, we need to make restrictions that forbid +anyone to deny you these rights or to ask you to surrender the rights. +These restrictions translate to certain responsibilities for you if you +distribute copies of the software, or if you modify it. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must give the recipients all the rights that +you have. You must make sure that they, too, receive or can get the +source code. And you must show them these terms so they know their +rights. + + We protect your rights with two steps: (1) copyright the software, and +(2) offer you this license which gives you legal permission to copy, +distribute and/or modify the software. + + Also, for each author's protection and ours, we want to make certain +that everyone understands that there is no warranty for this free +software. If the software is modified by someone else and passed on, we +want its recipients to know that what they have is not the original, so +that any problems introduced by others will not reflect on the original +authors' reputations. + + Finally, any free program is threatened constantly by software +patents. We wish to avoid the danger that redistributors of a free +program will individually obtain patent licenses, in effect making the +program proprietary. To prevent this, we have made it clear that any +patent must be licensed for everyone's free use or not licensed at all. + + The precise terms and conditions for copying, distribution and +modification follow. + + GNU GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License applies to any program or other work which contains +a notice placed by the copyright holder saying it may be distributed +under the terms of this General Public License. The "Program", below, +refers to any such program or work, and a "work based on the Program" +means either the Program or any derivative work under copyright law: +that is to say, a work containing the Program or a portion of it, +either verbatim or with modifications and/or translated into another +language. (Hereinafter, translation is included without limitation in +the term "modification".) Each licensee is addressed as "you". + +Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running the Program is not restricted, and the output from the Program +is covered only if its contents constitute a work based on the +Program (independent of having been made by running the Program). +Whether that is true depends on what the Program does. + + 1. You may copy and distribute verbatim copies of the Program's +source code as you receive it, in any medium, provided that you +conspicuously and appropriately publish on each copy an appropriate +copyright notice and disclaimer of warranty; keep intact all the +notices that refer to this License and to the absence of any warranty; +and give any other recipients of the Program a copy of this License +along with the Program. + +You may charge a fee for the physical act of transferring a copy, and +you may at your option offer warranty protection in exchange for a fee. + + 2. You may modify your copy or copies of the Program or any portion +of it, thus forming a work based on the Program, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) You must cause the modified files to carry prominent notices + stating that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in + whole or in part contains or is derived from the Program or any + part thereof, to be licensed as a whole at no charge to all third + parties under the terms of this License. + + c) If the modified program normally reads commands interactively + when run, you must cause it, when started running for such + interactive use in the most ordinary way, to print or display an + announcement including an appropriate copyright notice and a + notice that there is no warranty (or else, saying that you provide + a warranty) and that users may redistribute the program under + these conditions, and telling the user how to view a copy of this + License. (Exception: if the Program itself is interactive but + does not normally print such an announcement, your work based on + the Program is not required to print an announcement.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Program, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Program, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Program. + +In addition, mere aggregation of another work not based on the Program +with the Program (or with a work based on the Program) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may copy and distribute the Program (or a work based on it, +under Section 2) in object code or executable form under the terms of +Sections 1 and 2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable + source code, which must be distributed under the terms of Sections + 1 and 2 above on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three + years, to give any third party, for a charge no more than your + cost of physically performing source distribution, a complete + machine-readable copy of the corresponding source code, to be + distributed under the terms of Sections 1 and 2 above on a medium + customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer + to distribute corresponding source code. (This alternative is + allowed only for noncommercial distribution and only if you + received the program in object code or executable form with such + an offer, in accord with Subsection b above.) + +The source code for a work means the preferred form of the work for +making modifications to it. For an executable work, complete source +code means all the source code for all modules it contains, plus any +associated interface definition files, plus the scripts used to +control compilation and installation of the executable. However, as a +special exception, the source code distributed need not include +anything that is normally distributed (in either source or binary +form) with the major components (compiler, kernel, and so on) of the +operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering +access to copy from a designated place, then offering equivalent +access to copy the source code from the same place counts as +distribution of the source code, even though third parties are not +compelled to copy the source along with the object code. + + 4. You may not copy, modify, sublicense, or distribute the Program +except as expressly provided under this License. Any attempt +otherwise to copy, modify, sublicense or distribute the Program is +void, and will automatically terminate your rights under this License. +However, parties who have received copies, or rights, from you under +this License will not have their licenses terminated so long as such +parties remain in full compliance. + + 5. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Program or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Program (or any work based on the +Program), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + + 6. Each time you redistribute the Program (or any work based on the +Program), the recipient automatically receives a license from the +original licensor to copy, distribute or modify the Program subject to +these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties to +this License. + + 7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Program at all. For example, if a patent +license would not permit royalty-free redistribution of the Program by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under +any particular circumstance, the balance of the section is intended to +apply and the section as a whole is intended to apply in other +circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system, which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 8. If the distribution and/or use of the Program is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Program under this License +may add an explicit geographical distribution limitation excluding +those countries, so that distribution is permitted only in or among +countries not thus excluded. In such case, this License incorporates +the limitation as if written in the body of this License. + + 9. The Free Software Foundation may publish revised and/or new versions +of the General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any +later version", you have the option of following the terms and conditions +either of that version or of any later version published by the Free +Software Foundation. If the Program does not specify a version number of +this License, you may choose any version ever published by the Free Software +Foundation. + + 10. If you wish to incorporate parts of the Program into other free +programs whose distribution conditions are different, write to the author +to ask for permission. For software which is copyrighted by the Free +Software Foundation, write to the Free Software Foundation; we sometimes +make exceptions for this. Our decision will be guided by the two goals +of preserving the free status of all derivatives of our free software and +of promoting the sharing and reuse of software generally. + + NO WARRANTY + + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, +REPAIR OR CORRECTION. + + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE +POSSIBILITY OF SUCH DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this +when it starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author + Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may +be called something other than `show w' and `show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the program, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + `Gnomovision' (which makes passes at compilers) written by James Hacker. + + , 1 April 1989 + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. \ No newline at end of file diff --git a/vim/bundle/icinga2/COPYING.Exceptions b/vim/bundle/icinga2/COPYING.Exceptions new file mode 100644 index 0000000..d84e355 --- /dev/null +++ b/vim/bundle/icinga2/COPYING.Exceptions @@ -0,0 +1,13 @@ +In addition, as a special exception, the copyright holders give +permission to link the code of portions of this program with the +OpenSSL library under certain conditions as described in each +individual source file, and distribute linked combinations including +the two. + +You must obey the GNU General Public License in all respects for all +of the code used other than OpenSSL. If you modify file(s) with this +exception, you may extend this exception to your version of the +file(s), but you are not obligated to do so. If you do not wish to do +so, delete this exception statement from your version. If you delete +this exception statement from all source files in the program, then +also delete it here. diff --git a/vim/bundle/icinga2/ChangeLog b/vim/bundle/icinga2/ChangeLog new file mode 100644 index 0000000..520c628 --- /dev/null +++ b/vim/bundle/icinga2/ChangeLog @@ -0,0 +1,2034 @@ +# Icinga 2.x CHANGELOG + +Please check [doc/1-about.md]. + +## What's New + +### What's New in Version 2.5.4 + +#### Bugfixes + +* Bug 11932 (Checker): many check commands executed at same time when master reload + +### What's New in Version 2.5.3 + +#### Changes + +This release addresses an issue with PostgreSQL support for the IDO database module. + +#### Bugfixes + +* Bug 12533 (DB IDO): ido pgsql migration from 2.4.0 to 2.5.0 : wrong size for config_hash + +### What's New in Version 2.5.2 + +#### Bugfixes + +* Bug 12527 (DB IDO): Newly added group member tables in the IDO database are not updated +* Bug 12529 (Checker): Icinga 2 sends SOFT recovery notifications + +### What's New in Version 2.5.1 + +#### Bugfixes + +* Bug 12517 (Notifications): Icinga 2 sends recovery notifications for SOFT NOT-OK states + +### What's New in Version 2.5.0 + +#### Changes + +* InfluxdbWriter feature +* API + * New endpoints: /v1/variables and /v1/templates (GET requests), /v1/action/generate-ticket (POST request) + * State/type filters for notifications/users are now string values (PUT, POST, GET requests) +* Configuration + * TimePeriod excludes/includes attributes + * DateTime object for formatting time strings + * New prototype methods: Array#filter, Array#unique, Array#map, Array#reduce + * icinga2.conf now includes plugins-contrib, manubulon, windows-plugins, nscp by default (ITL CheckCommand definitions) + * Performance improvements (config compiler and validation) +* CLI + * 'icinga2 object list' formats state/type filters as string values + * Compiled config files are now visible with "notice" debug level (hidden by default) + * CA serial file now uses a hash value (HA cluster w/ 2 CA directories) +* Cluster + * There is a known issue with >2 endpoints inside a zone. Icinga 2 will now log a warning. + * Support for accepted ciphers and minimum TLS version + * Connection and error logging has been improved. +* DB IDO + * Schema upgrade required (2.5.0.sql) + * Incremental config dump (performance boost) + * `categories` attribute is now an array. Previous method is deprecated and to be removed. + * DbCatLog is not enabled by default anymore. + * SSL support for MySQL +* New packages + * vim-icinga2 for syntax highlighting + * libicinga2 (Debian), icinga2-libs (RPM) for Icinga Studio packages + +#### Feature + +* Feature 7355 (libicinga): Exclude option for TimePeriod definitions +* Feature 8401 (Packages): Package for syntax highlighting +* Feature 9184 (Perfdata): Add timestamp support for GelfWriter +* Feature 9264 (ITL): Extend CheckCommand definitions for nscp-local +* Feature 9725 (DB IDO): Add SSL support for the IdoMysqlConnection feature +* Feature 9839 (Configuration): Implement support for formatting date/time +* Feature 9858 (Perfdata): Gelf module: expose 'perfdata' fields for 'CHECK_RESULT' events +* Feature 10140 (libicinga): Remove the deprecated IcingaStatusWriter feature +* Feature 10480 (Perfdata): Add InfluxDbWriter feature +* Feature 10553 (Documentation): Update SELinux documentation +* Feature 10669 (ITL): Add IPv4/IPv6 support to the rest of the monitoring-plugins +* Feature 10722 (ITL): icinga2.conf: Include plugins-contrib, manubulon, windows-plugins, nscp by default +* Feature 10816 (libbase): Add name attribute for WorkQueue class +* Feature 10952 (Packages): Provide packages for icinga-studio on Fedora +* Feature 11063 (API): Implement SSL cipher configuration support for the API feature +* Feature 11290 (API): ApiListener: Force server's preferred cipher +* Feature 11292 (API): ApiListener: Make minimum TLS version configurable +* Feature 11359 (ITL): Add "retries" option to check_snmp command +* Feature 11419 (Configuration): Config parser should not log names of included files by default +* Feature 11423 (libicinga): Cleanup downtimes created by ScheduleDowntime +* Feature 11445 (Configuration): Allow strings in state/type filters +* Feature 11599 (Documentation): Documentation review +* Feature 11612 (Configuration): Improve performance for field accesses +* Feature 11623 (Installation): Add script for automatically cherry-picking commits for minor versions +* Feature 11659 (Configuration): Remove the (unused) 'inherits' keyword +* Feature 11706 (API): Improve logging for HTTP API requests +* Feature 11739 (Packages): Windows Installer: Remove dependency on KB2999226 package +* Feature 11772 (Cluster): Add lag threshold for cluster-zone check +* Feature 11837 (Documentation): Use HTTPS for debmon.org links in the documentation +* Feature 11869 (ITL): Add CIM port parameter for esxi_hardware CheckCommand +* Feature 11875 (Tests): Add debugging mode for Utility::GetTime +* Feature 11931 (ITL): Adding option to access ifName for manubulon snmp-interface check command +* Feature 11941 (API): Support for enumerating available templates via the API +* Feature 11955 (API): Implement support for getting a list of global variables from the API +* Feature 11967 (DB IDO): Update DB IDO schema version to 1.14.1 +* Feature 11968 (DB IDO): Enhance IDO check with schema version info +* Feature 11970 (ITL): add check command for plugin check_apache_status +* Feature 12006 (ITL): Add check command definitions for kdc and rbl +* Feature 12018 (Graphite): Add acknowledgement type to Graphite, InfluxDB, OpenTSDB metadata +* Feature 12024 (DB IDO): Change Ido*Connection 'categories' attribute to an array +* Feature 12041 (API): API: Add missing downtime_depth attribute +* Feature 12061 (ITL): Add check command definition for db2_health +* Feature 12106 (DB IDO): Do not populate logentries table by default +* Feature 12116 (Cluster): Enhance client disconnect message for "No data received on new API connection." +* Feature 12189 (ITL): Add support for "-A" command line switch to CheckCommand "snmp-process" +* Feature 12194 (Cluster): Improve log message for connecting nodes without configured Endpoint object +* Feature 12201 (Cluster): Improve error messages for failed certificate validation +* Feature 12215 (Cluster): Include IP address and port in the "New connection" log message +* Feature 12221 (ITL): A lot of missing parameters for (latest) mysql_health +* Feature 12222 (Cluster): Log a warning if there are more than 2 zone endpoint members +* Feature 12234 (CLI): Add history for icinga2 console +* Feature 12247 (Configuration): Add map/reduce and filter functionality for the Array class +* Feature 12254 (API): Remove obsolete debug log message +* Feature 12256 (ITL): Add check command definition for check_graphite +* Feature 12287 (Cluster): Enhance TLS handshake error messages with connection information +* Feature 12304 (Notifications): Add the notification type into the log message +* Feature 12314 (ITL): Add command definition for check_mysql_query +* Feature 12327 (API): Support for determining the Icinga 2 version via the API +* Feature 12329 (libicinga): Implement process_check_result script method for the Checkable class +* Feature 12336 (libbase): Improve logging for the WorkQueue class +* Feature 12338 (Configuration): Move internal script functions into the 'Internal' namespace +* Feature 12386 (Documentation): Rewrite Client and Cluster chapter and; add service monitoring chapter +* Feature 12389 (libbase): Include compiler name/version and build host name in --version +* Feature 12392 (ITL): Add custom variables for all check_swap arguments +* Feature 12393 (libbase): Implement support for marking functions as deprecated +* Feature 12407 (CLI): Implement support for inspecting variables with LLDB/GDB +* Feature 12408 (Configuration): Implement support for namespaces +* Feature 12412 (Documentation): Add URL and short description for Monitoring Plugins inside the ITL documentation +* Feature 12424 (ITL): Add perfsyntax parameter to nscp-local-counter CheckCommand +* Feature 12426 (Configuration): Implement comparison operators for the Array class +* Feature 12433 (API): Add API action for generating a PKI ticket +* Feature 12434 (DB IDO): Remove unused code from the IDO classes +* Feature 12435 (DB IDO): Incremental updates for the IDO database +* Feature 12448 (libbase): Improve performance for type lookups +* Feature 12450 (Cluster): Improve performance for Endpoint config validation +* Feature 12457 (libbase): Remove unnecessary Dictionary::Contains calls +* Feature 12468 (ITL): Add interfacetable CheckCommand options --trafficwithpkt and --snmp-maxmsgsize +* Feature 12477 (Documentation): Development docs: Add own section for gdb backtrace from a running process +* Feature 12481 (libbase): Remove some unused #includes + +#### Bugfixes + +* Bug 7354 (libicinga): Disable immediate hard state after first checkresult +* Bug 9242 (Cluster): Custom notification external commands do not work in a master-master setup +* Bug 9848 (libbase): Function::Invoke should optionally register ScriptFrame +* Bug 10061 (DB IDO): IDO: icinga_host/service_groups alias columns are TEXT columns +* Bug 10066 (DB IDO): Missing indexes for icinga_endpoints* and icinga_zones* tables in DB IDO schema +* Bug 10069 (DB IDO): IDO: check_source should not be a TEXT field +* Bug 10070 (DB IDO): IDO: there is no usable object index on icinga_{scheduleddowntime,comments} +* Bug 10075 (libbase): Race condition in CreatePipeOverlapped +* Bug 10363 (Notifications): Notification times w/ empty begin/end specifications prevent sending notifications +* Bug 10570 (API): /v1 returns HTML even if JSON is requested +* Bug 10903 (Perfdata): GELF multi-line output +* Bug 10937 (Configuration): High CPU usage with self-referenced parent zone config +* Bug 11182 (DB IDO): IDO: entry_time of all comments is set to the date and time when Icinga 2 was restarted +* Bug 11196 (Cluster): High load when pinning command endpoint on HA cluster +* Bug 11483 (libicinga): Numbers are not properly formatted in runtime macro strings +* Bug 11562 (Notifications): last_problem_notification should be synced in HA cluster +* Bug 11590 (Notifications): notification interval = 0 not honoured in HA clusters +* Bug 11622 (Configuration): Don't allow flow control keywords outside of other flow control constructs +* Bug 11648 (Packages): Reload permission error with SELinux +* Bug 11650 (Packages): RPM update starts disabled icinga2 service +* Bug 11688 (DB IDO): Outdated downtime/comments not removed from IDO database (restart) +* Bug 11730 (libicinga): Icinga 2 client gets killed during network scans +* Bug 11782 (Packages): Incorrect filter in pick.py +* Bug 11793 (Documentation): node setup: Add a note for --endpoint syntax for client-master connection +* Bug 11817 (Installation): Windows: Error with repository handler (missing /var/lib/icinga2/api/repository path) +* Bug 11823 (DB IDO): Volatile check results for OK->OK transitions are logged into DB IDO statehistory +* Bug 11825 (libicinga): Problems with check scheduling for HARD state changes (standalone/command_endpoint) +* Bug 11832 (Tests): Boost tests are missing a dependency on libmethods +* Bug 11847 (Documentation): Missing quotes for API action URL +* Bug 11851 (Notifications): Downtime notifications do not pass author and comment +* Bug 11862 (libicinga): SOFT OK-state after returning from a soft state +* Bug 11887 (ITL): Add "fuse.gvfsd-fuse" to the list of excluded file systems for check_disk +* Bug 11890 (Configuration): Config validation should not delete comments/downtimes w/o reference +* Bug 11894 (Configuration): Incorrect custom variable name in the hosts.conf example config +* Bug 11898 (libicinga): last SOFT state should be hard (max_check_attempts) +* Bug 11899 (libicinga): Flapping Notifications dependent on state change +* Bug 11903 (Documentation): Fix systemd client command formatting +* Bug 11905 (Documentation): Improve "Endpoint" documentation +* Bug 11926 (API): Trying to delete an object protected by a permissions filter, ends up deleting all objects that match the filter instead +* Bug 11933 (DB IDO): SOFT state changes with the same state are not logged +* Bug 11962 (DB IDO): Overflow in current_notification_number column in DB IDO MySQL +* Bug 11991 (Documentation): Incorrect URL for API examples in the documentation +* Bug 11993 (DB IDO): Comment/Downtime delete queries are slow +* Bug 12003 (libbase): Hang in TlsStream::Handshake +* Bug 12008 (Documentation): Add a note about creating Zone/Endpoint objects with the API +* Bug 12016 (Configuration): ConfigWriter::EmitScope incorrectly quotes dictionary keys +* Bug 12022 (Configuration): Icinga crashes when using include_recursive in an object definition +* Bug 12029 (Documentation): Migration docs still show unsupported CHANGE_*MODATTR external commands +* Bug 12044 (Packages): Icinga fails to build with OpenSSL 1.1.0 +* Bug 12046 (Documentation): Typo in Manubulon CheckCommand documentation +* Bug 12067 (Documentation): Documentation: Setting up Plugins section is broken +* Bug 12077 (Documentation): Add a note to the docs that API POST updates to custom attributes/groups won't trigger re-evaluation +* Bug 12085 (DB IDO): deadlock in ido reconnect +* Bug 12092 (API): Icinga incorrectly disconnects all endpoints if one has a wrong certificate +* Bug 12098 (Configuration): include_recursive should gracefully handle inaccessible files +* Bug 12099 (Packages): Build fails with Visual Studio 2013 +* Bug 12100 (libbase): Ensure to clear the SSL error queue before calling SSL_{read,write,do_handshake} +* Bug 12107 (DB IDO): Add missing index on state history for DB IDO cleanup +* Bug 12135 (ITL): ITL: check_iftraffic64.pl default values, wrong postfix value in CheckCommand +* Bug 12144 (Documentation): pkg-config is not listed as a build requirement in INSTALL.md +* Bug 12147 (DB IDO): IDO module starts threads before daemonize +* Bug 12179 (Cluster): Duplicate messages for command_endpoint w/ master and satellite +* Bug 12180 (Cluster): CheckerComponent sometimes fails to schedule checks in time +* Bug 12193 (Cluster): Increase cluster reconnect interval +* Bug 12199 (API): Fix URL encoding for '&' +* Bug 12204 (Documentation): Improve author information about check_yum +* Bug 12210 (DB IDO): Do not clear {host,service,contact}group_members tables on restart +* Bug 12216 (libicinga): icinga check reports "-1" for minimum latency and execution time and only uptime has a number but 0 +* Bug 12217 (Documentation): Incorrect documentation about apply rules in zones.d directories +* Bug 12219 (Documentation): Missing explanation for three level clusters with CSR auto-signing +* Bug 12225 (libicinga): Icinga stats min_execution_time and max_execution_time are invalid +* Bug 12227 (Perfdata): Incorrect escaping / formatting of perfdata to InfluxDB +* Bug 12237 (Installation): Increase default systemd timeout +* Bug 12257 (Notifications): Notification interval mistimed +* Bug 12259 (Documentation): Incorrect API permission name for /v1/status in the documentation +* Bug 12267 (Notifications): Multiple notifications when master fails +* Bug 12274 (ITL): -q option for check_ntp_time is wrong +* Bug 12288 (DB IDO): Change the way outdated comments/downtimes are deleted on restart +* Bug 12293 (Notifications): Missing notification for recovery during downtime +* Bug 12302 (Cluster): Remove obsolete README files in tools/syntax +* Bug 12310 (Notifications): Notification sent too fast when one master fails +* Bug 12318 (Configuration): Icinga doesn't delete temporary icinga2.debug file when config validation fails +* Bug 12331 (libbase): Fix building Icinga with -fvisibility=hidden +* Bug 12333 (Notifications): Incorrect downtime notification events +* Bug 12334 (libbase): Handle I/O errors while writing the Icinga state file more gracefully +* Bug 12390 (libbase): Disallow casting "" to an Object +* Bug 12391 (libbase): Don't violate POSIX by ensuring that the argument to usleep(3) is less than 1000000 +* Bug 12395 (libicinga): Flexible downtimes should be removed after trigger_time+duration +* Bug 12401 (DB IDO): Fixed downtime start does not update actual_start_time +* Bug 12402 (Notifications): Notification resent, even if interval = 0 +* Bug 12404 (Notifications): Add log message if notifications are forced (i.e. filters are not checked) +* Bug 12409 (Configuration): 'use' keyword cannot be used with templates +* Bug 12416 (Documentation): The description for the http_certificate attribute doesn't have the right default value +* Bug 12417 (DB IDO): IDO does duplicate config updates +* Bug 12418 (DB IDO): IDO marks objects as inactive on shutdown +* Bug 12422 (CLI): pki sign-csr does not log where it is writing the certificate file +* Bug 12425 (libicinga): CompatUtility::GetCheckableNotificationStateFilter is returning an incorrect value +* Bug 12428 (DB IDO): Fix the "ido" check command for use with command_endpoint +* Bug 12430 (DB IDO): ido CheckCommand returns returns "Could not connect to database server" when HA enabled +* Bug 12432 (Cluster): Only allow sending command_endpoint checks to directly connected child zones +* Bug 12438 (libbase): Replace GetType()->GetName() calls with GetReflectionType()->GetName() +* Bug 12442 (Documentation): Missing documentation for "legacy-timeperiod" template +* Bug 12452 (Installation): Remove unused functions from icinga-installer +* Bug 12453 (libbase): Use hash-based serial numbers for new certificates +* Bug 12454 (API): API: action schedule-downtime requires a duration also when fixed is true +* Bug 12458 (DB IDO): Insert fails for the icinga_scheduleddowntime table due to duplicate key +* Bug 12459 (DB IDO): Query for customvariablestatus incorrectly updates the host's/service's insert ID +* Bug 12460 (Cluster): DB IDO started before daemonizing (no systemd) +* Bug 12461 (DB IDO): IDO query fails due to key contraint violation for the icinga_customvariablestatus table +* Bug 12464 (API): API: events for DowntimeTriggered does not provide needed information +* Bug 12473 (Documentation): Docs: API example uses wrong attribute name +* Bug 12474 (libmethods): ClrCheck is null on *nix +* Bug 12475 (Cluster): Incorrect certificate validation error message +* Bug 12487 (Configuration): Memory leak when using closures +* Bug 12488 (Documentation): Typo in Notification object documentation + +### What's New in Version 2.4.10 + +#### Bugfixes + +* Bug 11812 (Checker): Checker component doesn't execute any checks for command_endpoint + +### What's New in Version 2.4.9 + +#### Changes + +This release fixes a number of issues introduced in 2.4.8. + +#### Bugfixes + +* Bug 11801 (Perfdata): Error: Function call 'rename' for file '/var/spool/icinga2/tmp/service-perfdata' failed with error code 2, 'No such file or directory' +* Bug 11804 (Configuration): Segfault when trying to start 2.4.8 +* Bug 11807 (Compat): Command Pipe thread 100% CPU Usage + +### What's New in Version 2.4.8 + +#### Changes + +* Bugfixes +* Support for limiting the maximum number of concurrent checks (new configuration option) +* HA-aware features now wait for connected cluster nodes in the same zone (e.g. DB IDO) +* The 'icinga' check now alerts on failed reloads + +#### Feature + +* Feature 8137 (Checker): Maximum concurrent service checks +* Feature 9236 (Perfdata): PerfdataWriter: Better failure handling for file renames across file systems +* Feature 9997 (libmethods): "icinga" check should have state WARNING when the last reload failed +* Feature 10581 (ITL): Provide icingacli in the ITL +* Feature 11556 (libbase): Add support for subjectAltName in SSL certificates +* Feature 11651 (CLI): Implement SNI support for the CLI commands +* Feature 11720 (ITL): 'disk' CheckCommand: Exclude 'cgroup' and 'tracefs' by default +* Feature 11748 (Cluster): Remove unused cluster commands +* Feature 11765 (Cluster): Only activate HARunOnce objects once there's a cluster connection +* Feature 11768 (Documentation): Add the category to the generated changelog + +#### Bugfixes + +* Bug 9989 (Configuration): Service apply without name possible +* Bug 10426 (libicinga): Icinga crashes with a segfault on receiving a lot of check results for nonexisting hosts/services +* Bug 10717 (Configuration): Comments and downtimes of deleted checkable objects are not deleted +* Bug 11046 (Cluster): Icinga2 agent gets stuck after disconnect and won't relay messages +* Bug 11112 (Compat): Empty author/text attribute for comment/downtimes external commands causing crash +* Bug 11147 (libicinga): "day -X" time specifications are parsed incorrectly +* Bug 11158 (libicinga): Crash with empty ScheduledDowntime 'ranges' attribute +* Bug 11374 (API): Icinga2 API: deleting service with cascade=1 does not delete dependant notification +* Bug 11390 (Compat): Command pipe overloaded: Can't send external Icinga command to the local command file +* Bug 11396 (API): inconsistent API /v1/objects/* response for PUT requests +* Bug 11589 (libicinga): notification sent out during flexible downtime +* Bug 11645 (Documentation): Incorrect chapter headings for Object#to_string and Object#type +* Bug 11646 (Configuration): Wrong log severity causes segfault +* Bug 11686 (API): Icinga Crash with the workflow Create_Host-> Downtime for the Host -> Delete Downtime -> Remove Host +* Bug 11711 (libicinga): Expired downtimes are not removed +* Bug 11714 (libbase): Crash in UnameHelper +* Bug 11742 (Documentation): Missing documentation for event commands w/ execution bridge +* Bug 11757 (API): API: Missing error handling for invalid JSON request body +* Bug 11767 (DB IDO): Ensure that program status updates are immediately updated in DB IDO +* Bug 11779 (API): Incorrect variable names for joined fields in filters + +### What's New in Version 2.4.7 + +#### Bugfixes + +* Bug 11639: Crash in IdoMysqlConnection::ExecuteMultipleQueries + +### What's New in Version 2.4.6 + +#### Feature + +* Feature 11638: Update RELEASE.md + +#### Bugfixes + +* Bug 11628: Docs: Zone attribute 'endpoints' is an array +* Bug 11634: Icinga 2 fails to build on Ubuntu Xenial +* Bug 11635: Failed assertion in IdoPgsqlConnection::FieldToEscapedString + +### What's New in Version 2.4.5 + +#### Changes + +* Windows Installer changed from NSIS to MSI +* New configuration attribute for hosts and services: check_timeout (overrides the CheckCommand's timeout when set) +* ITL updates +* Lots of bugfixes + +#### Feature + +* Feature 9283: Implement support for overriding check command timeout +* Feature 9618: Add Windows setup wizard screenshots +* Feature 11098: Add --method parameter for check_{oracle,mysql,mssql}_health CheckCommands +* Feature 11194: Add --units, --rate and --rate-multiplier support for the snmpv3 check command +* Feature 11399: Update .mailmap for Markus Frosch +* Feature 11437: Add silent install / reference to NSClient++ to documentation +* Feature 11449: Build 64-bit packages for Windows +* Feature 11473: Update NSClient++ to version 0.4.4.19 +* Feature 11474: Install 64-bit version of NSClient++ on 64-bit versions of Windows +* Feature 11585: Make sure to update the agent wizard banner +* Feature 11587: Update chocolatey uninstall script for the MSI package + +#### Bugfixes + +* Bug 9249: logrotate fails since the "su" directive was removed +* Bug 10624: Add application manifest for the Windows agent wizard +* Bug 10843: DB IDO: downtime is not in effect after restart +* Bug 11106: Too many assign where filters cause stack overflow +* Bug 11224: Socket Exceptions (Operation not permitted) while reading from API +* Bug 11227: Downtimes and Comments are not synced to child zones +* Bug 11258: Incorrect base URL in the icinga-rpm-release packages for Fedora +* Bug 11336: Use retry_interval instead of check_interval for first OK -> NOT-OK state change +* Bug 11347: Symlink subfolders not followed/considered for config files +* Bug 11382: Downtimes are not always activated/expired on restart +* Bug 11384: Remove dependency for .NET 3.5 from the chocolatey package +* Bug 11387: IDO: historical contact notifications table column notification_id is off-by-one +* Bug 11402: Explain how to use functions for wildcard matches for arrays and/or dictionaries in assign where expressions +* Bug 11407: Docs: Remove the migration script chapter +* Bug 11434: Config validation for Notification objects should check whether the state filters are valid +* Bug 11435: Icinga 2 Windows Agent does not honor install path during upgrade +* Bug 11438: Remove semi-colons in the auto-generated configs +* Bug 11439: Update the CentOS installation documentation +* Bug 11440: Docs: Cluster manual SSL generation formatting is broken +* Bug 11455: ConfigSync broken from 2.4.3. to 2.4.4 under Windows +* Bug 11462: Error compiling icinga2 targeted for x64 on Windows +* Bug 11475: FatalError() returns when called before Application.Run +* Bug 11482: API User gets wrongly authenticated (client_cn and no password) +* Bug 11484: Overwriting global type variables causes crash in ConfigItem::Commit() +* Bug 11494: Update documentation URL for Icinga Web 2 +* Bug 11522: Make the socket event engine configurable +* Bug 11534: DowntimesExpireTimerHandler crashes Icinga2 with +* Bug 11542: make install overwrites configuration files +* Bug 11559: Segfault during config validation if host exists, service does not exist any longer and downtime expires +* Bug 11564: Incorrect link in the documentation +* Bug 11567: Navigation attributes are missing in /v1/objects/ +* Bug 11574: Package fails to build on *NIX +* Bug 11577: Compiler warning in NotifyActive +* Bug 11582: icinga2 crashes when a command_endpoint is set, but the api feature is not active +* Bug 11586: icinga2-installer.exe doesn't wait until NSIS uninstall.exe exits +* Bug 11592: Remove instance_name from Ido*Connection example +* Bug 11610: Windows installer does not copy "features-enabled" on upgrade +* Bug 11617: Vim Syntax Highlighting does not work with assign where + +### What's New in Version 2.4.4 + +#### Feature + +* Feature 10358: ITL: Allow to enforce specific SSL versions using the http check command +* Feature 11205: Add "query" option to check_postgres command. + +#### Bugfixes + +* Bug 9642: Flapping notifications are sent for hosts/services which are in a downtime +* Bug 9969: Problem notifications while Flapping is active +* Bug 10225: Host notification type is PROBLEM but should be RECOVERY +* Bug 10231: MkDirP not working on Windows +* Bug 10766: DB IDO: User notification type filters are incorrect +* Bug 10770: Status code 200 even if an object could not be deleted. +* Bug 10795: http check's URI is really just Path +* Bug 10976: Explain how to join hosts/services for /v1/objects/comments +* Bug 11107: ITL: Missing documentation for nwc_health "mode" parameter +* Bug 11159: Common name in node wizard isn't case sensitive +* Bug 11208: CMake does not find MySQL libraries on Windows +* Bug 11209: Wrong log message for trusted cert in node setup command +* Bug 11240: DEL_DOWNTIME_BY_HOST_NAME does not accept optional arguments +* Bug 11248: Active checks are executed even though passive results are submitted +* Bug 11257: Incorrect check interval when passive check results are used +* Bug 11273: Services status updated multiple times within check_interval even though no retry was triggered +* Bug 11289: epoll_ctl might cause oops on Ubuntu trusty +* Bug 11320: Volatile transitions from HARD NOT-OK->NOT-OK do not trigger notifications +* Bug 11328: Typo in API docs +* Bug 11331: Update build requirements for SLES 11 SP4 +* Bug 11349: 'icinga2 feature list' fails when all features are disabled +* Bug 11350: Docs: Add API examples for creating services and check commands +* Bug 11352: Segmentation fault during 'icinga2 daemon -C' +* Bug 11369: Chocolatey package is missing uninstall function +* Bug 11385: Update development docs to use 'thread apply all bt full' + +### What's New in Version 2.4.3 + +#### Bugfixes + +* Bug 11211: Permission problem after running icinga2 node wizard +* Bug 11212: Wrong permissions for files in /var/cache/icinga2/* + +### What's New in Version 2.4.2 + +#### Changes + +* ITL + Additional arguments for check_disk + Fix incorrect path for the check_hpasm plugin + New command: check_iostat + Fix incorrect variable names for the check_impi plugin +* Cluster + Improve cluster performance + Fix connection handling problems (multiple connections for the same endpoint) +* Performance improvements for the DB IDO modules +* Lots and lots of various other bugfixes +* Documentation updates + +#### Feature + +* Feature 10660: Add CMake flag for disabling the unit tests +* Feature 10777: Add check_iostat to ITL +* Feature 10787: Add "-x" parameter in command definition for disk-windows CheckCommand +* Feature 10807: Raise a config error for "Checkable" objects in global zones +* Feature 10857: DB IDO: Add a log message when the connection handling is completed +* Feature 10860: Log DB IDO query queue stats +* Feature 10880: "setting up check plugins" section should be enhanced with package manager examples +* Feature 10920: Add Timeout parameter to snmpv3 check +* Feature 10947: Add example how to use custom functions in attributes +* Feature 10964: Troubleshooting: Explain how to fetch the executed command +* Feature 10988: Support TLSv1.1 and TLSv1.2 for the cluster transport encryption +* Feature 11037: Add String#trim +* Feature 11138: Checkcommand Disk : Option Freespace-ignore-reserved + +#### Bugfixes + +* Bug 7287: Re-checks scheduling w/ retry_interval +* Bug 8714: Add priority queue for disconnect/programstatus update events +* Bug 8976: DB IDO: notification_id for contact notifications is out of range +* Bug 10226: Icinga2 reload timeout results in killing old and new process because of systemd +* Bug 10449: Livestatus log query - filter "class" yields empty results +* Bug 10458: Incorrect SQL command for creating the user of the PostgreSQL DB for the IDO +* Bug 10460: A PgSQL DB for the IDO can't be created w/ UTF8 +* Bug 10497: check_memory and check_swap plugins do unit conversion and rounding before percentage calculations resulting in imprecise percentages +* Bug 10544: check_network performance data in invalid format +* Bug 10554: Non-UTF8 characters from plugins causes IDO to fail +* Bug 10655: API queries cause memory leaks +* Bug 10700: Crash in ExternalCommandListener +* Bug 10711: Zone::CanAccessObject is very expensive +* Bug 10713: ApiListener::ReplayLog can block with a lot of clients +* Bug 10714: API is not working on wheezy +* Bug 10724: Remove the local zone name question in node wizard +* Bug 10728: node wizard does not remember user defined port +* Bug 10736: Missing num_hosts_pending in /v1/status/CIB +* Bug 10739: Crash on startup with incorrect directory permissions +* Bug 10744: build of icinga2 with gcc 4.4.7 segfaulting with ido +* Bug 10745: ITL check command possibly mistyped variable names +* Bug 10748: Missing path in mkdir() exceptions +* Bug 10760: Disallow lambda expressions where side-effect-free expressions are not allowed +* Bug 10765: Avoid duplicate config and status updates on startup +* Bug 10773: chcon partial context error in safe-reload prevents reload +* Bug 10779: Wrong postgresql-setup initdb command for RHEL7 +* Bug 10780: The hpasm check command is using the PluginDir constant +* Bug 10784: Incorrect information in --version on Linux +* Bug 10806: Missing SUSE repository for monitoring plugins documentation +* Bug 10817: Failed IDO query for icinga_downtimehistory +* Bug 10818: Use NodeName in null and random checks +* Bug 10819: Cluster config sync ignores zones.d from API packages +* Bug 10824: Windows build fails with latest git master +* Bug 10825: Missing documentation for API packages zones.d config sync +* Bug 10826: Build error with older CMake versions on VERSION_LESS compare +* Bug 10828: Relative path in include_zones does not work +* Bug 10829: IDO breaks when writing to icinga_programstatus with latest snapshots +* Bug 10830: Config validation doesn't fail when templates are used as object names +* Bug 10852: Formatting problem in "Advanced Filter" chapter +* Bug 10855: Implement support for re-ordering groups of IDO queries +* Bug 10862: Evaluate if CanExecuteQuery/FieldToEscapedString lead to exceptions on !m_Connected +* Bug 10867: "repository add" cli command writes invalid "type" attribute +* Bug 10883: Icinga2 crashes in IDO when removing a comment +* Bug 10890: Remove superfluous #ifdef +* Bug 10891: is_active in IDO is only re-enabled on "every second" restart +* Bug 10908: Typos in the "troubleshooting" section of the documentation +* Bug 10923: API actions: Decide whether fixed: false is the right default +* Bug 10931: Exception stack trace on icinga2 client when the master reloads the configuration +* Bug 10932: Cluster config sync: Ensure that /var/lib/icinga2/api/zones/* exists +* Bug 10935: Logrotate on systemd distros should use systemctl not service +* Bug 10948: Icinga state file corruption with temporary file creation +* Bug 10956: Compiler warnings in lib/remote/base64.cpp +* Bug 10959: Better explaination for array values in "disk" CheckCommand docs +* Bug 10963: high load and memory consumption on icinga2 agent v2.4.1 +* Bug 10968: Race condition when using systemd unit file +* Bug 10974: Modified attributes do not work for the IcingaApplication object w/ external commands +* Bug 10979: Mistake in mongodb command definition (mongodb_replicaset) +* Bug 10981: Incorrect name in AUTHORS +* Bug 10989: Escaped sequences not properly generated with 'node update-config' +* Bug 10991: Stream buffer size is 512 bytes, could be raised +* Bug 10998: Incorrect IdoPgSqlConnection Example in Documentation +* Bug 11006: Segfault in ApiListener::ConfigUpdateObjectAPIHandler +* Bug 11014: Check event duplication with parallel connections involved +* Bug 11019: next_check noise in the IDO +* Bug 11020: Master reloads with agents generate false alarms +* Bug 11065: Deleting an object via API does not disable it in DB IDO +* Bug 11074: Partially missing escaping in doc/7-icinga-template-library.md +* Bug 11075: Outdated link to icingaweb2-module-nagvis +* Bug 11083: Ensure that config sync updates are always sent on reconnect +* Bug 11085: Crash in ConfigItem::RunWithActivationContext +* Bug 11088: API queries on non-existant objects cause exception +* Bug 11096: Windows build fails on InterlockedIncrement type +* Bug 11103: Problem with hostgroup_members table cleanup +* Bug 11111: Clean up unused variables a bit +* Bug 11118: Cluster WQ thread dies after fork() +* Bug 11122: Connections are not cleaned up properly +* Bug 11132: YYYY-MM-DD time specs are parsed incorrectly +* Bug 11178: Documentation: Unescaped pipe character in tables +* Bug 11179: CentOS 5 doesn't support epoll_create1 +* Bug 11204: "node setup" tries to chown() files before they're created + +### What's New in Version 2.4.1 + +#### Changes + +* ITL + * Add running_kernel_use_sudo option for the running_kernel check +* Configuration + * Add global constants: `PlatformName`. `PlatformVersion`, `PlatformKernel` and `PlatformKernelVersion` +* CLI + * Use NodeName and ZoneName constants for 'node setup' and 'node wizard' + +#### Feature + +* Feature 10622: Add by_ssh_options argument for the check_by_ssh plugin +* Feature 10693: Add running_kernel_use_sudo option for the running_kernel check +* Feature 10716: Use NodeName and ZoneName constants for 'node setup' and 'node wizard' + +#### Bugfixes + +* Bug 10528: Documentation example in "Access Object Attributes at Runtime" doesn't work correctly +* Bug 10615: Build fails on SLES 11 SP3 with GCC 4.8 +* Bug 10632: "node wizard" does not ask user to verify SSL certificate +* Bug 10641: API setup command incorrectly overwrites existing certificates +* Bug 10643: Icinga 2 crashes when ScheduledDowntime objects are used +* Bug 10645: Documentation for schedule-downtime is missing required paremeters +* Bug 10648: lib/base/process.cpp SIGSEGV on Debian squeeze / RHEL 6 +* Bug 10661: Incorrect web inject URL in documentation +* Bug 10663: Incorrect redirect for stderr in /usr/lib/icinga2/prepare-dirs +* Bug 10667: Indentation in command-plugins.conf +* Bug 10677: node wizard checks for /var/lib/icinga2/ca directory but not the files +* Bug 10690: CLI command 'repository add' doesn't work +* Bug 10692: Fix typos in the documentation +* Bug 10708: Windows setup wizard crashes when InstallDir registry key is not set +* Bug 10710: Incorrect path for icinga2 binary in development documentation +* Bug 10720: Remove --master_zone from --help because it is currently not implemented + +### What's New in Version 2.4.0 + +#### Changes + +* API + * RESTful API with basic auth or client certificates + * Filters, types, permissions + * configuration package management + * query/create/modify/delete config objects at runtime + * status queries for global stats + * actions (e.g. acknowledge all service problems) + * event streams +* ITL and Plugin Check Command definitions + * The 'running_kernel' check command was moved to the plugins-contrib section. You have to update your config to include 'plugins-contrib' +* Configuration + * The global constants Enable* and Vars have been removed. Use the IcingaApplication object attributes instead. +* Features + * New Graphite tree. Please check the documentation how enable the legacy schema. + * IcingaStatusWriter feature has been deprecated and will be removed in future versions. + * Modified attributes are not exposed as bit mask to external interfaces anymore (api related changes). External commands like CHANGE_*_MODATTR have been removed. + +#### Feature + +* Feature 7709: Validators should be implemented in (auto-generated) native code +* Feature 8093: Add icinga, cluster, cluster-zone check information to the ApiListener status handler +* Feature 8149: graphite writer should pass "-" in host names and "." in perf data +* Feature 8666: Allow some of the Array and Dictionary methods to be inlined by the compiler +* Feature 8688: Add embedded DB IDO version health check +* Feature 8689: Add support for current and current-1 db ido schema version +* Feature 8690: 'icinga2 console' should serialize temporary attributes (rather than just config + state) +* Feature 8738: Implement support for CLIENT_MULTI_STATEMENTS +* Feature 8741: Deprecate IcingaStatusWriter feature +* Feature 8775: Move the base command templates into libmethods +* Feature 8776: Implement support for libedit +* Feature 8791: Refactor the startup process +* Feature 8832: Implement constructor-style casts +* Feature 8842: Add support for the C++11 keyword 'override' +* Feature 8867: Use DebugHint information when reporting validation errors +* Feature 8890: Move implementation code from thpp files into separate files +* Feature 8922: Avoid unnecessary dictionary lookups +* Feature 9044: Remove the ScopeCurrent constant +* Feature 9068: Implement sandbox mode for the config parser +* Feature 9074: Basic API framework +* Feature 9076: Reflection support for the API +* Feature 9077: Implement filters for the API +* Feature 9078: Event stream support for the API +* Feature 9079: Implement status queries for the API +* Feature 9080: Add commands (actions) for the API +* Feature 9081: Add modified attribute support for the API +* Feature 9082: Runtime configuration for the API +* Feature 9083: Configuration file management for the API +* Feature 9084: Enable the ApiListener by default +* Feature 9085: Certificate-based authentication for the API +* Feature 9086: Password-based authentication for the API +* Feature 9087: Create default administrative user +* Feature 9088: API permissions +* Feature 9091: API status queries +* Feature 9093: Changelog for modified attributes +* Feature 9095: Disallow changes for certain config attributes at runtime +* Feature 9096: Dependency tracking for objects +* Feature 9098: Update modules to support adding and removing objects at runtime +* Feature 9099: Implement support for writing configuration files +* Feature 9100: Multiple sources for zone configuration tree +* Feature 9101: Commands for adding and removing objects +* Feature 9102: Support validating configuration changes +* Feature 9103: Staging for configuration validation +* Feature 9104: Implement config file management commands +* Feature 9105: API Documentation +* Feature 9175: Move 'running_kernel' check command to plugins-contrib 'operating system' section +* Feature 9286: DB IDO/Livestatus: Add zone object table w/ endpoint members +* Feature 9414: "-Wno-deprecated-register" compiler option breaks builds on SLES 11 +* Feature 9447: Implement support for HTTP +* Feature 9448: Define RESTful url schema +* Feature 9461: New Graphite schema +* Feature 9470: Implement URL parser +* Feature 9471: Implement ApiUser type +* Feature 9594: Implement base64 de- and encoder +* Feature 9614: Register ServiceOK, ServiceWarning, HostUp, etc. as constants +* Feature 9647: Move url to /lib/remote from /lib/base +* Feature 9689: Add exceptions for Utility::MkDir{,P} +* Feature 9693: Add Array::FromVector() method +* Feature 9698: Implement support for X-HTTP-Method-Override +* Feature 9704: String::Trim() should return a new string rather than modifying the current string +* Feature 9705: Add real path sanity checks to provided file paths +* Feature 9723: Documentation for config management API +* Feature 9768: Update the url parsers behaviour +* Feature 9777: Make Comments and Downtime types available as ConfigObject type in the API +* Feature 9794: Setting global variables with i2tcl doesn't work +* Feature 9849: Validation for modified attributes +* Feature 9850: Re-implement events for attribute changes +* Feature 9851: Remove GetModifiedAttributes/SetModifiedAttributes +* Feature 9852: Implement support for . in modify_attribute +* Feature 9859: Implement global modified attributes +* Feature 9866: Implement support for attaching GDB to the Icinga process on crash +* Feature 9914: Rename DynamicObject/DynamicType to ConfigObject/ConfigType +* Feature 9919: Allow comments when parsing JSON +* Feature 9921: Implement the 'base' field for the Type class +* Feature 9926: Ensure that runtime config objects are persisted on disk +* Feature 9927: Figure out how to sync dynamically created objects inside the cluster +* Feature 9929: Add override keyword for all relevant methods +* Feature 9930: Document Object#clone +* Feature 9931: Implement Object#clone and rename Array/Dictionary#clone to shallow_clone +* Feature 9933: Implement support for indexers in ConfigObject::RestoreAttribute +* Feature 9935: Implement support for restoring modified attributes +* Feature 9937: Add package attribute for ConfigObject and set its origin +* Feature 9940: Implement support for filter_vars +* Feature 9944: Add String::ToLower/ToUpper +* Feature 9946: Remove debug messages in HttpRequest class +* Feature 9953: Rename config/modules to config/packages +* Feature 9960: Implement ignore_on_error keyword +* Feature 10017: Use an AST node for the 'library' keyword +* Feature 10038: Add plural_name field to /v1/types +* Feature 10039: URL class improvements +* Feature 10042: Implement a demo API client: Icinga Studio +* Feature 10060: Implement joins for status queries +* Feature 10116: Add global status handler for the API +* Feature 10186: Make ConfigObject::{G,S}etField() method public +* Feature 10194: Sanitize error status codes and messages +* Feature 10202: Add documentation for api-users.conf and app.conf +* Feature 10209: Rename statusqueryhandler to objectqueryhandler +* Feature 10212: Move /v1/ to /v1/objects/ +* Feature 10243: Provide keywords to retrieve the current file name at parse time +* Feature 10257: Change object version to timestamps for diff updates on config sync +* Feature 10329: Pretty-print arrays and dictionaries when converting them to strings +* Feature 10368: Document that modified attributes require accept_config for cluster/clients +* Feature 10374: Add check command nginx_status +* Feature 10383: DB IDO should provide its connected state via /v1/status +* Feature 10385: Add 'support' tracker to changelog.py +* Feature 10387: Use the API for "icinga2 console" +* Feature 10388: Log a warning message on unauthorized http request +* Feature 10392: Original attributes list in IDO +* Feature 10393: Hide internal attributes +* Feature 10394: Add getter for endpoint 'connected' attribute +* Feature 10407: Remove api.cpp, api.hpp +* Feature 10409: Add documentation for apply+for in the language reference chapter +* Feature 10423: Ability to set port on SNMP Checks +* Feature 10431: Add the name for comments/downtimes next to legacy_id to DB IDO +* Feature 10441: Rewrite man page +* Feature 10479: Use ZoneName variable for parent_zone in node update-config +* Feature 10482: Documentation: Reorganize Livestatus and alternative frontends +* Feature 10503: Missing parameters for check jmx4perl +* Feature 10507: Add check command negate +* Feature 10509: Change GetLastStateUp/Down to host attributes +* Feature 10511: Add check command mysql +* Feature 10513: Add ipv4/ipv6 only to tcp and http CheckCommand +* Feature 10522: Change output format for 'icinga2 console' +* Feature 10547: Icinga 2 script debugger +* Feature 10548: Implement CSRF protection for the API +* Feature 10549: Change 'api setup' into a manual step while configuring the API +* Feature 10551: Change object query result set +* Feature 10566: Enhance programmatic examples for the API docs +* Feature 10574: Mention wxWidget (optional) requirement in INSTALL.md +* Feature 10575: Documentation for /v1/console +* Feature 10576: Explain variable names for joined objects in filter expressions +* Feature 10577: Documentation for the script debugger +* Feature 10591: Explain DELETE for config stages/packages +* Feature 10630: Update wxWidgets documentation for Icinga Studio + +#### Bugfixes + +* Bug 8822: Update OpenSSL for the Windows builds +* Bug 8823: Don't allow users to instantiate the StreamLogger class +* Bug 8830: Make default notifications include users from host.vars.notification.mail.users +* Bug 8865: Failed assertion in IdoMysqlConnection::FieldToEscapedString +* Bug 8907: Validation fails even though field is not required +* Bug 8924: Specify pidfile for status_of_proc in the init script +* Bug 8952: Crash in VMOps::FunctionCall +* Bug 8989: pgsql driver does not have latest mysql changes synced +* Bug 9015: Compiler warnings with latest HEAD 5ac5f98 +* Bug 9027: PostgreSQL schema sets default timestamps w/o time zone +* Bug 9053: icinga demo module can not be built +* Bug 9188: Remove incorrect 'ignore where' expression from 'ssh' apply example +* Bug 9455: Fix incorrect datatype for the check_source column in icinga_statehistory table +* Bug 9547: Wrong vars changed handler in api events +* Bug 9576: Overflow in freshness_threshold column (smallint) w/ DB IDO MySQL +* Bug 9590: 'node wizard/setup' should always generate new CN certificates +* Bug 9703: Problem with child nodes in http url registry +* Bug 9735: Broken cluster config sync w/o include_zones +* Bug 9778: Accessing field ID 0 ("prototype") fails +* Bug 9793: Operator - should not work with "" and numbers +* Bug 9795: ScriptFrame's 'Self' attribute gets corrupted when an expression throws an exception +* Bug 9813: win32 build: S_ISDIR is undefined +* Bug 9843: console autocompletion should take into account parent classes' prototypes +* Bug 9868: Crash in ScriptFrame::~ScriptFrame +* Bug 9872: Color codes in console prompt break line editing +* Bug 9876: Crash during cluster log replay +* Bug 9879: Missing conf.d or zones.d cause parse failure +* Bug 9911: Do not let API users create objects with invalid names +* Bug 9966: Fix formatting in mkclass +* Bug 9968: Implement support for '.' when persisting modified attributes +* Bug 9987: Crash in ConfigCompiler::RegisterZoneDir +* Bug 10008: Don't parse config files for branches not taken +* Bug 10012: Unused variable 'dobj' in configobject.tcpp +* Bug 10024: HTTP keep-alive does not work with .NET WebClient +* Bug 10027: Filtering by name doesn't work +* Bug 10034: Unused variable console_type in consolecommand.cpp +* Bug 10041: build failure: demo module +* Bug 10048: Error handling in HttpClient/icinga-studio +* Bug 10110: Add object_id where clause for icinga_downtimehistory +* Bug 10180: API actions do not follow REST guidelines +* Bug 10198: Detect infinite recursion in user scripts +* Bug 10210: Move the Collection status handler to /v1/status +* Bug 10211: PerfdataValue is not properly serialised in status queries +* Bug 10224: URL parser is cutting off last character +* Bug 10234: ASCII NULs don't work in string values +* Bug 10238: Use a temporary file for modified-attributes.conf updates +* Bug 10241: Properly encode URLs in Icinga Studio +* Bug 10249: Config Sync shouldn't send updates for objects the client doesn't have access to +* Bug 10253: /v1/objects/ returns an HTTP error when there are no objects of that type +* Bug 10255: Config sync does not set endpoint syncing and plays disconnect-sync ping-pong +* Bug 10256: ConfigWriter::EmitValue should format floating point values properly +* Bug 10326: icinga2 repository host add does not work +* Bug 10350: Remove duplicated text in section "Apply Notifications to Hosts and Services" +* Bug 10355: Version updates are not working properly +* Bug 10360: Icinga2 API performance regression +* Bug 10371: Ensure that modified attributes work with clients with local config and no zone attribute +* Bug 10386: restore_attribute does not work in clusters +* Bug 10403: Escaping $ not documented +* Bug 10406: Misleading wording in generated zones.conf +* Bug 10410: OpenBSD: hang during ConfigItem::ActivateItems() in daemon startup +* Bug 10417: 'which' isn't available in a minimal CentOS container +* Bug 10422: Changing a group's attributes causes duplicate rows in the icinga_*group_members table +* Bug 10433: 'dig_lookup' custom attribute for the 'dig' check command isn't optional +* Bug 10436: Custom variables aren't removed from the IDO database +* Bug 10439: "Command options" is empty when executing icinga2 without any argument. +* Bug 10440: Improve --help output for the --log-level option +* Bug 10455: Improve error handling during log replay +* Bug 10456: Incorrect attribute name in the documentation +* Bug 10457: Don't allow scripts to access FANoUserView attributes in sandbox mode +* Bug 10461: Line continuation is broken in 'icinga2 console' +* Bug 10466: Crash in IndexerExpression::GetReference when attempting to set an attribute on an object other than the current one +* Bug 10473: IDO tries to execute empty UPDATE queries +* Bug 10491: Unique constraint violation with multiple comment inserts in DB IDO +* Bug 10495: Incorrect JSON-RPC message causes Icinga 2 to crash +* Bug 10498: IcingaStudio: Accessing non-ConfigObjects causes ugly exception +* Bug 10501: Plural name rule not treating edge case correcly +* Bug 10504: Increase the default timeout for OS checks +* Bug 10508: Figure out whether we need the Checkable attributes state_raw, last_state_raw, hard_state_raw +* Bug 10510: CreatePipeOverlapped is not thread-safe +* Bug 10512: Mismatch on {comment,downtime}_id vs internal name in the API +* Bug 10517: Circular reference between *Connection and TlsStream objects +* Bug 10518: Crash in ConfigWriter::GetKeywords +* Bug 10527: Fix indentation for Dictionary::ToString +* Bug 10529: Change session_token to integer timestamp +* Bug 10535: Spaces do not work in command arguments +* Bug 10538: Crash in ConfigWriter::EmitIdentifier +* Bug 10539: Don't validate custom attributes that aren't strings +* Bug 10540: Async mysql queries aren't logged in the debug log +* Bug 10545: Broken build - unresolved external symbol "public: void __thiscall icinga::ApiClient::ExecuteScript... +* Bug 10555: Don't try to use --gc-sections on Solaris +* Bug 10556: Update OpenSSL for the Windows builds +* Bug 10558: There's a variable called 'string' in filter expressions +* Bug 10559: Autocompletion doesn't work in the debugger +* Bug 10560: 'api setup' should create a user even when api feature is already enabled +* Bug 10561: 'remove-comment' action does not support filters +* Bug 10562: Documentation should not reference real host names +* Bug 10563: /v1/console should only use a single permission +* Bug 10568: Improve location information for errors in API filters +* Bug 10569: Icinga 2 API Docs +* Bug 10578: API call doesn't fail when trying to use a template that doesn't exist +* Bug 10580: Detailed error message is missing when object creation via API fails +* Bug 10583: modify_attribute: object cannot be cloned +* Bug 10588: Documentation for /v1/types +* Bug 10596: Deadlock in MacroProcessor::EvaluateFunction +* Bug 10601: Don't allow users to set state attributes via PUT +* Bug 10602: API overwrites (and then deletes) config file when trying to create an object that already exists +* Bug 10604: Group memberships are not updated for runtime created objects +* Bug 10629: Download URL for NSClient++ is incorrect +* Bug 10637: Utility::FormatErrorNumber fails when error message uses arguments + +### What's New in Version 2.3.11 + +#### Changes + +* Function for performing CIDR matches: cidr_match() +* New methods: String#reverse and Array#reverse +* New ITL command definitions: nwc_health, hpasm, squid, pgsql +* Additional arguments for ITL command definitions: by_ssh, dig, pop, spop, imap, simap +* Documentation updates +* Various bugfixes + +#### Features + +* Feature 9183: Add timestamp support for OpenTsdbWriter +* Feature 9466: Add FreeBSD setup to getting started +* Feature 9812: add check command for check_nwc_health +* Feature 9854: check_command for plugin check_hpasm +* Feature 10004: escape_shell_arg() method +* Feature 10006: Implement a way for users to resolve commands+arguments in the same way Icinga does +* Feature 10057: Command Execution Bridge: Use of same endpoint names in examples for a better understanding +* Feature 10109: Add check command squid +* Feature 10112: Add check command pgsql +* Feature 10129: Add ipv4/ipv6 only to nrpe CheckCommand +* Feature 10139: expand check command dig +* Feature 10142: Update debug docs for core dumps and full backtraces +* Feature 10157: Update graphing section in the docs +* Feature 10158: Make check_disk.exe CheckCommand Config more verbose +* Feature 10161: Improve documentation for check_memory +* Feature 10197: Implement the Array#reverse and String#reverse methods +* Feature 10207: Find a better description for cluster communication requirements +* Feature 10216: Clarify on cluster/client naming convention and add troubleshooting section +* Feature 10219: Add timeout argument for pop, spop, imap, simap commands +* Feature 10352: Improve timeperiod documentation +* Feature 10354: New method: cidr_match() +* Feature 10379: Add a debug log message for updating the program status table in DB IDO + +#### Bugfixes + +* Bug 8805: check cluster-zone returns wrong log lag +* Bug 9322: sending multiple Livestatus commands rejects all except the first +* Bug 10002: Deadlock in WorkQueue::Enqueue +* Bug 10079: Improve error message for socket errors in Livestatus +* Bug 10093: Rather use unique SID when granting rights for folders in NSIS on Windows Client +* Bug 10177: Windows Check Update -> Access denied +* Bug 10191: String methods cannot be invoked on an empty string +* Bug 10192: null + null should not be "" +* Bug 10199: Remove unnecessary MakeLiteral calls in SetExpression::DoEvaluate +* Bug 10204: Config parser problem with parenthesis and newlines +* Bug 10205: config checker reports wrong error on apply for rules +* Bug 10235: Deadlock in TlsStream::Close +* Bug 10239: Don't throw an exception when replaying the current replay log file +* Bug 10245: Percent character whitespace on Windows +* Bug 10254: Performance Data Labels including '=' will not be displayed correct +* Bug 10262: Don't log messages we've already relayed to all relevant zones +* Bug 10266: "Not after" value overflows in X509 certificates on RHEL5 +* Bug 10348: Checkresultreader is unable to process host checks +* Bug 10349: Missing Start call for base class in CheckResultReader +* Bug 10351: Broken table layout in chapter 20 +* Bug 10365: ApiListener::SyncRelayMessage doesn't send message to all zone members +* Bug 10377: Wrong connection log message for global zones + +### What's New in Version 2.3.10 + +#### Features + +* Feature 9218: Use the command_endpoint name as check_source value if defined + +#### Bugfixes + +* Bug 9244: String escape problem with PostgreSQL >= 9.1 and standard_conforming_strings=on +* Bug 10003: Nested "outer" macro calls fails on (handled) missing "inner" values +* Bug 10051: Missing fix for reload on Windows in 2.3.9 +* Bug 10058: Wrong calculation for host compat state "UNREACHABLE" in DB IDO +* Bug 10074: Missing zero padding for generated CA serial.txt + +### What's New in Version 2.3.9 + +#### Changes + +* Fix that the first SOFT state is recognized as second SOFT state +* Implemented reload functionality for Windows +* New ITL check commands +* Documentation updates +* Various other bugfixes + +#### Features + +* Feature 9527: CheckCommand for check_interfaces +* Feature 9671: Add check_yum to ITL +* Feature 9675: Add check_redis to ITL +* Feature 9686: Update gdb pretty printer docs w/ Python 3 +* Feature 9699: Adding "-r" parameter to the check_load command for dividing the load averages by the number of CPUs. +* Feature 9747: check_command for plugin check_clamd +* Feature 9796: Implement Dictionary#get and Array#get +* Feature 9801: Add check_jmx4perl to ITL +* Feature 9811: add check command for check_mailq +* Feature 9827: snmpv3 CheckCommand section improved +* Feature 9882: Implement the Dictionary#keys method +* Feature 9883: Use an empty dictionary for the 'this' scope when executing commands with Livestatus +* Feature 9985: add check command nscp-local-counter +* Feature 9996: Add new arguments openvmtools for Open VM Tools + +#### Bugfixes + +* Bug 8979: Missing DEL_DOWNTIME_BY_HOST_NAME command required by Classic UI 1.x +* Bug 9262: cluster check w/ immediate parent and child zone endpoints +* Bug 9623: missing config warning on empty port in endpoints +* Bug 9769: Set correct X509 version for certificates +* Bug 9773: Add log for missing EventCommand for command_endpoints +* Bug 9779: Trying to set a field for a non-object instance fails +* Bug 9782: icinga2 node wizard don't take zone_name input +* Bug 9806: Operator + is inconsistent when used with empty and non-empty strings +* Bug 9814: Build fix for Boost 1.59 +* Bug 9835: Dict initializer incorrectly re-initializes field that is set to an empty string +* Bug 9860: missing check_perfmon.exe +* Bug 9867: Agent freezes when the check returns massive output +* Bug 9884: Warning about invalid API function icinga::Hello +* Bug 9897: First SOFT state is recognized as second SOFT state +* Bug 9902: typo in docs +* Bug 9912: check_command interfaces option match_aliases has to be boolean +* Bug 9913: Default disk checks on Windows fail because check_disk doesn't support -K +* Bug 9928: Add missing category for IDO query +* Bug 9947: Serial number field is not properly initialized for CA certificates +* Bug 9961: Don't re-download NSCP for every build +* Bug 9962: Utility::Glob on Windows doesn't support wildcards in all but the last path component +* Bug 9972: Icinga2 - too many open files - Exception +* Bug 9984: fix check command nscp-local +* Bug 9992: Duplicate severity type in the documentation for SyslogLogger + +### What's New in Version 2.3.8 + +#### Changes + +* Bugfixes + +#### Bugfixes + +* Bug 9554: Don't allow "ignore where" for groups when there's no "assign where" +* Bug 9634: DB IDO: Do not update endpointstatus table on config updates +* Bug 9637: Wrong parameter for CheckCommand "ping-common-windows" +* Bug 9665: Escaping does not work for OpenTSDB perfdata plugin +* Bug 9666: checkcommand disk does not check free inode - check_disk + +### What's New in Version 2.3.7 + +#### Changes + +* Bugfixes + +#### Features + +* Feature 9610: Enhance troubleshooting ssl errors & cluster replay log + +#### Bugfixes + +* Bug 9406: Selective cluster reconnecting breaks client communication +* Bug 9535: Config parser ignores "ignore" in template definition +* Bug 9584: Incorrect return value for the macro() function +* Bug 9585: Wrong formatting in DB IDO extensions docs +* Bug 9586: DB IDO: endpoint* tables are cleared on reload causing constraint violations +* Bug 9621: Assertion failed in icinga::ScriptUtils::Intersection +* Bug 9622: Missing lock in ScriptUtils::Union + +### What's New in Version 2.3.6 + +#### Changes + +* Require openssl1 on sles11sp3 from Security Module repository + * Bug in SLES 11's OpenSSL version 0.9.8j preventing verification of generated certificates. + * Re-create these certificates with 2.3.6 linking against openssl1 (cli command or CSR auto-signing). +* ITL: Add ldap, ntp_peer, mongodb and elasticsearch CheckCommand definitions +* Bugfixes + +#### Features + +* Feature 6714: add pagerduty notification documentation +* Feature 9172: Add "ldap" CheckCommand for "check_ldap" plugin +* Feature 9191: Add "mongodb" CheckCommand definition +* Feature 9415: Add elasticsearch checkcommand to itl +* Feature 9416: snmpv3 CheckCommand: Add possibility to set securityLevel +* Feature 9451: Merge documentation fixes from GitHub +* Feature 9523: Add ntp_peer CheckCommand +* Feature 9562: Add new options for ntp_time CheckCommand +* Feature 9578: new options for smtp CheckCommand + +#### Bugfixes + +* Bug 9205: port empty when using icinga2 node wizard +* Bug 9253: Incorrect variable name in the ITL +* Bug 9303: Missing 'snmp_is_cisco' in Manubulon snmp-memory command definition +* Bug 9436: Functions can't be specified as command arguments +* Bug 9450: node setup: indent accept_config and accept_commands +* Bug 9452: Wrong file reference in README.md +* Bug 9456: Windows client w/ command_endpoint broken with $nscp_path$ and NscpPath detection +* Bug 9463: Incorrect check_ping.exe parameter in the ITL +* Bug 9476: Documentation for checks in an HA zone is wrong +* Bug 9481: Fix stability issues in the TlsStream/Stream classes +* Bug 9489: Add log message for discarded cluster events (e.g. from unauthenticated clients) +* Bug 9490: Missing openssl verify in cluster troubleshooting docs +* Bug 9513: itl/plugins-contrib.d/*.conf should point to PluginContribDir +* Bug 9522: wrong default port documentated for nrpe +* Bug 9549: Generated certificates cannot be verified w/ openssl 0.9.8j on SLES 11 +* Bug 9558: mysql-devel is not available in sles11sp3 +* Bug 9563: Update getting started for Debian Jessie + +### What's New in Version 2.3.5 + +#### Changes + +* NSClient++ is now bundled with the Windows setup wizard and can optionally be installed +* Windows Wizard: "include " is set by default +* Windows Wizard: Add update mode +* Plugins: Add check_perfmon plugin for Windows +* ITL: Add CheckCommand objects for Windows plugins ("include ") +* ITL: Add CheckCommand definitions for "mongodb", "iftraffic", "disk_smb" +* ITL: Add arguments to CheckCommands "dns", "ftp", "tcp", "nscp" + +#### Features + +* Feature 8116: Extend Windows installer with an update mode +* Feature 8180: Add documentation and CheckCommands for the windows plugins +* Feature 8809: Add check_perfmon plugin for Windows +* Feature 9115: Add SHOWALL to NSCP Checkcommand +* Feature 9130: Add 'check_drivesize' as nscp-local check command +* Feature 9145: Add arguments to "dns" CheckCommand +* Feature 9146: Add arguments to "ftp" CheckCommand +* Feature 9147: Add arguments to "tcp" CheckCommand +* Feature 9176: ITL Documentation: Add a link for passing custom attributes as command parameters +* Feature 9180: Include Windows support details in the documentation +* Feature 9185: Add timestamp support for PerfdataWriter +* Feature 9191: Add "mongodb" CheckCommand definition +* Feature 9238: Bundle NSClient++ in Windows Installer +* Feature 9254: Add 'disk_smb' Plugin CheckCommand definition +* Feature 9256: Determine NSClient++ installation path using MsiGetComponentPath +* Feature 9260: Include by default on Windows +* Feature 9261: Add the --load-all and --log options for nscp-local +* Feature 9263: Add support for installing NSClient++ in the Icinga 2 Windows wizard +* Feature 9270: Update service apply for documentation +* Feature 9272: Add 'iftraffic' to plugins-contrib check command definitions +* Feature 9285: Best practices: cluster config sync +* Feature 9297: Add examples for function usage in "set_if" and "command" attributes +* Feature 9310: Add typeof in 'assign/ignore where' expression as example +* Feature 9311: Add local variable scope for *Command to documentation (host, service, etc) +* Feature 9313: Use a more simple example for passing command parameters +* Feature 9318: Explain string concatenation in objects by real-world example +* Feature 9363: Update documentation for escape sequences +* Feature 9419: Enhance cluster/client troubleshooting +* Feature 9420: Enhance cluster docs with HA command_endpoints +* Feature 9431: Documentation: Move configuration before advanced topics + +#### Bugfixes + +* Bug 8853: Syntax Highlighting: host.address vs host.add +* Bug 8888: Icinga2 --version: Error showing Distribution +* Bug 8891: Node wont connect properly to master if host is is not set for Endpoint on new installs +* Bug 9055: Wrong timestamps w/ historical data replay in DB IDO +* Bug 9109: WIN: syslog is not an enable-able feature in windows +* Bug 9116: node update-config reports critical and warning +* Bug 9121: Possible DB deadlock +* Bug 9131: Missing ")" in last Apply Rules example +* Bug 9142: Downtimes are always "fixed" +* Bug 9143: Incorrect type and state filter mapping for User objects in DB IDO +* Bug 9161: 'disk': wrong order of threshold command arguments +* Bug 9187: SPEC: Give group write permissions for perfdata dir +* Bug 9205: port empty when using icinga2 node wizard +* Bug 9222: Missing custom attributes in backends if name is equal to object attribute +* Bug 9253: Incorrect variable name in the ITL +* Bug 9255: --scm-installs fails when the service is already installed +* Bug 9258: Some checks in the default Windows configuration fail +* Bug 9259: Disk and 'icinga' services are missing in the default Windows config +* Bug 9268: Typo in Configuration Best Practice +* Bug 9269: Wrong permission etc on windows +* Bug 9324: Multi line output not correctly handled from compat channels +* Bug 9328: Multiline vars are broken in objects.cache output +* Bug 9372: plugins-contrib.d/databases.conf: wrong argument for mssql_health +* Bug 9389: Documentation: Typo +* Bug 9390: Wrong service table attributes in Livestatus documentation +* Bug 9393: Documentation: Extend Custom Attributes with the boolean type +* Bug 9394: Including on Linux fails with unregistered function +* Bug 9399: Documentation: Typo +* Bug 9406: Selective cluster reconnecting breaks client communication +* Bug 9412: Documentation: Update the link to register a new Icinga account + +### What's New in Version 2.3.4 + +#### Changes + +* ITL: Check commands for various databases +* Improve validation messages for time periods +* Update max_check_attempts in generic-{host,service} templates +* Update logrotate configuration +* Bugfixes + +#### Features + +* Feature 8760: Add database plugins to ITL +* Feature 8803: Agent Wizard: add options for API defaults +* Feature 8893: Improve timeperiod validation error messages +* Feature 8895: Add explanatory note for Icinga2 client documentation + +#### Bugfixes + +* Bug 8808: logrotate doesn't work on Ubuntu +* Bug 8821: command_endpoint check_results are not replicated to other endpoints in the same zone +* Bug 8879: Reword documentation of check_address +* Bug 8881: Add arguments to the UPS check +* Bug 8889: Fix a minor markdown error +* Bug 8892: Validation errors for time ranges which span the DST transition +* Bug 8894: Default max_check_attempts should be lower for hosts than for services +* Bug 8913: Windows Build: Flex detection +* Bug 8917: Node wizard should only accept 'y', 'n', 'Y' and 'N' as answers for boolean questions +* Bug 8919: Fix complexity class for Dictionary::Get +* Bug 8987: Fix a typo +* Bug 9012: Typo in graphite feature enable documentation +* Bug 9014: Don't update scheduleddowntime table w/ trigger_time column when only adding a downtime +* Bug 9016: Downtimes which have been triggered are not properly recorded in the database +* Bug 9017: scheduled_downtime_depth column is not reset when a downtime ends or when a downtime is being removed +* Bug 9021: Multiple log messages w/ "Attempting to send notifications for notification object" +* Bug 9041: Acknowledging problems w/ expire time does not add the expiry information to the related comment for IDO and compat +* Bug 9045: Vim syntax: Match groups before host/service/user objects +* Bug 9049: check_disk order of command arguments +* Bug 9050: web.conf is not in the RPM package +* Bug 9064: troubleshoot truncates crash reports +* Bug 9069: Documentation: set_if usage with boolean values and functions +* Bug 9073: custom attributes with recursive macro function calls causing sigabrt + +### What's New in Version 2.3.3 + +#### Changes + +* New function: parse_performance_data +* Include more details in --version +* Improve documentation +* Bugfixes + +#### Features + +* Feature 8685: Show state/type filter names in notice/debug log +* Feature 8686: Update documentation for "apply for" rules +* Feature 8693: New function: parse_performance_data +* Feature 8740: Add "access objects at runtime" examples to advanced section +* Feature 8761: Include more details in --version +* Feature 8816: Add "random" CheckCommand for test and demo purposes +* Feature 8827: Move release info in INSTALL.md into a separate file + +#### Bugfixes + +* Bug 8660: Update syntax highlighting for 2.3 features +* Bug 8677: Re-order the object types in alphabetical order +* Bug 8724: Missing config validator for command arguments 'set_if' +* Bug 8734: startup.log broken when the DB schema needs an update +* Bug 8736: Don't update custom vars for each status update +* Bug 8748: Don't ignore extraneous arguments for functions +* Bug 8749: Build warnings with CMake 3.1.3 +* Bug 8750: Flex version check does not reject unsupported versions +* Bug 8753: Fix a typo in the documentation of ICINGA2_WITH_MYSQL and ICINGA2_WITH_PGSQL +* Bug 8755: Fix VIM syntax highlighting for comments +* Bug 8757: Add missing keywords in the syntax highlighting files +* Bug 8762: Plugin "check_http" is missing in Windows environments +* Bug 8763: Typo in doc library-reference +* Bug 8764: Revamp migration documentation +* Bug 8765: Explain processing logic/order of apply rules with for loops +* Bug 8766: Remove prompt to create a TicketSalt from the wizard +* Bug 8767: Typo and invalid example in the runtime macro documentation +* Bug 8769: Improve error message for invalid field access +* Bug 8770: object Notification + apply Service fails with error "...refers to service which doesn't exist" +* Bug 8771: Correct HA documentation +* Bug 8829: Figure out why command validators are not triggered +* Bug 8834: Return doesn't work inside loops +* Bug 8844: Segmentation fault when executing "icinga2 pki new-cert" +* Bug 8862: wrong 'dns_lookup' custom attribute default in command-plugins.conf +* Bug 8866: Fix incorrect perfdata templates in the documentation +* Bug 8869: Array in command arguments doesn't work + +### What's New in Version 2.3.2 + +#### Changes + +* Bugfixes + +#### Bugfixes + +* Bug 8721: Log message for cli commands breaks the init script + +### What's New in Version 2.3.1 + +#### Changes + +* Bugfixes + +Please note that this version fixes the default thresholds for the disk check which were inadvertently broken in 2.3.0; if you're using percent-based custom thresholds you will need to add the '%' sign to your custom attributes + +#### Features + +* Feature 8659: Implement String#contains + +#### Bugfixes + +* Bug 8540: Kill signal sent only to check process, not whole process group +* Bug 8657: Missing program name in 'icinga2 --version' +* Bug 8658: Fix check_disk thresholds: make sure partitions are the last arguments +* Bug 8672: Api heartbeat message response time problem +* Bug 8673: Fix check_disk default thresholds and document the change of unit +* Bug 8679: Config validation fail because of unexpected new-line +* Bug 8680: Update documentation for DB IDO HA Run-Once +* Bug 8683: Make sure that the /var/log/icinga2/crash directory exists +* Bug 8684: Fix formatting for the GDB stacktrace +* Bug 8687: Crash in Dependency::Stop +* Bug 8691: Debian packages do not create /var/log/icinga2/crash + +### What's New in Version 2.3.0 + +#### Changes + +* Improved configuration validation + * Unnecessary escapes are no longer permitted (e.g. \') + * Dashes are no longer permitted in identifier names (as their semantics are ambiguous) + * Unused values are detected (e.g. { "-M" }) + * Validation for time ranges has been improved + * Additional validation rules for some object types (Notification and User) +* New language features + * Implement a separate type for boolean values + * Support for user-defined functions + * Support for conditional statements (if/else) + * Support for 'for' and 'while' loops + * Support for local variables using the 'var' keyword + * New operators: % (modulo), ^ (xor), - (unary minus) and + (unary plus) + * Implemented prototype-based methods for most built-in types (e.g. [ 3, 2 ].sort()) + * Explicit access to local and global variables using the 'locals' and 'globals' keywords + * Changed the order in which filters are evaluated for apply rules with 'for' + * Make type objects accessible as global variables + * Support for using functions in custom attributes + * Access objects and their runtime attributes in functions (e.g. get_host(NodeName).state) +* ITL improvements + * Additional check commands were added to the ITL + * Additional arguments for existing check commands +* CLI improvements + * Add the 'icinga2 console' CLI command which can be used to test expressions + * Add the 'icinga2 troubleshoot' CLI command for collecting troubleshooting information + * Performance improvements for the 'icinga2 node update-config' CLI command + * Implement argument auto-completion for short options (e.g. daemon -c) + * 'node setup' and 'node wizard' create backups for existing certificate files +* Add ignore_soft_states option for Dependency object configuration +* Fewer threads are used for socket I/O +* Flapping detection for hosts and services is disabled by default +* Added support for OpenTSDB +* New Livestatus tables: hostsbygroup, servicesbygroup, servicesbyhostgroup +* Include GDB backtrace in crash reports +* Various documentation improvements +* Solved a number of issues where cluster instances would not reconnect after intermittent connection problems +* A lot of other, minor changes + +* [DB IDO schema upgrade](17-upgrading-icinga-2.md#upgrading-icinga-2) to `1.13.0` required! + +#### Features + +* Feature 3446: Add troubleshooting collect cli command +* Feature 6109: Don't spawn threads for network connections +* Feature 6570: Disallow side-effect-free r-value expressions in expression lists +* Feature 6697: Plugin Check Commands: add check_vmware_esx +* Feature 6857: Run CheckCommands with C locale (workaround for comma vs dot and plugin api bug) +* Feature 6858: Add some more PNP details +* Feature 6868: Disable flapping detection by default +* Feature 6923: IDO should fill program_end_time on a clean shutdown +* Feature 7136: extended Manubulon SNMP Check Plugin Command +* Feature 7209: ITL: Interfacetable +* Feature 7256: Add OpenTSDB Writer +* Feature 7292: ITL: Check_Mem.pl +* Feature 7294: ITL: ESXi-Hardware +* Feature 7326: Add parent soft states option to Dependency object configuration +* Feature 7361: Livestatus: Add GroupBy tables: hostsbygroup, servicesbygroup, servicesbyhostgroup +* Feature 7545: Please add labels in SNMP checks +* Feature 7564: Access object runtime attributes in custom vars & command arguments +* Feature 7610: Variable from for loop not usable in assign statement +* Feature 7700: Evaluate apply/object rules when the parent objects are created +* Feature 7702: Add an option that hides CLI commands +* Feature 7704: ConfigCompiler::HandleInclude* should return an AST node +* Feature 7706: ConfigCompiler::Compile* should return an AST node +* Feature 7748: Redesign how stack frames work for scripts +* Feature 7767: Rename _DEBUG to I2_DEBUG +* Feature 7774: Implement an AST Expression for T_CONST +* Feature 7778: Missing check_disk output on Windows +* Feature 7784: Implement the DISABLE_HOST_SVC_NOTIFICATIONS and ENABLE_HOST_SVC_NOTIFICATIONS commands +* Feature 7793: Don't build db_ido when both MySQL and PostgreSQL aren't enabled +* Feature 7794: Implement an option to disable building the Livestatus module +* Feature 7795: Implement an option to disable building the Demo component +* Feature 7805: Implement unit tests for the config parser +* Feature 7807: Move the cast functions into libbase +* Feature 7813: Implement the % operator +* Feature 7816: Document operator precedence +* Feature 7822: Make the config parser thread-safe +* Feature 7823: Figure out whether Number + String should implicitly convert the Number argument to a string +* Feature 7824: Implement the "if" and "else" keywords +* Feature 7873: Plugin Check Commands: Add icmp +* Feature 7879: Windows agent is missing the standard plugin check_ping +* Feature 7883: Implement official support for user-defined functions and the "for" keyword +* Feature 7901: Implement socket_path attribute for the IdoMysqlConnection class +* Feature 7910: The lexer shouldn't accept escapes for characters which don't have to be escaped +* Feature 7925: Move the config file for the ido-*sql features into the icinga2-ido-* packages +* Feature 8016: Documentation enhancement for snmp traps and passive checks. +* Feature 8019: Register type objects as global variables +* Feature 8020: Improve output of ToString for type objects +* Feature 8030: Evaluate usage of function() +* Feature 8033: Allow name changed from inside the object +* Feature 8040: Disallow calling strings as functions +* Feature 8043: Implement a boolean sub-type for the Value class +* Feature 8047: ConfigCompiler::HandleInclude should return an inline dictionary +* Feature 8060: Windows plugins should behave like their Linux cousins +* Feature 8065: Implement a way to remove dictionary keys +* Feature 8071: Implement a way to call methods on objects +* Feature 8074: Figure out how variable scopes should work +* Feature 8078: Backport i2tcl's error reporting functionality into "icinga2 console" +* Feature 8096: Document the new language features in 2.3 +* Feature 8121: feature enable should use relative symlinks +* Feature 8133: Implement line-continuation for the "console" command +* Feature 8169: Implement additional methods for strings +* Feature 8172: Assignments shouldn't have a "return" value +* Feature 8195: Host/Service runtime macro downtime_depth +* Feature 8226: Make invalid log-severity option output an error instead of a warning +* Feature 8244: Implement keywords to explicitly access globals/locals +* Feature 8259: The check "hostalive" is not working with ipv6 +* Feature 8269: Implement the while keyword +* Feature 8277: Add macros $host.check_source$ and $service.check_source$ +* Feature 8290: Make operators &&, || behave like in JavaScript +* Feature 8291: Implement validator support for function objects +* Feature 8293: The Zone::global attribute is not documented +* Feature 8316: Extend disk checkcommand +* Feature 8322: Implement Array#join +* Feature 8371: Add path information for objects in object list +* Feature 8374: Add timestamp support for Graphite +* Feature 8386: Add documentation for cli command 'console' +* Feature 8393: Implement support for Json.encode and Json.decode +* Feature 8394: Implement continue/break keywords +* Feature 8399: Backup certificate files in 'node setup' +* Feature 8410: udp check command is missing arguments. +* Feature 8414: Add ITL check command for check_ipmi_sensor +* Feature 8429: add webinject checkcommand +* Feature 8465: Add the ability to use a CA certificate as a way of verifying hosts for CSR autosigning +* Feature 8467: introduce time dependent variable values +* Feature 8498: Snmp CheckCommand misses various options +* Feature 8515: Show slave lag for the cluster-zone check +* Feature 8522: Update Remote Client/Distributed Monitoring Documentation +* Feature 8527: Change Livestatus query log level to 'notice' +* Feature 8548: Add support for else-if +* Feature 8575: Include GDB backtrace in crash reports +* Feature 8599: Remove macro argument for IMPL_TYPE_LOOKUP +* Feature 8600: Add validator for time ranges in ScheduledDowntime objects +* Feature 8610: Support the SNI TLS extension +* Feature 8621: Add check commands for NSClient++ +* Feature 8648: Document closures ('use') + +#### Bugfixes + +* Bug 6171: Remove name and return value for stats functions +* Bug 6959: Scheduled start time will be ignored if the host or service is already in a problem state +* Bug 7311: Invalid macro results in exception +* Bug 7542: Update validators for CustomVarObject +* Bug 7576: validate configured legacy timeperiod ranges +* Bug 7582: Variable expansion is single quoted. +* Bug 7644: Unity build doesn't work with MSVC +* Bug 7647: Avoid rebuilding libbase when the version number changes +* Bug 7731: Reminder notifications not being sent but logged every 5 secs +* Bug 7765: DB IDO: Duplicate entry icinga_{host,service}dependencies +* Bug 7800: Fix the shift/reduce conflicts in the parser +* Bug 7802: Change parameter type for include and include_recursive to T_STRING +* Bug 7808: Unterminated string literals should cause parser to return an error +* Bug 7809: Scoping rules for "for" are broken +* Bug 7810: Return values for functions are broken +* Bug 7811: The __return keyword is broken +* Bug 7812: Validate array subscripts +* Bug 7814: Set expression should check whether LHS is a null pointer +* Bug 7815: - operator doesn't work in expressions +* Bug 7826: Compiler warnings +* Bug 7830: - shouldn't be allowed in identifiers +* Bug 7871: Missing persistent_comment, notify_contact columns for acknowledgement table +* Bug 7894: Fix warnings when using CMake 3.1.0 +* Bug 7895: Serialize() fails to serialize objects which don't have a registered type +* Bug 7995: Windows Agent: Missing directory "zones" in setup +* Bug 8018: Value("").IsEmpty() should return true +* Bug 8029: operator precedence for % and > is incorrect +* Bug 8041: len() overflows +* Bug 8061: Confusing error message for import +* Bug 8067: Require at least one user for notification objects (user or as member of user_groups) +* Bug 8076: icinga 2 Config Error needs to be more verbose +* Bug 8081: Location info for strings is incorrect +* Bug 8100: POSTGRES IDO: invalid syntax for integer: "true" while trying to update table icinga_hoststatus +* Bug 8111: User::ValidateFilters isn't being used +* Bug 8117: Agent checks fail when there's already a host with the same name +* Bug 8122: Config file passing validation causes segfault +* Bug 8132: Debug info for indexer is incorrect +* Bug 8136: Icinga crashes when config file name is invalid +* Bug 8164: escaped backslash in string literals +* Bug 8166: parsing include_recursive +* Bug 8173: Segfault on icinga::String::operator= when compiling configuration +* Bug 8175: Compiler warnings +* Bug 8179: Exception on missing config files +* Bug 8184: group assign fails with bad lexical cast when evaluating rules +* Bug 8185: Argument auto-completion doesn't work for short options +* Bug 8211: icinga2 node update should not write config for blacklisted zones/host +* Bug 8230: Lexer term for T_ANGLE_STRING is too aggressive +* Bug 8249: Problems using command_endpoint inside HA zone +* Bug 8257: Report missing command objects on remote agent +* Bug 8260: icinga2 node wizard: Create backups of certificates +* Bug 8289: Livestatus operator =~ is not case-insensitive +* Bug 8294: Running icinga2 command as non privilged user raises error +* Bug 8298: notify flag is ignored in ACKNOWLEDGE_*_PROBLEM commands +* Bug 8300: ApiListener::ReplayLog shouldn't hold mutex lock during call to Socket::Poll +* Bug 8307: PidPath, VarsPath, ObjectsPath and StatePath no longer read from init.conf +* Bug 8309: Crash in ScheduledDowntime::CreateNextDowntime +* Bug 8313: Incorrectly formatted timestamp in .timestamp file +* Bug 8318: Remote Clients: Add manual setup cli commands +* Bug 8323: Apply rule '' for host does not match anywhere! +* Bug 8333: Icinga2 master doesn't change check-status when "accept_commands = true" is not set at client node +* Bug 8372: Stacktrace on Endpoint not belonging to a zone or multiple zones +* Bug 8383: last_hard_state missing in StatusDataWriter +* Bug 8387: StatusDataWriter: Wrong host notification filters (broken fix in #8192) +* Bug 8388: Config sync authoritative file never created +* Bug 8389: Added downtimes must be triggered immediately if checkable is Not-OK +* Bug 8390: Agent writes CR CR LF in synchronized config files +* Bug 8397: Icinga2 config reset after package update (centos6.6) +* Bug 8425: DB IDO: Duplicate entry icinga_scheduleddowntime +* Bug 8433: Make the arguments for the stats functions const-ref +* Bug 8434: Build fails on OpenBSD +* Bug 8436: Indicate that Icinga2 is shutting down in case of a fatal error +* Bug 8438: DB IDO {host,service}checks command_line value is "Object of type 'icinga::Array'" +* Bug 8444: Don't attempt to restore program state from non-existing state file +* Bug 8452: Livestatus query on commands table with custom vars fails +* Bug 8461: Don't request heartbeat messages until after we've synced the log +* Bug 8473: Exception in WorkQueue::StatusTimerHandler +* Bug 8488: Figure out why 'node update-config' becomes slow over time +* Bug 8493: Misleading ApiListener connection log messages on a master (Endpoint vs Zone) +* Bug 8496: Icinga doesn't update long_output in DB +* Bug 8511: Deadlock with DB IDO dump and forcing a scheduled check +* Bug 8517: Config parser fails non-deterministic on Notification missing Checkable +* Bug 8519: apply-for incorrectly converts loop var to string +* Bug 8529: livestatus limit header not working +* Bug 8535: Crash in ApiEvents::RepositoryTimerHandler +* Bug 8536: Valgrind warning for ExternalCommandListener::CommandPipeThread +* Bug 8537: Crash in DbObject::SendStatusUpdate +* Bug 8544: Hosts: process_performance_data = 0 in database even though enable_perfdata = 1 in config +* Bug 8555: Don't accept config updates for zones for which we have an authoritative copy of the config +* Bug 8559: check_memory tool shows incorrect memory size on windows +* Bug 8593: Memory leak in Expression::GetReference +* Bug 8594: Improve Livestatus query performance +* Bug 8596: Dependency: Validate *_{host,service}_name objects on their existance +* Bug 8604: Attribute hints don't work for nested attributes +* Bug 8627: Icinga2 shuts down when service is reloaded +* Bug 8638: Fix a typo in documentation + +### What's New in Version 2.2.4 + +#### Changes + +* Bugfixes + +#### Bugfixes + +* Bug #6943: Configured recurring downtimes not applied on saturdays +* Bug #7660: livestatus / nsca / etc submits are ignored during reload +* Bug #7685: kUn-Bashify mail-{host,service}-notification.sh +* Bug #8128: Icinga 2.2.2 build fails on SLES11SP3 because of changed boost dependency +* Bug #8131: vfork() hangs on OS X +* Bug #8162: Satellite doesn't use manually supplied 'local zone name' +* Bug #8192: Feature statusdata shows wrong host notification options +* Bug #8201: Update Icinga Web 2 uri to /icingaweb2 +* Bug #8214: Fix YAJL detection on Debian squeeze +* Bug #8222: inconsistent URL http(s)://www.icinga.org +* Bug #8223: Typos in readme file for windows plugins +* Bug #8245: check_ssmtp command does NOT support mail_from +* Bug #8256: Restart fails after deleting a Host +* Bug #8288: Crash in DbConnection::ProgramStatusHandler +* Bug #8295: Restart of Icinga hangs +* Bug #8299: Scheduling downtime for host and all services only schedules services +* Bug #8311: Segfault in Checkable::AddNotification +* Bug #8321: enable_event_handlers attribute is missing in status.dat +* Bug #8368: Output in "node wizard" is confusing + +### What's New in Version 2.2.3 + +#### Changes + +* Bugfixes + +#### Bugfixes + +* Bug #8063: Volatile checks trigger invalid notifications on OK->OK state changes +* Bug #8125: Incorrect ticket shouldn't cause "node wizard" to terminate +* Bug #8126: Icinga 2.2.2 doesn't build on i586 SUSE distributions +* Bug #8143: Windows plugin check_service.exe can't find service NTDS +* Bug #8144: Arguments without values are not used on plugin exec +* Bug #8147: check_interval must be greater than 0 error on update-config +* Bug #8152: DB IDO query queue limit reached on reload +* Bug #8171: Typo in example of StatusDataWriter +* Bug #8178: Icinga 2.2.2 segfaults on FreeBSD +* Bug #8181: icinga2 node update config shows hex instead of human readable names +* Bug #8182: Segfault on update-config old empty config + +### What's New in Version 2.2.2 + +#### Changes + +* Bugfixes + +#### Bugfixes + +* Bug #7045: icinga2 init-script doesn't validate configuration on reload action +* Bug #7064: Missing host downtimes/comments in Livestatus +* Bug #7301: Docs: Better explaination of dependency state filters +* Bug #7314: double macros in command arguments seems to lead to exception +* Bug #7511: Feature `compatlog' should flush output buffer on every new line +* Bug #7518: update-config fails to create hosts +* Bug #7591: CPU usage at 100% when check_interval = 0 in host object definition +* Bug #7618: Repository does not support services which have a slash in their name +* Bug #7683: If a parent host goes down, the child host isn't marked as unrechable in the db ido +* Bug #7707: "node wizard" shouldn't crash when SaveCert fails +* Bug #7745: Cluster heartbeats need to be more aggressive +* Bug #7769: The unit tests still crash sometimes +* Bug #7863: execute checks locally if command_endpoint == local endpoint +* Bug #7878: Segfault on issuing node update-config +* Bug #7882: Improve error reporting when libmysqlclient or libpq are missing +* Bug #7891: CLI `icinga2 node update-config` doesn't sync configs from remote clients as expected +* Bug #7913: /usr/lib/icinga2 is not owned by a package +* Bug #7914: SUSE packages %set_permissions post statement wasn't moved to common +* Bug #7917: update_config not updating configuration +* Bug #7920: Test Classic UI config file with Apache 2.4 +* Bug #7929: Apache 2.2 fails with new apache conf +* Bug #8002: typeof() seems to return null for arrays and dictionaries +* Bug #8003: SIGABRT while evaluating apply rules +* Bug #8028: typeof does not work for numbers +* Bug #8039: Livestatus: Replace unixcat with nc -U +* Bug #8048: Wrong command in documentation for installing Icinga 2 pretty printers. +* Bug #8050: exception during config check +* Bug #8051: Update host examples in Dependencies for Network Reachability documentation +* Bug #8058: DB IDO: Missing last_hard_state column update in {host,service}status tables +* Bug #8059: Unit tests fail on FreeBSD +* Bug #8066: Setting a dictionary key to null does not cause the key/value to be removed +* Bug #8070: Documentation: Add note on default notification interval in getting started notifications.conf +* Bug #8075: No option to specify timeout to check_snmp and snmp manubulon commands + +### What's New in Version 2.2.1 + +#### Changes + +* Support arrays in [command argument macros](#command-passing-parameters) #6709 + * Allows to define multiple parameters for [nrpe -a](#plugin-check-command-nrpe), [nscp -l](#plugin-check-command-nscp), [disk -p](#plugin-check-command-disk), [dns -a](#plugin-check-command-dns). +* Bugfixes + +#### Features + +* Feature #6709: Support for arrays in macros +* Feature #7463: Update spec file to use yajl-devel +* Feature #7739: The classicui Apache conf doesn't support Apache 2.4 +* Feature #7747: Increase default timeout for NRPE checks +* Feature #7867: Document how arrays in macros work + +#### Bugfixes + +* Bug #7173: service icinga2 status gives wrong information when run as unprivileged user +* Bug #7602: livestatus large amount of submitting unix socket command results in broken pipes +* Bug #7613: icinga2 checkconfig should fail if group given for command files does not exist +* Bug #7671: object and template with the same name generate duplicate object error +* Bug #7708: Built-in commands shouldn't be run on the master instance in remote command execution mode +* Bug #7725: Windows wizard uses incorrect CLI command +* Bug #7726: Windows wizard is missing --zone argument +* Bug #7730: Restart Icinga - Error Restoring program state from file '/var/lib/icinga2/icinga2.state' +* Bug #7735: 2.2.0 has out-of-date icinga2 man page +* Bug #7738: Systemd rpm scripts are run in wrong package +* Bug #7740: /usr/sbin/icinga-prepare-dirs conflicts in the bin and common package +* Bug #7741: Icinga 2.2 misses the build requirement libyajl-devel for SUSE distributions +* Bug #7743: Icinga2 node add failed with unhandled exception +* Bug #7754: Incorrect error message for localhost +* Bug #7770: Objects created with node update-config can't be seen in Classic UI +* Bug #7786: Move the icinga2-prepare-dirs script elsewhere +* Bug #7806: !in operator returns incorrect result +* Bug #7828: Verify if master radio box is disabled in the Windows wizard +* Bug #7847: Wrong information in section "Linux Client Setup Wizard for Remote Monitoring" +* Bug #7862: Segfault in CA handling +* Bug #7868: Documentation: Explain how unresolved macros are handled +* Bug #7890: Wrong permission in run directory after restart +* Bug #7896: Fix Apache config in the Debian package + +### What's New in Version 2.2.0 + +#### Changes + +* DB IDO schema update to version `1.12.0` + * schema files in `lib/db_ido_{mysql,pgsql}/schema` (source) + * Table `programstatus`: New column `program_version` + * Table `customvariables` and `customvariablestatus`: New column `is_json` (required for custom attribute array/dictionary support) +* New features + * [GelfWriter](#gelfwriter): Logging check results, state changes, notifications to GELF (graylog2, logstash) #7619 + * Agent/Client/Node framework #7249 + * Windows plugins for the client/agent parts #7242 #7243 +* New CLI commands #7245 + * `icinga2 feature {enable,disable}` replaces `icinga2-{enable,disable}-feature` script #7250 + * `icinga2 object list` replaces `icinga2-list-objects` script #7251 + * `icinga2 pki` replaces` icinga2-build-{ca,key}` scripts #7247 + * `icinga2 repository` manages `/etc/icinga2/repository.d` which must be included in `icinga2.conf` #7255 + * `icinga2 node` cli command provides node (master, satellite, agent) setup (wizard) and management functionality #7248 + * `icinga2 daemon` for existing daemon arguments (`-c`, `-C`). Removed `-u` and `-g` parameters in favor of [init.conf](#init-conf). + * bash auto-completion & terminal colors #7396 +* Configuration + * Former `localhost` example host is now defined in [hosts.conf](#hosts-conf) #7594 + * All example services moved into advanced apply rules in [services.conf](#services-conf) + * Updated downtimes configuration example in [downtimes.conf](#downtimes-conf) #7472 + * Updated notification apply example in [notifications.conf](#notifications-conf) #7594 + * Support for object attribute 'zone' #7400 + * Support setting [object variables in apply rules](#dependencies-apply-custom-attributes) #7479 + * Support arrays and dictionaries in [custom attributes](#custom-attributes-apply) #6544 #7560 + * Add [apply for rules](#using-apply-for) for advanced dynamic object generation #7561 + * New attribute `accept_commands` for [ApiListener](#objecttype-apilistener) #7559 + * New [init.conf](#init-conf) file included first containing new constants `RunAsUser` and `RunAsGroup`. +* Cluster + * Add [CSR Auto-Signing support](#csr-autosigning-requirements) using generated ticket #7244 + * Allow to [execute remote commands](#icinga2-remote-monitoring-client-command-execution) on endpoint clients #7559 +* Perfdata + * [PerfdataWriter](#writing-performance-data-files): Don't change perfdata, pass through from plugins #7268 + * [GraphiteWriter](#graphite-carbon-cache-writer): Add warn/crit/min/max perfdata and downtime_depth stats values #7366 #6946 +* Packages + * `python-icinga2` package dropped in favor of integrated cli commands #7245 + * Windows Installer for the agent parts #7243 + +> **Note** +> +> Please remove `conf.d/hosts/localhost*` after verifying your updated configuration! + +#### Features + +* Feature #6544: Support for array in custom variable. +* Feature #6946: Add downtime depth as statistic metric for GraphiteWriter +* Feature #7187: Document how to use multiple assign/ignore statements with logical "and" & "or" +* Feature #7199: Cli commands: add filter capability to 'object list' +* Feature #7241: Windows Wizard +* Feature #7242: Windows plugins +* Feature #7243: Windows installer +* Feature #7244: CSR auto-signing +* Feature #7245: Cli commands +* Feature #7246: Cli command framework +* Feature #7247: Cli command: pki +* Feature #7248: Cli command: Node +* Feature #7249: Node Repository +* Feature #7250: Cli command: Feature +* Feature #7251: Cli command: Object +* Feature #7252: Cli command: SCM +* Feature #7253: Cli Commands: Node Repository Blacklist & Whitelist +* Feature #7254: Documentation: Agent/Satellite Setup +* Feature #7255: Cli command: Repository +* Feature #7262: macro processor needs an array printer +* Feature #7319: Documentation: Add support for locally-scoped variables for host/service in applied Dependency +* Feature #7334: GraphiteWriter: Add support for customized metric prefix names +* Feature #7356: Documentation: Cli Commands +* Feature #7366: GraphiteWriter: Add warn/crit/min/max perfdata values if existing +* Feature #7370: CLI command: variable +* Feature #7391: Add program_version column to programstatus table +* Feature #7396: Implement generic color support for terminals +* Feature #7400: Remove zone keyword and allow to use object attribute 'zone' +* Feature #7415: CLI: List disabled features in feature list too +* Feature #7421: Add -h next to --help +* Feature #7423: Cli command: Node Setup +* Feature #7452: Replace cJSON with a better JSON parser +* Feature #7465: Cli command: Node Setup Wizard (for Satellites and Agents) +* Feature #7467: Remove virtual agent name feature for localhost +* Feature #7472: Update downtimes.conf example config +* Feature #7478: Documentation: Mention 'icinga2 object list' in config validation +* Feature #7479: Set host/service variable in apply rules +* Feature #7480: Documentation: Add host/services variables in apply rules +* Feature #7504: Documentation: Revamp getting started with 1 host and multiple (service) applies +* Feature #7514: Documentation: Move troubleshooting after the getting started chapter +* Feature #7524: Documentation: Explain how to manage agent config in central repository +* Feature #7543: Documentation for arrays & dictionaries in custom attributes and their usage in apply rules for +* Feature #7559: Execute remote commands on the agent w/o local objects by passing custom attributes +* Feature #7560: Support dictionaries in custom attributes +* Feature #7561: Generate objects using apply with foreach in arrays or dictionaries (key => value) +* Feature #7566: Implement support for arbitrarily complex indexers +* Feature #7594: Revamp sample configuration: add NodeName host, move services into apply rules schema +* Feature #7596: Plugin Check Commands: disk is missing '-p', 'x' parameter +* Feature #7619: Add GelfWriter for writing log events to graylog2/logstash +* Feature #7620: Documentation: Update Icinga Web 2 installation +* Feature #7622: Icinga 2 should use less RAM +* Feature #7680: Conditionally enable MySQL and PostgresSQL, add support for FreeBSD and DragonFlyBSD + +#### Bugfixes + +* Bug #6547: delaying notifications with times.begin should postpone first notification into that window +* Bug #7257: default value for "disable_notifications" in service dependencies is set to "false" +* Bug #7268: Icinga2 changes perfdata order and removes maximum +* Bug #7272: icinga2 returns exponential perfdata format with check_nt +* Bug #7275: snmp-load checkcommand has wrong threshold syntax +* Bug #7276: SLES (Suse Linux Enterprise Server) 11 SP3 package dependency failure +* Bug #7302: ITL: check_procs and check_http are missing arguments +* Bug #7324: config parser crashes on unknown attribute in assign +* Bug #7327: Icinga2 docs: link supported operators from sections about apply rules +* Bug #7331: Error messages for invalid imports missing +* Bug #7338: Docs: Default command timeout is 60s not 5m +* Bug #7339: Importing a CheckCommand in a NotificationCommand results in an exception without stacktrace. +* Bug #7349: Documentation: Wrong check command for snmp-int(erface) +* Bug #7351: snmp-load checkcommand has a wrong "-T" param value +* Bug #7359: Setting snmp_v2 can cause snmp-manubulon-command derived checks to fail +* Bug #7365: Typo for "HTTP Checks" match in groups.conf +* Bug #7369: Fix reading perfdata in compat/checkresultreader +* Bug #7372: custom attribute name 'type' causes empty vars dictionary +* Bug #7373: Wrong usermod command for external command pipe setup +* Bug #7378: Commands are auto-completed when they shouldn't be +* Bug #7379: failed en/disable feature should return error +* Bug #7380: Debian package root permissions interfere with icinga2 cli commands as icinga user +* Bug #7392: Schema upgrade files are missing in /usr/share/icinga2-ido-{mysql,pgsql} +* Bug #7417: CMake warnings on OS X +* Bug #7428: Documentation: 1-about contribute links to non-existing report a bug howto +* Bug #7433: Unity build fails on RHEL 5 +* Bug #7446: When replaying logs the secobj attribute is ignored +* Bug #7473: Performance data via API is broken +* Bug #7475: can't assign Service to Host in nested HostGroup +* Bug #7477: Fix typos and other small corrections in documentation +* Bug #7482: OnStateLoaded isn't called for objects which don't have any state +* Bug #7483: Hosts/services should not have themselves as parents +* Bug #7495: Utility::GetFQDN doesn't work on OS X +* Bug #7503: Icinga2 fails to start due to configuration errors +* Bug #7520: Use ScriptVariable::Get for RunAsUser/RunAsGroup +* Bug #7536: Object list dump erraneously evaluates template definitions +* Bug #7537: Nesting an object in a template causes the template to become non-abstract +* Bug #7538: There is no __name available to nested objects +* Bug #7573: link missing in documentation about livestatus +* Bug #7577: Invalid checkresult object causes Icinga 2 to crash +* Bug #7579: only notify users on recovery which have been notified before (not-ok state) +* Bug #7585: Nested templates do not work (anymore) +* Bug #7586: Exception when executing check +* Bug #7597: Compilation Error with boost 1.56 under Windows +* Bug #7599: Plugin execution on Windows does not work +* Bug #7617: mkclass crashes when called without arguments +* Bug #7623: Missing state filter 'OK' must not prevent recovery notifications being sent +* Bug #7624: Installation on Windows fails +* Bug #7625: IDO module crashes on Windows +* Bug #7646: Get rid of static boost::mutex variables +* Bug #7648: Unit tests fail to run +* Bug #7650: Wrong set of dependency state when a host depends on a service +* Bug #7681: CreateProcess fails on Windows 7 +* Bug #7688: DebugInfo is missing for nested dictionaries + + +### What's New in Version 2.1.1 + +#### Features + +* Feature #6719: Change log message for checking/sending notifications +* Feature #7028: Document how to use @ to escape keywords +* Feature #7033: Add include guards for mkclass files +* Feature #7034: Ensure that namespaces for INITIALIZE_ONCE and REGISTER_TYPE are truly unique +* Feature #7035: Implement support for unity builds +* Feature #7039: Figure out a better way to set the version for snapshot builds +* Feature #7040: Unity builds: Detect whether __COUNTER__ is available +* Feature #7041: Enable unity build for RPM/Debian packages +* Feature #7070: Explain event commands and their integration by a real life example (httpd restart via ssh) +* Feature #7158: Extend documentation for icinga-web on Debian systems + +#### Bugfixes + +* Bug #6147: Link libcJSON against libm +* Bug #6696: make test fails on openbsd +* Bug #6841: Too many queued messages +* Bug #6862: SSL_read errors during restart +* Bug #6981: SSL errors with interleaved SSL_read/write +* Bug #7029: icinga2.spec: files-attr-not-set for python-icinga2 package +* Bug #7032: "Error parsing performance data" in spite of "enable_perfdata = false" +* Bug #7036: Remove validator for the Script type +* Bug #7037: icinga2-list-objects doesn't work with Python 3 +* Bug #7038: Fix rpmlint errors +* Bug #7042: icinga2-list-objects complains about Umlauts and stops output +* Bug #7044: icinga2 init-script terminates with exit code 0 if $DAEMON is not in place or not executable +* Bug #7047: service icinga2 status - prints cat error if the service is stopped +* Bug #7058: Exit code is not initialized for some failed checks +* Bug #7065: pipe2 returns ENOSYS on GNU Hurd and Debian kfreebsd +* Bug #7072: GraphiteWriter should ignore empty perfdata value +* Bug #7080: Missing differentiation between service and systemctl +* Bug #7096: new SSL Errors with too many queued messages +* Bug #7115: Build fails on Haiku +* Bug #7123: Manubulon-Plugin conf Filename wrong +* Bug #7139: GNUInstallDirs.cmake outdated +* Bug #7167: Segfault using cluster in TlsStream::IsEof +* Bug #7168: fping4 doesn't work correctly with the shipped command-plugins.conf +* Bug #7186: Livestatus hangs from time to time +* Bug #7195: fix memory leak ido_pgsql +* Bug #7210: clarify on db ido upgrades + +### What's New in Version 2.1.0 + +#### Changes + +* DB IDO schema upgrade ([MySQL](#upgrading-mysql-db),[PostgreSQL](#upgrading-postgresql-db) required! + * new schema version: **1.11.7** + * RPMs install the schema files into `/usr/share/icinga2-ido*` instead of `/usr/share/doc/icinga2-ido*` #6881 +* [Information for config objects](#list-configuration-objects) using `icinga2-list-objects` script #6702 +* Add Python 2.4 as requirement #6702 +* Add search path: If `-c /etc/icinga2/icinga2.conf` is omitted, use `SysconfDir + "/icinga2/icinga2.conf"` #6874 +* Change log level for failed commands #6751 +* Notifications are load-balanced in a [High Availability cluster setup](#high-availability-notifications) #6203 + * New config attribute: `enable_ha` +* DB IDO "run once" or "run everywhere" mode in a [High Availability cluster setup](#high-availability-db-ido) #6203 #6827 + * New config attributes: `enable_ha` and `failover_timeout` +* RPMs use the `icingacmd` group for /var/{cache,log,run}/icinga2 #6948 + +#### Features + +* Feature #5219: Cluster support for modified attributes +* Feature #6066: Better log messages for cluster changes +* Feature #6203: Better cluster support for notifications / IDO +* Feature #6205: Log replay sends messages to instances which shouldn't get those messages +* Feature #6702: Information for config objects +* Feature #6704: Release 2.1 +* Feature #6751: Change log level for failed commands +* Feature #6874: add search path for icinga2.conf +* Feature #6898: Enhance logging for perfdata/graphitewriter +* Feature #6919: Clean up spec file +* Feature #6920: Recommend related packages on SUSE distributions +* API - Bug #6998: ApiListener ignores bind_host attribute +* DB IDO - Feature #6827: delay ido connect in ha cluster +* Documentation - Bug #6870: Wrong object attribute 'enable_flap_detection' +* Documentation - Bug #6878: Wrong parent in Load Distribution +* Documentation - Bug #6909: clarify on which config tools are available +* Documentation - Bug #6968: Update command arguments 'set_if' and beautify error message +* Documentation - Bug #6995: Keyword "required" used inconsistently for host and service "icon_image*" attributes +* Documentation - Feature #6651: Migration: note on check command timeouts +* Documentation - Feature #6703: Documentation for zones and cluster permissions +* Documentation - Feature #6743: Better explanation for HA config cluster +* Documentation - Feature #6839: Explain how the order attribute works in commands +* Documentation - Feature #6864: Add section for reserved keywords +* Documentation - Feature #6867: add section about disabling re-notifications +* Documentation - Feature #6869: Add systemd options: enable, journal +* Documentation - Feature #6922: Enhance Graphite Writer description +* Documentation - Feature #6949: Add documentation for icinga2-list-objects +* Documentation - Feature #6997: how to add a new cluster node +* Documentation - Feature #7018: add example selinux policy for external command pipe +* Plugins - Feature #6650: Plugin Check Commands: add manubulon snmp plugins + +#### Bugfixes + +* Bug #6881: make install does not install the db-schema +* Bug #6915: use _rundir macro for configuring the run directory +* Bug #6916: External command pipe: Too many open files +* Bug #6917: enforce /usr/lib as base for the cgi path on SUSE distributions +* Bug #6942: ExternalCommandListener fails open pipe: Too many open files +* Bug #6948: check file permissions in /var/cache/icinga2 +* Bug #6962: Commands are processed multiple times +* Bug #6964: Host and service checks stuck in "pending" when hostname = localhost a parent/satellite setup +* Bug #7001: Build fails with Boost 1.56 +* Bug #7016: 64-bit RPMs are not installable + +### What's New in Version 2.0.2 + +#### Changes + +* DB IDO schema upgrade required (new schema version: 1.11.6) + +#### Features + +* Feature #5818: SUSE packages +* Feature #6655: Build packages for el7 +* Feature #6688: Rename README to README.md +* Feature #6698: Require command to be an array when the arguments attribute is used +* Feature #6700: Release 2.0.2 +* Feature #6783: Print application paths for --version +* DB IDO - Bug #6414: objects and their ids are inserted twice +* DB IDO - Bug #6608: Two Custom Variables with same name, but Upper/Lowercase creating IDO duplicate entry +* DB IDO - Bug #6646: NULL vs empty string +* DB IDO - Bug #6850: exit application if ido schema version does not match +* Documentation - Bug #6652: clarify on which features are required for classic ui/web/web2 +* Documentation - Bug #6708: update installation with systemd usage +* Documentation - Bug #6711: icinga Web: wrong path to command pipe +* Documentation - Bug #6725: Missing documentation about implicit dependency +* Documentation - Bug #6728: wrong path for the file 'localhost.conf' +* Migration - Bug #6558: group names quoted twice in arrays +* Migration - Bug #6560: Service dependencies aren't getting converted properly +* Migration - Bug #6561: $TOTALHOSTSERVICESWARNING$ and $TOTALHOSTSERVICESCRITICAL$ aren't getting converted +* Migration - Bug #6563: Check and retry intervals are incorrect +* Migration - Bug #6786: Fix notification definition if no host_name / service_description given +* Plugins - Feature #6695: Plugin Check Commands: Add expect option to check_http +* Plugins - Feature #6791: Plugin Check Commands: Add timeout option to check_ssh + +#### Bugfixes + +* Bug #6450: ipmi-sensors segfault due to stack size +* Bug #6479: Notifications not always triggered +* Bug #6501: Classic UI Debian/Ubuntu: apache 2.4 requires 'a2enmod cgi' & apacheutils installed +* Bug #6548: Add cmake constant for PluginDir +* Bug #6549: GraphiteWriter regularly sends empty lines +* Bug #6550: add log message for invalid performance data +* Bug #6589: Command pipe blocks when trying to open it more than once in parallel +* Bug #6621: Infinite loop in TlsStream::Close +* Bug #6627: Location of the run directory is hard coded and bound to "local_state_dir" +* Bug #6659: RPMLint security warning - missing-call-to-setgroups-before-setuid /usr/sbin/icinga2 +* Bug #6682: Missing detailed error messages on ApiListener SSL Errors +* Bug #6686: Event Commands are triggered in OK HARD state everytime +* Bug #6687: Remove superfluous quotes and commas in dictionaries +* Bug #6713: sample config: add check commands location hint (itl/plugin check commands) +* Bug #6718: "order" attribute doesn't seem to work as expected +* Bug #6724: TLS Connections still unstable in 2.0.1 +* Bug #6756: GraphiteWriter: Malformatted integer values +* Bug #6765: Config validation without filename argument fails with unhandled exception +* Bug #6768: Repo Error on RHEL 6.5 +* Bug #6773: Order doesn't work in check ssh command +* Bug #6782: The "ssl" check command always sets -D +* Bug #6790: Service icinga2 reload command does not cause effect +* Bug #6809: additional group rights missing when Icinga started with -u and -g +* Bug #6810: High Availablity does not synchronise the data like expected +* Bug #6820: Icinga 2 crashes during startup +* Bug #6821: [Patch] Fix build issue and crash found on Solaris, potentially other Unix OSes +* Bug #6825: incorrect sysconfig path on sles11 +* Bug #6832: Remove if(NOT DEFINED ICINGA2_SYSCONFIGFILE) in etc/initsystem/CMakeLists.txt +* Bug #6840: Missing space in error message +* Bug #6849: Error handler for getaddrinfo must use gai_strerror +* Bug #6852: Startup logfile is not flushed to disk +* Bug #6856: event command execution does not call finish handler +* Bug #6861: write startup error messages to error.log + +### What's New in Version 2.0.1 + +#### Features + +* Feature #6531: Add port option to check imap/pop/smtp and a new dig +* Feature #6581: Add more options to snmp check +* DB IDO - Bug #5577: PostgreSQL string escaping +* DB IDO - Bug #6577: icinga2-ido-pgsql snapshot package missing dependecy dbconfig-common +* Documentation - Bug #6506: Array section confusing +* Documentation - Bug #6592: Documentation for || and && is missing +* Documentation - Feature #6658: change docs.icinga.org/icinga2/latest to git master +* Livestatus - Bug #6494: Thruk Panorama View cannot query Host Status +* Livestatus - Feature #5312: OutputFormat python +* Migration - Bug #6559: $SERVICEDESC$ isn't getting converted correctly + +#### Bugfixes + +* Bug #6316: application fails to start on wrong log file permissions but does not tell about it +* Bug #6368: Deadlock in ApiListener::RelayMessage +* Bug #6373: base64 on CentOS 5 fails to read certificate bundles +* Bug #6388: Debian package icinga2-classicui needs versioned dependency of icinga-cgi* +* Bug #6488: build warnings +* Bug #6492: icinga2.state could not be opened +* Bug #6493: Copyright problems +* Bug #6498: icinga2 cannot be built with both systemd and init.d files +* Bug #6510: Reminder notifications are sent on disabled services +* Bug #6526: htpasswd should be installed with icinga2-classicui on Ubuntu +* Bug #6529: parsing of double defined command can generate unexpected errors +* Bug #6537: Icinga doesn't send SetLogPosition messages when one of the endpoints fails to connect +* Bug #6551: Improve systemd service definition +* Bug #6565: Dependencies should cache their parent and child object +* Bug #6574: Check command result doesn't match +* Bug #6576: Remove line number information from stack traces +* Bug #6588: Notifications causing segfault from exim +* Bug #6605: Please add --sni option to http check command +* Bug #6612: Icinga stops updating IDO after a while +* Bug #6617: TLS connections are still unstable +* Bug #6620: icinga2-build-ca shouldn't prompt for DN +* Bug #6622: icinga2-sign-key creates ".crt" and ".key" files when the CA passphrase is invalid +* Bug #6657: ICINGA2_SYSCONFIGFILE should use full path using CMAKE_INSTALL_FULL_SYSCONFDIR +* Bug #6662: Increase icinga.cmd Limit +* Bug #6665: Build fails when MySQL is not installed +* Bug #6671: enabled_notification doesn't work as expected +* Bug #6672: Icinga crashes after "Too many queued messages" +* Bug #6673: enable_notifications = false for users has no effect + diff --git a/vim/bundle/icinga2/INSTALL.md b/vim/bundle/icinga2/INSTALL.md new file mode 100644 index 0000000..5357d4b --- /dev/null +++ b/vim/bundle/icinga2/INSTALL.md @@ -0,0 +1,175 @@ +# Installing Icinga 2 + +The recommended way of installing Icinga 2 is to use packages. The Icinga +project provides both release and development packages for a number +of operating systems. + +Please check the documentation in the [doc/](doc/) directory for a current list +of available packages and detailed installation instructions. + +There are a number of known caveats when installing from source such as +incorrect directory and file permissions. So even if you're planning to +not use the official packages it is advisable to build your own Debian +or RPM packages. + +## Build Requirements + +The following requirements need to be fulfilled in order to build the +application using a dist tarball (package names for RHEL and Debian in +parentheses): + +* cmake >= 2.6 +* GNU make (make) +* C++ compiler which supports C++11 (gcc-c++ >= 4.7 on RHEL/SUSE, build-essential on Debian, alternatively clang++) +* pkg-config +* OpenSSL library and header files >= 0.9.8 (openssl-devel on RHEL, libopenssl1-devel on SLES11, +libopenssl-devel on SLES12, libssl-dev on Debian) +* Boost library and header files >= 1.41.0 (boost-devel on RHEL, libboost-all-dev on Debian) +* GNU bison (bison) +* GNU flex (flex) >= 2.5.35 +* recommended: libexecinfo on FreeBSD (automatically used when Icinga 2 is + installed via port or package) +* optional: MySQL (mysql-devel on RHEL, libmysqlclient-devel on SUSE, libmysqlclient-dev on Debian); + set CMake variable `ICINGA2_WITH_MYSQL` to `OFF` to disable this module +* optional: PostgreSQL (postgresql-devel on RHEL, libpq-dev on Debian); set CMake + variable `ICINGA2_WITH_PGSQL` to `OFF` to disable this module +* optional: YAJL (yajl-devel on RHEL, libyajl-dev on Debian) +* optional: libedit (libedit-devel on CentOS (RHEL requires rhel-7-server-optional-rpms + repository for el7 e.g.), libedit-dev on Debian) +* optional: Termcap (libtermcap-devel on RHEL, not necessary on Debian) - only + required if libedit doesn't already link against termcap/ncurses +* optional: libwxgtk2.8-dev or newer (wxGTK-devel and wxBase) - only required when building the Icinga 2 Studio + +Note: RHEL5 ships an ancient flex version. Updated packages are available for +example from the repoforge buildtools repository. + +* x86: http://mirror.hs-esslingen.de/repoforge/redhat/el5/en/i386/buildtools/ +* x86\_64: http://mirror.hs-esslingen.de/repoforge/redhat/el5/en/x86\_64/buildtools/ + +### User Requirements + +By default Icinga will run as user 'icinga' and group 'icinga'. Additionally the +external command pipe and livestatus features require a dedicated command group +'icingacmd'. You can choose your own user/group names and pass them to CMake +using the `ICINGA2_USER`, `ICINGA2_GROUP` and `ICINGA2_COMMAND_GROUP` variables. + + # groupadd icinga + # groupadd icingacmd + # useradd -c "icinga" -s /sbin/nologin -G icingacmd -g icinga icinga + +Add the web server user to the icingacmd group in order to grant it write +permissions to the external command pipe and livestatus socket: + + # usermod -a -G icingacmd www-data + +Make sure to replace "www-data" with the name of the user your web server +is running as. + +## Building Icinga 2 + +Once you have installed all the necessary build requirements you can build +Icinga 2 using the following commands: + + $ mkdir build && cd build + $ cmake .. + $ make + $ make install + +You can specify an alternative installation prefix using `-DCMAKE_INSTALL_PREFIX`: + + $ cmake .. -DCMAKE_INSTALL_PREFIX=/tmp/icinga2 + +In addition to `CMAKE_INSTALL_PREFIX` the following Icinga-specific cmake +variables are supported: + +- `ICINGA2_USER`: The user Icinga 2 should run as; defaults to `icinga` +- `ICINGA2_GROUP`: The group Icinga 2 should run as; defaults to `icinga` +- `ICINGA2_GIT_VERSION_INFO`: Whether to use Git to determine the version number; defaults to `ON` +- `ICINGA2_COMMAND_GROUP`: The command group Icinga 2 should use; defaults to `icingacmd` +- `ICINGA2_UNITY_BUILD`: Whether to perform a unity build; defaults to `ON` +- `ICINGA2_LTO_BUILD`: Whether to use link time optimization (LTO); defaults to `OFF` +- `ICINGA2_PLUGINDIR`: The path for the Monitoring Plugins project binaries; defaults to `/usr/lib/nagios/plugins` +- `ICINGA2_RUNDIR`: The location of the "run" directory; defaults to `CMAKE_INSTALL_LOCALSTATEDIR/run` +- `CMAKE_INSTALL_SYSCONFDIR`: The configuration directory; defaults to `CMAKE_INSTALL_PREFIX/etc` +- `ICINGA2_SYSCONFIGFILE`: Where to put the config file the initscript/systemd pulls it's dirs from; +defaults to `CMAKE_INSTALL_PREFIX/etc/sysconfig/icinga2` +- `CMAKE_INSTALL_LOCALSTATEDIR`: The state directory; defaults to `CMAKE_INSTALL_PREFIX/var` +- `USE_SYSTEMD=ON|OFF`: Use systemd or a classic SysV initscript; defaults to `OFF` +- `INSTALL_SYSTEMD_SERVICE_AND_INITSCRIPT=ON|OFF` Force install both the systemd service definition file +and the SysV initscript in parallel, regardless of how `USE_SYSTEMD` is set. +Only use this for special packaging purposes and if you know what you are doing. +Defaults to `OFF`. +- `ICINGA2_WITH_MYSQL`: Determines whether the MySQL IDO module is built; defaults to `ON` +- `ICINGA2_WITH_PGSQL`: Determines whether the PostgreSQL IDO module is built; defaults to `ON` +- `ICINGA2_WITH_CHECKER`: Determines whether the checker module is built; defaults to `ON` +- `ICINGA2_WITH_COMPAT`: Determines whether the compat module is built; defaults to `ON` +- `ICINGA2_WITH_DEMO`: Determines whether the demo module is built; defaults to `OFF` +- `ICINGA2_WITH_HELLO`: Determines whether the hello module is built; defaults to `OFF` +- `ICINGA2_WITH_LIVESTATUS`: Determines whether the Livestatus module is built; defaults to `ON` +- `ICINGA2_WITH_NOTIFICATION`: Determines whether the notification module is built; defaults to `ON` +- `ICINGA2_WITH_PERFDATA`: Determines whether the perfdata module is built; defaults to `ON` +- `ICINGA2_WITH_STUDIO`: Determines whether the Icinga Studio application is built; defaults to `OFF` +- `ICINGA2_WITH_TESTS`: Determines whether the unit tests are built; defaults to `ON` + +CMake determines the Icinga 2 version number using `git describe` if the +source directory is contained in a Git repository. Otherwise the version number +is extracted from the [icinga2.spec](icinga2.spec) file. This behavior can be +overridden by creating a file called `icinga-version.h.force` in the source +directory. Alternatively the `-DICINGA2_GIT_VERSION_INFO=OFF` option for CMake +can be used to disable the usage of `git describe`. + +### Building Icinga 2 RPMs + +Setup your build environment on RHEL/SUSE and copy the generated tarball from your git +repository to `rpmbuild/SOURCES`. + +Copy the icinga2.spec file to `rpmbuild/SPEC` and then run this command: + + $ rpmbuild -ba SPEC/icinga2.spec + +### Building Icinga 2 Debs + +Setup your build environment on Debian/Ubuntu, copy the 'debian' directory from +the Debian packaging Git repository (https://anonscm.debian.org/cgit/pkg-nagios/pkg-icinga2.git) +into your source tree and run the following command: + + $ dpkg-buildpackage -uc -us + +### Building Post Install Tasks + +After building Icinga 2 yourself, your package build system should at least run the following post +install requirements: + +* enable the `checker`, `notification` and `mainlog` feature by default +* run 'icinga2 api setup' in order to enable the `api` feature and generate SSL certificates for the node + + +## Running Icinga 2 + +Icinga 2 comes with a single binary that takes care of loading all the relevant +components (e.g. for check execution, notifications, etc.): + + # /usr/sbin/icinga2 daemon + [2015-03-12 13:25:56 +0100] information/cli: Icinga application loader (version: v2.3.0-20-ga4d3713; debug) + [2015-03-12 13:25:56 +0100] information/cli: Loading application type: icinga/IcingaApplication + [2015-03-12 13:25:56 +0100] information/Utility: Loading library 'libicinga.dylib' + [2015-03-12 13:25:56 +0100] information/ConfigCompiler: Compiling config file: /Users/gunnar/i2/etc/icinga2/icinga2.conf + [2015-03-12 13:25:56 +0100] information/ConfigCompiler: Compiling config file: /Users/gunnar/i2/etc/icinga2/constants.conf + ... + +Icinga 2 can be started as a daemon using the provided init script: + + # /etc/init.d/icinga2 + Usage: /etc/init.d/icinga2 {start|stop|restart|reload|checkconfig|status} + +Or if your distribution uses systemd: + + # systemctl {start|stop|reload|status|enable|disable} icinga2 + +Icinga 2 reads a single configuration file which is used to specify all +configuration settings (global settings, hosts, services, etc.). The +configuration format is explained in detail in the [doc/](doc/) directory. + +By default `make install` installs example configuration files in +`/usr/local/etc/icinga2` unless you have specified a different prefix or +sysconfdir. diff --git a/vim/bundle/icinga2/NEWS b/vim/bundle/icinga2/NEWS new file mode 100644 index 0000000..27c2058 --- /dev/null +++ b/vim/bundle/icinga2/NEWS @@ -0,0 +1 @@ +News for this application can be found on the project website at https://www.icinga.org diff --git a/vim/bundle/icinga2/README.md b/vim/bundle/icinga2/README.md new file mode 100644 index 0000000..0950948 --- /dev/null +++ b/vim/bundle/icinga2/README.md @@ -0,0 +1,26 @@ +# Icinga 2 + +## About + +Icinga 2 is an open source monitoring system which checks the availability of your +network resources, notifies users of outages, and generates performance data for reporting. + +Scalable and extensible, Icinga 2 can monitor large, complex environments across +multiple locations. + +More details online at [www.icinga.org](https://www.icinga.org/icinga/icinga-2/) +and inside the [documentation](doc/1-about.md). + +## Installation + +Read the [INSTALL.md](INSTALL.md) file for more information about how to install it. + +## Documentation + +The documentation is located in the [doc/](doc/) directory. The latest documentation +is also available on https://docs.icinga.org + +## Support + +Check the project website at https://www.icinga.org for status updates and +https://support.icinga.org if you want to contact us. diff --git a/vim/bundle/icinga2/RELEASE.md b/vim/bundle/icinga2/RELEASE.md new file mode 100644 index 0000000..0ef9991 --- /dev/null +++ b/vim/bundle/icinga2/RELEASE.md @@ -0,0 +1,172 @@ +# Release Workflow + +Print this document. + +Specify the release version. + + VERSION=2.5.4 + +## Issues + +Check the following issue filters: + +* [Pending backports](https://dev.icinga.org/projects/i2/issues?query_id=41) +* [Invalid target version](https://dev.icinga.org/projects/i2/issues?query_id=55) + +## Backport Commits + + $ git checkout master + $ ./pick.py -V $VERSION + +The script creates a new branch 'auto-merged-' which is based on the +current support branch. It then merges all commits from the 'master' branch which +reference a ticket for the version that was specified. + +If there are any merge commits you will need to manually fix them and continue the +rebase until no commits are left: + + $ git rebase --continue + +After finishing the rebase the branch needs to be merged into the support branch: + + $ git checkout support/2.5 + $ git merge --ff-only auto-merged-2.5.3 + +## Authors + +Update the [.mailmap](.mailmap) and [AUTHORS](AUTHORS) files: + + $ git checkout master + $ git log --use-mailmap | grep ^Author: | cut -f2- -d' ' | sort | uniq > AUTHORS + +## Version + +Update the version number in the following file: + +* [icinga2.spec]: Version: (.*) + +Example: + + gsed -i "s/Version: .*/Version: $VERSION/g" icinga2.spec + gsed -i "s/.*<\/version>/$VERSION<\/version>/g" icinga2.nuspec + gsed -i "s/Icinga2-v.*-/Icinga2-v$VERSION-/g" tools/chocolateyInstall.ps1 + +## Changelog + +Update the [ChangeLog](ChangeLog), [doc/1-about.md](doc/1-about.md) files using +the changelog.py script. Also generate HTML for the wordpress release announcement. + +Changelog: + + $ ./changelog.py -V $VERSION + +Docs: + + $ ./changelog.py -V $VERSION -l + +Wordpress: + + $ ./changelog.py -V $VERSION -H -l + +## Git Tag + +Commit these changes to the "master" branch: + + $ git commit -v -a -m "Release version $VERSION" + +For minor releases: Cherry-pick this commit into the "support" branch. + +Create a signed tag (tags/v) on the "master" branch (for major +releases) or the "support" branch (for minor releases). + +GB: + + $ git tag -u EE8E0720 -m "Version $VERSION" v$VERSION + +MF: + + $ git tag -u D14A1F16 -m "Version $VERSION" v$VERSION + +Push the tag. + + $ git push --tags + +For major releases: Create a new "support" branch: + + $ git checkout master + $ git checkout -b support/2.5 + $ git push -u origin support/2.5 + +For minor releases: Push the support branch, cherry-pick the release commit +into master and merge the support branch: + + $ git push -u origin support/2.5 + $ git checkout master + $ git cherry-pick support/2.5 + $ git merge --strategy=ours support/2.5 + $ git push origin master + +# External Dependencies + +## Build Server + +* Update Git tags for the release jobs. +* Build the newly created Git tag for Debian/RHEL/SuSE. +* Build the newly created Git tag for Windows. + +## Release Tests + +* Test DB IDO with MySQL and PostgreSQL. +* Provision the vagrant boxes and test the release packages. +* Test the [setup wizard](http://packages.icinga.org/windows/) inside a Windows VM. + +* Start a new docker container and install/run icinga2. + +Example for CentOS7: + + $ docker run -ti centos:latest bash + + # yum -y install http://packages.icinga.org/epel/7/release/noarch/icinga-rpm-release-7-1.el7.centos.noarch.rpm + # yum -y install icinga2 + # icinga2 daemon -C + + # systemctl start icinga2 + # tail -f /var/log/icinga2/icinga2.log + +## GitHub Release + +Create a new release for the newly created Git tag. +https://github.com/Icinga/icinga2/releases + +## Chocolatey + +Navigate to the git repository on your Windows box which +already has chocolatey installed. Pull/checkout the release. + +Create the nupkg package: + + cpack + +Install the created icinga2 package locally: + + choco install icinga2 -version 2.5.4 -fdv "%cd%" -source "'%cd%;https://chocolatey.org/api/v2/'" + +Upload the package to [chocolatey](https://chocolatey.org/packages/upload). + +## Online Documentation + +SSH into the web box, navigate into `icinga2-latest/module/icinga2` +and pull the current support branch. + +## Announcement + +* Create a new blog post on www.icinga.org/blog +* Send announcement mail to icinga-announce@lists.icinga.org +* Social media: [Twitter](https://twitter.com/icinga), [Facebook](https://www.facebook.com/icinga), [G+](http://plus.google.com/+icinga), [Xing](https://www.xing.com/communities/groups/icinga-da4b-1060043), [LinkedIn](https://www.linkedin.com/groups/Icinga-1921830/about) +* Update IRC channel topic + +# After the release + +* Add new minor version +* Close the released version +* Update Redmine filters for the next major/minor version diff --git a/vim/bundle/icinga2/agent/CMakeLists.txt b/vim/bundle/icinga2/agent/CMakeLists.txt new file mode 100644 index 0000000..8d1fba8 --- /dev/null +++ b/vim/bundle/icinga2/agent/CMakeLists.txt @@ -0,0 +1,30 @@ +# Icinga 2 +# Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +if(MSVC) + include_external_msproject( + icinga2setupagent + ${CMAKE_CURRENT_SOURCE_DIR}/windows-setup-agent/Icinga2SetupAgent.csproj + TYPE FAE04EC0-301F-11D3-BF4B-00C04F79EFBC + PLATFORM Win32 + ) + + install( + FILES ${CMAKE_CURRENT_SOURCE_DIR}/windows-setup-agent/bin/\${CMAKE_INSTALL_CONFIG_NAME}/Icinga2SetupAgent.exe ${CMAKE_CURRENT_SOURCE_DIR}/windows-setup-agent/bin/\${CMAKE_INSTALL_CONFIG_NAME}/Icinga2SetupAgent.exe.config + DESTINATION ${CMAKE_INSTALL_SBINDIR} + ) +endif() diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/.gitignore b/vim/bundle/icinga2/agent/windows-setup-agent/.gitignore new file mode 100644 index 0000000..8d4a6c0 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/.gitignore @@ -0,0 +1,2 @@ +bin +obj \ No newline at end of file diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/App.config b/vim/bundle/icinga2/agent/windows-setup-agent/App.config new file mode 100644 index 0000000..49c7a61 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/App.config @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/EndpointInputBox.Designer.cs b/vim/bundle/icinga2/agent/windows-setup-agent/EndpointInputBox.Designer.cs new file mode 100644 index 0000000..c06ec16 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/EndpointInputBox.Designer.cs @@ -0,0 +1,177 @@ +namespace Icinga +{ + partial class EndpointInputBox + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.btnOK = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.txtHost = new System.Windows.Forms.TextBox(); + this.txtPort = new System.Windows.Forms.TextBox(); + this.label1 = new System.Windows.Forms.Label(); + this.lblHost = new System.Windows.Forms.Label(); + this.lblPort = new System.Windows.Forms.Label(); + this.lblInstanceName = new System.Windows.Forms.Label(); + this.txtInstanceName = new System.Windows.Forms.TextBox(); + this.chkConnect = new System.Windows.Forms.CheckBox(); + this.SuspendLayout(); + // + // btnOK + // + this.btnOK.Location = new System.Drawing.Point(196, 171); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(75, 23); + this.btnOK.TabIndex = 4; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // btnCancel + // + this.btnCancel.CausesValidation = false; + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(277, 171); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 5; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + // + // txtHost + // + this.txtHost.Enabled = false; + this.txtHost.Location = new System.Drawing.Point(101, 103); + this.txtHost.Name = "txtHost"; + this.txtHost.Size = new System.Drawing.Size(251, 20); + this.txtHost.TabIndex = 2; + // + // txtPort + // + this.txtPort.Enabled = false; + this.txtPort.Location = new System.Drawing.Point(101, 134); + this.txtPort.Name = "txtPort"; + this.txtPort.Size = new System.Drawing.Size(100, 20); + this.txtPort.TabIndex = 3; + this.txtPort.Text = "5665"; + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(12, 9); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(276, 13); + this.label1.TabIndex = 4; + this.label1.Text = "Please enter the connection details for the new endpoint:"; + // + // lblHost + // + this.lblHost.AutoSize = true; + this.lblHost.Location = new System.Drawing.Point(15, 106); + this.lblHost.Name = "lblHost"; + this.lblHost.Size = new System.Drawing.Size(32, 13); + this.lblHost.TabIndex = 5; + this.lblHost.Text = "Host:"; + // + // lblPort + // + this.lblPort.AutoSize = true; + this.lblPort.Location = new System.Drawing.Point(15, 137); + this.lblPort.Name = "lblPort"; + this.lblPort.Size = new System.Drawing.Size(29, 13); + this.lblPort.TabIndex = 6; + this.lblPort.Text = "Port:"; + // + // lblInstanceName + // + this.lblInstanceName.AutoSize = true; + this.lblInstanceName.Location = new System.Drawing.Point(15, 41); + this.lblInstanceName.Name = "lblInstanceName"; + this.lblInstanceName.Size = new System.Drawing.Size(82, 13); + this.lblInstanceName.TabIndex = 7; + this.lblInstanceName.Text = "Instance Name:"; + // + // txtInstanceName + // + this.txtInstanceName.Location = new System.Drawing.Point(101, 37); + this.txtInstanceName.Name = "txtInstanceName"; + this.txtInstanceName.Size = new System.Drawing.Size(251, 20); + this.txtInstanceName.TabIndex = 0; + // + // chkConnect + // + this.chkConnect.AutoSize = true; + this.chkConnect.Location = new System.Drawing.Point(18, 73); + this.chkConnect.Name = "chkConnect"; + this.chkConnect.Size = new System.Drawing.Size(141, 17); + this.chkConnect.TabIndex = 1; + this.chkConnect.Text = "Connect to this endpoint"; + this.chkConnect.UseVisualStyleBackColor = true; + this.chkConnect.CheckedChanged += new System.EventHandler(this.chkConnect_CheckedChanged); + // + // EndpointInputBox + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(360, 202); + this.Controls.Add(this.chkConnect); + this.Controls.Add(this.txtInstanceName); + this.Controls.Add(this.lblInstanceName); + this.Controls.Add(this.lblPort); + this.Controls.Add(this.lblHost); + this.Controls.Add(this.label1); + this.Controls.Add(this.txtPort); + this.Controls.Add(this.txtHost); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnOK); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedDialog; + this.MaximizeBox = false; + this.MinimizeBox = false; + this.Name = "EndpointInputBox"; + this.ShowIcon = false; + this.ShowInTaskbar = false; + this.StartPosition = System.Windows.Forms.FormStartPosition.CenterParent; + this.Text = "Add Endpoint"; + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Label lblHost; + private System.Windows.Forms.Label lblPort; + public System.Windows.Forms.TextBox txtHost; + public System.Windows.Forms.TextBox txtPort; + public System.Windows.Forms.TextBox txtInstanceName; + private System.Windows.Forms.Label lblInstanceName; + public System.Windows.Forms.CheckBox chkConnect; + } +} \ No newline at end of file diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/EndpointInputBox.cs b/vim/bundle/icinga2/agent/windows-setup-agent/EndpointInputBox.cs new file mode 100644 index 0000000..62ef8a2 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/EndpointInputBox.cs @@ -0,0 +1,52 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; + +namespace Icinga +{ + public partial class EndpointInputBox : Form + { + public EndpointInputBox() + { + InitializeComponent(); + } + + private void Warning(string message) + { + MessageBox.Show(this, message, Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + + private void chkConnect_CheckedChanged(object sender, EventArgs e) + { + txtHost.Enabled = chkConnect.Checked; + txtPort.Enabled = chkConnect.Checked; + } + + private void btnOK_Click(object sender, EventArgs e) + { + if (txtInstanceName.Text.Length == 0) { + Warning("Please enter an instance name."); + return; + } + + if (chkConnect.Checked) { + if (txtHost.Text.Length == 0) { + Warning("Please enter a host name."); + return; + } + + if (txtPort.Text.Length == 0) { + Warning("Please enter a port."); + return; + } + } + + DialogResult = DialogResult.OK; + Close(); + } + } +} diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/EndpointInputBox.resx b/vim/bundle/icinga2/agent/windows-setup-agent/EndpointInputBox.resx new file mode 100644 index 0000000..7080a7d --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/EndpointInputBox.resx @@ -0,0 +1,120 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + \ No newline at end of file diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/Icinga2SetupAgent.csproj b/vim/bundle/icinga2/agent/windows-setup-agent/Icinga2SetupAgent.csproj new file mode 100644 index 0000000..4d09d4d --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/Icinga2SetupAgent.csproj @@ -0,0 +1,204 @@ + + + + + Debug + x86 + {A86F1159-66E8-4BDB-BF28-A2BDAF76517C} + WinExe + Properties + Icinga + Icinga2SetupAgent + v2.0 + 512 + + publish\ + true + Disk + false + Foreground + 7 + Days + false + false + true + 0 + 1.0.0.%2a + false + false + true + + + x86 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\RelWithDebInfo\ + TRACE + prompt + 4 + + + x86 + pdbonly + true + bin\MinSizeRel\ + TRACE + prompt + 4 + + + x64 + true + full + false + bin\Debug\ + DEBUG;TRACE + prompt + 4 + + + x64 + pdbonly + true + bin\Release\ + TRACE + prompt + 4 + + + x64 + pdbonly + true + bin\RelWithDebInfo\ + TRACE + prompt + 4 + + + x64 + pdbonly + true + bin\MinSizeRel\ + TRACE + prompt + 4 + + + icinga.ico + + + app.manifest + + + + + + + + + + + + Form + + + ServiceStatus.cs + + + Form + + + SetupWizard.cs + + + Form + + + EndpointInputBox.cs + + + + + ServiceStatus.cs + + + SetupWizard.cs + + + EndpointInputBox.cs + + + ResXFileCodeGenerator + Resources.Designer.cs + Designer + + + True + Resources.resx + True + + + + SettingsSingleFileGenerator + Settings.Designer.cs + + + True + Settings.settings + True + + + + + + + + + + + + + + False + Microsoft .NET Framework 4.5 %28x86 and x64%29 + true + + + False + .NET Framework 3.5 SP1 Client Profile + false + + + False + .NET Framework 3.5 SP1 + false + + + + + diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/Program.cs b/vim/bundle/icinga2/agent/windows-setup-agent/Program.cs new file mode 100644 index 0000000..e132bc1 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/Program.cs @@ -0,0 +1,89 @@ +using System; +using System.IO; +using System.Windows.Forms; +using Microsoft.Win32; +using System.Runtime.InteropServices; +using System.Text; + +namespace Icinga +{ + static class Program + { + [DllImport("msi.dll", SetLastError = true)] + static extern int MsiEnumProducts(int iProductIndex, StringBuilder lpProductBuf); + + [DllImport("msi.dll", CharSet = CharSet.Unicode)] + static extern Int32 MsiGetProductInfo(string product, string property, [Out] StringBuilder valueBuf, ref Int32 len); + + public static string Icinga2InstallDir + { + get + { + StringBuilder szProduct; + + for (int index = 0; ; index++) { + szProduct = new StringBuilder(39); + if (MsiEnumProducts(index, szProduct) != 0) + break; + + int cbName = 128; + StringBuilder szName = new StringBuilder(cbName); + + if (MsiGetProductInfo(szProduct.ToString(), "ProductName", szName, ref cbName) != 0) + continue; + + if (szName.ToString() != "Icinga 2") + continue; + + int cbLocation = 1024; + StringBuilder szLocation = new StringBuilder(cbLocation); + if (MsiGetProductInfo(szProduct.ToString(), "InstallLocation", szLocation, ref cbLocation) == 0) + return szLocation.ToString(); + } + + return ""; + } + } + + public static string Icinga2DataDir + { + get + { + return Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData) + "\\icinga2"; + } + } + + + public static void FatalError(Form owner, string message) + { + MessageBox.Show(owner, message, "Icinga 2 Setup Wizard", MessageBoxButtons.OK, MessageBoxIcon.Error); + Application.Exit(); + } + + /// + /// The main entry point for the application. + /// + [STAThread] + static void Main() + { + Application.EnableVisualStyles(); + Application.SetCompatibleTextRenderingDefault(false); + + string installDir = Program.Icinga2InstallDir; + + if (installDir == "") { + FatalError(null, "Icinga 2 does not seem to be installed properly."); + return; + } + + Form form; + + if (File.Exists(Program.Icinga2DataDir + "\\etc\\icinga2\\features-enabled\\api.conf")) + form = new ServiceStatus(); + else + form = new SetupWizard(); + + Application.Run(form); + } + } +} diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/Properties/AssemblyInfo.cs b/vim/bundle/icinga2/agent/windows-setup-agent/Properties/AssemblyInfo.cs new file mode 100644 index 0000000..c0241b1 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/Properties/AssemblyInfo.cs @@ -0,0 +1,36 @@ +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +// General Information about an assembly is controlled through the following +// set of attributes. Change these attribute values to modify the information +// associated with an assembly. +[assembly: AssemblyTitle("Icinga 2 Agent Wizard")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("Icinga Development Team")] +[assembly: AssemblyProduct("Icinga 2")] +[assembly: AssemblyCopyright("Copyright © 2014-2015 Icinga Development Team")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] + +// Setting ComVisible to false makes the types in this assembly not visible +// to COM components. If you need to access a type in this assembly from +// COM, set the ComVisible attribute to true on that type. +[assembly: ComVisible(false)] + +// The following GUID is for the ID of the typelib if this project is exposed to COM +[assembly: Guid("51f4fcaf-8cf8-4d1c-9fde-61526c17a0d8")] + +// Version information for an assembly consists of the following four values: +// +// Major Version +// Minor Version +// Build Number +// Revision +// +// You can specify all the values or you can default the Build and Revision Numbers +// by using the '*' as shown below: +// [assembly: AssemblyVersion("1.0.*")] +[assembly: AssemblyVersion("1.0.0.0")] +[assembly: AssemblyFileVersion("1.0.0.0")] diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Resources.Designer.cs b/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Resources.Designer.cs new file mode 100644 index 0000000..cb365d2 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Resources.Designer.cs @@ -0,0 +1,73 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34011 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Icinga.Properties { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "4.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class Resources { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal Resources() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Icinga.Properties.Resources", typeof(Resources).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap icinga_banner { + get { + object obj = ResourceManager.GetObject("icinga-banner", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + } +} diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Resources.resx b/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Resources.resx new file mode 100644 index 0000000..ccc5fab --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Resources.resx @@ -0,0 +1,124 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + ..\icinga-banner.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + + \ No newline at end of file diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Settings.Designer.cs b/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Settings.Designer.cs new file mode 100644 index 0000000..f1515dd --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Settings.Designer.cs @@ -0,0 +1,26 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.34011 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Icinga.Properties { + + + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.Editors.SettingsDesigner.SettingsSingleFileGenerator", "12.0.0.0")] + internal sealed partial class Settings : global::System.Configuration.ApplicationSettingsBase { + + private static Settings defaultInstance = ((Settings)(global::System.Configuration.ApplicationSettingsBase.Synchronized(new Settings()))); + + public static Settings Default { + get { + return defaultInstance; + } + } + } +} diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Settings.settings b/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Settings.settings new file mode 100644 index 0000000..3964565 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/Properties/Settings.settings @@ -0,0 +1,7 @@ + + + + + + + diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/ServiceStatus.Designer.cs b/vim/bundle/icinga2/agent/windows-setup-agent/ServiceStatus.Designer.cs new file mode 100644 index 0000000..874f296 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/ServiceStatus.Designer.cs @@ -0,0 +1,132 @@ +namespace Icinga +{ + partial class ServiceStatus + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ServiceStatus)); + this.picBanner = new System.Windows.Forms.PictureBox(); + this.lblStatus = new System.Windows.Forms.Label(); + this.txtStatus = new System.Windows.Forms.TextBox(); + this.btnReconfigure = new System.Windows.Forms.Button(); + this.btnOK = new System.Windows.Forms.Button(); + this.btnOpenConfigDir = new System.Windows.Forms.Button(); + ((System.ComponentModel.ISupportInitialize)(this.picBanner)).BeginInit(); + this.SuspendLayout(); + // + // picBanner + // + this.picBanner.Image = global::Icinga.Properties.Resources.icinga_banner; + this.picBanner.Location = new System.Drawing.Point(0, 0); + this.picBanner.Name = "picBanner"; + this.picBanner.Size = new System.Drawing.Size(625, 77); + this.picBanner.TabIndex = 2; + this.picBanner.TabStop = false; + // + // lblStatus + // + this.lblStatus.AutoSize = true; + this.lblStatus.Location = new System.Drawing.Point(12, 105); + this.lblStatus.Name = "lblStatus"; + this.lblStatus.Size = new System.Drawing.Size(79, 13); + this.lblStatus.TabIndex = 3; + this.lblStatus.Text = "Service Status:"; + // + // txtStatus + // + this.txtStatus.Location = new System.Drawing.Point(97, 102); + this.txtStatus.Name = "txtStatus"; + this.txtStatus.ReadOnly = true; + this.txtStatus.Size = new System.Drawing.Size(278, 20); + this.txtStatus.TabIndex = 3; + // + // btnReconfigure + // + this.btnReconfigure.Location = new System.Drawing.Point(195, 143); + this.btnReconfigure.Name = "btnReconfigure"; + this.btnReconfigure.Size = new System.Drawing.Size(89, 23); + this.btnReconfigure.TabIndex = 1; + this.btnReconfigure.Text = "Reconfigure"; + this.btnReconfigure.UseVisualStyleBackColor = true; + this.btnReconfigure.Click += new System.EventHandler(this.btnReconfigure_Click); + // + // btnOK + // + this.btnOK.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnOK.Location = new System.Drawing.Point(290, 143); + this.btnOK.Name = "btnOK"; + this.btnOK.Size = new System.Drawing.Size(89, 23); + this.btnOK.TabIndex = 0; + this.btnOK.Text = "OK"; + this.btnOK.UseVisualStyleBackColor = true; + this.btnOK.Click += new System.EventHandler(this.btnOK_Click); + // + // btnOpenConfigDir + // + this.btnOpenConfigDir.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnOpenConfigDir.Location = new System.Drawing.Point(100, 143); + this.btnOpenConfigDir.Name = "btnOpenConfigDir"; + this.btnOpenConfigDir.Size = new System.Drawing.Size(89, 23); + this.btnOpenConfigDir.TabIndex = 2; + this.btnOpenConfigDir.Text = "Examine Config"; + this.btnOpenConfigDir.UseVisualStyleBackColor = true; + this.btnOpenConfigDir.Click += new System.EventHandler(this.btnOpenConfigDir_Click); + // + // ServiceStatus + // + this.AcceptButton = this.btnOK; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnOK; + this.ClientSize = new System.Drawing.Size(391, 186); + this.Controls.Add(this.btnOpenConfigDir); + this.Controls.Add(this.btnOK); + this.Controls.Add(this.btnReconfigure); + this.Controls.Add(this.txtStatus); + this.Controls.Add(this.lblStatus); + this.Controls.Add(this.picBanner); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "ServiceStatus"; + this.Text = "Icinga 2 Service Status"; + ((System.ComponentModel.ISupportInitialize)(this.picBanner)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + + private System.Windows.Forms.PictureBox picBanner; + private System.Windows.Forms.Label lblStatus; + private System.Windows.Forms.TextBox txtStatus; + private System.Windows.Forms.Button btnReconfigure; + private System.Windows.Forms.Button btnOK; + private System.Windows.Forms.Button btnOpenConfigDir; + } +} \ No newline at end of file diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/ServiceStatus.cs b/vim/bundle/icinga2/agent/windows-setup-agent/ServiceStatus.cs new file mode 100644 index 0000000..e9782fe --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/ServiceStatus.cs @@ -0,0 +1,42 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Data; +using System.Drawing; +using System.Text; +using System.Windows.Forms; +using System.ServiceProcess; +using System.Diagnostics; + +namespace Icinga +{ + public partial class ServiceStatus : Form + { + public ServiceStatus() + { + InitializeComponent(); + + try { + ServiceController sc = new ServiceController("icinga2"); + + txtStatus.Text = sc.Status.ToString(); + } catch (InvalidOperationException) { + txtStatus.Text = "Not Available"; + } + } + + private void btnReconfigure_Click(object sender, EventArgs e) + { + new SetupWizard().ShowDialog(this); + } + + private void btnOK_Click(object sender, EventArgs e) + { + Close(); + } + + private void btnOpenConfigDir_Click(object sender, EventArgs e) { + Process.Start("explorer.exe", Program.Icinga2DataDir); + } + } +} diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/ServiceStatus.resx b/vim/bundle/icinga2/agent/windows-setup-agent/ServiceStatus.resx new file mode 100644 index 0000000..724f4a2 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/ServiceStatus.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAICAQAAAABADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAAEAAAABAA + AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP// + AAD///8AAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAcAAAcAB3AAAAAAAAAAAAAAcABwB///cA + AAAAAAAAAAAAcAAA////AAAAAAAAAAAAAAAAAP///3AAAAAAAAAAAAAAAAD///9wAAAAAAAAAAAAAAAA + j//4AAAAB3AAAAAAAAAAAAj/jwAAAA/4AAAAAAAAAAAAAAiAAAAP9wAAAAAAAAAAAAAH9wAAf3AAAAAA + AAAAAAAAAH93d/cAAAAAAAAAAAAAAAB////3AAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAB/////9w + AAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAH//////h3AAAAAAAAAAAAB/////+I//h3eHAAAAAAAAD/ + ////AAB3j//3AAAAAAB4////9wAAAAf/+AAAAAf/+AB4iPAAAAAAj/cAAAAH//AAAAD3AAAAAAcAAAAA + B/+AAAAAjwAAAAAAAAAAAAB3AAAAAA9wAAAAAAAAAAAAAAAAAAAIh3AAAAAAAAAAAAAAAAAAD//wAAAA + AAAAAAAAAAAAAH//9wAAAAAAAAAAAAAAAAB///cAAAAAAAcAAAAAAAAACP+AAAAAAHAAcAAAAAAAAAB3 + AAAAAAcAAAcAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAAAAAAAAAD/////4AAAB8AAAAOAAAABgAAAAYAA + AAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAA + AAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAcAAAAPgAAAH/////w== + + + \ No newline at end of file diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/SetupWizard.Designer.cs b/vim/bundle/icinga2/agent/windows-setup-agent/SetupWizard.Designer.cs new file mode 100644 index 0000000..8a2374b --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/SetupWizard.Designer.cs @@ -0,0 +1,702 @@ +namespace Icinga +{ + partial class SetupWizard + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Windows Form Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(SetupWizard)); + this.btnBack = new System.Windows.Forms.Button(); + this.btnNext = new System.Windows.Forms.Button(); + this.btnCancel = new System.Windows.Forms.Button(); + this.tabFinish = new System.Windows.Forms.TabPage(); + this.lblSetupCompleted = new System.Windows.Forms.Label(); + this.tabConfigure = new System.Windows.Forms.TabPage(); + this.lblConfigStatus = new System.Windows.Forms.Label(); + this.prgConfig = new System.Windows.Forms.ProgressBar(); + this.tabParameters = new System.Windows.Forms.TabPage(); + this.groupBox3 = new System.Windows.Forms.GroupBox(); + this.chkAcceptConfig = new System.Windows.Forms.CheckBox(); + this.chkAcceptCommands = new System.Windows.Forms.CheckBox(); + this.txtTicket = new System.Windows.Forms.TextBox(); + this.lblTicket = new System.Windows.Forms.Label(); + this.txtInstanceName = new System.Windows.Forms.TextBox(); + this.lblInstanceName = new System.Windows.Forms.Label(); + this.groupBox2 = new System.Windows.Forms.GroupBox(); + this.rdoNoListener = new System.Windows.Forms.RadioButton(); + this.txtListenerPort = new System.Windows.Forms.TextBox(); + this.lblListenerPort = new System.Windows.Forms.Label(); + this.rdoListener = new System.Windows.Forms.RadioButton(); + this.groupBox1 = new System.Windows.Forms.GroupBox(); + this.btnRemoveEndpoint = new System.Windows.Forms.Button(); + this.btnAddEndpoint = new System.Windows.Forms.Button(); + this.lvwEndpoints = new System.Windows.Forms.ListView(); + this.colInstanceName = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.colHost = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.colPort = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.rdoNoMaster = new System.Windows.Forms.RadioButton(); + this.rdoNewMaster = new System.Windows.Forms.RadioButton(); + this.tbcPages = new System.Windows.Forms.TabControl(); + this.tabRetrieveCertificate = new System.Windows.Forms.TabPage(); + this.lblRetrieveCertificate = new System.Windows.Forms.Label(); + this.prgRetrieveCertificate = new System.Windows.Forms.ProgressBar(); + this.tabVerifyCertificate = new System.Windows.Forms.TabPage(); + this.grpX509Fields = new System.Windows.Forms.GroupBox(); + this.txtX509Field = new System.Windows.Forms.TextBox(); + this.lvwX509Fields = new System.Windows.Forms.ListView(); + this.colField = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.colValue = ((System.Windows.Forms.ColumnHeader)(new System.Windows.Forms.ColumnHeader())); + this.txtX509Subject = new System.Windows.Forms.TextBox(); + this.txtX509Issuer = new System.Windows.Forms.TextBox(); + this.lblX509Subject = new System.Windows.Forms.Label(); + this.lblX509Issuer = new System.Windows.Forms.Label(); + this.lblX509Prompt = new System.Windows.Forms.Label(); + this.tabError = new System.Windows.Forms.TabPage(); + this.txtError = new System.Windows.Forms.TextBox(); + this.lblError = new System.Windows.Forms.Label(); + this.picBanner = new System.Windows.Forms.PictureBox(); + this.chkInstallNSCP = new System.Windows.Forms.CheckBox(); + this.tabFinish.SuspendLayout(); + this.tabConfigure.SuspendLayout(); + this.tabParameters.SuspendLayout(); + this.groupBox3.SuspendLayout(); + this.groupBox2.SuspendLayout(); + this.groupBox1.SuspendLayout(); + this.tbcPages.SuspendLayout(); + this.tabRetrieveCertificate.SuspendLayout(); + this.tabVerifyCertificate.SuspendLayout(); + this.grpX509Fields.SuspendLayout(); + this.tabError.SuspendLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picBanner)).BeginInit(); + this.SuspendLayout(); + // + // btnBack + // + this.btnBack.Enabled = false; + this.btnBack.Location = new System.Drawing.Point(367, 592); + this.btnBack.Name = "btnBack"; + this.btnBack.Size = new System.Drawing.Size(75, 23); + this.btnBack.TabIndex = 1; + this.btnBack.Text = "< &Back"; + this.btnBack.UseVisualStyleBackColor = true; + this.btnBack.Click += new System.EventHandler(this.btnBack_Click); + // + // btnNext + // + this.btnNext.Location = new System.Drawing.Point(448, 592); + this.btnNext.Name = "btnNext"; + this.btnNext.Size = new System.Drawing.Size(75, 23); + this.btnNext.TabIndex = 2; + this.btnNext.Text = "&Next >"; + this.btnNext.UseVisualStyleBackColor = true; + this.btnNext.Click += new System.EventHandler(this.btnNext_Click); + // + // btnCancel + // + this.btnCancel.DialogResult = System.Windows.Forms.DialogResult.Cancel; + this.btnCancel.Location = new System.Drawing.Point(538, 592); + this.btnCancel.Name = "btnCancel"; + this.btnCancel.Size = new System.Drawing.Size(75, 23); + this.btnCancel.TabIndex = 3; + this.btnCancel.Text = "Cancel"; + this.btnCancel.UseVisualStyleBackColor = true; + this.btnCancel.Click += new System.EventHandler(this.btnCancel_Click); + // + // tabFinish + // + this.tabFinish.Controls.Add(this.lblSetupCompleted); + this.tabFinish.Location = new System.Drawing.Point(4, 5); + this.tabFinish.Name = "tabFinish"; + this.tabFinish.Padding = new System.Windows.Forms.Padding(3); + this.tabFinish.Size = new System.Drawing.Size(617, 500); + this.tabFinish.TabIndex = 5; + this.tabFinish.Text = "Finish"; + this.tabFinish.UseVisualStyleBackColor = true; + // + // lblSetupCompleted + // + this.lblSetupCompleted.AutoSize = true; + this.lblSetupCompleted.Location = new System.Drawing.Point(34, 35); + this.lblSetupCompleted.Name = "lblSetupCompleted"; + this.lblSetupCompleted.Size = new System.Drawing.Size(214, 13); + this.lblSetupCompleted.TabIndex = 0; + this.lblSetupCompleted.Text = "The Icinga 2 agent was set up successfully."; + // + // tabConfigure + // + this.tabConfigure.Controls.Add(this.lblConfigStatus); + this.tabConfigure.Controls.Add(this.prgConfig); + this.tabConfigure.Location = new System.Drawing.Point(4, 5); + this.tabConfigure.Name = "tabConfigure"; + this.tabConfigure.Padding = new System.Windows.Forms.Padding(3); + this.tabConfigure.Size = new System.Drawing.Size(617, 500); + this.tabConfigure.TabIndex = 4; + this.tabConfigure.Text = "Configure Icinga 2"; + this.tabConfigure.UseVisualStyleBackColor = true; + // + // lblConfigStatus + // + this.lblConfigStatus.AutoSize = true; + this.lblConfigStatus.Location = new System.Drawing.Point(184, 204); + this.lblConfigStatus.Name = "lblConfigStatus"; + this.lblConfigStatus.Size = new System.Drawing.Size(141, 13); + this.lblConfigStatus.TabIndex = 1; + this.lblConfigStatus.Text = "Updating the configuration..."; + // + // prgConfig + // + this.prgConfig.Location = new System.Drawing.Point(184, 223); + this.prgConfig.Name = "prgConfig"; + this.prgConfig.Size = new System.Drawing.Size(289, 23); + this.prgConfig.TabIndex = 0; + // + // tabParameters + // + this.tabParameters.Controls.Add(this.groupBox3); + this.tabParameters.Controls.Add(this.txtTicket); + this.tabParameters.Controls.Add(this.lblTicket); + this.tabParameters.Controls.Add(this.txtInstanceName); + this.tabParameters.Controls.Add(this.lblInstanceName); + this.tabParameters.Controls.Add(this.groupBox2); + this.tabParameters.Controls.Add(this.groupBox1); + this.tabParameters.Location = new System.Drawing.Point(4, 5); + this.tabParameters.Name = "tabParameters"; + this.tabParameters.Padding = new System.Windows.Forms.Padding(3); + this.tabParameters.Size = new System.Drawing.Size(617, 500); + this.tabParameters.TabIndex = 3; + this.tabParameters.Text = "Agent Parameters"; + this.tabParameters.UseVisualStyleBackColor = true; + // + // groupBox3 + // + this.groupBox3.Controls.Add(this.chkInstallNSCP); + this.groupBox3.Controls.Add(this.chkAcceptConfig); + this.groupBox3.Controls.Add(this.chkAcceptCommands); + this.groupBox3.Location = new System.Drawing.Point(308, 359); + this.groupBox3.Name = "groupBox3"; + this.groupBox3.Size = new System.Drawing.Size(301, 111); + this.groupBox3.TabIndex = 5; + this.groupBox3.TabStop = false; + this.groupBox3.Text = "Advanced Options"; + // + // chkAcceptConfig + // + this.chkAcceptConfig.AutoSize = true; + this.chkAcceptConfig.Location = new System.Drawing.Point(9, 47); + this.chkAcceptConfig.Name = "chkAcceptConfig"; + this.chkAcceptConfig.Size = new System.Drawing.Size(190, 17); + this.chkAcceptConfig.TabIndex = 1; + this.chkAcceptConfig.Text = "Accept config updates from master"; + this.chkAcceptConfig.UseVisualStyleBackColor = true; + // + // chkAcceptCommands + // + this.chkAcceptCommands.AutoSize = true; + this.chkAcceptCommands.Location = new System.Drawing.Point(9, 24); + this.chkAcceptCommands.Name = "chkAcceptCommands"; + this.chkAcceptCommands.Size = new System.Drawing.Size(171, 17); + this.chkAcceptCommands.TabIndex = 0; + this.chkAcceptCommands.Text = "Accept commands from master"; + this.chkAcceptCommands.UseVisualStyleBackColor = true; + // + // txtTicket + // + this.txtTicket.Location = new System.Drawing.Point(98, 45); + this.txtTicket.Name = "txtTicket"; + this.txtTicket.Size = new System.Drawing.Size(340, 20); + this.txtTicket.TabIndex = 1; + // + // lblTicket + // + this.lblTicket.AutoSize = true; + this.lblTicket.Location = new System.Drawing.Point(9, 48); + this.lblTicket.Name = "lblTicket"; + this.lblTicket.Size = new System.Drawing.Size(71, 13); + this.lblTicket.TabIndex = 4; + this.lblTicket.Text = "Setup Ticket:"; + // + // txtInstanceName + // + this.txtInstanceName.Location = new System.Drawing.Point(98, 16); + this.txtInstanceName.Name = "txtInstanceName"; + this.txtInstanceName.Size = new System.Drawing.Size(340, 20); + this.txtInstanceName.TabIndex = 0; + // + // lblInstanceName + // + this.lblInstanceName.AutoSize = true; + this.lblInstanceName.Location = new System.Drawing.Point(9, 20); + this.lblInstanceName.Name = "lblInstanceName"; + this.lblInstanceName.Size = new System.Drawing.Size(82, 13); + this.lblInstanceName.TabIndex = 3; + this.lblInstanceName.Text = "Instance Name:"; + // + // groupBox2 + // + this.groupBox2.Controls.Add(this.rdoNoListener); + this.groupBox2.Controls.Add(this.txtListenerPort); + this.groupBox2.Controls.Add(this.lblListenerPort); + this.groupBox2.Controls.Add(this.rdoListener); + this.groupBox2.Location = new System.Drawing.Point(8, 359); + this.groupBox2.Name = "groupBox2"; + this.groupBox2.Size = new System.Drawing.Size(294, 111); + this.groupBox2.TabIndex = 2; + this.groupBox2.TabStop = false; + this.groupBox2.Text = "TCP Listener"; + // + // rdoNoListener + // + this.rdoNoListener.AutoSize = true; + this.rdoNoListener.Checked = true; + this.rdoNoListener.Location = new System.Drawing.Point(11, 82); + this.rdoNoListener.Name = "rdoNoListener"; + this.rdoNoListener.Size = new System.Drawing.Size(163, 17); + this.rdoNoListener.TabIndex = 9; + this.rdoNoListener.TabStop = true; + this.rdoNoListener.Text = "Do not listen for connections."; + this.rdoNoListener.UseVisualStyleBackColor = true; + this.rdoNoListener.CheckedChanged += new System.EventHandler(this.RadioListener_CheckedChanged); + // + // txtListenerPort + // + this.txtListenerPort.Enabled = false; + this.txtListenerPort.Location = new System.Drawing.Point(132, 51); + this.txtListenerPort.Name = "txtListenerPort"; + this.txtListenerPort.Size = new System.Drawing.Size(84, 20); + this.txtListenerPort.TabIndex = 8; + this.txtListenerPort.Text = "5665"; + // + // lblListenerPort + // + this.lblListenerPort.AutoSize = true; + this.lblListenerPort.Location = new System.Drawing.Point(43, 55); + this.lblListenerPort.Name = "lblListenerPort"; + this.lblListenerPort.Size = new System.Drawing.Size(29, 13); + this.lblListenerPort.TabIndex = 1; + this.lblListenerPort.Text = "Port:"; + // + // rdoListener + // + this.rdoListener.AutoSize = true; + this.rdoListener.Location = new System.Drawing.Point(11, 24); + this.rdoListener.Name = "rdoListener"; + this.rdoListener.Size = new System.Drawing.Size(250, 17); + this.rdoListener.TabIndex = 7; + this.rdoListener.Text = "Listen for connections from the master instance:"; + this.rdoListener.UseVisualStyleBackColor = true; + this.rdoListener.CheckedChanged += new System.EventHandler(this.RadioListener_CheckedChanged); + // + // groupBox1 + // + this.groupBox1.Controls.Add(this.btnRemoveEndpoint); + this.groupBox1.Controls.Add(this.btnAddEndpoint); + this.groupBox1.Controls.Add(this.lvwEndpoints); + this.groupBox1.Controls.Add(this.rdoNoMaster); + this.groupBox1.Controls.Add(this.rdoNewMaster); + this.groupBox1.Location = new System.Drawing.Point(8, 77); + this.groupBox1.Name = "groupBox1"; + this.groupBox1.Size = new System.Drawing.Size(601, 276); + this.groupBox1.TabIndex = 1; + this.groupBox1.TabStop = false; + this.groupBox1.Text = "Master Instance"; + // + // btnRemoveEndpoint + // + this.btnRemoveEndpoint.Enabled = false; + this.btnRemoveEndpoint.Location = new System.Drawing.Point(520, 112); + this.btnRemoveEndpoint.Name = "btnRemoveEndpoint"; + this.btnRemoveEndpoint.Size = new System.Drawing.Size(75, 23); + this.btnRemoveEndpoint.TabIndex = 6; + this.btnRemoveEndpoint.Text = "Remove"; + this.btnRemoveEndpoint.UseVisualStyleBackColor = true; + this.btnRemoveEndpoint.Click += new System.EventHandler(this.btnRemoveEndpoint_Click); + // + // btnAddEndpoint + // + this.btnAddEndpoint.Location = new System.Drawing.Point(520, 83); + this.btnAddEndpoint.Name = "btnAddEndpoint"; + this.btnAddEndpoint.Size = new System.Drawing.Size(75, 23); + this.btnAddEndpoint.TabIndex = 5; + this.btnAddEndpoint.Text = "Add"; + this.btnAddEndpoint.UseVisualStyleBackColor = true; + this.btnAddEndpoint.Click += new System.EventHandler(this.btnAddEndpoint_Click); + // + // lvwEndpoints + // + this.lvwEndpoints.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.colInstanceName, + this.colHost, + this.colPort}); + this.lvwEndpoints.FullRowSelect = true; + this.lvwEndpoints.Location = new System.Drawing.Point(11, 83); + this.lvwEndpoints.Name = "lvwEndpoints"; + this.lvwEndpoints.Size = new System.Drawing.Size(500, 176); + this.lvwEndpoints.TabIndex = 4; + this.lvwEndpoints.UseCompatibleStateImageBehavior = false; + this.lvwEndpoints.View = System.Windows.Forms.View.Details; + this.lvwEndpoints.SelectedIndexChanged += new System.EventHandler(this.lvwEndpoints_SelectedIndexChanged); + // + // colInstanceName + // + this.colInstanceName.Text = "Instance Name"; + this.colInstanceName.Width = 200; + // + // colHost + // + this.colHost.Text = "Host"; + this.colHost.Width = 200; + // + // colPort + // + this.colPort.Text = "Port"; + this.colPort.Width = 80; + // + // rdoNoMaster + // + this.rdoNoMaster.AutoSize = true; + this.rdoNoMaster.Checked = true; + this.rdoNoMaster.Location = new System.Drawing.Point(11, 50); + this.rdoNoMaster.Name = "rdoNoMaster"; + this.rdoNoMaster.Size = new System.Drawing.Size(374, 17); + this.rdoNoMaster.TabIndex = 3; + this.rdoNoMaster.TabStop = true; + this.rdoNoMaster.Text = "This instance should report its check results to an existing Icinga 2 master:"; + this.rdoNoMaster.UseVisualStyleBackColor = true; + this.rdoNoMaster.CheckedChanged += new System.EventHandler(this.RadioMaster_CheckedChanged); + // + // rdoNewMaster + // + this.rdoNewMaster.AutoSize = true; + this.rdoNewMaster.Enabled = false; + this.rdoNewMaster.Location = new System.Drawing.Point(11, 22); + this.rdoNewMaster.Name = "rdoNewMaster"; + this.rdoNewMaster.Size = new System.Drawing.Size(167, 17); + this.rdoNewMaster.TabIndex = 2; + this.rdoNewMaster.TabStop = true; + this.rdoNewMaster.Text = "This is a new master instance."; + this.rdoNewMaster.UseVisualStyleBackColor = true; + this.rdoNewMaster.CheckedChanged += new System.EventHandler(this.RadioMaster_CheckedChanged); + // + // tbcPages + // + this.tbcPages.Appearance = System.Windows.Forms.TabAppearance.FlatButtons; + this.tbcPages.Controls.Add(this.tabParameters); + this.tbcPages.Controls.Add(this.tabRetrieveCertificate); + this.tbcPages.Controls.Add(this.tabVerifyCertificate); + this.tbcPages.Controls.Add(this.tabConfigure); + this.tbcPages.Controls.Add(this.tabFinish); + this.tbcPages.Controls.Add(this.tabError); + this.tbcPages.ItemSize = new System.Drawing.Size(0, 1); + this.tbcPages.Location = new System.Drawing.Point(0, 80); + this.tbcPages.Margin = new System.Windows.Forms.Padding(0); + this.tbcPages.Name = "tbcPages"; + this.tbcPages.SelectedIndex = 0; + this.tbcPages.Size = new System.Drawing.Size(625, 509); + this.tbcPages.SizeMode = System.Windows.Forms.TabSizeMode.Fixed; + this.tbcPages.TabIndex = 0; + this.tbcPages.SelectedIndexChanged += new System.EventHandler(this.tbcPages_SelectedIndexChanged); + // + // tabRetrieveCertificate + // + this.tabRetrieveCertificate.Controls.Add(this.lblRetrieveCertificate); + this.tabRetrieveCertificate.Controls.Add(this.prgRetrieveCertificate); + this.tabRetrieveCertificate.Location = new System.Drawing.Point(4, 5); + this.tabRetrieveCertificate.Name = "tabRetrieveCertificate"; + this.tabRetrieveCertificate.Padding = new System.Windows.Forms.Padding(3); + this.tabRetrieveCertificate.Size = new System.Drawing.Size(617, 500); + this.tabRetrieveCertificate.TabIndex = 7; + this.tabRetrieveCertificate.Text = "Checking Certificate"; + this.tabRetrieveCertificate.UseVisualStyleBackColor = true; + // + // lblRetrieveCertificate + // + this.lblRetrieveCertificate.AutoSize = true; + this.lblRetrieveCertificate.Location = new System.Drawing.Point(164, 229); + this.lblRetrieveCertificate.Name = "lblRetrieveCertificate"; + this.lblRetrieveCertificate.Size = new System.Drawing.Size(110, 13); + this.lblRetrieveCertificate.TabIndex = 3; + this.lblRetrieveCertificate.Text = "Checking certificate..."; + // + // prgRetrieveCertificate + // + this.prgRetrieveCertificate.Location = new System.Drawing.Point(164, 248); + this.prgRetrieveCertificate.Name = "prgRetrieveCertificate"; + this.prgRetrieveCertificate.Size = new System.Drawing.Size(289, 23); + this.prgRetrieveCertificate.TabIndex = 2; + // + // tabVerifyCertificate + // + this.tabVerifyCertificate.Controls.Add(this.grpX509Fields); + this.tabVerifyCertificate.Controls.Add(this.txtX509Subject); + this.tabVerifyCertificate.Controls.Add(this.txtX509Issuer); + this.tabVerifyCertificate.Controls.Add(this.lblX509Subject); + this.tabVerifyCertificate.Controls.Add(this.lblX509Issuer); + this.tabVerifyCertificate.Controls.Add(this.lblX509Prompt); + this.tabVerifyCertificate.Location = new System.Drawing.Point(4, 5); + this.tabVerifyCertificate.Name = "tabVerifyCertificate"; + this.tabVerifyCertificate.Padding = new System.Windows.Forms.Padding(3); + this.tabVerifyCertificate.Size = new System.Drawing.Size(617, 500); + this.tabVerifyCertificate.TabIndex = 6; + this.tabVerifyCertificate.Text = "Verify Certificate"; + this.tabVerifyCertificate.UseVisualStyleBackColor = true; + // + // grpX509Fields + // + this.grpX509Fields.Controls.Add(this.txtX509Field); + this.grpX509Fields.Controls.Add(this.lvwX509Fields); + this.grpX509Fields.Location = new System.Drawing.Point(11, 115); + this.grpX509Fields.Name = "grpX509Fields"; + this.grpX509Fields.Size = new System.Drawing.Size(598, 369); + this.grpX509Fields.TabIndex = 8; + this.grpX509Fields.TabStop = false; + this.grpX509Fields.Text = "X509 Fields"; + // + // txtX509Field + // + this.txtX509Field.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtX509Field.Location = new System.Drawing.Point(6, 197); + this.txtX509Field.Multiline = true; + this.txtX509Field.Name = "txtX509Field"; + this.txtX509Field.ReadOnly = true; + this.txtX509Field.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.txtX509Field.Size = new System.Drawing.Size(586, 166); + this.txtX509Field.TabIndex = 9; + // + // lvwX509Fields + // + this.lvwX509Fields.Columns.AddRange(new System.Windows.Forms.ColumnHeader[] { + this.colField, + this.colValue}); + this.lvwX509Fields.Location = new System.Drawing.Point(6, 19); + this.lvwX509Fields.Name = "lvwX509Fields"; + this.lvwX509Fields.Size = new System.Drawing.Size(586, 172); + this.lvwX509Fields.TabIndex = 8; + this.lvwX509Fields.UseCompatibleStateImageBehavior = false; + this.lvwX509Fields.View = System.Windows.Forms.View.Details; + this.lvwX509Fields.SelectedIndexChanged += new System.EventHandler(this.lvwX509Fields_SelectedIndexChanged); + // + // colField + // + this.colField.Text = "Field"; + this.colField.Width = 200; + // + // colValue + // + this.colValue.Text = "Value"; + this.colValue.Width = 350; + // + // txtX509Subject + // + this.txtX509Subject.Location = new System.Drawing.Point(71, 73); + this.txtX509Subject.Name = "txtX509Subject"; + this.txtX509Subject.ReadOnly = true; + this.txtX509Subject.Size = new System.Drawing.Size(532, 20); + this.txtX509Subject.TabIndex = 4; + // + // txtX509Issuer + // + this.txtX509Issuer.Location = new System.Drawing.Point(71, 47); + this.txtX509Issuer.Name = "txtX509Issuer"; + this.txtX509Issuer.ReadOnly = true; + this.txtX509Issuer.Size = new System.Drawing.Size(532, 20); + this.txtX509Issuer.TabIndex = 3; + // + // lblX509Subject + // + this.lblX509Subject.AutoSize = true; + this.lblX509Subject.Location = new System.Drawing.Point(8, 77); + this.lblX509Subject.Name = "lblX509Subject"; + this.lblX509Subject.Size = new System.Drawing.Size(46, 13); + this.lblX509Subject.TabIndex = 2; + this.lblX509Subject.Text = "Subject:"; + // + // lblX509Issuer + // + this.lblX509Issuer.AutoSize = true; + this.lblX509Issuer.Location = new System.Drawing.Point(8, 50); + this.lblX509Issuer.Name = "lblX509Issuer"; + this.lblX509Issuer.Size = new System.Drawing.Size(38, 13); + this.lblX509Issuer.TabIndex = 1; + this.lblX509Issuer.Text = "Issuer:"; + // + // lblX509Prompt + // + this.lblX509Prompt.AutoSize = true; + this.lblX509Prompt.Location = new System.Drawing.Point(8, 15); + this.lblX509Prompt.Name = "lblX509Prompt"; + this.lblX509Prompt.Size = new System.Drawing.Size(201, 13); + this.lblX509Prompt.TabIndex = 0; + this.lblX509Prompt.Text = "Please verify the master\'s SSL certificate:"; + // + // tabError + // + this.tabError.Controls.Add(this.txtError); + this.tabError.Controls.Add(this.lblError); + this.tabError.Location = new System.Drawing.Point(4, 5); + this.tabError.Name = "tabError"; + this.tabError.Padding = new System.Windows.Forms.Padding(3); + this.tabError.Size = new System.Drawing.Size(617, 500); + this.tabError.TabIndex = 8; + this.tabError.Text = "Error"; + this.tabError.UseVisualStyleBackColor = true; + // + // txtError + // + this.txtError.Font = new System.Drawing.Font("Courier New", 9.75F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0))); + this.txtError.Location = new System.Drawing.Point(11, 38); + this.txtError.Multiline = true; + this.txtError.Name = "txtError"; + this.txtError.ReadOnly = true; + this.txtError.ScrollBars = System.Windows.Forms.ScrollBars.Vertical; + this.txtError.Size = new System.Drawing.Size(598, 397); + this.txtError.TabIndex = 1; + // + // lblError + // + this.lblError.AutoSize = true; + this.lblError.Location = new System.Drawing.Point(8, 12); + this.lblError.Name = "lblError"; + this.lblError.Size = new System.Drawing.Size(209, 13); + this.lblError.TabIndex = 0; + this.lblError.Text = "An error occurred while setting up Icinga 2:"; + // + // picBanner + // + this.picBanner.Image = global::Icinga.Properties.Resources.icinga_banner; + this.picBanner.Location = new System.Drawing.Point(0, 0); + this.picBanner.Name = "picBanner"; + this.picBanner.Size = new System.Drawing.Size(625, 77); + this.picBanner.TabIndex = 1; + this.picBanner.TabStop = false; + // + // chkInstallNSCP + // + this.chkInstallNSCP.AutoSize = true; + this.chkInstallNSCP.Location = new System.Drawing.Point(9, 70); + this.chkInstallNSCP.Name = "chkInstallNSCP"; + this.chkInstallNSCP.Size = new System.Drawing.Size(149, 17); + this.chkInstallNSCP.TabIndex = 6; + this.chkInstallNSCP.Text = "Install/Update NSClient++"; + this.chkInstallNSCP.UseVisualStyleBackColor = true; + // + // SetupWizard + // + this.AcceptButton = this.btnNext; + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.CancelButton = this.btnCancel; + this.ClientSize = new System.Drawing.Size(625, 624); + this.Controls.Add(this.btnCancel); + this.Controls.Add(this.btnNext); + this.Controls.Add(this.btnBack); + this.Controls.Add(this.picBanner); + this.Controls.Add(this.tbcPages); + this.FormBorderStyle = System.Windows.Forms.FormBorderStyle.FixedSingle; + this.Icon = ((System.Drawing.Icon)(resources.GetObject("$this.Icon"))); + this.MaximizeBox = false; + this.Name = "SetupWizard"; + this.Text = "Icinga 2 Setup Wizard"; + this.tabFinish.ResumeLayout(false); + this.tabFinish.PerformLayout(); + this.tabConfigure.ResumeLayout(false); + this.tabConfigure.PerformLayout(); + this.tabParameters.ResumeLayout(false); + this.tabParameters.PerformLayout(); + this.groupBox3.ResumeLayout(false); + this.groupBox3.PerformLayout(); + this.groupBox2.ResumeLayout(false); + this.groupBox2.PerformLayout(); + this.groupBox1.ResumeLayout(false); + this.groupBox1.PerformLayout(); + this.tbcPages.ResumeLayout(false); + this.tabRetrieveCertificate.ResumeLayout(false); + this.tabRetrieveCertificate.PerformLayout(); + this.tabVerifyCertificate.ResumeLayout(false); + this.tabVerifyCertificate.PerformLayout(); + this.grpX509Fields.ResumeLayout(false); + this.grpX509Fields.PerformLayout(); + this.tabError.ResumeLayout(false); + this.tabError.PerformLayout(); + ((System.ComponentModel.ISupportInitialize)(this.picBanner)).EndInit(); + this.ResumeLayout(false); + + } + + #endregion + + private System.Windows.Forms.PictureBox picBanner; + private System.Windows.Forms.Button btnBack; + private System.Windows.Forms.Button btnNext; + private System.Windows.Forms.Button btnCancel; + private System.Windows.Forms.TabPage tabFinish; + private System.Windows.Forms.Label lblSetupCompleted; + private System.Windows.Forms.TabPage tabConfigure; + private System.Windows.Forms.Label lblConfigStatus; + private System.Windows.Forms.ProgressBar prgConfig; + private System.Windows.Forms.TabPage tabParameters; + private System.Windows.Forms.TextBox txtInstanceName; + private System.Windows.Forms.Label lblInstanceName; + private System.Windows.Forms.GroupBox groupBox2; + private System.Windows.Forms.RadioButton rdoNoListener; + private System.Windows.Forms.TextBox txtListenerPort; + private System.Windows.Forms.Label lblListenerPort; + private System.Windows.Forms.RadioButton rdoListener; + private System.Windows.Forms.GroupBox groupBox1; + private System.Windows.Forms.Button btnRemoveEndpoint; + private System.Windows.Forms.Button btnAddEndpoint; + private System.Windows.Forms.ListView lvwEndpoints; + private System.Windows.Forms.ColumnHeader colHost; + private System.Windows.Forms.ColumnHeader colPort; + private System.Windows.Forms.RadioButton rdoNoMaster; + private System.Windows.Forms.RadioButton rdoNewMaster; + private System.Windows.Forms.TabControl tbcPages; + private System.Windows.Forms.TabPage tabVerifyCertificate; + private System.Windows.Forms.Label lblX509Prompt; + private System.Windows.Forms.TextBox txtX509Subject; + private System.Windows.Forms.TextBox txtX509Issuer; + private System.Windows.Forms.Label lblX509Subject; + private System.Windows.Forms.Label lblX509Issuer; + private System.Windows.Forms.GroupBox grpX509Fields; + private System.Windows.Forms.ListView lvwX509Fields; + private System.Windows.Forms.ColumnHeader colField; + private System.Windows.Forms.ColumnHeader colValue; + private System.Windows.Forms.TextBox txtX509Field; + private System.Windows.Forms.TabPage tabRetrieveCertificate; + private System.Windows.Forms.Label lblRetrieveCertificate; + private System.Windows.Forms.ProgressBar prgRetrieveCertificate; + private System.Windows.Forms.TabPage tabError; + private System.Windows.Forms.TextBox txtError; + private System.Windows.Forms.Label lblError; + private System.Windows.Forms.TextBox txtTicket; + private System.Windows.Forms.Label lblTicket; + private System.Windows.Forms.ColumnHeader colInstanceName; + private System.Windows.Forms.GroupBox groupBox3; + private System.Windows.Forms.CheckBox chkAcceptConfig; + private System.Windows.Forms.CheckBox chkAcceptCommands; + private System.Windows.Forms.CheckBox chkInstallNSCP; + } +} + diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/SetupWizard.cs b/vim/bundle/icinga2/agent/windows-setup-agent/SetupWizard.cs new file mode 100644 index 0000000..f100cc6 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/SetupWizard.cs @@ -0,0 +1,483 @@ +using System; +using System.IO; +using System.Text; +using System.Collections.Generic; +using System.ComponentModel; +using System.Windows.Forms; +using System.Runtime.InteropServices; +using System.Security.Cryptography.X509Certificates; +using System.Threading; +using System.Net.NetworkInformation; +using System.IO.Compression; +using System.Diagnostics; +using System.ServiceProcess; +using System.Security.AccessControl; + +namespace Icinga +{ + public partial class SetupWizard : Form + { + private string _TrustedFile; + + public SetupWizard() + { + InitializeComponent(); + + txtInstanceName.Text = Icinga2InstanceName; + } + + private void Warning(string message) + { + MessageBox.Show(this, message, Text, MessageBoxButtons.OK, MessageBoxIcon.Warning); + } + + private string Icinga2InstanceName + { + get + { + IPGlobalProperties props = IPGlobalProperties.GetIPGlobalProperties(); + + string fqdn = props.HostName; + + if (props.DomainName != "") + fqdn += "." + props.DomainName; + + return fqdn; + } + } + + private bool GetMasterHostPort(out string host, out string port) + { + foreach (ListViewItem lvi in lvwEndpoints.Items) { + if (lvi.SubItems.Count > 1) { + host = lvi.SubItems[1].Text; + port = lvi.SubItems[2].Text; + return true; + } + } + + host = null; + port = null; + return false; + } + + private void EnableFeature(string feature) + { + FileStream fp = null; + try { + fp = File.Open(Program.Icinga2DataDir + String.Format("\\etc\\icinga2\\features-enabled\\{0}.conf", feature), FileMode.Create); + using (StreamWriter sw = new StreamWriter(fp, Encoding.ASCII)) { + fp = null; + sw.Write(String.Format("include \"../features-available/{0}.conf\"\n", feature)); + } + } finally { + if (fp != null) + fp.Dispose(); + } + } + + private void SetRetrievalStatus(int pct) + { + if (InvokeRequired) { + Invoke((MethodInvoker)delegate { SetRetrievalStatus(pct); }); + return; + } + + prgRetrieveCertificate.Value = pct; + } + + private void SetConfigureStatus(int pct, string message) + { + if (InvokeRequired) { + Invoke((MethodInvoker)delegate { SetConfigureStatus(pct, message); }); + return; + } + + prgConfig.Value = pct; + lblConfigStatus.Text = message; + } + + private void ShowErrorText(string text) + { + if (InvokeRequired) { + Invoke((MethodInvoker)delegate { ShowErrorText(text); }); + return; + } + + txtError.Text = text; + tbcPages.SelectedTab = tabError; + } + + private bool RunProcess(string filename, string arguments, out string output) + { + ProcessStartInfo psi = new ProcessStartInfo(); + psi.FileName = filename; + psi.Arguments = arguments; + psi.CreateNoWindow = true; + psi.UseShellExecute = false; + psi.RedirectStandardOutput = true; + psi.RedirectStandardError = true; + + String result = ""; + + using (Process proc = Process.Start(psi)) { + proc.ErrorDataReceived += delegate(object sender, DataReceivedEventArgs args) { + result += args.Data + "\r\n"; + }; + proc.OutputDataReceived += delegate(object sender, DataReceivedEventArgs args) { + result += args.Data + "\r\n"; + }; + proc.BeginOutputReadLine(); + proc.BeginErrorReadLine(); + proc.WaitForExit(); + + output = result; + + if (proc.ExitCode != 0) + return false; + } + + return true; + } + + private void VerifyCertificate(string host, string port) + { + SetRetrievalStatus(25); + + string pathPrefix = Program.Icinga2DataDir + "\\etc\\icinga2\\pki\\" + txtInstanceName.Text; + string processArguments = "pki new-cert --cn \"" + txtInstanceName.Text + "\" --key \"" + pathPrefix + ".key\" --cert \"" + pathPrefix + ".crt\""; + string output; + + if (!File.Exists(pathPrefix + ".crt")) { + if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe", + processArguments, + out output)) { + ShowErrorText("Running command 'icinga2.exe " + processArguments + "' produced the following output:\n" + output); + return; + } + } + + SetRetrievalStatus(50); + + _TrustedFile = Path.GetTempFileName(); + + processArguments = "pki save-cert --host \"" + host + "\" --port \"" + port + "\" --key \"" + pathPrefix + ".key\" --cert \"" + pathPrefix + ".crt\" --trustedcert \"" + _TrustedFile + "\""; + if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe", + processArguments, + out output)) { + ShowErrorText("Running command 'icinga2.exe " + processArguments + "' produced the following output:\n" + output); + return; + } + + SetRetrievalStatus(100); + + X509Certificate2 cert = new X509Certificate2(_TrustedFile); + Invoke((MethodInvoker)delegate { ShowCertificatePrompt(cert); }); + } + + private void ConfigureService() + { + SetConfigureStatus(0, "Updating configuration files..."); + + string output; + + string args = ""; + + if (rdoNewMaster.Checked) + args += " --master"; + + Invoke((MethodInvoker)delegate { + string master_host, master_port; + GetMasterHostPort(out master_host, out master_port); + + args += " --master_host " + master_host + "," + master_port; + + foreach (ListViewItem lvi in lvwEndpoints.Items) { + args += " --endpoint " + lvi.SubItems[0].Text; + + if (lvi.SubItems.Count > 1) + args += "," + lvi.SubItems[1].Text + "," + lvi.SubItems[2].Text; + } + }); + + if (rdoListener.Checked) + args += " --listen ::," + txtListenerPort.Text; + + if (chkAcceptConfig.Checked) + args += " --accept-config"; + + if (chkAcceptCommands.Checked) + args += " --accept-commands"; + + args += " --ticket \"" + txtTicket.Text + "\""; + args += " --trustedcert \"" + _TrustedFile + "\""; + args += " --cn \"" + txtInstanceName.Text + "\""; + args += " --zone \"" + txtInstanceName.Text + "\""; + + if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe", + "node setup" + args, + out output)) { + ShowErrorText("Running command 'icinga2.exe " + "node setup" + args + "' produced the following output:\n" + output); + return; + } + + SetConfigureStatus(50, "Setting ACLs for the Icinga 2 directory..."); + DirectoryInfo di = new DirectoryInfo(Program.Icinga2InstallDir); + DirectorySecurity ds = di.GetAccessControl(); + FileSystemAccessRule rule = new FileSystemAccessRule("NT AUTHORITY\\NetworkService", + FileSystemRights.Modify, + InheritanceFlags.ObjectInherit | InheritanceFlags.ContainerInherit, PropagationFlags.None, AccessControlType.Allow); + ds.AddAccessRule(rule); + di.SetAccessControl(ds); + + SetConfigureStatus(75, "Installing the Icinga 2 service..."); + + RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe", + "--scm-uninstall", + out output); + + if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe", + "daemon --validate", + out output)) { + ShowErrorText("Running command 'icinga2.exe daemon --validate' produced the following output:\n" + output); + return; + } + + if (!RunProcess(Program.Icinga2InstallDir + "\\sbin\\icinga2.exe", + "--scm-install daemon", + out output)) { + ShowErrorText("Running command 'icinga2.exe daemon --scm-install daemon' produced the following output:\n" + output); + return; + } + + if (chkInstallNSCP.Checked) + { + SetConfigureStatus(85, "Waiting for NSClient++ installation to complete..."); + + Process proc = new Process(); + proc.StartInfo.FileName = "msiexec.exe"; + proc.StartInfo.Arguments = "/i \"" + Program.Icinga2InstallDir + "\\sbin\\NSCP.msi\""; + proc.Start(); + proc.WaitForExit(); + } + + SetConfigureStatus(100, "Finished."); + + FinishConfigure(); + } + + private void FinishConfigure() + { + if (InvokeRequired) { + Invoke((MethodInvoker)FinishConfigure); + return; + } + + tbcPages.SelectedTab = tabFinish; + } + + private void btnBack_Click(object sender, EventArgs e) + { + if (tbcPages.SelectedTab == tabError) { + tbcPages.SelectedIndex = 0; + return; + } + + int offset = 1; + + if (tbcPages.SelectedTab == tabVerifyCertificate) + offset++; + + tbcPages.SelectedIndex -= offset; + } + + private void btnNext_Click(object sender, EventArgs e) + { + if (tbcPages.SelectedTab == tabParameters) { + if (txtInstanceName.Text.Length == 0) { + Warning("Please enter an instance name."); + return; + } + + if (txtTicket.Text.Length == 0) { + Warning("Please enter an agent ticket."); + return; + } + + if (rdoNoMaster.Checked) { + if (lvwEndpoints.Items.Count == 0) { + Warning("You need to add at least one master endpoint."); + return; + } + + string host, port; + if (!GetMasterHostPort(out host, out port)) { + Warning("Please enter a remote host and port for at least one of your endpoints."); + return; + } + } + + if (rdoListener.Checked && (txtListenerPort.Text == "")) { + Warning("You need to specify a listener port."); + return; + } + } + + if (tbcPages.SelectedTab == tabFinish || tbcPages.SelectedTab == tabError) + Application.Exit(); + + tbcPages.SelectedIndex++; + } + + private void btnCancel_Click(object sender, EventArgs e) + { + Application.Exit(); + } + + private void tbcPages_SelectedIndexChanged(object sender, EventArgs e) + { + Refresh(); + + btnBack.Enabled = (tbcPages.SelectedTab == tabVerifyCertificate || tbcPages.SelectedTab == tabError); + btnNext.Enabled = (tbcPages.SelectedTab == tabParameters || tbcPages.SelectedTab == tabVerifyCertificate || tbcPages.SelectedTab == tabFinish); + + if (tbcPages.SelectedTab == tabFinish) { + btnNext.Text = "&Finish >"; + btnCancel.Enabled = false; + } + + if (tbcPages.SelectedTab == tabRetrieveCertificate) { + ListViewItem lvi = lvwEndpoints.Items[0]; + + string master_host, master_port; + GetMasterHostPort(out master_host, out master_port); + + Thread thread = new Thread((ThreadStart)delegate { VerifyCertificate(master_host, master_port); }); + thread.Start(); + } + + /*if (tbcPages.SelectedTab == tabParameters && + !File.Exists(Icinga2DataDir + "\\etc\\icinga2\\pki\\agent\\agent.crt")) { + byte[] bytes = Convert.FromBase64String(txtBundle.Text); + MemoryStream ms = new MemoryStream(bytes); + GZipStream gz = new GZipStream(ms, CompressionMode.Decompress); + MemoryStream ms2 = new MemoryStream(); + + byte[] buffer = new byte[512]; + int rc; + while ((rc = gz.Read(buffer, 0, buffer.Length)) > 0) + ms2.Write(buffer, 0, rc); + ms2.Position = 0; + TarReader tr = new TarReader(ms2); + tr.ReadToEnd(Icinga2DataDir + "\\etc\\icinga2\\pki\\agent"); + }*/ + + if (tbcPages.SelectedTab == tabConfigure) { + Thread thread = new Thread(ConfigureService); + thread.Start(); + } + } + + private void RadioMaster_CheckedChanged(object sender, EventArgs e) + { + lvwEndpoints.Enabled = !rdoNewMaster.Checked; + btnAddEndpoint.Enabled = !rdoNewMaster.Checked; + btnRemoveEndpoint.Enabled = !rdoNewMaster.Checked && lvwEndpoints.SelectedItems.Count > 0; + } + + private void RadioListener_CheckedChanged(object sender, EventArgs e) + { + txtListenerPort.Enabled = rdoListener.Checked; + } + + private void AddCertificateField(string name, string shortValue, string longValue = null) + { + ListViewItem lvi = new ListViewItem(); + lvi.Text = name; + lvi.SubItems.Add(shortValue); + if (longValue == null) + longValue = shortValue; + lvi.Tag = longValue; + lvwX509Fields.Items.Add(lvi); + } + + private string PadText(string input) + { + string output = ""; + + for (int i = 0; i < input.Length; i += 2) { + if (output != "") + output += " "; + + int len = 2; + if (input.Length - i < 2) + len = input.Length - i; + output += input.Substring(i, len); + } + + return output; + } + + private void ShowCertificatePrompt(X509Certificate2 certificate) + { + txtX509Issuer.Text = certificate.Issuer; + txtX509Subject.Text = certificate.Subject; + + lvwX509Fields.Items.Clear(); + + AddCertificateField("Version", "V" + certificate.Version.ToString()); + AddCertificateField("Serial number", certificate.SerialNumber); + AddCertificateField("Signature algorithm", certificate.SignatureAlgorithm.FriendlyName); + AddCertificateField("Valid from", certificate.NotBefore.ToString()); + AddCertificateField("Valid to", certificate.NotAfter.ToString()); + + string pkey = BitConverter.ToString(certificate.PublicKey.EncodedKeyValue.RawData).Replace("-", " "); + AddCertificateField("Public key", certificate.PublicKey.Oid.FriendlyName + " (" + certificate.PublicKey.Key.KeySize + " bits)", pkey); + + string thumbprint = PadText(certificate.Thumbprint); + AddCertificateField("Thumbprint", thumbprint); + + tbcPages.SelectedTab = tabVerifyCertificate; + } + + private void btnAddEndpoint_Click(object sender, EventArgs e) + { + EndpointInputBox eib = new EndpointInputBox(); + + if (eib.ShowDialog(this) == DialogResult.Cancel) + return; + + ListViewItem lvi = new ListViewItem(); + lvi.Text = eib.txtInstanceName.Text; + + if (eib.chkConnect.Checked) { + lvi.SubItems.Add(eib.txtHost.Text); + lvi.SubItems.Add(eib.txtPort.Text); + } + + lvwEndpoints.Items.Add(lvi); + } + + private void lvwEndpoints_SelectedIndexChanged(object sender, EventArgs e) + { + btnRemoveEndpoint.Enabled = lvwEndpoints.SelectedItems.Count > 0; + } + + private void lvwX509Fields_SelectedIndexChanged(object sender, EventArgs e) + { + if (lvwX509Fields.SelectedItems.Count == 0) + return; + + ListViewItem lvi = lvwX509Fields.SelectedItems[0]; + + txtX509Field.Text = (string)lvi.Tag; + } + + private void btnRemoveEndpoint_Click(object sender, EventArgs e) + { + while (lvwEndpoints.SelectedItems.Count > 0) { + lvwEndpoints.Items.Remove(lvwEndpoints.SelectedItems[0]); + } + } + } +} diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/SetupWizard.resx b/vim/bundle/icinga2/agent/windows-setup-agent/SetupWizard.resx new file mode 100644 index 0000000..724f4a2 --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/SetupWizard.resx @@ -0,0 +1,138 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + + + AAABAAEAICAQAAAABADoAgAAFgAAACgAAAAgAAAAQAAAAAEABAAAAAAAAAIAAAAAAAAAAAAAEAAAABAA + AAAAAAAAAACAAACAAAAAgIAAgAAAAIAAgACAgAAAgICAAMDAwAAAAP8AAP8AAAD//wD/AAAA/wD/AP// + AAD///8AAAAAAAAAAAAAAAAAAAAAAAAHAAAAAAAAAAAAAAAAcAAAcAB3AAAAAAAAAAAAAAcABwB///cA + AAAAAAAAAAAAcAAA////AAAAAAAAAAAAAAAAAP///3AAAAAAAAAAAAAAAAD///9wAAAAAAAAAAAAAAAA + j//4AAAAB3AAAAAAAAAAAAj/jwAAAA/4AAAAAAAAAAAAAAiAAAAP9wAAAAAAAAAAAAAH9wAAf3AAAAAA + AAAAAAAAAH93d/cAAAAAAAAAAAAAAAB////3AAAAAAAAAAAAAAAA/////wAAAAAAAAAAAAAAB/////9w + AAAAAAAAAAAAAAf/////gAAAAAAAAAAAAAAH//////h3AAAAAAAAAAAAB/////+I//h3eHAAAAAAAAD/ + ////AAB3j//3AAAAAAB4////9wAAAAf/+AAAAAf/+AB4iPAAAAAAj/cAAAAH//AAAAD3AAAAAAcAAAAA + B/+AAAAAjwAAAAAAAAAAAAB3AAAAAA9wAAAAAAAAAAAAAAAAAAAIh3AAAAAAAAAAAAAAAAAAD//wAAAA + AAAAAAAAAAAAAH//9wAAAAAAAAAAAAAAAAB///cAAAAAAAcAAAAAAAAACP+AAAAAAHAAcAAAAAAAAAB3 + AAAAAAcAAAcAAAAAAAAAAAAAAABwAAAAAAAAAAAAAAAAAAAAAAD/////4AAAB8AAAAOAAAABgAAAAYAA + AAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAYAA + AAGAAAABgAAAAYAAAAGAAAABgAAAAYAAAAGAAAABgAAAAcAAAAPgAAAH/////w== + + + \ No newline at end of file diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/app.manifest b/vim/bundle/icinga2/agent/windows-setup-agent/app.manifest new file mode 100644 index 0000000..ff3d8ae --- /dev/null +++ b/vim/bundle/icinga2/agent/windows-setup-agent/app.manifest @@ -0,0 +1,58 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/icinga-banner.png b/vim/bundle/icinga2/agent/windows-setup-agent/icinga-banner.png new file mode 100644 index 0000000..34d8995 Binary files /dev/null and b/vim/bundle/icinga2/agent/windows-setup-agent/icinga-banner.png differ diff --git a/vim/bundle/icinga2/agent/windows-setup-agent/icinga.ico b/vim/bundle/icinga2/agent/windows-setup-agent/icinga.ico new file mode 100644 index 0000000..6ff7e90 Binary files /dev/null and b/vim/bundle/icinga2/agent/windows-setup-agent/icinga.ico differ diff --git a/vim/bundle/icinga2/changelog.py b/vim/bundle/icinga2/changelog.py new file mode 100755 index 0000000..64c8cb5 --- /dev/null +++ b/vim/bundle/icinga2/changelog.py @@ -0,0 +1,158 @@ +#!/usr/bin/env python +# Icinga 2 +# Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +import urllib2, json, sys, string +from argparse import ArgumentParser + +DESCRIPTION="update release changes" +VERSION="1.0.0" +ISSUE_URL= "https://dev.icinga.org/issues/" +ISSUE_PROJECT="i2" + +arg_parser = ArgumentParser(description= "%s (Version: %s)" % (DESCRIPTION, VERSION)) +arg_parser.add_argument('-V', '--version', required=True, type=str, help="define version to query") +arg_parser.add_argument('-p', '--project', type=str, help="add urls to issues") +arg_parser.add_argument('-l', '--links', action='store_true', help="add urls to issues") +arg_parser.add_argument('-H', '--html', action='store_true', help="print html output (defaults to markdown)") + +args = arg_parser.parse_args(sys.argv[1:]) + +ftype = "md" if not args.html else "html" + +def format_header(text, lvl, ftype = ftype): + if ftype == "html": + return "%s" % (lvl, text, lvl) + if ftype == "md": + return "#" * lvl + " " + text + +def format_logentry(log_entry, args = args, issue_url = ISSUE_URL): + if args.links: + if args.html: + return "
  • {0} {1} ({2}): {3}
  • ".format(log_entry[0], log_entry[1], log_entry[2], log_entry[3],issue_url) + else: + return "* {0} [{1}]({4}{1} \"{0} {1}\") ({2}): {3}".format(log_entry[0], log_entry[1], log_entry[2], log_entry[3], issue_url) + else: + if args.html: + return "
  • %s %d (%s): %s
  • " % log_entry + else: + return "* %s %d (%s): %s" % log_entry + +def print_category(category, entries): + if len(entries) > 0: + print "" + print format_header(category, 4) + print "" + if args.html: + print "
      " + + for entry in sorted(entries): + print format_logentry(entry) + + if args.html: + print "
    " + print "" + + +version_name = args.version + +if args.project: + ISSUE_PROJECT=args.project + +rsp = urllib2.urlopen("https://dev.icinga.org/projects/%s/versions.json" % (ISSUE_PROJECT)) +versions_data = json.loads(rsp.read()) + +version_id = None + +for version in versions_data["versions"]: + if version["name"] == version_name: + version_id = version["id"] + break + +if version_id == None: + print "Version '%s' not found." % (version_name) + sys.exit(1) + +changes = "" + +if "custom_fields" in version: + for field in version["custom_fields"]: + if field["id"] == 14: + changes = field["value"] + break + + changes = string.join(string.split(changes, "\r\n"), "\n") + +print format_header("What's New in Version %s" % (version_name), 3) +print "" + +if changes: + print format_header("Changes", 4) + print "" + print changes + print "" + +offset = 0 + +features = [] +bugfixes = [] +support = [] + +while True: + # We could filter using &cf_13=1, however this doesn't currently work because the custom field isn't set + # for some of the older tickets: + rsp = urllib2.urlopen("https://dev.icinga.org/projects/%s/issues.json?offset=%d&status_id=closed&fixed_version_id=%d" % (ISSUE_PROJECT, offset, version_id)) + issues_data = json.loads(rsp.read()) + issues_count = len(issues_data["issues"]) + offset = offset + issues_count + + if issues_count == 0: + break + + for issue in issues_data["issues"]: + ignore_issue = False + + if "custom_fields" in issue: + for field in issue["custom_fields"]: + if field["id"] == 13 and "value" in field and field["value"] == "0": + ignore_issue = True + break + + if ignore_issue: + continue + + if "category" in issue: + category = issue["category"]["name"] + else: + category = "no category" + + # the order is important for print_category() + entry = (issue["tracker"]["name"], issue["id"], category, issue["subject"].strip()) + + if issue["tracker"]["name"] == "Feature": + features.append(entry) + elif issue["tracker"]["name"] == "Bug": + bugfixes.append(entry) + elif issue["tracker"]["name"] == "Support": + support.append(entry) + +print_category("Feature", features) +print_category("Bugfixes", bugfixes) +print_category("Support", support) + + +sys.exit(0) diff --git a/vim/bundle/icinga2/choco/CMakeLists.txt b/vim/bundle/icinga2/choco/CMakeLists.txt new file mode 100644 index 0000000..d6e9575 --- /dev/null +++ b/vim/bundle/icinga2/choco/CMakeLists.txt @@ -0,0 +1,29 @@ +# Icinga 2 +# Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +if(WIN32) + find_program(CHOCO_BINARY choco) + + configure_file(icinga2.nuspec.cmake icinga2.nuspec) + configure_file(chocolateyInstall.ps1.cmake chocolateyInstall.ps1) + + add_custom_target(choco-pkg ALL + COMMAND choco pack + COMMAND ${CMAKE_COMMAND} -E rename ${CMAKE_CURRENT_BINARY_DIR}/icinga2.${SPEC_VERSION}.nupkg ${CMAKE_CURRENT_BINARY_DIR}/icinga2.nupkg + DEPENDS icinga2.nuspec ${CMAKE_CURRENT_BINARY_DIR}/chocolateyInstall.ps1 chocolateyUninstall.ps1 + ) +endif() diff --git a/vim/bundle/icinga2/choco/chocolateyInstall.ps1.cmake b/vim/bundle/icinga2/choco/chocolateyInstall.ps1.cmake new file mode 100755 index 0000000..d23f34f --- /dev/null +++ b/vim/bundle/icinga2/choco/chocolateyInstall.ps1.cmake @@ -0,0 +1,8 @@ +$packageName = 'icinga2' +$installerType = 'msi' +$url32 = 'https://packages.icinga.org/windows/Icinga2-v${SPEC_VERSION}-x86.msi' +$url64 = 'https://packages.icinga.org/windows/Icinga2-v${SPEC_VERSION}-x86_64.msi' +$silentArgs = '/qn /norestart' +$validExitCodes = @(0) + +Install-ChocolateyPackage "$packageName" "$installerType" "$silentArgs" "$url32" "$url64" -validExitCodes $validExitCodes diff --git a/vim/bundle/icinga2/choco/chocolateyUninstall.ps1 b/vim/bundle/icinga2/choco/chocolateyUninstall.ps1 new file mode 100644 index 0000000..d5babe7 --- /dev/null +++ b/vim/bundle/icinga2/choco/chocolateyUninstall.ps1 @@ -0,0 +1,28 @@ +$packageName = "Icinga 2"; +$fileType = 'msi'; +$silentArgs = '/qr /norestart' +$validExitCodes = @(0) + +try { + $packageGuid = Get-ChildItem HKLM:\SOFTWARE\Classes\Installer\Products | + Get-ItemProperty -Name 'ProductName' | + ? { $_.ProductName -like $packageName + "*"} | + Select -ExpandProperty PSChildName -First 1 + + $properties = Get-ItemProperty HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\UserData\S-1-5-18\Products\$packageGuid\InstallProperties + + $file = $properties.LocalPackage + + # Would like to use the following, but looks like there is a bug in this method when uninstalling MSI's + # Uninstall-ChocolateyPackage $packageName $fileType $silentArgs $file -validExitCodes $validExitCodes + + # Use this instead + $msiArgs = "/x $file $silentArgs"; + Start-ChocolateyProcessAsAdmin "$msiArgs" 'msiexec' -validExitCodes $validExitCodes + + Write-ChocolateySuccess $package +} +catch { + Write-ChocolateyFailure $package "$($_.Exception.Message)" + throw +} diff --git a/vim/bundle/icinga2/choco/icinga2.nuspec.cmake b/vim/bundle/icinga2/choco/icinga2.nuspec.cmake new file mode 100755 index 0000000..90280ee --- /dev/null +++ b/vim/bundle/icinga2/choco/icinga2.nuspec.cmake @@ -0,0 +1,24 @@ + + + + + + + icinga2 + Icinga2 + ${SPEC_VERSION} + 2016 - The Icinga Project + Icinga Development Team + icinga2 - Monitoring Agent for Windows + Icinga 2 is an open source monitoring platform which notifies users about host and service outages. + https://www.icinga.org/ + icinga2 agent monitoring + https://www.icinga.org/resources/faq/ + false + https://www.icinga.org/wp-content/uploads/2015/05/icinga_icon_128x128.png + + + + + + diff --git a/vim/bundle/icinga2/cmake/FindYAJL.cmake b/vim/bundle/icinga2/cmake/FindYAJL.cmake new file mode 100644 index 0000000..186e319 --- /dev/null +++ b/vim/bundle/icinga2/cmake/FindYAJL.cmake @@ -0,0 +1,28 @@ +# - Try to find libyajl +# Once done this will define +# YAJL_FOUND - System has YAJL +# YAJL_INCLUDE_DIRS - The YAJL include directories +# YAJL_LIBRARIES - The libraries needed to use YAJL +# YAJL_DEFINITIONS - Compiler switches required for using YAJL + +find_package(PkgConfig) +pkg_check_modules(PC_YAJL QUIET yajl) +set(YAJL_DEFINITIONS ${PC_YAJL_CFLAGS_OTHER}) + +find_path(YAJL_INCLUDE_DIR yajl/yajl_version.h + HINTS ${PC_YAJL_INCLUDEDIR} ${PC_YAJL_INCLUDE_DIRS} + PATH_SUFFIXES libyajl) + +find_library(YAJL_LIBRARY NAMES yajl libyajl + HINTS ${PC_YAJL_LIBDIR} ${PC_YAJL_LIBRARY_DIRS}) + +set(YAJL_LIBRARIES ${YAJL_LIBRARY} ) +set(YAJL_INCLUDE_DIRS ${YAJL_INCLUDE_DIR}) + +include(FindPackageHandleStandardArgs) +# handle the QUIETLY and REQUIRED arguments and set YAJL_FOUND to TRUE +# if all listed variables are TRUE +find_package_handle_standard_args(yajl DEFAULT_MSG + YAJL_LIBRARY YAJL_INCLUDE_DIR) + +mark_as_advanced(YAJL_INCLUDE_DIR YAJL_LIBRARY) diff --git a/vim/bundle/icinga2/cmake/InstallConfig.cmake b/vim/bundle/icinga2/cmake/InstallConfig.cmake new file mode 100644 index 0000000..7af92cf --- /dev/null +++ b/vim/bundle/icinga2/cmake/InstallConfig.cmake @@ -0,0 +1,52 @@ +# Icinga 2 +# Copyright (C) 2012-2016 Icinga Development Team (http://www.icinga.org) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +function(install_if_not_exists src dest) + set(real_dest "${dest}") + if(NOT IS_ABSOLUTE "${src}") + set(src "${CMAKE_CURRENT_SOURCE_DIR}/${src}") + endif() + get_filename_component(src_name "${src}" NAME) + get_filename_component(basename_dest "${src}" NAME) + string(REPLACE "/" "\\\\" nsis_src "${src}") + string(REPLACE "/" "\\\\" nsis_dest_dir "${real_dest}") + string(REPLACE "/" "\\\\" nsis_dest "${real_dest}/${basename_dest}") + install(CODE " + if(\"\$ENV{DESTDIR}\" STREQUAL \"\") + set(target_dir \${CMAKE_INSTALL_PREFIX}) + else() + set(target_dir \$ENV{DESTDIR}) + endif() + if(\${CMAKE_INSTALL_PREFIX} MATCHES .*/_CPack_Packages/.* OR NOT EXISTS \"\$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/\${skel_prefix}${dest}/${src_name}\") + message(STATUS \"Installing: \$ENV{DESTDIR}${dest}/${src_name}\") + if(\${CMAKE_INSTALL_PREFIX} MATCHES .*/_CPack_Packages/.*) + set(skel_prefix \"share/skel/\") + else() + set(skel_prefix \"\") + endif() + execute_process(COMMAND \${CMAKE_COMMAND} -E copy \"${src}\" + \"\${target_dir}/\${skel_prefix}${dest}/${src_name}\" + RESULT_VARIABLE copy_result + ERROR_VARIABLE error_output) + if(copy_result) + message(FATAL_ERROR \${error_output}) + endif() + else() + message(STATUS \"Skipping : \${target_dir}/${dest}/${src_name}\") + endif() + ") +endfunction(install_if_not_exists) diff --git a/vim/bundle/icinga2/config.h.cmake b/vim/bundle/icinga2/config.h.cmake new file mode 100644 index 0000000..1903b28 --- /dev/null +++ b/vim/bundle/icinga2/config.h.cmake @@ -0,0 +1,28 @@ +#ifndef CONFIG_H +#define CONFIG_H + +#cmakedefine HAVE_BACKTRACE_SYMBOLS +#cmakedefine HAVE_PIPE2 +#cmakedefine HAVE_VFORK +#cmakedefine HAVE_DLADDR +#cmakedefine HAVE_LIBEXECINFO +#cmakedefine HAVE_CXXABI_H +#cmakedefine HAVE_NICE +#cmakedefine HAVE_EDITLINE + +#cmakedefine ICINGA2_UNITY_BUILD + +#define ICINGA_PREFIX "${CMAKE_INSTALL_PREFIX}" +#define ICINGA_SYSCONFDIR "${CMAKE_INSTALL_FULL_SYSCONFDIR}" +#define ICINGA_RUNDIR "${ICINGA2_RUNDIR}" +#define ICINGA_LOCALSTATEDIR "${CMAKE_INSTALL_FULL_LOCALSTATEDIR}" +#define ICINGA_PKGDATADIR "${CMAKE_INSTALL_FULL_DATADIR}/icinga2" +#define ICINGA_INCLUDECONFDIR "${CMAKE_INSTALL_FULL_DATADIR}/icinga2/include" +#define ICINGA_USER "${ICINGA2_USER}" +#define ICINGA_GROUP "${ICINGA2_GROUP}" + +#define ICINGA_BUILD_HOST_NAME "${ICINGA2_BUILD_HOST_NAME}" +#define ICINGA_BUILD_COMPILER_NAME "${ICINGA2_BUILD_COMPILER_NAME}" +#define ICINGA_BUILD_COMPILER_VERSION "${ICINGA2_BUILD_COMPILER_VERSION}" + +#endif /* CONFIG_H */ diff --git a/vim/bundle/icinga2/contrib/GPLHeader b/vim/bundle/icinga2/contrib/GPLHeader new file mode 100644 index 0000000..2de75cc --- /dev/null +++ b/vim/bundle/icinga2/contrib/GPLHeader @@ -0,0 +1,19 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + diff --git a/vim/bundle/icinga2/contrib/README b/vim/bundle/icinga2/contrib/README new file mode 100644 index 0000000..56b2878 --- /dev/null +++ b/vim/bundle/icinga2/contrib/README @@ -0,0 +1,6 @@ +Icinga 2 Contrib files +====================== + +This directory contains various unsupported scripts. Chances are that they're +either completely broken or at least need some changes to work with the most +recent version of Icinga 2. diff --git a/vim/bundle/icinga2/contrib/discover-api.py b/vim/bundle/icinga2/contrib/discover-api.py new file mode 100755 index 0000000..7c9a691 --- /dev/null +++ b/vim/bundle/icinga2/contrib/discover-api.py @@ -0,0 +1,146 @@ +#!/usr/bin/env python +# Icinga 2 +# Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +import sys +import subprocess +import socket +import urlparse +import requests +import json +from xml.dom.minidom import parse + +api_url = "https://localhost:5665/" +api_user = "root" +api_password = "root" + +if len(sys.argv) < 2: + print "Syntax: %s [ ...]" % (sys.argv[0]) + sys.exit(1) + +tcp_service_commands = { + 'ssh': 'ssh', + 'http': 'http', + 'smtp': 'smtp', + 'ssmtp': 'ssmtp' +} + +udp_service_commands = { + 'ntp': 'ntp_time', + 'snmp': 'snmp-uptime' +} + +hosts = {} + +def process_host(host_element): + global hosts + + status = "down" + + for status_element in host_element.getElementsByTagName("status"): + status = status_element.getAttribute("state") + + if status != "up": + return + + for address_element in host_element.getElementsByTagName("address"): + if not address_element.getAttribute("addrtype") in [ "ipv4", "ipv6" ]: + continue + + address = address_element.getAttribute("addr") + break + + name = address + + for hostname_element in host_element.getElementsByTagName("hostname"): + name = hostname_element.getAttribute("name") + + try: + services = hosts[name]["services"] + except: + services = {} + + for port_element in host_element.getElementsByTagName("port"): + state = "closed" + + for state_element in port_element.getElementsByTagName("state"): + state = state_element.getAttribute("state") + + if state != "open": + continue + + port = int(port_element.getAttribute("portid")) + protocol = port_element.getAttribute("protocol") + + try: + serv = socket.getservbyport(port, protocol) + except: + serv = str(port) + + try: + if protocol == "tcp": + command = tcp_service_commands[serv] + elif protocol == "udp": + command = udp_service_commands[serv] + else: + raise "Unknown protocol." + except: + command = protocol + + if command == "udp": + continue + + services[serv] = { "command": command, "port": port } + + hosts[name] = { "name": name, "address": address, "services": services } + +def create_host(host): + global api_url, api_user, api_password + + req = { + "templates": [ "discovered-host" ], + "attrs": { + "address": host["address"] + } + } + + headers = {"Accept": "application/json"} + url = urlparse.urljoin(api_url, "v1/objects/hosts/%s" % (host["name"])) + requests.put(url, headers=headers, auth=(api_user, api_password), data=json.dumps(req), verify=False) + + for serv, service in host["services"].iteritems(): + req = { + "templates": [ "discovered-service" ], + "attrs": { + "vars.%s_port" % (service["command"]): service["port"], + "check_command": service["command"], + } + } + + headers = {"Accept": "application/json"} + url = urlparse.urljoin(api_url, "v1/objects/services/%s!%s" % (host["name"], serv)) + requests.put(url, headers=headers, auth=(api_user, api_password), data=json.dumps(req), verify=False) + +for arg in sys.argv[1:]: + # Expects XML output from 'nmap -oX' + dom = parse(arg) + + for host in dom.getElementsByTagName("host"): + process_host(host) + +for host in hosts.values(): + create_host(host) diff --git a/vim/bundle/icinga2/contrib/discover.py b/vim/bundle/icinga2/contrib/discover.py new file mode 100755 index 0000000..a6726bb --- /dev/null +++ b/vim/bundle/icinga2/contrib/discover.py @@ -0,0 +1,132 @@ +#!/usr/bin/env python +# Icinga 2 +# Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +import sys +import subprocess +import socket +from xml.dom.minidom import parse + +if len(sys.argv) < 2: + print "Syntax: %s [ ...]" % (sys.argv[0]) + sys.exit(1) + +tcp_service_commands = { + 'ssh': 'ssh', + 'http': 'http_ip', + 'https': 'https_ip', + 'smtp': 'smtp', + 'ssmtp': 'ssmtp' +} + +udp_service_commands = { + 'ntp': 'ntp_time', + 'snmp': 'snmp-uptime' +} + +hosts = {} + +def process_host(host_element): + global hosts + + status = "down" + + for status_element in host_element.getElementsByTagName("status"): + status = status_element.getAttribute("state") + + if status != "up": + return + + for address_element in host_element.getElementsByTagName("address"): + if not address_element.getAttribute("addrtype") in [ "ipv4", "ipv6" ]: + continue + + address = address_element.getAttribute("addr") + break + + name = address + + for hostname_element in host_element.getElementsByTagName("hostname"): + name = hostname_element.getAttribute("name") + + try: + services = hosts[name]["services"] + except: + services = {} + + for port_element in host_element.getElementsByTagName("port"): + state = "closed" + + for state_element in port_element.getElementsByTagName("state"): + state = state_element.getAttribute("state") + + if state != "open": + continue + + port = int(port_element.getAttribute("portid")) + protocol = port_element.getAttribute("protocol") + + try: + serv = socket.getservbyport(port, protocol) + except: + serv = str(port) + + try: + if protocol == "tcp": + command = tcp_service_commands[serv] + elif protocol == "udp": + command = udp_service_commands[serv] + else: + raise "Unknown protocol." + except: + command = protocol + + if command == "udp": + continue + + services[serv] = { "command": command, "port": port } + + hosts[name] = { "name": name, "address": address, "services": services } + +def print_host(host): + print "object Host \"%s\" {" % (host["name"]) + print "\timport \"discovered-host\"," + print "" + print "\taddress = \"%s\"," % (host["address"]) + print "}" + print "" + + for serv, service in host["services"].iteritems(): + print "object Service \"%s\" {" % (serv) + print "\timport \"discovered-service\"," + print "" + print "\thost_name = \"%s\"" % (host["name"]) + print "\tcheck_command = \"%s\"," % (service["command"]) + print "" + print "\tvars.port = %s" % (service["port"]) + print "}" + print "" + +for arg in sys.argv[1:]: + # Expects XML output from 'nmap -oX' + dom = parse(arg) + + for host in dom.getElementsByTagName("host"): + process_host(host) + +for host in hosts.values(): + print_host(host) diff --git a/vim/bundle/icinga2/contrib/i2eval/Makefile b/vim/bundle/icinga2/contrib/i2eval/Makefile new file mode 100644 index 0000000..85905ff --- /dev/null +++ b/vim/bundle/icinga2/contrib/i2eval/Makefile @@ -0,0 +1,3 @@ +i2tcl.so: i2tcl.cpp i2tcl.hpp + swig -c++ -o i2tcl_wrap.cpp i2tcl.hpp + g++ -g -std=c++11 -I/usr/include/tcl8.5 -shared -fpic -Iicinga2/lib -Iicinga2/build -Iicinga2/build/lib -L/opt/icinga2/lib/icinga2 -lbase -lconfig -Wl,-rpath=/opt/icinga2/lib/icinga2 -o i2tcl.so i2tcl_wrap.cpp i2tcl.cpp diff --git a/vim/bundle/icinga2/contrib/i2eval/README b/vim/bundle/icinga2/contrib/i2eval/README new file mode 100644 index 0000000..8fbb136 --- /dev/null +++ b/vim/bundle/icinga2/contrib/i2eval/README @@ -0,0 +1 @@ +This is the source code for the 'i2eval' IRC bot that's on #icinga and #icinga-devel. diff --git a/vim/bundle/icinga2/contrib/i2eval/i2tcl.cpp b/vim/bundle/icinga2/contrib/i2eval/i2tcl.cpp new file mode 100644 index 0000000..2790244 --- /dev/null +++ b/vim/bundle/icinga2/contrib/i2eval/i2tcl.cpp @@ -0,0 +1,176 @@ +#include "i2tcl.hpp" +#include "config/configcompiler.hpp" +#include "config/configcompilercontext.hpp" +#include "base/function.hpp" +#include "base/json.hpp" +#include "base/application.hpp" +#include + +using namespace icinga; + +static bool l_Init_Called; +static Tcl_Interp *l_Interp; +static Tcl_Encoding l_Encoding; +static std::map l_Lines; +static int l_NextLine = 1; + +static Value i2_call_tcl(const String& command, const String& mtype, const std::vector& args) +{ + Tcl_Obj **objv = new Tcl_Obj *[args.size() + 1]; + objv[0] = Tcl_NewStringObj(command.CStr(), -1); + Tcl_IncrRefCount(objv[0]); + + for (size_t i = 0; i < args.size(); i++) { + Tcl_DString dsText; + String arg = static_cast(args[i]); + Tcl_ExternalToUtfDString(l_Encoding, arg.CStr(), -1, &dsText); + objv[i + 1] = Tcl_NewStringObj(Tcl_DStringValue(&dsText), Tcl_DStringLength(&dsText)); + Tcl_DStringFree(&dsText); + Tcl_IncrRefCount(objv[i + 1]); + } + + int code = Tcl_EvalObjv(l_Interp, args.size() + 1, objv, TCL_EVAL_GLOBAL); + + Tcl_Obj *result = Tcl_GetObjResult(l_Interp); + + for (size_t i = 0; i < args.size() + 1; i++) + Tcl_DecrRefCount(objv[i]); + + delete [] objv; + + if (code == TCL_ERROR) + BOOST_THROW_EXCEPTION(std::runtime_error("An error occurred in the TCL script")); + + Value vresult; + + if (mtype == "list") { + Array::Ptr arr = new Array(); + + int len; + if (Tcl_ListObjLength(l_Interp, result, &len) != TCL_OK) + BOOST_THROW_EXCEPTION(std::invalid_argument("TCL proc returned something that is not a list")); + + for (size_t i = 0; i < len; i++) { + Tcl_Obj *obj; + Tcl_ListObjIndex(l_Interp, result, i, &obj); + + const char* strObj = Tcl_GetString(obj); + + Tcl_DString dsObj; + arr->Add(Tcl_UtfToExternalDString(l_Encoding, strObj, -1, &dsObj)); + Tcl_DStringFree(&dsObj); + } + + vresult = arr; + } else if (mtype == "null") { + /* Nothing to do here */ + } else if (mtype == "number") { + const char* strResult = Tcl_GetString(result); + vresult = Convert::ToDouble(strResult); + } else if (mtype == "bool") { + const char* strResult = Tcl_GetString(result); + vresult = Convert::ToBool(Convert::ToLong(strResult)); + } else { + const char* strResult = Tcl_GetString(result); + + Tcl_DString dsResult; + vresult = Tcl_UtfToExternalDString(l_Encoding, strResult, -1, &dsResult); + Tcl_DStringFree(&dsResult); + } + + + return vresult; +} + +void i2_register_command(const char *icmd, const char *tcmd, const char *mtype, Tcl_Interp *interp) +{ + Function::Ptr sf = new Function(icmd, boost::bind(i2_call_tcl, String(tcmd), String(mtype), _1)); + ScriptGlobal::Set(icmd, sf); +} + +void *i2_new_frame(Tcl_Interp *interp) +{ + if (!l_Init_Called) { + l_Init_Called = true; + l_Encoding = Tcl_GetEncoding(l_Interp, "ISO8859-1"); + Application::InitializeBase(); + } + + ScriptFrame *frame = new ScriptFrame(); + frame->Self = ScriptGlobal::GetGlobals(); + return frame; +} + +void i2_free_frame(void *frame, Tcl_Interp *interp) +{ + delete reinterpret_cast(frame); +} + +char *i2_eval(void *uframe, const char *text, Tcl_Interp *interp) +{ + std::ostringstream msgbuf; + Expression *expr; + ScriptFrame *frame = reinterpret_cast(uframe); + + l_Interp = interp; + + try { + String lineNum = Convert::ToString(l_NextLine); + l_NextLine++; + + String fileName = "<" + lineNum + ">"; + l_Lines[fileName] = text; + + expr = ConfigCompiler::CompileText(fileName, text); + + if (expr) { + Value result = expr->Evaluate(*frame); + if (!result.IsObject() || result.IsObjectType() || result.IsObjectType()) + msgbuf << JsonEncode(result); + else + msgbuf << result; + } + } catch (const ScriptError& ex) { + DebugInfo di = ex.GetDebugInfo(); + + if (di.FirstLine != 0) { + String text = l_Lines[di.Path]; + + std::vector lines; + boost::algorithm::split(lines, text, boost::is_any_of("\n")); + + for (int i = di.FirstLine; i <= di.LastLine; i++) { + int start, len; + + if (i == di.FirstLine) + start = di.FirstColumn; + else + start = 0; + + if (i == di.LastLine) + len = di.LastColumn - di.FirstColumn + 1; + else + len = lines[i].GetLength(); + + String pathInfo = di.Path; + if (i != 1) + pathInfo += "(" + Convert::ToString(i) + ")"; + pathInfo += ": "; + + msgbuf << pathInfo << lines[i - 1] << "\n"; + msgbuf << String(pathInfo.GetLength(), ' '); + msgbuf << String(start, ' ') << String(len, '^') << "\n"; + } + } + + msgbuf << ex.what(); + } catch (const std::exception& ex) { + msgbuf << "Error: " << DiagnosticInformation(ex); + } + + delete expr; + + std::string str = msgbuf.str(); + return strdup(str.c_str()); +} + diff --git a/vim/bundle/icinga2/contrib/i2eval/i2tcl.hpp b/vim/bundle/icinga2/contrib/i2eval/i2tcl.hpp new file mode 100644 index 0000000..3faa2c1 --- /dev/null +++ b/vim/bundle/icinga2/contrib/i2eval/i2tcl.hpp @@ -0,0 +1,23 @@ +#ifdef SWIG +%module i2tcl +%{ +#include "i2tcl.hpp" +%} + +%typemap(in,numinputs=0) Tcl_Interp *interp { + $1 = interp; +} + +#endif /* SWIG */ + +#include + +#ifndef I2TCL_H +#define I2TCL_H + +void i2_register_command(const char *icmd, const char *tcmd, const char *mtype, Tcl_Interp *interp); +void *i2_new_frame(Tcl_Interp *interp); +void i2_free_frame(void *frame, Tcl_Interp *interp); +char *i2_eval(void *frame, const char *text, Tcl_Interp *interp); + +#endif /* I2TCL_H */ diff --git a/vim/bundle/icinga2/contrib/i2eval/i2tcl.tcl b/vim/bundle/icinga2/contrib/i2eval/i2tcl.tcl new file mode 100644 index 0000000..4b653de --- /dev/null +++ b/vim/bundle/icinga2/contrib/i2eval/i2tcl.tcl @@ -0,0 +1,109 @@ +package require http +package require tls +http::register https 443 [list ::tls::socket -tls1 1] + +load /home/gunnar/i2tcl.so i2tcl + +bind pub - > i2tcl +bind pub - >u i2tcl_url +bind pub - ^ i2tcl +bind pub - ^u i2tcl_url + +if {![info exists ::i2frame]} { + set ::i2frame [i2_new_frame] +} + +set ::i2chan "" +set ::i2nick "" + +i2_register_command irc i2_irc null +i2_register_command channels channels list +i2_register_command chanlist internalchanlist list +i2_register_command getnick getcurrentnick string +i2_register_command onchan onchan bool +i2_register_command topic topic string +i2_register_command topicnick topicnick string +i2_register_command topicstamp topicstamp number +i2_register_command chanmodes getchanmode string +i2_register_command isop isop bool +i2_register_command isvoice isvoice bool +i2_register_command ishop ishop bool +i2_register_command chanhost getchanhost string +i2_register_command chanbans chanbans list +i2_register_command getnick i2_getnick string +i2_register_command getchan i2_getchan string +i2_register_command "Internal.run_with_activation_context" i2_null null +i2_register_command exit i2_null null + +proc i2_null {} { +} + +proc i2_getnick {} { + global i2nick + return $i2nick +} + +proc i2_getchan {} { + global i2chan + return $i2chan +} + +proc i2_irc {message} { + global i2chan + + if {[string first "\n" $message] != -1 || [string first "\r" $message] != -1} { + return + } + + putserv "PRIVMSG $i2chan :$message" +} + +proc i2tcl {nick host hand chan arg} { + global i2frame i2chan i2nick + + set i2chan $chan + set i2nick $nick + + set result [i2_eval $i2frame $arg] + + if {$result == ""} { set result "" } + foreach sline [split $result \n] { + putserv "PRIVMSG $chan :( $arg ) = $sline" + } +} + +proc i2tcl_url {nick host hand chan arg} { + global i2frame i2chan i2nick + + set i2chan $chan + set i2nick $nick + + if {[catch {set token [http::geturl $arg]} msg]} { + putserv "PRIVMSG $chan :HTTP request failed: $msg" + http::cleanup $token + return + } + + if {[http::status $token] != "ok"} { + putserv "PRIVMSG $chan :HTTP request failed: [http::error $token]" + http::cleanup $token + return + } + + set rpl [split [http::code $token] " "] + + if {[lindex $rpl 1] != 200} { + putserv "PRIVMSG $chan :HTTP request failed: [join [lrange $rpl 1 end]]" + http::cleanup $token + return + } + + set code [http::data $token] + http::cleanup $token + set result [i2_eval $i2frame $code] + + if {$result == ""} { set result "" } + foreach sline [split $result \n] { + putserv "PRIVMSG $chan :( $arg ) = $sline" + } +} diff --git a/vim/bundle/icinga2/contrib/icinga2clr.cs b/vim/bundle/icinga2/contrib/icinga2clr.cs new file mode 100644 index 0000000..1de92b5 --- /dev/null +++ b/vim/bundle/icinga2/contrib/icinga2clr.cs @@ -0,0 +1,44 @@ +/****************************************************************************** + * Icinga 2 * + * Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) * + * * + * This program is free software; you can redistribute it and/or * + * modify it under the terms of the GNU General Public License * + * as published by the Free Software Foundation; either version 2 * + * of the License, or (at your option) any later version. * + * * + * This program is distributed in the hope that it will be useful, * + * but WITHOUT ANY WARRANTY; without even the implied warranty of * + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * + * GNU General Public License for more details. * + * * + * You should have received a copy of the GNU General Public License * + * along with this program; if not, write to the Free Software Foundation * + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. * + ******************************************************************************/ + +using System; +using System.Collections; + +namespace Icinga +{ + public enum ServiceState + { + ServiceOK, + ServiceWarning, + ServiceCritical, + ServiceUnknown + } + + public class CheckResult + { + public ServiceState State; + public String Output; + public String PerformanceData; + } + + public interface ICheckPlugin + { + CheckResult Check(Hashtable args); + } +} diff --git a/vim/bundle/icinga2/contrib/make-agent-config.py b/vim/bundle/icinga2/contrib/make-agent-config.py new file mode 100755 index 0000000..715a81f --- /dev/null +++ b/vim/bundle/icinga2/contrib/make-agent-config.py @@ -0,0 +1,68 @@ +#!/usr/bin/env python +# Icinga 2 +# Copyright (C) 2012-2016 Icinga Development Team (https://www.icinga.org/) +# +# This program is free software; you can redistribute it and/or +# modify it under the terms of the GNU General Public License +# as published by the Free Software Foundation; either version 2 +# of the License, or (at your option) any later version. +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software Foundation +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA. + +import subprocess, json + +inventory_json = subprocess.check_output(["icinga2", "agent", "list", "--batch"]) +inventory = json.loads(inventory_json) + +for agent, agent_info in inventory.items(): + print "object Endpoint \"%s\" {" % (agent) + print " host = \"%s\"" % (agent) + print "}" + print "" + print "object Zone \"%s\" {" % (agent_info["zone"]) + if "parent_zone" in agent_info: + print " parent = \"%s\"" % (agent_info["parent_zone"]) + print " endpoints = [ \"%s\" ]" % (agent) + print "}" + print "" + + print "object Host \"%s\" {" % (agent_info["zone"]) + print " check_command = \"cluster-zone\"" + print "}" + print "" + + print "apply Dependency \"host-zone-%s\" to Host {" % (agent_info["zone"]) + print " parent_host_name = \"%s\"" % (agent_info["zone"]) + print " assign where host.zone == \"%s\"" % (agent_info["zone"]) + print "}" + print "" + + print "apply Dependency \"service-zone-%s\" to Service {" % (agent_info["zone"]) + print " parent_host_name = \"%s\"" % (agent_info["zone"]) + print " assign where service.zone == \"%s\"" % (agent_info["zone"]) + print "}" + print "" + + for host, services in agent_info["repository"].items(): + if host != agent_info["zone"]: + print "object Host \"%s\" {" % (host) + print " check_command = \"dummy\"" + print " zone = \"%s\"" % (agent_info["zone"]) + print "}" + print "" + + for service in services: + print "object Service \"%s\" {" % (service) + print " check_command = \"dummy\"" + print " host_name = \"%s\"" % (host) + print " zone = \"%s\"" % (agent_info["zone"]) + print "}" + print "" + diff --git a/vim/bundle/icinga2/doc/.gitignore b/vim/bundle/icinga2/doc/.gitignore new file mode 100644 index 0000000..e60e194 --- /dev/null +++ b/vim/bundle/icinga2/doc/.gitignore @@ -0,0 +1,2 @@ +build +*.rst diff --git a/vim/bundle/icinga2/doc/1-about.md b/vim/bundle/icinga2/doc/1-about.md new file mode 100644 index 0000000..c979f76 --- /dev/null +++ b/vim/bundle/icinga2/doc/1-about.md @@ -0,0 +1,316 @@ +# About Icinga 2 + +## What is Icinga 2? + +Icinga 2 is an open source monitoring system which checks the availability of +your network resources, notifies users of outages, and generates performance +data for reporting. + +Scalable and extensible, Icinga 2 can monitor large, complex environments across +multiple locations. + +## Licensing + +Icinga 2 and the Icinga 2 documentation are licensed under the terms of the GNU +General Public License Version 2, you will find a copy of this license in the +LICENSE file included in the source package. + +## Support + +Support for Icinga 2 is available in a number of ways. Please have a look at +the [support overview page](https://support.icinga.org). + +## Contribute + +There are many ways to contribute to Icinga -- whether it be sending patches, +testing, reporting bugs, or reviewing and updating the documentation. Every +contribution is appreciated! + +Please get in touch with the Icinga team at https://www.icinga.org/community/. + +If you want to help update this documentation, please read +[this howto](https://wiki.icinga.org/display/community/Update+the+Icinga+2+documentation). + +### Icinga 2 Development + +You can follow Icinga 2's development closely by checking +out these resources: + +* [Development Bug Tracker](https://dev.icinga.org/projects/i2): [How to report a bug?](https://www.icinga.org/icinga/faq/) +* Git Repositories: [main mirror on icinga.org](https://git.icinga.org/?p=icinga2.git;a=summary) [release mirror at github.com](https://github.com/Icinga/icinga2) +* [Git Checkins Mailinglist](https://lists.icinga.org/mailman/listinfo/icinga-checkins) +* [Development](https://lists.icinga.org/mailman/listinfo/icinga-devel) and [Users](https://lists.icinga.org/mailman/listinfo/icinga-users) Mailinglists +* [#icinga-devel on irc.freenode.net](http://webchat.freenode.net/?channels=icinga-devel) including a Git Commit Bot + +For general support questions, please refer to the [community support channels](https://support.icinga.org). + +### How to Report a Bug or Feature Request + +More details in the [Icinga FAQ](https://www.icinga.org/icinga/faq/). + +* [Register](https://accounts.icinga.org/register) an Icinga account. +* Create a new issue at the [Icinga 2 Development Tracker](https://dev.icinga.org/projects/i2). +* When reporting a bug, please include the details described in the [Troubleshooting](15-troubleshooting.md#troubleshooting-information-required) chapter (version, configs, logs, etc.). + +## What's New + +### What's New in Version 2.5.4 + +#### Bugfixes + +* Bug [11932](https://dev.icinga.org/issues/11932 "Bug 11932") (Checker): many check commands executed at same time when master reload + +### What's New in Version 2.5.3 + +#### Changes + +This release addresses an issue with PostgreSQL support for the IDO database module. + +#### Bugfixes + +* Bug [12533](https://dev.icinga.org/issues/12533 "Bug 12533") (DB IDO): ido pgsql migration from 2.4.0 to 2.5.0 : wrong size for config_hash + +### What's New in Version 2.5.2 + +#### Bugfixes + +* Bug [12527](https://dev.icinga.org/issues/12527 "Bug 12527") (DB IDO): Newly added group member tables in the IDO database are not updated +* Bug [12529](https://dev.icinga.org/issues/12529 "Bug 12529") (Checker): Icinga 2 sends SOFT recovery notifications + +### What's New in Version 2.5.1 + +#### Bugfixes + +* Bug [12517](https://dev.icinga.org/issues/12517 "Bug 12517") (Notifications): Icinga 2 sends recovery notifications for SOFT NOT-OK states + +### What's New in Version 2.5.0 + +#### Changes + +* InfluxdbWriter feature +* API + * New endpoints: /v1/variables and /v1/templates (GET requests), /v1/action/generate-ticket (POST request) + * State/type filters for notifications/users are now string values (PUT, POST, GET requests) +* Configuration + * TimePeriod excludes/includes attributes + * DateTime object for formatting time strings + * New prototype methods: Array#filter, Array#unique, Array#map, Array#reduce + * icinga2.conf now includes plugins-contrib, manubulon, windows-plugins, nscp by default (ITL CheckCommand definitions) + * Performance improvements (config compiler and validation) +* CLI + * 'icinga2 object list' formats state/type filters as string values + * Compiled config files are now visible with "notice" debug level (hidden by default) + * CA serial file now uses a hash value (HA cluster w/ 2 CA directories) +* Cluster + * There is a known issue with >2 endpoints inside a zone. Icinga 2 will now log a warning. + * Support for accepted ciphers and minimum TLS version + * Connection and error logging has been improved. +* DB IDO + * Schema upgrade required (2.5.0.sql) + * Incremental config dump (performance boost) + * `categories` attribute is now an array. Previous method is deprecated and to be removed. + * DbCatLog is not enabled by default anymore. + * SSL support for MySQL +* New packages + * vim-icinga2 for syntax highlighting + * libicinga2 (Debian), icinga2-libs (RPM) for Icinga Studio packages + +#### Feature + +* Feature [7355](https://dev.icinga.org/issues/7355 "Feature 7355") (libicinga): Exclude option for TimePeriod definitions +* Feature [8401](https://dev.icinga.org/issues/8401 "Feature 8401") (Packages): Package for syntax highlighting +* Feature [9184](https://dev.icinga.org/issues/9184 "Feature 9184") (Perfdata): Add timestamp support for GelfWriter +* Feature [9264](https://dev.icinga.org/issues/9264 "Feature 9264") (ITL): Extend CheckCommand definitions for nscp-local +* Feature [9725](https://dev.icinga.org/issues/9725 "Feature 9725") (DB IDO): Add SSL support for the IdoMysqlConnection feature +* Feature [9839](https://dev.icinga.org/issues/9839 "Feature 9839") (Configuration): Implement support for formatting date/time +* Feature [9858](https://dev.icinga.org/issues/9858 "Feature 9858") (Perfdata): Gelf module: expose 'perfdata' fields for 'CHECK_RESULT' events +* Feature [10140](https://dev.icinga.org/issues/10140 "Feature 10140") (libicinga): Remove the deprecated IcingaStatusWriter feature +* Feature [10480](https://dev.icinga.org/issues/10480 "Feature 10480") (Perfdata): Add InfluxDbWriter feature +* Feature [10553](https://dev.icinga.org/issues/10553 "Feature 10553") (Documentation): Update SELinux documentation +* Feature [10669](https://dev.icinga.org/issues/10669 "Feature 10669") (ITL): Add IPv4/IPv6 support to the rest of the monitoring-plugins +* Feature [10722](https://dev.icinga.org/issues/10722 "Feature 10722") (ITL): icinga2.conf: Include plugins-contrib, manubulon, windows-plugins, nscp by default +* Feature [10816](https://dev.icinga.org/issues/10816 "Feature 10816") (libbase): Add name attribute for WorkQueue class +* Feature [10952](https://dev.icinga.org/issues/10952 "Feature 10952") (Packages): Provide packages for icinga-studio on Fedora +* Feature [11063](https://dev.icinga.org/issues/11063 "Feature 11063") (API): Implement SSL cipher configuration support for the API feature +* Feature [11290](https://dev.icinga.org/issues/11290 "Feature 11290") (API): ApiListener: Force server's preferred cipher +* Feature [11292](https://dev.icinga.org/issues/11292 "Feature 11292") (API): ApiListener: Make minimum TLS version configurable +* Feature [11359](https://dev.icinga.org/issues/11359 "Feature 11359") (ITL): Add "retries" option to check_snmp command +* Feature [11419](https://dev.icinga.org/issues/11419 "Feature 11419") (Configuration): Config parser should not log names of included files by default +* Feature [11423](https://dev.icinga.org/issues/11423 "Feature 11423") (libicinga): Cleanup downtimes created by ScheduleDowntime +* Feature [11445](https://dev.icinga.org/issues/11445 "Feature 11445") (Configuration): Allow strings in state/type filters +* Feature [11599](https://dev.icinga.org/issues/11599 "Feature 11599") (Documentation): Documentation review +* Feature [11612](https://dev.icinga.org/issues/11612 "Feature 11612") (Configuration): Improve performance for field accesses +* Feature [11623](https://dev.icinga.org/issues/11623 "Feature 11623") (Installation): Add script for automatically cherry-picking commits for minor versions +* Feature [11659](https://dev.icinga.org/issues/11659 "Feature 11659") (Configuration): Remove the (unused) 'inherits' keyword +* Feature [11706](https://dev.icinga.org/issues/11706 "Feature 11706") (API): Improve logging for HTTP API requests +* Feature [11739](https://dev.icinga.org/issues/11739 "Feature 11739") (Packages): Windows Installer: Remove dependency on KB2999226 package +* Feature [11772](https://dev.icinga.org/issues/11772 "Feature 11772") (Cluster): Add lag threshold for cluster-zone check +* Feature [11837](https://dev.icinga.org/issues/11837 "Feature 11837") (Documentation): Use HTTPS for debmon.org links in the documentation +* Feature [11869](https://dev.icinga.org/issues/11869 "Feature 11869") (ITL): Add CIM port parameter for esxi_hardware CheckCommand +* Feature [11875](https://dev.icinga.org/issues/11875 "Feature 11875") (Tests): Add debugging mode for Utility::GetTime +* Feature [11931](https://dev.icinga.org/issues/11931 "Feature 11931") (ITL): Adding option to access ifName for manubulon snmp-interface check command +* Feature [11941](https://dev.icinga.org/issues/11941 "Feature 11941") (API): Support for enumerating available templates via the API +* Feature [11955](https://dev.icinga.org/issues/11955 "Feature 11955") (API): Implement support for getting a list of global variables from the API +* Feature [11967](https://dev.icinga.org/issues/11967 "Feature 11967") (DB IDO): Update DB IDO schema version to 1.14.1 +* Feature [11968](https://dev.icinga.org/issues/11968 "Feature 11968") (DB IDO): Enhance IDO check with schema version info +* Feature [11970](https://dev.icinga.org/issues/11970 "Feature 11970") (ITL): add check command for plugin check_apache_status +* Feature [12006](https://dev.icinga.org/issues/12006 "Feature 12006") (ITL): Add check command definitions for kdc and rbl +* Feature [12018](https://dev.icinga.org/issues/12018 "Feature 12018") (Graphite): Add acknowledgement type to Graphite, InfluxDB, OpenTSDB metadata +* Feature [12024](https://dev.icinga.org/issues/12024 "Feature 12024") (DB IDO): Change Ido*Connection 'categories' attribute to an array +* Feature [12041](https://dev.icinga.org/issues/12041 "Feature 12041") (API): API: Add missing downtime_depth attribute +* Feature [12061](https://dev.icinga.org/issues/12061 "Feature 12061") (ITL): Add check command definition for db2_health +* Feature [12106](https://dev.icinga.org/issues/12106 "Feature 12106") (DB IDO): Do not populate logentries table by default +* Feature [12116](https://dev.icinga.org/issues/12116 "Feature 12116") (Cluster): Enhance client disconnect message for "No data received on new API connection." +* Feature [12189](https://dev.icinga.org/issues/12189 "Feature 12189") (ITL): Add support for "-A" command line switch to CheckCommand "snmp-process" +* Feature [12194](https://dev.icinga.org/issues/12194 "Feature 12194") (Cluster): Improve log message for connecting nodes without configured Endpoint object +* Feature [12201](https://dev.icinga.org/issues/12201 "Feature 12201") (Cluster): Improve error messages for failed certificate validation +* Feature [12215](https://dev.icinga.org/issues/12215 "Feature 12215") (Cluster): Include IP address and port in the "New connection" log message +* Feature [12221](https://dev.icinga.org/issues/12221 "Feature 12221") (ITL): A lot of missing parameters for (latest) mysql_health +* Feature [12222](https://dev.icinga.org/issues/12222 "Feature 12222") (Cluster): Log a warning if there are more than 2 zone endpoint members +* Feature [12234](https://dev.icinga.org/issues/12234 "Feature 12234") (CLI): Add history for icinga2 console +* Feature [12247](https://dev.icinga.org/issues/12247 "Feature 12247") (Configuration): Add map/reduce and filter functionality for the Array class +* Feature [12254](https://dev.icinga.org/issues/12254 "Feature 12254") (API): Remove obsolete debug log message +* Feature [12256](https://dev.icinga.org/issues/12256 "Feature 12256") (ITL): Add check command definition for check_graphite +* Feature [12287](https://dev.icinga.org/issues/12287 "Feature 12287") (Cluster): Enhance TLS handshake error messages with connection information +* Feature [12304](https://dev.icinga.org/issues/12304 "Feature 12304") (Notifications): Add the notification type into the log message +* Feature [12314](https://dev.icinga.org/issues/12314 "Feature 12314") (ITL): Add command definition for check_mysql_query +* Feature [12327](https://dev.icinga.org/issues/12327 "Feature 12327") (API): Support for determining the Icinga 2 version via the API +* Feature [12329](https://dev.icinga.org/issues/12329 "Feature 12329") (libicinga): Implement process_check_result script method for the Checkable class +* Feature [12336](https://dev.icinga.org/issues/12336 "Feature 12336") (libbase): Improve logging for the WorkQueue class +* Feature [12338](https://dev.icinga.org/issues/12338 "Feature 12338") (Configuration): Move internal script functions into the 'Internal' namespace +* Feature [12386](https://dev.icinga.org/issues/12386 "Feature 12386") (Documentation): Rewrite Client and Cluster chapter and; add service monitoring chapter +* Feature [12389](https://dev.icinga.org/issues/12389 "Feature 12389") (libbase): Include compiler name/version and build host name in --version +* Feature [12392](https://dev.icinga.org/issues/12392 "Feature 12392") (ITL): Add custom variables for all check_swap arguments +* Feature [12393](https://dev.icinga.org/issues/12393 "Feature 12393") (libbase): Implement support for marking functions as deprecated +* Feature [12407](https://dev.icinga.org/issues/12407 "Feature 12407") (CLI): Implement support for inspecting variables with LLDB/GDB +* Feature [12408](https://dev.icinga.org/issues/12408 "Feature 12408") (Configuration): Implement support for namespaces +* Feature [12412](https://dev.icinga.org/issues/12412 "Feature 12412") (Documentation): Add URL and short description for Monitoring Plugins inside the ITL documentation +* Feature [12424](https://dev.icinga.org/issues/12424 "Feature 12424") (ITL): Add perfsyntax parameter to nscp-local-counter CheckCommand +* Feature [12426](https://dev.icinga.org/issues/12426 "Feature 12426") (Configuration): Implement comparison operators for the Array class +* Feature [12433](https://dev.icinga.org/issues/12433 "Feature 12433") (API): Add API action for generating a PKI ticket +* Feature [12434](https://dev.icinga.org/issues/12434 "Feature 12434") (DB IDO): Remove unused code from the IDO classes +* Feature [12435](https://dev.icinga.org/issues/12435 "Feature 12435") (DB IDO): Incremental updates for the IDO database +* Feature [12448](https://dev.icinga.org/issues/12448 "Feature 12448") (libbase): Improve performance for type lookups +* Feature [12450](https://dev.icinga.org/issues/12450 "Feature 12450") (Cluster): Improve performance for Endpoint config validation +* Feature [12457](https://dev.icinga.org/issues/12457 "Feature 12457") (libbase): Remove unnecessary Dictionary::Contains calls +* Feature [12468](https://dev.icinga.org/issues/12468 "Feature 12468") (ITL): Add interfacetable CheckCommand options --trafficwithpkt and --snmp-maxmsgsize +* Feature [12477](https://dev.icinga.org/issues/12477 "Feature 12477") (Documentation): Development docs: Add own section for gdb backtrace from a running process +* Feature [12481](https://dev.icinga.org/issues/12481 "Feature 12481") (libbase): Remove some unused #includes + +#### Bugfixes + +* Bug [7354](https://dev.icinga.org/issues/7354 "Bug 7354") (libicinga): Disable immediate hard state after first checkresult +* Bug [9242](https://dev.icinga.org/issues/9242 "Bug 9242") (Cluster): Custom notification external commands do not work in a master-master setup +* Bug [9848](https://dev.icinga.org/issues/9848 "Bug 9848") (libbase): Function::Invoke should optionally register ScriptFrame +* Bug [10061](https://dev.icinga.org/issues/10061 "Bug 10061") (DB IDO): IDO: icinga_host/service_groups alias columns are TEXT columns +* Bug [10066](https://dev.icinga.org/issues/10066 "Bug 10066") (DB IDO): Missing indexes for icinga_endpoints* and icinga_zones* tables in DB IDO schema +* Bug [10069](https://dev.icinga.org/issues/10069 "Bug 10069") (DB IDO): IDO: check_source should not be a TEXT field +* Bug [10070](https://dev.icinga.org/issues/10070 "Bug 10070") (DB IDO): IDO: there is no usable object index on icinga_{scheduleddowntime,comments} +* Bug [10075](https://dev.icinga.org/issues/10075 "Bug 10075") (libbase): Race condition in CreatePipeOverlapped +* Bug [10363](https://dev.icinga.org/issues/10363 "Bug 10363") (Notifications): Notification times w/ empty begin/end specifications prevent sending notifications +* Bug [10570](https://dev.icinga.org/issues/10570 "Bug 10570") (API): /v1 returns HTML even if JSON is requested +* Bug [10903](https://dev.icinga.org/issues/10903 "Bug 10903") (Perfdata): GELF multi-line output +* Bug [10937](https://dev.icinga.org/issues/10937 "Bug 10937") (Configuration): High CPU usage with self-referenced parent zone config +* Bug [11182](https://dev.icinga.org/issues/11182 "Bug 11182") (DB IDO): IDO: entry_time of all comments is set to the date and time when Icinga 2 was restarted +* Bug [11196](https://dev.icinga.org/issues/11196 "Bug 11196") (Cluster): High load when pinning command endpoint on HA cluster +* Bug [11483](https://dev.icinga.org/issues/11483 "Bug 11483") (libicinga): Numbers are not properly formatted in runtime macro strings +* Bug [11562](https://dev.icinga.org/issues/11562 "Bug 11562") (Notifications): last_problem_notification should be synced in HA cluster +* Bug [11590](https://dev.icinga.org/issues/11590 "Bug 11590") (Notifications): notification interval = 0 not honoured in HA clusters +* Bug [11622](https://dev.icinga.org/issues/11622 "Bug 11622") (Configuration): Don't allow flow control keywords outside of other flow control constructs +* Bug [11648](https://dev.icinga.org/issues/11648 "Bug 11648") (Packages): Reload permission error with SELinux +* Bug [11650](https://dev.icinga.org/issues/11650 "Bug 11650") (Packages): RPM update starts disabled icinga2 service +* Bug [11688](https://dev.icinga.org/issues/11688 "Bug 11688") (DB IDO): Outdated downtime/comments not removed from IDO database (restart) +* Bug [11730](https://dev.icinga.org/issues/11730 "Bug 11730") (libicinga): Icinga 2 client gets killed during network scans +* Bug [11782](https://dev.icinga.org/issues/11782 "Bug 11782") (Packages): Incorrect filter in pick.py +* Bug [11793](https://dev.icinga.org/issues/11793 "Bug 11793") (Documentation): node setup: Add a note for --endpoint syntax for client-master connection +* Bug [11817](https://dev.icinga.org/issues/11817 "Bug 11817") (Installation): Windows: Error with repository handler (missing /var/lib/icinga2/api/repository path) +* Bug [11823](https://dev.icinga.org/issues/11823 "Bug 11823") (DB IDO): Volatile check results for OK->OK transitions are logged into DB IDO statehistory +* Bug [11825](https://dev.icinga.org/issues/11825 "Bug 11825") (libicinga): Problems with check scheduling for HARD state changes (standalone/command_endpoint) +* Bug [11832](https://dev.icinga.org/issues/11832 "Bug 11832") (Tests): Boost tests are missing a dependency on libmethods +* Bug [11847](https://dev.icinga.org/issues/11847 "Bug 11847") (Documentation): Missing quotes for API action URL +* Bug [11851](https://dev.icinga.org/issues/11851 "Bug 11851") (Notifications): Downtime notifications do not pass author and comment +* Bug [11862](https://dev.icinga.org/issues/11862 "Bug 11862") (libicinga): SOFT OK-state after returning from a soft state +* Bug [11887](https://dev.icinga.org/issues/11887 "Bug 11887") (ITL): Add "fuse.gvfsd-fuse" to the list of excluded file systems for check_disk +* Bug [11890](https://dev.icinga.org/issues/11890 "Bug 11890") (Configuration): Config validation should not delete comments/downtimes w/o reference +* Bug [11894](https://dev.icinga.org/issues/11894 "Bug 11894") (Configuration): Incorrect custom variable name in the hosts.conf example config +* Bug [11898](https://dev.icinga.org/issues/11898 "Bug 11898") (libicinga): last SOFT state should be hard (max_check_attempts) +* Bug [11899](https://dev.icinga.org/issues/11899 "Bug 11899") (libicinga): Flapping Notifications dependent on state change +* Bug [11903](https://dev.icinga.org/issues/11903 "Bug 11903") (Documentation): Fix systemd client command formatting +* Bug [11905](https://dev.icinga.org/issues/11905 "Bug 11905") (Documentation): Improve "Endpoint" documentation +* Bug [11926](https://dev.icinga.org/issues/11926 "Bug 11926") (API): Trying to delete an object protected by a permissions filter, ends up deleting all objects that match the filter instead +* Bug [11933](https://dev.icinga.org/issues/11933 "Bug 11933") (DB IDO): SOFT state changes with the same state are not logged +* Bug [11962](https://dev.icinga.org/issues/11962 "Bug 11962") (DB IDO): Overflow in current_notification_number column in DB IDO MySQL +* Bug [11991](https://dev.icinga.org/issues/11991 "Bug 11991") (Documentation): Incorrect URL for API examples in the documentation +* Bug [11993](https://dev.icinga.org/issues/11993 "Bug 11993") (DB IDO): Comment/Downtime delete queries are slow +* Bug [12003](https://dev.icinga.org/issues/12003 "Bug 12003") (libbase): Hang in TlsStream::Handshake +* Bug [12008](https://dev.icinga.org/issues/12008 "Bug 12008") (Documentation): Add a note about creating Zone/Endpoint objects with the API +* Bug [12016](https://dev.icinga.org/issues/12016 "Bug 12016") (Configuration): ConfigWriter::EmitScope incorrectly quotes dictionary keys +* Bug [12022](https://dev.icinga.org/issues/12022 "Bug 12022") (Configuration): Icinga crashes when using include_recursive in an object definition +* Bug [12029](https://dev.icinga.org/issues/12029 "Bug 12029") (Documentation): Migration docs still show unsupported CHANGE_*MODATTR external commands +* Bug [12044](https://dev.icinga.org/issues/12044 "Bug 12044") (Packages): Icinga fails to build with OpenSSL 1.1.0 +* Bug [12046](https://dev.icinga.org/issues/12046 "Bug 12046") (Documentation): Typo in Manubulon CheckCommand documentation +* Bug [12067](https://dev.icinga.org/issues/12067 "Bug 12067") (Documentation): Documentation: Setting up Plugins section is broken +* Bug [12077](https://dev.icinga.org/issues/12077 "Bug 12077") (Documentation): Add a note to the docs that API POST updates to custom attributes/groups won't trigger re-evaluation +* Bug [12085](https://dev.icinga.org/issues/12085 "Bug 12085") (DB IDO): deadlock in ido reconnect +* Bug [12092](https://dev.icinga.org/issues/12092 "Bug 12092") (API): Icinga incorrectly disconnects all endpoints if one has a wrong certificate +* Bug [12098](https://dev.icinga.org/issues/12098 "Bug 12098") (Configuration): include_recursive should gracefully handle inaccessible files +* Bug [12099](https://dev.icinga.org/issues/12099 "Bug 12099") (Packages): Build fails with Visual Studio 2013 +* Bug [12100](https://dev.icinga.org/issues/12100 "Bug 12100") (libbase): Ensure to clear the SSL error queue before calling SSL_{read,write,do_handshake} +* Bug [12107](https://dev.icinga.org/issues/12107 "Bug 12107") (DB IDO): Add missing index on state history for DB IDO cleanup +* Bug [12135](https://dev.icinga.org/issues/12135 "Bug 12135") (ITL): ITL: check_iftraffic64.pl default values, wrong postfix value in CheckCommand +* Bug [12144](https://dev.icinga.org/issues/12144 "Bug 12144") (Documentation): pkg-config is not listed as a build requirement in INSTALL.md +* Bug [12147](https://dev.icinga.org/issues/12147 "Bug 12147") (DB IDO): IDO module starts threads before daemonize +* Bug [12179](https://dev.icinga.org/issues/12179 "Bug 12179") (Cluster): Duplicate messages for command_endpoint w/ master and satellite +* Bug [12180](https://dev.icinga.org/issues/12180 "Bug 12180") (Cluster): CheckerComponent sometimes fails to schedule checks in time +* Bug [12193](https://dev.icinga.org/issues/12193 "Bug 12193") (Cluster): Increase cluster reconnect interval +* Bug [12199](https://dev.icinga.org/issues/12199 "Bug 12199") (API): Fix URL encoding for '&' +* Bug [12204](https://dev.icinga.org/issues/12204 "Bug 12204") (Documentation): Improve author information about check_yum +* Bug [12210](https://dev.icinga.org/issues/12210 "Bug 12210") (DB IDO): Do not clear {host,service,contact}group_members tables on restart +* Bug [12216](https://dev.icinga.org/issues/12216 "Bug 12216") (libicinga): icinga check reports "-1" for minimum latency and execution time and only uptime has a number but 0 +* Bug [12217](https://dev.icinga.org/issues/12217 "Bug 12217") (Documentation): Incorrect documentation about apply rules in zones.d directories +* Bug [12219](https://dev.icinga.org/issues/12219 "Bug 12219") (Documentation): Missing explanation for three level clusters with CSR auto-signing +* Bug [12225](https://dev.icinga.org/issues/12225 "Bug 12225") (libicinga): Icinga stats min_execution_time and max_execution_time are invalid +* Bug [12227](https://dev.icinga.org/issues/12227 "Bug 12227") (Perfdata): Incorrect escaping / formatting of perfdata to InfluxDB +* Bug [12237](https://dev.icinga.org/issues/12237 "Bug 12237") (Installation): Increase default systemd timeout +* Bug [12257](https://dev.icinga.org/issues/12257 "Bug 12257") (Notifications): Notification interval mistimed +* Bug [12259](https://dev.icinga.org/issues/12259 "Bug 12259") (Documentation): Incorrect API permission name for /v1/status in the documentation +* Bug [12267](https://dev.icinga.org/issues/12267 "Bug 12267") (Notifications): Multiple notifications when master fails +* Bug [12274](https://dev.icinga.org/issues/12274 "Bug 12274") (ITL): -q option for check_ntp_time is wrong +* Bug [12288](https://dev.icinga.org/issues/12288 "Bug 12288") (DB IDO): Change the way outdated comments/downtimes are deleted on restart +* Bug [12293](https://dev.icinga.org/issues/12293 "Bug 12293") (Notifications): Missing notification for recovery during downtime +* Bug [12302](https://dev.icinga.org/issues/12302 "Bug 12302") (Cluster): Remove obsolete README files in tools/syntax +* Bug [12310](https://dev.icinga.org/issues/12310 "Bug 12310") (Notifications): Notification sent too fast when one master fails +* Bug [12318](https://dev.icinga.org/issues/12318 "Bug 12318") (Configuration): Icinga doesn't delete temporary icinga2.debug file when config validation fails +* Bug [12331](https://dev.icinga.org/issues/12331 "Bug 12331") (libbase): Fix building Icinga with -fvisibility=hidden +* Bug [12333](https://dev.icinga.org/issues/12333 "Bug 12333") (Notifications): Incorrect downtime notification events +* Bug [12334](https://dev.icinga.org/issues/12334 "Bug 12334") (libbase): Handle I/O errors while writing the Icinga state file more gracefully +* Bug [12390](https://dev.icinga.org/issues/12390 "Bug 12390") (libbase): Disallow casting "" to an Object +* Bug [12391](https://dev.icinga.org/issues/12391 "Bug 12391") (libbase): Don't violate POSIX by ensuring that the argument to usleep(3) is less than 1000000 +* Bug [12395](https://dev.icinga.org/issues/12395 "Bug 12395") (libicinga): Flexible downtimes should be removed after trigger_time+duration +* Bug [12401](https://dev.icinga.org/issues/12401 "Bug 12401") (DB IDO): Fixed downtime start does not update actual_start_time +* Bug [12402](https://dev.icinga.org/issues/12402 "Bug 12402") (Notifications): Notification resent, even if interval = 0 +* Bug [12404](https://dev.icinga.org/issues/12404 "Bug 12404") (Notifications): Add log message if notifications are forced (i.e. filters are not checked) +* Bug [12409](https://dev.icinga.org/issues/12409 "Bug 12409") (Configuration): 'use' keyword cannot be used with templates +* Bug [12416](https://dev.icinga.org/issues/12416 "Bug 12416") (Documentation): The description for the http_certificate attribute doesn't have the right default value +* Bug [12417](https://dev.icinga.org/issues/12417 "Bug 12417") (DB IDO): IDO does duplicate config updates +* Bug [12418](https://dev.icinga.org/issues/12418 "Bug 12418") (DB IDO): IDO marks objects as inactive on shutdown +* Bug [12422](https://dev.icinga.org/issues/12422 "Bug 12422") (CLI): pki sign-csr does not log where it is writing the certificate file +* Bug [12425](https://dev.icinga.org/issues/12425 "Bug 12425") (libicinga): CompatUtility::GetCheckableNotificationStateFilter is returning an incorrect value +* Bug [12428](https://dev.icinga.org/issues/12428 "Bug 12428") (DB IDO): Fix the "ido" check command for use with command_endpoint +* Bug [12430](https://dev.icinga.org/issues/12430 "Bug 12430") (DB IDO): ido CheckCommand returns returns "Could not connect to database server" when HA enabled +* Bug [12432](https://dev.icinga.org/issues/12432 "Bug 12432") (Cluster): Only allow sending command_endpoint checks to directly connected child zones +* Bug [12438](https://dev.icinga.org/issues/12438 "Bug 12438") (libbase): Replace GetType()->GetName() calls with GetReflectionType()->GetName() +* Bug [12442](https://dev.icinga.org/issues/12442 "Bug 12442") (Documentation): Missing documentation for "legacy-timeperiod" template +* Bug [12452](https://dev.icinga.org/issues/12452 "Bug 12452") (Installation): Remove unused functions from icinga-installer +* Bug [12453](https://dev.icinga.org/issues/12453 "Bug 12453") (libbase): Use hash-based serial numbers for new certificates +* Bug [12454](https://dev.icinga.org/issues/12454 "Bug 12454") (API): API: action schedule-downtime requires a duration also when fixed is true +* Bug [12458](https://dev.icinga.org/issues/12458 "Bug 12458") (DB IDO): Insert fails for the icinga_scheduleddowntime table due to duplicate key +* Bug [12459](https://dev.icinga.org/issues/12459 "Bug 12459") (DB IDO): Query for customvariablestatus incorrectly updates the host's/service's insert ID +* Bug [12460](https://dev.icinga.org/issues/12460 "Bug 12460") (Cluster): DB IDO started before daemonizing (no systemd) +* Bug [12461](https://dev.icinga.org/issues/12461 "Bug 12461") (DB IDO): IDO query fails due to key contraint violation for the icinga_customvariablestatus table +* Bug [12464](https://dev.icinga.org/issues/12464 "Bug 12464") (API): API: events for DowntimeTriggered does not provide needed information +* Bug [12473](https://dev.icinga.org/issues/12473 "Bug 12473") (Documentation): Docs: API example uses wrong attribute name +* Bug [12474](https://dev.icinga.org/issues/12474 "Bug 12474") (libmethods): ClrCheck is null on *nix +* Bug [12475](https://dev.icinga.org/issues/12475 "Bug 12475") (Cluster): Incorrect certificate validation error message +* Bug [12487](https://dev.icinga.org/issues/12487 "Bug 12487") (Configuration): Memory leak when using closures +* Bug [12488](https://dev.icinga.org/issues/12488 "Bug 12488") (Documentation): Typo in Notification object documentation diff --git a/vim/bundle/icinga2/doc/10-icinga-template-library.md b/vim/bundle/icinga2/doc/10-icinga-template-library.md new file mode 100644 index 0000000..8768595 --- /dev/null +++ b/vim/bundle/icinga2/doc/10-icinga-template-library.md @@ -0,0 +1,4691 @@ +# Icinga Template Library + +The Icinga Template Library (ITL) implements standard templates and object +definitions for commonly used services. + +By default the ITL is included in the `icinga2.conf` configuration file: + + include + +## Generic Templates + +These templates are imported by the provided example configuration. + +> **Note**: +> +> These templates are built into the binaries. By convention +> all command and timeperiod objects should import these templates. + +### plugin-check-command + +Command template for check plugins executed by Icinga 2. + +The `plugin-check-command` command does not support any vars. + +By default this template is automatically imported into all CheckCommand definitions. + +### plugin-notification-command + +Command template for notification scripts executed by Icinga 2. + +The `plugin-notification-command` command does not support any vars. + +By default this template is automatically imported into all CheckCommand definitions. + +### plugin-event-command + +Command template for event handler scripts executed by Icinga 2. + +The `plugin-event-command` command does not support any vars. + +By default this template is automatically imported into all CheckCommand definitions. + +### legacy-timeperiod + +Timeperiod template for [Timeperiod objects](9-object-types.md#objecttype-timeperiod). + +The `legacy-timeperiod` timeperiod does not support any vars. + +By default this template is automatically imported into all CheckCommand definitions. + +## Check Commands + +These check commands are embedded into Icinga 2 and do not require any external +plugin scripts. + +### icinga + +Check command for the built-in `icinga` check. This check returns performance +data for the current Icinga instance. + +The `icinga` check command does not support any vars. + +### cluster + +Check command for the built-in `cluster` check. This check returns performance +data for the current Icinga instance and connected endpoints. + +The `cluster` check command does not support any vars. + +### cluster-zone + +Check command for the built-in `cluster-zone` check. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------|--------------- +cluster_zone | **Required.** The zone name. +cluster_lag_warning | **Optional.** Warning threshold for log lag in seconds. Applies if the log lag is greater than the threshold. +cluster_lag_critical | **Optional.** Critical threshold for log lag in seconds. Applies if the log lag is greater than the threshold. + +### ido + +Check command for the built-in `ido` check. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-------------|--------------- +ido_type | **Required.** The type of the IDO connection object. Can be either "IdoMysqlConnection" or "IdoPgsqlConnection". +ido_name | **Required.** The name of the IDO connection object. + +### random + +Check command for the built-in `random` check. This check returns random states +and adds the check source to the check output. + +For test and demo purposes only. The `random` check command does not support +any vars. + +### exception + +Check command for the built-in `exception` check. This check throws an exception. + +For test and demo purposes only. The `exception` check command does not support +any vars. + +# Plugin Check Commands + +## Plugin Check Commands for Monitoring Plugins + +The Plugin Check Commands provides example configuration for plugin check commands +provided by the [Monitoring Plugins](https://www.monitoring-plugins.org) project. + +By default the Plugin Check Commands are included in the `icinga2.conf` configuration +file: + + include + +The plugin check commands assume that there's a global constant named `PluginDir` +which contains the path of the plugins from the Monitoring Plugins project. + +**Note**: If there are command parameters missing for the provided CheckCommand +definitions please kindly send a patch upstream. This should include an update +for the ITL CheckCommand itself and this documentation section. + +### apt + +The plugin [apt](https://www.monitoring-plugins.org/doc/index.html) checks for software updates on systems that use +package management systems based on the apt-get(8) command found in Debian based systems. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +apt_extra_opts | **Optional.** Read options from an ini file. +apt_upgrade | **Optional.** [Default] Perform an upgrade. If an optional OPTS argument is provided, apt-get will be run with these command line options instead of the default. +apt_dist_upgrade | **Optional.** Perform a dist-upgrade instead of normal upgrade. Like with -U OPTS can be provided to override the default options. +apt_include | **Optional.** Include only packages matching REGEXP. Can be specified multiple times the values will be combined together. +apt_exclude | **Optional.** Exclude packages matching REGEXP from the list of packages that would otherwise be included. Can be specified multiple times. +apt_critical | **Optional.** If the full package information of any of the upgradable packages match this REGEXP, the plugin will return CRITICAL status. Can be specified multiple times. +apt_timeout | **Optional.** Seconds before plugin times out (default: 10). + + +### breeze + +The [check_breeze](https://www.monitoring-plugins.org/doc/man/check_breeze.html) plugin reports the signal +strength of a Breezecom wireless equipment. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-----------------|--------------------------------- +breeze_hostname | **Required.** Name or IP address of host to check. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +breeze_community | **Optional.** SNMPv1 community. Defaults to "public". +breeze_warning | **Required.** Percentage strength below which a WARNING status will result. Defaults to 50. +breeze_critical | **Required.** Percentage strength below which a WARNING status will result. Defaults to 20. + + +### by_ssh + +The [check_by_ssh](https://www.monitoring-plugins.org/doc/man/check_by_ssh.html) plugin uses SSH to execute +commands on a remote host. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +by_ssh_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +by_ssh_port | **Optional.** The SSH port. Defaults to 22. +by_ssh_command | **Required.** The command that should be executed. Can be an array if multiple arguments should be passed to `check_by_ssh`. +by_ssh_arguments| **Optional.** A dictionary with arguments for the command. This works exactly like the 'arguments' dictionary for ordinary CheckCommands. +by_ssh_logname | **Optional.** The SSH username. +by_ssh_identity | **Optional.** The SSH identity. +by_ssh_quiet | **Optional.** Whether to suppress SSH warnings. Defaults to false. +by_ssh_warn | **Optional.** The warning threshold. +by_ssh_crit | **Optional.** The critical threshold. +by_ssh_timeout | **Optional.** The timeout in seconds. +by_ssh_options | **Optional.** Call ssh with '-o OPTION' (multiple options may be specified as an array). +by_ssh_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +by_ssh_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### clamd + +The [check_clamd](https://www.monitoring-plugins.org/doc/man/check_clamd.html) plugin tests CLAMD +connections with the specified host (or unix socket). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-------------------|-------------- +clamd_address | **Required.** The host's address or unix socket (must be an absolute path). +clamd_port | **Optional.** Port number (default: none). +clamd_expect | **Optional.** String to expect in server response. Multiple strings must be defined as array. +clamd_all | **Optional.** All expect strings need to occur in server response. Defaults to false. +clamd_escape_send | **Optional.** Enable usage of \\n, \\r, \\t or \\\\ in send string. +clamd_send | **Optional.** String to send to the server. +clamd_escape_quit | **Optional.** Enable usage of \\n, \\r, \\t or \\\\ in quit string. +clamd_quit | **Optional.** String to send server to initiate a clean close of the connection. +clamd_refuse | **Optional.** Accept TCP refusals with states ok, warn, crit. Defaults to crit. +clamd_mismatch | **Optional.** Accept expected string mismatches with states ok, warn, crit. Defaults to warn. +clamd_jail | **Optional.** Hide output from TCP socket. +clamd_maxbytes | **Optional.** Close connection once more than this number of bytes are received. +clamd_delay | **Optional.** Seconds to wait between sending string and polling for response. +clamd_certificate | **Optional.** Minimum number of days a certificate has to be valid. 1st value is number of days for warning, 2nd is critical (if not specified: 0) -- separated by comma. +clamd_ssl | **Optional.** Use SSL for the connection. Defaults to false. +clamd_wtime | **Optional.** Response time to result in warning status (seconds). +clamd_ctime | **Optional.** Response time to result in critical status (seconds). +clamd_timeout | **Optional.** Seconds before connection times out. Defaults to 10. +clamd_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +clamd_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### dhcp + +The [check_dhcp](https://www.monitoring-plugins.org/doc/man/check_dhcp.html) plugin +tests the availability of DHCP servers on a network. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +dhcp_serverip | **Optional.** The IP address of the DHCP server which we should get a response from. +dhcp_requestedip| **Optional.** The IP address which we should be offered by a DHCP server. +dhcp_timeout | **Optional.** The timeout in seconds. +dhcp_interface | **Optional.** The interface to use. +dhcp_mac | **Optional.** The MAC address to use in the DHCP request. +dhcp_unicast | **Optional.** Whether to use unicast requests. Defaults to false. + + +### dig + +The [check_dig](https://www.monitoring-plugins.org/doc/man/check_dig.html) plugin +test the DNS service on the specified host using dig. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------|-------------- +dig_server | **Optional.** The DNS server to query. Defaults to "127.0.0.1". +dig_port | **Optional.** Port number (default: 53). +dig_lookup | **Required.** The address that should be looked up. +dig_record_type | **Optional.** Record type to lookup (default: A). +dig_expected_address | **Optional.** An address expected to be in the answer section. If not set, uses whatever was in -l. +dig_arguments | **Optional.** Pass STRING as argument(s) to dig. +dig_retries | **Optional.** Number of retries passed to dig, timeout is divided by this value (Default: 3). +dig_warning | **Optional.** Response time to result in warning status (seconds). +dig_critical | **Optional.** Response time to result in critical status (seconds). +dig_timeout | **Optional.** Seconds before connection times out (default: 10). +dig_ipv4 | **Optional.** Force dig to only use IPv4 query transport. Defaults to false. +dig_ipv6 | **Optional.** Force dig to only use IPv6 query transport. Defaults to false. + + +### disk + +The [check_disk](https://www.monitoring-plugins.org/doc/man/check_disk.html) plugin +checks the amount of used disk space on a mounted file system and generates an alert +if free space is less than one of the threshold values. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------|------------------------ +disk\_wfree | **Optional.** The free space warning threshold. Defaults to "20%". If the percent sign is omitted, units from `disk_units` are used. +disk\_cfree | **Optional.** The free space critical threshold. Defaults to "10%". If the percent sign is omitted, units from `disk_units` are used. +disk\_inode\_wfree | **Optional.** The free inode warning threshold. +disk\_inode\_cfree | **Optional.** The free inode critical threshold. +disk\_partition | **Optional.** The partition. **Deprecated in 2.3.** +disk\_partition\_excluded | **Optional.** The excluded partition. **Deprecated in 2.3.** +disk\_partitions | **Optional.** The partition(s). Multiple partitions must be defined as array. +disk\_partitions\_excluded | **Optional.** The excluded partition(s). Multiple partitions must be defined as array. +disk\_clear | **Optional.** Clear thresholds. +disk\_exact\_match | **Optional.** For paths or partitions specified with -p, only check for exact paths. +disk\_errors\_only | **Optional.** Display only devices/mountpoints with errors. May be true or false. +disk\_ignore\_reserved | **Optional.** If set, account root-reserved blocks are not accounted for freespace in perfdata. +disk\_group | **Optional.** Group paths. Thresholds apply to (free-)space of all partitions together. +disk\_kilobytes | **Optional.** Same as --units kB. May be true or false. +disk\_local | **Optional.** Only check local filesystems. May be true or false. +disk\_stat\_remote\_fs | **Optional.** Only check local filesystems against thresholds. Yet call stat on remote filesystems to test if they are accessible (e.g. to detect Stale NFS Handles). May be true or false. +disk\_mountpoint | **Optional.** Display the mountpoint instead of the partition. May be true or false. +disk\_megabytes | **Optional.** Same as --units MB. May be true or false. +disk\_all | **Optional.** Explicitly select all paths. This is equivalent to -R '.\*'. May be true or false. +disk\_eregi\_path | **Optional.** Case insensitive regular expression for path/partition. Multiple regular expression strings must be defined as array. +disk\_ereg\_path | **Optional.** Regular expression for path or partition. Multiple regular expression strings must be defined as array. +disk\_ignore\_eregi\_path | **Optional.** Regular expression to ignore selected path/partition (case insensitive). Multiple regular expression strings must be defined as array. +disk\_ignore\_ereg\_path | **Optional.** Regular expression to ignore selected path or partition. Multiple regular expression strings must be defined as array. +disk\_timeout | **Optional.** Seconds before connection times out (default: 10). +disk\_units | **Optional.** Choose bytes, kB, MB, GB, TB (default: MB). +disk\_exclude\_type | **Optional.** Ignore all filesystems of indicated type. Multiple regular expression strings must be defined as array. + +### disk_smb + +The [check_disk_smb](https://www.monitoring-plugins.org/doc/man/check_disk_smb.html) plugin +uses the `smbclient` binary to check SMB shares. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|------------------------ +disk_smb_hostname | **Required.** NetBIOS name of the server. +disk_smb_share | **Required.** Share name being queried. +disk_smb_workgroup | **Optional.** Workgroup or Domain used (defaults to 'WORKGROUP' if omitted). +disk_smb_address | **Optional.** IP address of the host (only necessary if host belongs to another network). +disk_smb_username | **Optional.** Username for server log-in (defaults to 'guest' if omitted). +disk_smb_password | **Optional.** Password for server log-in (defaults to an empty password if omitted). +disk_smb_wused | **Optional.** The used space warning threshold. Defaults to "85%". If the percent sign is omitted, use optional disk units. +disk_smb_cused | **Optional.** The used space critical threshold. Defaults to "95%". If the percent sign is omitted, use optional disk units. +disk_smb_port | **Optional.** Connection port, e.g. `139` or `445`. Defaults to `smbclient` default if omitted. + +### dns + +The [check_dns](https://www.monitoring-plugins.org/doc/man/check_dns.html) plugin +uses the nslookup program to obtain the IP address for the given host/domain query. +An optional DNS server to use may be specified. If no DNS server is specified, the +default server(s) specified in `/etc/resolv.conf` will be used. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------|-------------- +dns_lookup | **Optional.** The hostname or IP to query the DNS for. Defaults to "$host_name$". +dns_server | **Optional.** The DNS server to query. Defaults to the server configured in the OS. +dns_expected_answer | **Optional.** The answer to look for. A hostname must end with a dot. **Deprecated in 2.3.** +dns_expected_answers | **Optional.** The answer(s) to look for. A hostname must end with a dot. Multiple answers must be defined as array. +dns_authoritative | **Optional.** Expect the server to send an authoritative answer. +dns_wtime | **Optional.** Return warning if elapsed time exceeds value. +dns_ctime | **Optional.** Return critical if elapsed time exceeds value. +dns_timeout | **Optional.** Seconds before connection times out. Defaults to 10. + + +### dummy + +The [check_dummy](https://www.monitoring-plugins.org/doc/man/check_dummy.html) plugin +will simply return the state corresponding to the numeric value of the `dummy_state` +argument with optional text. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +dummy_state | **Optional.** The state. Can be one of 0 (ok), 1 (warning), 2 (critical) and 3 (unknown). Defaults to 0. +dummy_text | **Optional.** Plugin output. Defaults to "Check was successful.". + + +### file_age + +The [check_file_age](https://www.monitoring-plugins.org/doc/man/check_file_age.html) plugin +checks a file's size and modification time to make sure it's not empty and that it's sufficiently recent. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-----------------------|-------------------------------------------------------------------------------------------------------- +file_age_file | **Required.** File to monitor. +file_age_warning_time | **Optional.** File must be no more than this many seconds old as warning threshold. Defaults to "240s". +file_age_critical_time | **Optional.** File must be no more than this many seconds old as critical threshold. Defaults to "600s". +file_age_warning_size | **Optional.** File must be at least this many bytes long as warning threshold. No default given. +file_age_critical_size | **Optional.** File must be at least this many bytes long as critical threshold. Defaults to "0B". +file_age_ignoremissing | **Optional.** Return OK if the file does not exist. Defaults to false. + + +### flexlm + +The [check_flexlm](https://www.monitoring-plugins.org/doc/man/check_flexlm.html) plugin +checks available flexlm license managers. Requires the `lmstat` command. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-------------------|---------------------------------------------------------- +flexlm_licensefile | **Required.** Name of license file (usually license.dat). +flexlm_timeout | **Optional.** Plugin time out in seconds. Defaults to 15. + + +### fping4 + +The [check_fping](https://www.monitoring-plugins.org/doc/man/check_fping.html) plugin +will use the `fping` command to ping the specified host for a fast check. Note that it is +necessary to set the suid flag on fping. + +This CheckCommand expects an IPv4 address. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +fping_address | **Optional.** The host's IPv4 address. Defaults to "$address$". +fping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 100. +fping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 5. +fping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 200. +fping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15. +fping_number | **Optional.** The number of packets to send. Defaults to 5. +fping_interval | **Optional.** The interval between packets in milli-seconds. Defaults to 500. +fping_bytes | **Optional.** The size of ICMP packet. +fping_target_timeout | **Optional.** The target timeout in milli-seconds. +fping_source_ip | **Optional.** The name or ip address of the source ip. +fping_source_interface | **Optional.** The source interface name. + + +### fping6 + +The [check_fping](https://www.monitoring-plugins.org/doc/man/check_fping.html) plugin +will use the `fping` command to ping the specified host for a fast check. Note that it is +necessary to set the suid flag on fping. + +This CheckCommand expects an IPv6 address. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +fping_address | **Optional.** The host's IPv6 address. Defaults to "$address6$". +fping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 100. +fping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 5. +fping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 200. +fping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15. +fping_number | **Optional.** The number of packets to send. Defaults to 5. +fping_interval | **Optional.** The interval between packets in milli-seconds. Defaults to 500. +fping_bytes | **Optional.** The size of ICMP packet. +fping_target_timeout | **Optional.** The target timeout in milli-seconds. +fping_source_ip | **Optional.** The name or ip address of the source ip. +fping_source_interface | **Optional.** The source interface name. + + +### ftp + +The [check_ftp](https://www.monitoring-plugins.org/doc/man/check_ftp.html) plugin +tests FTP connections with the specified host (or unix socket). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-------------------|-------------- +ftp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ftp_port | **Optional.** The FTP port number. +ftp_expect | **Optional.** String to expect in server response. Multiple strings must be defined as array. +ftp_all | **Optional.** All expect strings need to occur in server response. Defaults to false. +ftp_escape_send | **Optional.** Enable usage of \\n, \\r, \\t or \\\\ in send string. +ftp_send | **Optional.** String to send to the server. +ftp_escape_quit | **Optional.** Enable usage of \\n, \\r, \\t or \\\\ in quit string. +ftp_quit | **Optional.** String to send server to initiate a clean close of the connection. +ftp_refuse | **Optional.** Accept TCP refusals with states ok, warn, crit. Defaults to crit. +ftp_mismatch | **Optional.** Accept expected string mismatches with states ok, warn, crit. Defaults to warn. +ftp_jail | **Optional.** Hide output from TCP socket. +ftp_maxbytes | **Optional.** Close connection once more than this number of bytes are received. +ftp_delay | **Optional.** Seconds to wait between sending string and polling for response. +ftp_certificate | **Optional.** Minimum number of days a certificate has to be valid. 1st value is number of days for warning, 2nd is critical (if not specified: 0) -- separated by comma. +ftp_ssl | **Optional.** Use SSL for the connection. Defaults to false. +ftp_wtime | **Optional.** Response time to result in warning status (seconds). +ftp_ctime | **Optional.** Response time to result in critical status (seconds). +ftp_timeout | **Optional.** Seconds before connection times out. Defaults to 10. +ftp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +ftp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### game + +The [check_game](https://www.monitoring-plugins.org/doc/man/check_game.html) plugin +tests game server connections with the specified host. +This plugin uses the 'qstat' command, the popular game server status query tool. +If you don't have the package installed, you will need to [download](http://www.activesw.com/people/steve/qstat.html) +or install the package `quakestat` before you can use this plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-------------------|------------------- +game_game | **Required.** Name of the game. +game_ipaddress | **Required.** Ipaddress of the game server to query. +game_timeout | **Optional.** Seconds before connection times out. Defaults to 10. +game_port | **Optional.** Port to connect to. +game_gamefield | **Optional.** Field number in raw qstat output that contains game name. +game_mapfield | **Optional.** Field number in raw qstat output that contains map name. +game_pingfield | **Optional.** Field number in raw qstat output that contains ping time. +game_gametime | **Optional.** Field number in raw qstat output that contains game time. +game_hostname | **Optional.** Name of the host running the game. + + +### hostalive + +Check command object for the [check_ping](https://www.monitoring-plugins.org/doc/man/check_ping.html) +plugin with host check default values. This variant uses the host's `address` attribute +if available and falls back to using the `address6` attribute if the `address` attribute is not set. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ping_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 3000. +ping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 80. +ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 5000. +ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 100. +ping_packets | **Optional.** The number of packets to send. Defaults to 5. +ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout). + + +### hostalive4 + +Check command object for the [check_ping](https://www.monitoring-plugins.org/doc/man/check_ping.html) +plugin with host check default values. This variant uses the host's `address` attribute. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ping_address | **Optional.** The host's IPv4 address. Defaults to "$address$". +ping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 3000. +ping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 80. +ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 5000. +ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 100. +ping_packets | **Optional.** The number of packets to send. Defaults to 5. +ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout). + + +### hostalive6 + +Check command object for the [check_ping](https://www.monitoring-plugins.org/doc/man/check_ping.html) +plugin with host check default values. This variant uses the host's `address6` attribute. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ping_address | **Optional.** The host's IPv6 address. Defaults to "$address6$". +ping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 3000. +ping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 80. +ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 5000. +ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 100. +ping_packets | **Optional.** The number of packets to send. Defaults to 5. +ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout). + + +### hpjd + +The [check_hpjd](https://www.monitoring-plugins.org/doc/man/check_hpjd.html) plugin +tests the state of an HP printer with a JetDirect card. Net-snmp must be installed +on the computer running the plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +hpjd_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +hpjd_port | **Optional.** The host's SNMP port. Defaults to 161. +hpjd_community | **Optional.** The SNMP community. Defaults to "public". + + +### http + +The [check_http](https://www.monitoring-plugins.org/doc/man/check_http.html) plugin +tests the HTTP service on the specified host. It can test normal (http) and secure +(https) servers, follow redirects, search for strings and regular expressions, +check connection times, and report on certificate expiration times. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------------------|--------------------------------- +http_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +http_vhost | **Optional.** The virtual host that should be sent in the "Host" header. +http_uri | **Optional.** The request URI for GET or POST. Defaults to `/`. +http_port | **Optional.** The TCP port. Defaults to 80 when not using SSL, 443 otherwise. +http_ssl | **Optional.** Whether to use SSL. Defaults to false. +http_ssl_force_tlsv1 | **Optional.** Whether to force TLSv1. +http_ssl_force_tlsv1_1 | **Optional.** Whether to force TLSv1.1. +http_ssl_force_tlsv1_2 | **Optional.** Whether to force TLSv1.2. +http_ssl_force_sslv2 | **Optional.** Whether to force SSLv2. +http_ssl_force_sslv3 | **Optional.** Whether to force SSLv3. +http_ssl_force_tlsv1_or_higher | **Optional.** Whether to force TLSv1 or higher. +http_ssl_force_tlsv1_1_or_higher | **Optional.** Whether to force TLSv1.1 or higher. +http_ssl_force_tlsv1_2_or_higher | **Optional.** Whether to force TLSv1.2 or higher. +http_ssl_force_sslv2_or_higher | **Optional.** Whether to force SSLv2 or higher. +http_ssl_force_sslv3_or_higher | **Optional.** Whether to force SSLv3 or higher. +http_sni | **Optional.** Whether to use SNI. Defaults to false. +http_auth_pair | **Optional.** Add 'username:password' authorization pair. +http_proxy_auth_pair | **Optional.** Add 'username:password' authorization pair for proxy. +http_ignore_body | **Optional.** Don't download the body, just the headers. +http_linespan | **Optional.** Allow regex to span newline. +http_expect_body_regex | **Optional.** A regular expression which the body must match against. Incompatible with http_ignore_body. +http_expect_body_eregi | **Optional.** A case-insensitive expression which the body must match against. Incompatible with http_ignore_body. +http_invertregex | **Optional.** Changes behaviour of http_expect_body_regex and http_expect_body_eregi to return CRITICAL if found, OK if not. +http_warn_time | **Optional.** The warning threshold. +http_critical_time | **Optional.** The critical threshold. +http_expect | **Optional.** Comma-delimited list of strings, at least one of them is expected in the first (status) line of the server response. Default: HTTP/1. +http_certificate | **Optional.** Minimum number of days a certificate has to be valid. This parameter explicitely sets the port to 443 and ignores the URL if passed. +http_clientcert | **Optional.** Name of file contains the client certificate (PEM format). +http_privatekey | **Optional.** Name of file contains the private key (PEM format). +http_headerstring | **Optional.** String to expect in the response headers. +http_string | **Optional.** String to expect in the content. +http_post | **Optional.** URL encoded http POST data. +http_method | **Optional.** Set http method (for example: HEAD, OPTIONS, TRACE, PUT, DELETE). +http_maxage | **Optional.** Warn if document is more than seconds old. +http_contenttype | **Optional.** Specify Content-Type header when POSTing. +http_useragent | **Optional.** String to be sent in http header as User Agent. +http_header | **Optional.** Any other tags to be sent in http header. +http_extendedperfdata | **Optional.** Print additional perfdata. Defaults to false. +http_onredirect | **Optional.** How to handle redirect pages. Possible values: "ok" (default), "warning", "critical", "follow", "sticky" (like follow but stick to address), "stickyport" (like sticky but also to port) +http_pagesize | **Optional.** Minimum page size required:Maximum page size required. +http_timeout | **Optional.** Seconds before connection times out. +http_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +http_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### icmp + +The [check_icmp](https://www.monitoring-plugins.org/doc/man/check_icmp.html) plugin +check_icmp allows for checking multiple hosts at once compared to `check_ping`. +The main difference is that check_ping executes the system's ping(1) command and +parses its output while check_icmp talks ICMP itself. check_icmp must be installed +setuid root. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +icmp_address | **Optional.** The host's address. This can either be a single address or an array of addresses. Defaults to "$address$". +icmp_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 100. +icmp_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 5. +icmp_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 200. +icmp_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15. +icmp_source | **Optional.** The source IP address to send packets from. +icmp_packets | **Optional.** The number of packets to send. Defaults to 5. +icmp_packet_interval | **Optional** The maximum packet interval. Defaults to 80 (milliseconds). +icmp_target_interval | **Optional.** The maximum target interval. +icmp_hosts_alive | **Optional.** The number of hosts which have to be alive for the check to succeed. +icmp_data_bytes | **Optional.** Payload size for each ICMP request. Defaults to 8. +icmp_timeout | **Optional.** The plugin timeout in seconds. Defaults to 10 (seconds). + + +### imap + +The [check_imap](https://www.monitoring-plugins.org/doc/man/check_imap.html) plugin +tests IMAP connections with the specified host (or unix socket). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------------|-------------- +imap_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +imap_port | **Optional.** The port that should be checked. Defaults to 143. +imap_escape | **Optional.** Can use \\n, \\r, \\t or \\ in send or quit string. Must come before send or quit option. Default: nothing added to send, \\r\\n added to end of quit. +imap_send | **Optional.** String to send to the server. +imap_expect | **Optional.** String to expect in server response. Multiple strings must be defined as array. +imap_all | **Optional.** All expect strings need to occur in server response. Default is any. +imap_quit | **Optional.** String to send server to initiate a clean close of the connection. +imap_refuse | **Optional.** Accept TCP refusals with states ok, warn, crit (default: crit). +imap_mismatch | **Optional.** Accept expected string mismatches with states ok, warn, crit (default: warn). +imap_jail | **Optional.** Hide output from TCP socket. +imap_maxbytes | **Optional.** Close connection once more than this number of bytes are received. +imap_delay | **Optional.** Seconds to wait between sending string and polling for response. +imap_certificate_age | **Optional.** Minimum number of days a certificate has to be valid. +imap_ssl | **Optional.** Use SSL for the connection. +imap_warning | **Optional.** Response time to result in warning status (seconds). +imap_critical | **Optional.** Response time to result in critical status (seconds). +imap_timeout | **Optional.** Seconds before connection times out (default: 10). +imap_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +imap_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### ldap + +The [check_ldap](https://www.monitoring-plugins.org/doc/man/check_ldap.html) plugin +can be used to check LDAP servers. + +The plugin can also be used for monitoring ldaps connections instead of the deprecated `check_ldaps`. +This can be ensured by enabling `ldap_starttls` or `ldap_ssl`. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ldap_address | **Optional.** Host name, IP Address, or unix socket (must be an absolute path). Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ldap_port | **Optional.** Port number. Defaults to 389. +ldap_attr | **Optional.** LDAP attribute to search for (default: "(objectclass=*)" +ldap_base | **Required.** LDAP base (eg. ou=myunit,o=myorg,c=at). +ldap_bind | **Optional.** LDAP bind DN (if required). +ldap_pass | **Optional.** LDAP password (if required). +ldap_starttls | **Optional.** Use STARTSSL mechanism introduced in protocol version 3. +ldap_ssl | **Optional.** Use LDAPS (LDAP v2 SSL method). This also sets the default port to 636. +ldap_v2 | **Optional.** Use LDAP protocol version 2 (enabled by default). +ldap_v3 | **Optional.** Use LDAP protocol version 3 (disabled by default) +ldap_warning | **Optional.** Response time to result in warning status (seconds). +ldap_critical | **Optional.** Response time to result in critical status (seconds). +ldap_timeout | **Optional.** Seconds before connection times out (default: 10). +ldap_verbose | **Optional.** Show details for command-line debugging (disabled by default) + +### load + +The [check_load](https://www.monitoring-plugins.org/doc/man/check_load.html) plugin +tests the current system load average. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +load_wload1 | **Optional.** The 1-minute warning threshold. Defaults to 5. +load_wload5 | **Optional.** The 5-minute warning threshold. Defaults to 4. +load_wload15 | **Optional.** The 15-minute warning threshold. Defaults to 3. +load_cload1 | **Optional.** The 1-minute critical threshold. Defaults to 10. +load_cload5 | **Optional.** The 5-minute critical threshold. Defaults to 6. +load_cload15 | **Optional.** The 15-minute critical threshold. Defaults to 4. +load_percpu | **Optional.** Divide the load averages by the number of CPUs (when possible). Defaults to false. + +### mailq + +The [check_mailq](https://www.monitoring-plugins.org/doc/man/check_mailq.html) plugin +checks the number of messages in the mail queue (supports multiple sendmail queues, qmail). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +mailq_warning | **Required.** Min. number of messages in queue to generate warning. +mailq_critical | **Required.** Min. number of messages in queue to generate critical alert ( w < c ). +mailq_domain_warning | **Optional.** Min. number of messages for same domain in queue to generate warning +mailq_domain_critical | **Optional.** Min. number of messages for same domain in queue to generate critical alert ( W < C ). +mailq_timeout | **Optional.** Plugin timeout in seconds (default = 15). +mailq_servertype | **Optional.** [ sendmail \| qmail \| postfix \| exim \| nullmailer ] (default = autodetect). + +### mysql + +The [check_mysql](https://www.monitoring-plugins.org/doc/man/check_mysql.html) plugin +tests connections to a MySQL server. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|--------------------------------------------------------------- +mysql_hostname | **Optional.** Host name, IP Address, or unix socket (must be an absolute path). +mysql_port | **Optional.** Port number (default: 3306). +mysql_ignore_auth | **Optional.** Ignore authentication failure and check for mysql connectivity only. +mysql_database | **Optional.** Check database with indicated name. +mysql_file | **Optional.** Read from the specified client options file. +mysql_group | **Optional.** Use a client options group. +mysql_username | **Optional.** Connect using the indicated username. +mysql_password | **Optional.** Use the indicated password to authenticate the connection. +mysql_check_slave | **Optional.** Check if the slave thread is running properly. +mysql_warning | **Optional.** Exit with WARNING status if slave server is more than INTEGER seconds behind master. +mysql_critical | **Optional.** Exit with CRITICAL status if slave server is more then INTEGER seconds behind master. +mysql_ssl | **Optional.** Use ssl encryptation. +mysql_cacert | **Optional.** Path to CA signing the cert. +mysql_cert | **Optional.** Path to SSL certificate. +mysql_key | **Optional.** Path to private SSL key. +mysql_cadir | **Optional.** Path to CA directory. +mysql_ciphers | **Optional.** List of valid SSL ciphers. + + +### mysql_query + +The [check_mysql_query](https://www.monitoring-plugins.org/doc/man/check_mysql_query.html) plugin +checks a query result against threshold levels. +The result from the query should be numeric. For extra security, create a user with minimal access. + +**Note**: You must specify `mysql_query_password` with an empty string to force an empty password, +overriding any my.cnf settings. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|--------------------------------------------------------------- +mysql_query_hostname | **Optional.** Host name, IP Address, or unix socket (must be an absolute path). +mysql_query_port | **Optional.** Port number (default: 3306). +mysql_query_database | **Optional.** Check database with indicated name. +mysql_query_file | **Optional.** Read from the specified client options file. +mysql_query_group | **Optional.** Use a client options group. +mysql_query_username | **Optional.** Connect using the indicated username. +mysql_query_password | **Optional.** Use the indicated password to authenticate the connection. +mysql_query_execute | **Required.** SQL Query to run on the MySQL Server. +mysql_query_warning | **Optional.** Exit with WARNING status if query is outside of the range (format: start:end). +mysql_query_critical | **Optional.** Exit with CRITICAL status if query is outside of the range. + + +### negate + +The [negate](https://www.monitoring-plugins.org/doc/man/negate.html) plugin +negates the status of a plugin (returns OK for CRITICAL and vice-versa). +Additional switches can be used to control which state becomes what. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|--------------------------------------------------------------- +negate_timeout | **Optional.** Seconds before plugin times out (default: 11). +negate_timeout_result | **Optional.** Custom result on Negate timeouts, default to UNKNOWN. +negate_ok | **Optional.** OK, WARNING, CRITICAL or UNKNOWN. +negate_warning | Numeric values are accepted. +negate_critical | If nothing is specified, permutes OK and CRITICAL. +negate_substitute | **Optional.** Substitute output text as well. Will only substitute text in CAPITALS. +negate_command | **Required.** Command to be negated. +negate_arguments | **Optional.** Arguments for the negated command. + +### nrpe + +The `check_nrpe` plugin can be used to query an [NRPE](http://docs.icinga.org/latest/en/nrpe.html) +server or [NSClient++](https://www.nsclient.org). **Note**: This plugin +is considered insecure/deprecated. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +nrpe_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +nrpe_port | **Optional.** The NRPE port. Defaults to 5666. +nrpe_command | **Optional.** The command that should be executed. +nrpe_no_ssl | **Optional.** Whether to disable SSL or not. Defaults to `false`. +nrpe_timeout_unknown | **Optional.** Whether to set timeouts to unknown instead of critical state. Defaults to `false`. +nrpe_timeout | **Optional.** The timeout in seconds. +nrpe_arguments | **Optional.** Arguments that should be passed to the command. Multiple arguments must be defined as array. +nrpe_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +nrpe_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### nscp + +The [check_nt](https://www.monitoring-plugins.org/doc/man/check_nt.html) plugin +collects data from the [NSClient++](https://www.nsclient.org) service. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +nscp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +nscp_port | **Optional.** The NSClient++ port. Defaults to 12489. +nscp_password | **Optional.** The NSClient++ password. +nscp_variable | **Required.** The variable that should be checked. +nscp_params | **Optional.** Parameters for the query. Multiple parameters must be defined as array. +nscp_warn | **Optional.** The warning threshold. +nscp_crit | **Optional.** The critical threshold. +nscp_timeout | **Optional.** The query timeout in seconds. +nscp_showall | **Optional.** Use with SERVICESTATE to see working services or PROCSTATE for running processes. Defaults to false. + + +### ntp_time + +The [check_ntp_time](https://www.monitoring-plugins.org/doc/man/check_ntp_time.html) plugin +checks the clock offset between the local host and a remote NTP server. + +**Note**: If you want to monitor an NTP server, please use `ntp_peer`. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ntp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ntp_port | **Optional.** Port number (default: 123). +ntp_quiet | **Optional.** Returns UNKNOWN instead of CRITICAL if offset cannot be found. +ntp_warning | **Optional.** Offset to result in warning status (seconds). +ntp_critical | **Optional.** Offset to result in critical status (seconds). +ntp_timeoffset | **Optional.** Expected offset of the ntp server relative to local server (seconds). +ntp_timeout | **Optional.** Seconds before connection times out (default: 10). +ntp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +ntp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### ntp_peer + +The [check_ntp_peer](https://www.monitoring-plugins.org/doc/man/check_ntp_peer.html) plugin +checks the health of an NTP server. It supports checking the offset with the sync peer, the +jitter and stratum. This plugin will not check the clock offset between the local host and NTP + server; please use `ntp_time` for that purpose. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ntp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ntp_port | **Optional.** The port to use. Default to 123. +ntp_warning | **Optional.** Offset to result in warning status (seconds). +ntp_critical | **Optional.** Offset to result in critical status (seconds). +ntp_wstratum | **Optional.** Warning threshold for stratum of server's synchronization peer. +ntp_cstratum | **Optional.** Critical threshold for stratum of server's synchronization peer. +ntp_wjitter | **Optional.** Warning threshold for jitter. +ntp_cjitter | **Optional.** Critical threshold for jitter. +ntp_wsource | **Optional.** Warning threshold for number of usable time sources. +ntp_csource | **Optional.** Critical threshold for number of usable time sources. +ntp_timeout | **Optional.** Seconds before connection times out (default: 10). +ntp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +ntp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### passive + +Specialised check command object for passive checks executing the `check_dummy` plugin with appropriate default values. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +dummy_state | **Optional.** The state. Can be one of 0 (ok), 1 (warning), 2 (critical) and 3 (unknown). Defaults to 3. +dummy_text | **Optional.** Plugin output. Defaults to "No Passive Check Result Received.". + +### pgsql + +The [check_pgsql](https://www.monitoring-plugins.org/doc/man/check_pgsql.html) plugin +tests a PostgreSQL DBMS to determine whether it is active and accepting queries. +If a query is specified using the `pgsql_query` attribute, it will be executed after +connecting to the server. The result from the query has to be numeric in order +to compare it against the query thresholds if set. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|--------------------------------------------------------------- +pgsql_hostname | **Optional.** Host name, IP Address, or unix socket (must be an absolute path). +pgsql_port | **Optional.** Port number (default: 5432). +pgsql_database | **Optional.** Database to check (default: template1). +pgsql_username | **Optional.** Login name of user. +pgsql_password | **Optional.** Password (BIG SECURITY ISSUE). +pgsql_options | **Optional.** Connection parameters (keyword = value), see below. +pgsql_warning | **Optional.** Response time to result in warning status (seconds). +pgsql_critical | **Optional.** Response time to result in critical status (seconds). +pgsql_timeout | **Optional.** Seconds before connection times out (default: 10). +pgsql_query | **Optional.** SQL query to run. Only first column in first row will be read. +pgsql_query_warning | **Optional.** SQL query value to result in warning status (double). +pgsql_query_critical | **Optional.** SQL query value to result in critical status (double). + +### ping + +The [check_ping](https://www.monitoring-plugins.org/doc/man/check_ping.html) plugin +uses the ping command to probe the specified host for packet loss (percentage) and +round trip average (milliseconds). + +This command uses the host's `address` attribute if available and falls back to using +the `address6` attribute if the `address` attribute is not set. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ping_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 100. +ping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 5. +ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 200. +ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15. +ping_packets | **Optional.** The number of packets to send. Defaults to 5. +ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout). + + +### ping4 + +The [check_ping](https://www.monitoring-plugins.org/doc/man/check_ping.html) plugin +uses the ping command to probe the specified host for packet loss (percentage) and +round trip average (milliseconds). + +This command uses the host's `address` attribute if not explicitely specified using +the `ping_address` attribute. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ping_address | **Optional.** The host's IPv4 address. Defaults to "$address$". +ping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 100. +ping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 5. +ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 200. +ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15. +ping_packets | **Optional.** The number of packets to send. Defaults to 5. +ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout). + +### ping6 + +The [check_ping](https://www.monitoring-plugins.org/doc/man/check_ping.html) plugin +uses the ping command to probe the specified host for packet loss (percentage) and +round trip average (milliseconds). + +This command uses the host's `address6` attribute if not explicitely specified using +the `ping_address` attribute. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ping_address | **Optional.** The host's IPv6 address. Defaults to "$address6$". +ping_wrta | **Optional.** The RTA warning threshold in milliseconds. Defaults to 100. +ping_wpl | **Optional.** The packet loss warning threshold in %. Defaults to 5. +ping_crta | **Optional.** The RTA critical threshold in milliseconds. Defaults to 200. +ping_cpl | **Optional.** The packet loss critical threshold in %. Defaults to 15. +ping_packets | **Optional.** The number of packets to send. Defaults to 5. +ping_timeout | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout). + + +### pop + +The [check_pop](https://www.monitoring-plugins.org/doc/man/check_pop.html) plugin +tests POP connections with the specified host (or unix socket). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------|-------------- +pop_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +pop_port | **Optional.** The port that should be checked. Defaults to 110. +pop_escape | **Optional.** Can use \\n, \\r, \\t or \\ in send or quit string. Must come before send or quit option. Default: nothing added to send, \\r\\n added to end of quit. +pop_send | **Optional.** String to send to the server. +pop_expect | **Optional.** String to expect in server response. Multiple strings must be defined as array. +pop_all | **Optional.** All expect strings need to occur in server response. Default is any. +pop_quit | **Optional.** String to send server to initiate a clean close of the connection. +pop_refuse | **Optional.** Accept TCP refusals with states ok, warn, crit (default: crit). +pop_mismatch | **Optional.** Accept expected string mismatches with states ok, warn, crit (default: warn). +pop_jail | **Optional.** Hide output from TCP socket. +pop_maxbytes | **Optional.** Close connection once more than this number of bytes are received. +pop_delay | **Optional.** Seconds to wait between sending string and polling for response. +pop_certificate_age | **Optional.** Minimum number of days a certificate has to be valid. +pop_ssl | **Optional.** Use SSL for the connection. +pop_warning | **Optional.** Response time to result in warning status (seconds). +pop_critical | **Optional.** Response time to result in critical status (seconds). +pop_timeout | **Optional.** Seconds before connection times out (default: 10). +pop_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +pop_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### procs + +The [check_procs](https://www.monitoring-plugins.org/doc/man/check_procs.html) plugin +checks all processes and generates WARNING or CRITICAL states if the specified +metric is outside the required threshold ranges. The metric defaults to number +of processes. Search filters can be applied to limit the processes to check. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------|-------------- +procs_warning | **Optional.** The process count warning threshold. Defaults to 250. +procs_critical | **Optional.** The process count critical threshold. Defaults to 400. +procs_metric | **Optional.** Check thresholds against metric. +procs_timeout | **Optional.** Seconds before plugin times out. +procs_traditional | **Optional.** Filter own process the traditional way by PID instead of /proc/pid/exe. Defaults to false. +procs_state | **Optional.** Only scan for processes that have one or more of the status flags you specify. +procs_ppid | **Optional.** Only scan for children of the parent process ID indicated. +procs_vsz | **Optional.** Only scan for processes with VSZ higher than indicated. +procs_rss | **Optional.** Only scan for processes with RSS higher than indicated. +procs_pcpu | **Optional.** Only scan for processes with PCPU higher than indicated. +procs_user | **Optional.** Only scan for processes with user name or ID indicated. +procs_argument | **Optional.** Only scan for processes with args that contain STRING. +procs_argument_regex | **Optional.** Only scan for processes with args that contain the regex STRING. +procs_command | **Optional.** Only scan for exact matches of COMMAND (without path). +procs_nokthreads | **Optional.** Only scan for non kernel threads. Defaults to false. + + +### simap + +The [check_simap](https://www.monitoring-plugins.org/doc/man/check_simap.html) plugin +tests SIMAP connections with the specified host (or unix socket). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-----------------------|-------------- +simap_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +simap_port | **Optional.** The port that should be checked. Defaults to 993. +simap_escape | **Optional.** Can use \\n, \\r, \\t or \\ in send or quit string. Must come before send or quit option. Default: nothing added to send, \\r\\n added to end of quit. +simap_send | **Optional.** String to send to the server. +simap_expect | **Optional.** String to expect in server response. Multiple strings must be defined as array. +simap_all | **Optional.** All expect strings need to occur in server response. Default is any. +simap_quit | **Optional.** String to send server to initiate a clean close of the connection. +simap_refuse | **Optional.** Accept TCP refusals with states ok, warn, crit (default: crit). +simap_mismatch | **Optional.** Accept expected string mismatches with states ok, warn, crit (default: warn). +simap_jail | **Optional.** Hide output from TCP socket. +simap_maxbytes | **Optional.** Close connection once more than this number of bytes are received. +simap_delay | **Optional.** Seconds to wait between sending string and polling for response. +simap_certificate_age | **Optional.** Minimum number of days a certificate has to be valid. +simap_ssl | **Optional.** Use SSL for the connection. +simap_warning | **Optional.** Response time to result in warning status (seconds). +simap_critical | **Optional.** Response time to result in critical status (seconds). +simap_timeout | **Optional.** Seconds before connection times out (default: 10). +simap_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +simap_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + +### smart + +The [check_ide_smart](https://www.monitoring-plugins.org/doc/man/check_ide_smart.html) plugin +checks a local hard drive with the (Linux specific) SMART interface. Requires installation of `smartctl`. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +smart_device | **Required.** The name of a local hard drive to monitor. + + +### smtp + +The [check_smtp](https://www.monitoring-plugins.org/doc/man/check_smtp.html) plugin +will attempt to open an SMTP connection with the host. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------------|-------------- +smtp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +smtp_port | **Optional.** The port that should be checked. Defaults to 25. +smtp_mail_from | **Optional.** Test a MAIL FROM command with the given email address. +smtp_expect | **Optional.** String to expect in first line of server response (default: '220'). +smtp_command | **Optional.** SMTP command (may be used repeatedly). +smtp_response | **Optional.** Expected response to command (may be used repeatedly). +smtp_helo_fqdn | **Optional.** FQDN used for HELO +smtp_certificate_age | **Optional.** Minimum number of days a certificate has to be valid. +smtp_starttls | **Optional.** Use STARTTLS for the connection. +smtp_authtype | **Optional.** SMTP AUTH type to check (default none, only LOGIN supported). +smtp_authuser | **Optional.** SMTP AUTH username. +smtp_authpass | **Optional.** SMTP AUTH password. +smtp_ignore_quit | **Optional.** Ignore failure when sending QUIT command to server. +smtp_warning | **Optional.** Response time to result in warning status (seconds). +smtp_critical | **Optional.** Response time to result in critical status (seconds). +smtp_timeout | **Optional.** Seconds before connection times out (default: 10). +smtp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +smtp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### snmp + +The [check_snmp](https://www.monitoring-plugins.org/doc/man/check_snmp.html) plugin +checks the status of remote machines and obtains system information via SNMP. + +**Note**: This plugin uses the `snmpget` command included with the NET-SNMP package. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +snmp_oid | **Required.** The SNMP OID. +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port. Defaults to "161". +snmp_retries | **Optional.** Number of retries to be used in the SNMP requests. +snmp_warn | **Optional.** The warning threshold. +snmp_crit | **Optional.** The critical threshold. +snmp_string | **Optional.** Return OK state if the string matches exactly with the output value +snmp_ereg | **Optional.** Return OK state if extended regular expression REGEX matches with the output value +snmp_eregi | **Optional.** Return OK state if case-insensitive extended REGEX matches with the output value +snmp_label | **Optional.** Prefix label for output value +snmp_invert_search | **Optional.** Invert search result and return CRITICAL state if found +snmp_units | **Optional.** Units label(s) for output value (e.g., 'sec.'). +snmp_version | **Optional.** Version to use. E.g. 1, 2, 2c or 3. +snmp_miblist | **Optional.** MIB's to use, comma separated. Defaults to "ALL". +snmp_rate_multiplier | **Optional.** Converts rate per second. For example, set to 60 to convert to per minute. +snmp_rate | **Optional.** Boolean. Enable rate calculation. +snmp_getnext | **Optional.** Boolean. Use SNMP GETNEXT. Defaults to false. +snmp_timeout | **Optional.** The command timeout in seconds. Defaults to 10 seconds. + +### snmpv3 + +Check command object for the [check_snmp](https://www.monitoring-plugins.org/doc/man/check_snmp.html) +plugin, using SNMPv3 authentication and encryption options. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------|-------------- +snmpv3_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +snmpv3_getnext | **Optional.** Use SNMP GETNEXT instead of SNMP GET. +snmpv3_seclevel | **Optional.** The security level. Defaults to authPriv. +snmpv3_auth_alg | **Optional.** The authentication algorithm. Defaults to SHA. +snmpv3_user | **Required.** The username to log in with. +snmpv3_auth_key | **Required,** The authentication key. Required if `snmpv3_seclevel` is set to `authPriv` otherwise optional. +snmpv3_priv_key | **Required.** The encryption key. +snmpv3_oid | **Required.** The SNMP OID. +snmpv3_priv_alg | **Optional.** The encryption algorithm. Defaults to AES. +snmpv3_warn | **Optional.** The warning threshold. +snmpv3_crit | **Optional.** The critical threshold. +snmpv3_string | **Optional.** Return OK state (for that OID) if STRING is an exact match. +snmpv3_ereg | **Optional.** Return OK state (for that OID) if extended regular expression REGEX matches. +snmpv3_eregi | **Optional.** Return OK state (for that OID) if case-insensitive extended REGEX matches. +snmpv3_invert_search | **Optional.** Invert search result and return CRITICAL if found +snmpv3_label | **Optional.** Prefix label for output value. +snmpv3_units | **Optional.** Units label(s) for output value (e.g., 'sec.'). +snmpv3_rate_multiplier | **Optional.** Converts rate per second. For example, set to 60 to convert to per minute. +snmpv3_rate | **Optional.** Boolean. Enable rate calculation. +snmpv3_timeout | **Optional.** The command timeout in seconds. Defaults to 10 seconds. + +### snmp-uptime + +Check command object for the [check_snmp](https://www.monitoring-plugins.org/doc/man/check_snmp.html) +plugin, using the uptime OID by default. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +snmp_oid | **Optional.** The SNMP OID. Defaults to "1.3.6.1.2.1.1.3.0". +snmp_community | **Optional.** The SNMP community. Defaults to "public". + + +### spop + +The [check_spop](https://www.monitoring-plugins.org/doc/man/check_spop.html) plugin +tests SPOP connections with the specified host (or unix socket). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------------|-------------- +spop_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +spop_port | **Optional.** The port that should be checked. Defaults to 995. +spop_escape | **Optional.** Can use \\n, \\r, \\t or \\ in send or quit string. Must come before send or quit option. Default: nothing added to send, \\r\\n added to end of quit. +spop_send | **Optional.** String to send to the server. +spop_expect | **Optional.** String to expect in server response. Multiple strings must be defined as array. +spop_all | **Optional.** All expect strings need to occur in server response. Default is any. +spop_quit | **Optional.** String to send server to initiate a clean close of the connection. +spop_refuse | **Optional.** Accept TCP refusals with states ok, warn, crit (default: crit). +spop_mismatch | **Optional.** Accept expected string mismatches with states ok, warn, crit (default: warn). +spop_jail | **Optional.** Hide output from TCP socket. +spop_maxbytes | **Optional.** Close connection once more than this number of bytes are received. +spop_delay | **Optional.** Seconds to wait between sending string and polling for response. +spop_certificate_age | **Optional.** Minimum number of days a certificate has to be valid. +spop_ssl | **Optional.** Use SSL for the connection. +spop_warning | **Optional.** Response time to result in warning status (seconds). +spop_critical | **Optional.** Response time to result in critical status (seconds). +spop_timeout | **Optional.** Seconds before connection times out (default: 10). +spop_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +spop_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### ssh + +The [check_ssh](https://www.monitoring-plugins.org/doc/man/check_ssh.html) plugin +connects to an SSH server at a specified host and port. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ssh_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ssh_port | **Optional.** The port that should be checked. Defaults to 22. +ssh_timeout | **Optional.** Seconds before connection times out. Defaults to 10. +ssh_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +ssh_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### ssl + +Check command object for the [check_tcp](https://www.monitoring-plugins.org/doc/man/check_tcp.html) plugin, +using ssl-related options. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------------|-------------- +ssl_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ssl_port | **Required.** The port that should be checked. +ssl_timeout | **Optional.** Timeout in seconds for the connect and handshake. The plugin default is 10 seconds. +ssl_cert_valid_days_warn | **Optional.** Warning threshold for days before the certificate will expire. When used, ssl_cert_valid_days_critical must also be set. +ssl_cert_valid_days_critical | **Optional.** Critical threshold for days before the certificate will expire. When used, ssl_cert_valid_days_warn must also be set. + + +### ssmtp + +The [check_ssmtp](https://www.monitoring-plugins.org/doc/man/check_ssmtp.html) plugin +tests SSMTP connections with the specified host (or unix socket). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-----------------------|-------------- +ssmtp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ssmtp_port | **Optional.** The port that should be checked. Defaults to 465. +ssmtp_escape | **Optional.** Can use \\n, \\r, \\t or \\ in send or quit string. Must come before send or quit option. Default: nothing added to send, \\r\\n added to end of quit. +ssmtp_send | **Optional.** String to send to the server. +ssmtp_expect | **Optional.** String to expect in server response. Multiple strings must be defined as array. +ssmtp_all | **Optional.** All expect strings need to occur in server response. Default is any. +ssmtp_quit | **Optional.** String to send server to initiate a clean close of the connection. +ssmtp_refuse | **Optional.** Accept TCP refusals with states ok, warn, crit (default: crit). +ssmtp_mismatch | **Optional.** Accept expected string mismatches with states ok, warn, crit (default: warn). +ssmtp_jail | **Optional.** Hide output from TCP socket. +ssmtp_maxbytes | **Optional.** Close connection once more than this number of bytes are received. +ssmtp_delay | **Optional.** Seconds to wait between sending string and polling for response. +ssmtp_certificate_age | **Optional.** Minimum number of days a certificate has to be valid. +ssmtp_ssl | **Optional.** Use SSL for the connection. +ssmtp_warning | **Optional.** Response time to result in warning status (seconds). +ssmtp_critical | **Optional.** Response time to result in critical status (seconds). +ssmtp_timeout | **Optional.** Seconds before connection times out (default: 10). +ssmtp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +ssmtp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### swap + +The [check_swap](https://www.monitoring-plugins.org/doc/man/check_swap.html) plugin +checks the swap space on a local machine. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +swap_wfree | **Optional.** The free swap space warning threshold in % (enable `swap_integer` for number values). Defaults to `50%`. +swap_cfree | **Optional.** The free swap space critical threshold in % (enable `swap_integer` for number values). Defaults to `25%`. +swap_integer | **Optional.** Specifies whether the thresholds are passed as number or percent value. Defaults to false (percent values). +swap_allswaps | **Optional.** Conduct comparisons for all swap partitions, one by one. Defaults to false. +swap_noswap | **Optional.** Resulting state when there is no swap regardless of thresholds. Possible values are "ok", "warning", "critical", "unknown". Defaults to "critical". + + +### tcp + +The [check_tcp](https://www.monitoring-plugins.org/doc/man/check_tcp.html) plugin +tests TCP connections with the specified host (or unix socket). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +tcp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +tcp_port | **Required.** The port that should be checked. +tcp_expect | **Optional.** String to expect in server response. Multiple strings must be defined as array. +tcp_all | **Optional.** All expect strings need to occur in server response. Defaults to false. +tcp_escape_send | **Optional.** Enable usage of \\n, \\r, \\t or \\\\ in send string. +tcp_send | **Optional.** String to send to the server. +tcp_escape_quit | **Optional.** Enable usage of \\n, \\r, \\t or \\\\ in quit string. +tcp_quit | **Optional.** String to send server to initiate a clean close of the connection. +tcp_refuse | **Optional.** Accept TCP refusals with states ok, warn, crit. Defaults to crit. +tcp_mismatch | **Optional.** Accept expected string mismatches with states ok, warn, crit. Defaults to warn. +tcp_jail | **Optional.** Hide output from TCP socket. +tcp_maxbytes | **Optional.** Close connection once more than this number of bytes are received. +tcp_delay | **Optional.** Seconds to wait between sending string and polling for response. +tcp_certificate | **Optional.** Minimum number of days a certificate has to be valid. 1st value is number of days for warning, 2nd is critical (if not specified: 0) -- separated by comma. +tcp_ssl | **Optional.** Use SSL for the connection. Defaults to false. +tcp_wtime | **Optional.** Response time to result in warning status (seconds). +tcp_ctime | **Optional.** Response time to result in critical status (seconds). +tcp_timeout | **Optional.** Seconds before connection times out. Defaults to 10. +tcp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +tcp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### udp + +The [check_udp](https://www.monitoring-plugins.org/doc/man/check_udp.html) plugin +tests UDP connections with the specified host (or unix socket). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +udp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +udp_port | **Required.** The port that should be checked. +udp_send | **Required.** The payload to send in the UDP datagram. +udp_expect | **Required.** The payload to expect in the response datagram. +udp_quit | **Optional.** The payload to send to 'close' the session. +udp_ipv4 | **Optional.** Use IPv4 connection. Defaults to false. +udp_ipv6 | **Optional.** Use IPv6 connection. Defaults to false. + + +### ups + +The [check_ups](https://www.monitoring-plugins.org/doc/man/check_ups.html) plugin +tests the UPS service on the specified host. [Network UPS Tools](http://www.networkupstools.org) + must be running for this plugin to work. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +ups_address | **Required.** The address of the host running upsd. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +ups_name | **Required.** The UPS name. Defaults to `ups`. +ups_port | **Optional.** The port to which to connect. Defaults to 3493. +ups_variable | **Optional.** The variable to monitor. Must be one of LINE, TEMP, BATTPCT or LOADPCT. If this is not set, the check only relies on the value of `ups.status`. +ups_warning | **Optional.** The warning threshold for the selected variable. +ups_critical | **Optional.** The critical threshold for the selected variable. +ups_celsius | **Optional.** Display the temperature in degrees Celsius instead of Fahrenheit. Defaults to `false`. +ups_timeout | **Optional.** The number of seconds before the connection times out. Defaults to 10. + + +### users + +The [check_users](https://www.monitoring-plugins.org/doc/man/check_users.html) plugin +checks the number of users currently logged in on the local system and generates an +error if the number exceeds the thresholds specified. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +users_wgreater | **Optional.** The user count warning threshold. Defaults to 20. +users_cgreater | **Optional.** The user count critical threshold. Defaults to 50. + +## Windows Plugins for Icinga 2 + +To allow a basic monitoring of Windows clients Icinga 2 comes with a set of Windows only plugins. While trying to mirror the functionalities of their linux cousins from the monitoring-plugins package, the differences between Windows and Linux are too big to be able use the same CheckCommands for both systems. + +A check-commands-windows.conf comes with Icinga 2, it asumes that the Windows Plugins are installed in the PluginDir set in your constants.conf. To enable them the following include directive is needed in you icinga2.conf: + + include + +One of the differences between the Windows plugins and their linux counterparts is that they consistently do not require thresholds to run, functioning like dummies without. + + +### Threshold syntax + +So not specified differently the thresholds for the plugins all follow the same pattern + +Threshold | Meaning +:------------|:---------- +"29" | The threshold is 29. +"!29" | The threshold is 29, but the negative of the result is returned. +"[10-40]" | The threshold is a range from (including) 20 to 40, a value inside means the threshold has been exceeded. +"![10-40]" | Same as above, but the result is inverted. + + +### disk-windows + +Check command object for the `check_disk.exe` plugin. +Aggregates the free disk space of all volumes and mount points it can find, or the ones defined in `disk_win_path`. Ignores removable storage like fash drives and discs (CD, DVD etc.). + +Custom attributes: + +Name | Description +:-------------------|:------------ +disk\_win\_warn | **Optional**. The warning threshold. +disk\_win\_crit | **Optional**. The critical threshold. +disk\_win\_path | **Optional**. Check only these paths, default checks all. +disk\_win\_unit | **Optional**. Use this unit to display disk space, thresholds are interpreted in this unit. Defaults to "mb", possible values are: b, kb, mb, gb and tb. +disk\_win\_exclude | **Optional**. Exclude these drives from check. + +### load-windows + +Check command object for the `check_load.exe` plugin. +This plugin collects the inverse of the performance counter `\Processor(_Total)\% Idle Time` two times, with a wait time of one second between the collection. To change this wait time use [`perfmon-windows`](10-icinga-template-library.md#windows-plugins-load-windows). + +Custom attributes: + +Name | Description +:---------------|:------------ +load\_win\_warn | **Optional**. The warning threshold. +load\_win\_crit | **Optional**. The critical threshold. + + +### memory-windows + +Check command object for the `check_memory.exe` plugin. +The memory collection is instant. + +> **Note** +> +> Percentage based thresholds can be used by adding a '%' to the threshold +> value. Keep in mind that memory\_win\_unit is applied before the +> value is calculated. + +Custom attributes: + +Name | Description +:-----------------|:------------ +memory\_win\_warn | **Optional**. The warning threshold. +memory\_win\_crit | **Optional**. The critical threshold. +memory\_win\_unit | **Optional**. The unit to display the received value in, thresholds are interpreted in this unit. Defaults to "mb" (megabye), possible values are: b, kb, mb, gb and tb. + + +### network-windows + +Check command object for the `check_network.exe` plugin. +Collects the total Bytes inbount and outbound for all interfaces in one second, to itemise interfaces or use a different collection interval use [`perfmon-windows`](10-icinga-template-library.md#windows-plugins-load-windows). + +Custom attributes: + +Name | Description +:------------------|:------------ +network\_win\_warn | **Optional**. The warning threshold. +network\_win\_crit | **Optional**. The critical threshold. + + +### perfmon-windows + +Check command object for the `check_perfmon.exe` plugin. +This plugins allows to collect data from a Performance Counter. After the first data collection a second one is done after `perfmon_win_wait` milliseconds. When you know `perfmon_win_counter` only requires one set of data to provide valid data you can set `perfmon_win_wait` to `0`. + +To recieve a list of possible Performance Counter Objects run `check_perfmon.exe --print-objects` and to view an objects instances and counters run `check_perfmon.exe --print-object-info -P "name of object"` + +Custom attributes: + +Name | Description +:---------------------|:------------ +perfmon\_win\_warn | **Optional**. The warning threshold. +perfmon\_win\_crit | **Optional**. The critical threshold. +perfmon\_win\_counter | **Required**. The Performance Counter to use. Ex. `\Processor(_Total)\% Idle Time`. +perfmon\_win\_wait | **Optional**. Time in milliseconds to wait between data collection (default: 1000). +perfmon\_win\_type | **Optional**. Format in which to expect perfomance values. Possible are: long, int64 and double (default). + + +### ping-windows + +Check command object for the `check_ping.exe` plugin. +ping-windows should automaticly detect whether `ping_win_address` is an IPv4 or IPv6 address. If not, use ping4-windows and ping6-windows. Also note that check\_ping.exe waits at least `ping_win_timeout` milliseconds between the pings. + +Custom attributes: + +Name | Description +:------------------|:------------ +ping\_win\_warn | **Optional**. The warning threshold. RTA and package loss separated by comma. +ping\_win\_crit | **Optional**. The critical threshold. RTA and package loss separated by comma. +ping\_win\_address | **Required**. An IPv4 or IPv6 address +ping\_win\_packets | **Optional**. Number of packages to send. Default: 5. +ping\_win\_timeout | **Optional**. The timeout in milliseconds. Default: 1000 + + +### procs-windows + +Check command object for `check_procs.exe` plugin. +When useing `procs_win_user` this plugins needs adminstratice privileges to access the processes of other users, to just enumerate them no additional privileges are required. + +Custom attributes: + +Name | Description +:----------------|:------------ +procs\_win\_warn | **Optional**. The warning threshold. +procs\_win\_crit | **Optional**. The critical threshold. +procs\_win\_user | **Optional**. Count this useres processes. + + +### service-windows + +Check command object for `check_service.exe` plugin. +This checks thresholds work different since the binary decision whether a service is running or not does not allow for three states. As a default `check_service.exe` will return CRITICAL when `service_win_service` is not running, the `service_win_warn` flag changes this to WARNING. + +Custom attributes: + +Name | Description +:---------------------|:------------ +service\_win\_warn | **Optional**. Warn when service is not running. +service\_win\_service | **Required**. The critical threshold. + + +### swap-windows + +Check command object for `check_swap.exe` plugin. +The data collection is instant. + +Custom attributes: + +Name | Description +:---------------|:------------ +swap\_win\_warn | **Optional**. The warning threshold. +swap\_win\_crit | **Optional**. The critical threshold. +swap\_win\_unit | **Optional**. The unit to display the received value in, thresholds are interpreted in this unit. Defaults to "mb" (megabyte). + + +### update-windows + +Check command object for `check_update.exe` plugin. +Querying Microsoft for Windows updates can take multiple seconds to minutes. An update is treated as important when it has the WSUS flag for SecurityUpdates or CriticalUpdates. + +> **Note** +> +> The Network Services Account which runs Icinga 2 by default does not have the required +> permissions to run this check. + +Custom attributes: + +Name | Description +:-------------------|:------------ +update\_win\_warn | If set, returns warning when important updates are available +update\_win\_crit | If set, return critical when important updates that require a reboot are available. +update\_win\_reboot | Set to treat 'may need update' as 'definitely needs update' + + +### uptime-windows + +Check command opject for `check_uptime.exe` plugin. +Uses GetTickCount64 to get the uptime, so boot time is not included. + +Custom attributes: + +Name | Description +:-----------------|:------------ +uptime\_win\_warn | **Optional**. The warning threshold. +uptime\_win\_crit | **Optional**. The critical threshold. +uptime\_win\_unit | **Optional**. The unit to display the received value in, thresholds are interpreted in this unit. Defaults to "s"(seconds), possible values are ms (milliseconds), s, m (minutes), h (hours). + + +### users-windows + +Check command object for `check_users.exe` plugin. + +Custom attributes: + +Name | Description +:----------------|:------------ +users\_win\_warn | **Optional**. The warning threshold. +users\_win\_crit | **Optional**. The critical threshold. + + +## Plugin Check Commands for NSClient++ + +Icinga 2 can use the `nscp client` command to run arbitrary NSClient++ checks. + +You can enable these check commands by adding the following the include directive in your +[icinga2.conf](4-configuring-icinga-2.md#icinga2-conf) configuration file: + + include + +You can also optionally specify an alternative installation directory for NSClient++ by adding +the NscpPath constant in your [constants.conf](4-configuring-icinga-2.md#constants-conf) configuration +file: + + const NscpPath = "C:\\Program Files (x86)\\NSClient++" + +By default Icinga 2 uses the Microsoft Installer API to determine where NSClient++ is installed. It should +not be necessary to manually set this constant. + +Note that it is not necessary to run NSClient++ as a Windows service for these commands to work. + +### nscp-local + +Check command object for NSClient++ + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------- +nscp_log_level | **Optional.** The log level. Defaults to "critical". +nscp_load_all | **Optional.** Whether to load all modules. Defaults to true. +nscp_boot | **Optional.** Whether to use the --boot option. Defaults to true. +nscp_query | **Required.** The NSClient++ query. Try `nscp client -q x` for a list. +nscp_arguments | **Optional.** An array of query arguments. +nscp_showall | **Optional.** Shows more details in plugin output, default to false. + +### nscp-local-cpu + +Check command object for the `check_cpu` NSClient++ plugin. + +Name | Description +--------------------|------------------ +nscp_cpu_time | **Optional.** Calculate avarage usage for the given time intervals. Value has to be an array, default to [ "1m", "5m", "15m" ]. +nscp_cpu_warning | **Optional.** Threshold for WARNING state in percent, default to 80. +nscp_cpu_critical | **Optional.** Threshold for CRITICAL state in percent, default to 90. +nscp_cpu_arguments | **Optional.** Additional arguments. +nscp_cpu_showall | **Optional.** Shows more details in plugin output, default to false. + +### nscp-local-memory + +Check command object for the `check_memory` NSClient++ plugin. + +Name | Description +----------------------|------------------ +nscp_memory_committed | **Optional.** Check for committed memory, default to false. +nscp_memory_physical | **Optional.** Check for physical memory, default to true. +nscp_memory_free | **Optional.** Switch between checking free (true) or used memory (false), default to false. +nscp_memory_warning | **Optional.** Threshold for WARNING state in percent or absolut (use MB, GB, ...), default to 80 (free=false) or 20 (free=true). +nscp_memory_critical | **Optional.** Threshold for CRITICAL state in percent or absolut (use MB, GB, ...), default to 90 (free=false) or 10 (free=true). +nscp_memory_arguments | **Optional.** Additional arguments. +nscp_memory_showall | **Optional.** Shows more details in plugin output, default to false. + +### nscp-local-os-version + +Check command object for the `check_os_version` NSClient++ plugin. + +This command has the same custom attributes like the `nscp-local` check command. + +### nscp-local-pagefile + +Check command object for the `check_pagefile` NSClient++ plugin. + +This command has the same custom attributes like the `nscp-local` check command. + +### nscp-local-process + +Check command object for the `check_process` NSClient++ plugin. + +This command has the same custom attributes like the `nscp-local` check command. + +### nscp-local-service + +Check command object for the `check_service` NSClient++ plugin. + +Name | Description +-----------------------|------------------ +nscp_service_name | **Required.** Name of service to check. +nscp_service_type | **Optional.** Type to check, default to state. +nscp_service_ok | **Optional.** State for return an OK, i.e. for type=state running, stopped, ... +nscp_service_otype | **Optional.** Dedicate type for nscp_service_ok, default to nscp_service_state. +nscp_service_warning | **Optional.** State for return an WARNING. +nscp_service_wtype | **Optional.** Dedicate type for nscp_service_warning, default to nscp_service_state. +nscp_service_critical | **Optional.** State for return an CRITICAL. +nscp_service_ctype | **Optional.** Dedicate type for nscp_service_critical, default to nscp_service_state. +nscp_service_arguments | **Optional.** Additional arguments. +nscp_service_showall | **Optional.** Shows more details in plugin output, default to true. + +### nscp-local-uptime + +Check command object for the `check_uptime` NSClient++ plugin. + +This command has the same custom attributes like the `nscp-local` check command. + +### nscp-local-version + +Check command object for the `check_version` NSClient++ plugin. + +This command has the same custom attributes like the `nscp-local` check command. + +### nscp-local-disk + +Check command object for the `check_drivesize` NSClient++ plugin. + +Name | Description +-----------------------|------------------ +nscp_disk_drive | **Optional.** Drive character, default to all drives. +nscp_disk_free | **Optional.** Switch between checking free space (free=true) or used space (free=false), default to false. +nscp_disk_warning | **Optional.** Threshold for WARNING in percent or absolut (use MB, GB, ...), default to 80 (used) or 20 percent (free). +nscp_disk_critical | **Optional.** Threshold for CRITICAL in percent or absolut (use MB, GB, ...), default to 90 (used) or 10 percent (free). +nscp_disk_arguments | **Optional.** Additional arguments. +nscp_disk_showall | **Optional.** Shows more details in plugin output, default to true. + +### nscp-local-counter + +Check command object for the `check_pdh` NSClient++ plugin. + +Name | Description +-----------------------|------------------ +nscp_counter_name | **Required.** Performance counter name. +nscp_counter_warning | **Optional.** WARNING Threshold. +nscp_counter_critical | **Optional.** CRITICAL Threshold. +nscp_counter_arguments | **Optional.** Additional arguments. +nscp_counter_showall | **Optional.** Shows more details in plugin output, default to false. +nscp_counter_perfsyntax | **Optional.** Apply performance data label, e.g. `Total Processor Time` to avoid special character problems. Defaults to `nscp_counter_name`. + + + +## Plugin Check Commands for Manubulon SNMP + +The `SNMP Manubulon Plugin Check Commands` provide configuration for plugin check +commands provided by the [SNMP Manubulon project](http://nagios.manubulon.com/index_snmp.html). + +**Note:** Some plugin parameters are only available in Debian packages or in a +[forked repository](https://github.com/dnsmichi/manubulon-snmp) with patches applied. + +The SNMP manubulon plugin check commands assume that the global constant named `ManubulonPluginDir` +is set to the path where the Manubublon SNMP plugins are installed. + +You can enable these plugin check commands by adding the following the include directive in your +[icinga2.conf](4-configuring-icinga-2.md#icinga2-conf) configuration file: + + include + +### Checks by Host Type + +**N/A** : Not available for this type. + +**SNMP** : Available for simple SNMP query. + +**??** : Untested. + +**Specific** : Script name for platform specific checks. + + + Host type | Interface | storage | load/cpu | mem | process | env | specific + ------------------------|------------|----------|-----------|-----|----------|-----|------------------------- + Linux | Yes | Yes | Yes | Yes | Yes | No | + Windows | Yes | Yes | Yes | Yes | Yes | No | check_snmp_win.pl + Cisco router/switch | Yes | N/A | Yes | Yes | N/A | Yes | + HP router/switch | Yes | N/A | Yes | Yes | N/A | No | + Bluecoat proxy | Yes | SNMP | Yes | SNMP| No | Yes | + CheckPoint on SPLAT | Yes | Yes | Yes | Yes | Yes | No | check_snmp_cpfw.pl + CheckPoint on Nokia IP | Yes | Yes | Yes | No | ?? | No | check_snmp_vrrp.pl + Boostedge | Yes | Yes | Yes | Yes | ?? | No | check_snmp_boostedge.pl + AS400 | Yes | Yes | Yes | Yes | No | No | + NetsecureOne Netbox | Yes | Yes | Yes | ?? | Yes | No | + Radware Linkproof | Yes | N/A | SNMP | SNMP| No | No | check_snmp_linkproof_nhr
    check_snmp_vrrp.pl + IronPort | Yes | SNMP | SNMP | SNMP| No | Yes | + Cisco CSS | Yes | ?? | Yes | Yes | No | ?? | check_snmp_css.pl + + +### snmp-load + +Check command object for the [check_snmp_load.pl](http://nagios.manubulon.com/snmp_load.html) plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + + +Name | Description +------------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +snmp_nocrypt | **Optional.** Define SNMP encryption. If set, **snmp_v3** needs to be set. Defaults to false. +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port connection. +snmp_v2 | **Optional.** SNMP version to 2c. Defaults to false. +snmp_v3 | **Optional.** SNMP version to 3. Defaults to false. +snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser". +snmp_password | **Required.** SNMP version 3 password. No value defined as default. +snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to false. +snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des". +snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default. +snmp_warn | **Optional.** The warning threshold. Change the `snmp_load_type` var to "netsl" for using 3 values. +snmp_crit | **Optional.** The critical threshold. Change the `snmp_load_type` var to "netsl" for using 3 values. +snmp_load_type | **Optional.** Load type. Defaults to "stand". Check all available types in the [snmp load](http://nagios.manubulon.com/snmp_load.html) documentation. +snmp_perf | **Optional.** Enable perfdata values. Defaults to true. +snmp_timeout | **Optional.** The command timeout in seconds. Defaults to 5 seconds. + +### snmp-memory + +Check command object for the [check_snmp_mem.pl](http://nagios.manubulon.com/snmp_mem.html) plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +snmp_nocrypt | **Optional.** Define SNMP encryption. If set, **snmp_v3** needs to be set. Defaults to false. +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port connection. +snmp_v2 | **Optional.** SNMP version to 2c. Defaults to false. +snmp_v3 | **Optional.** SNMP version to 3. Defaults to false. +snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser". +snmp_password | **Required.** SNMP version 3 password. No value defined as default. +snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to false. +snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des". +snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default. +snmp_warn | **Optional.** The warning threshold. +snmp_crit | **Optional.** The critical threshold. +snmp_is_cisco | **Optional.** Change OIDs for Cisco switches. Defaults to false. +snmp_is_hp | **Optional.** Change OIDs for HP/Procurve switches. Defaults to false. +snmp_perf | **Optional.** Enable perfdata values. Defaults to true. +snmp_timeout | **Optional.** The command timeout in seconds. Defaults to 5 seconds. + +### snmp-storage + +Check command object for the [check_snmp_storage.pl](http://nagios.manubulon.com/snmp_storage.html) plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +snmp_nocrypt | **Optional.** Define SNMP encryption. If set, **snmp_v3** needs to be set. Defaults to false. +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port connection. +snmp_v2 | **Optional.** SNMP version to 2c. Defaults to false. +snmp_v3 | **Optional.** SNMP version to 3. Defaults to false. +snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser". +snmp_password | **Required.** SNMP version 3 password. No value defined as default. +snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to false. +snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des". +snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default. +snmp_warn | **Optional.** The warning threshold. +snmp_crit | **Optional.** The critical threshold. +snmp_storage_name | **Optional.** Storage name. Default to regex "^/$$". More options available in the [snmp storage](http://nagios.manubulon.com/snmp_storage.html) documentation. +snmp_perf | **Optional.** Enable perfdata values. Defaults to true. +snmp_timeout | **Optional.** The command timeout in seconds. Defaults to 5 seconds. + +### snmp-interface + +Check command object for the [check_snmp_int.pl](http://nagios.manubulon.com/snmp_int.html) plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +snmp_nocrypt | **Optional.** Define SNMP encryption. If set, **snmp_v3** needs to be set. Defaults to false. +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port connection. +snmp_v2 | **Optional.** SNMP version to 2c. Defaults to false. +snmp_v3 | **Optional.** SNMP version to 3. Defaults to false. +snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser". +snmp_password | **Required.** SNMP version 3 password. No value defined as default. +snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to false. +snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des". +snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default. +snmp_warn | **Optional.** The warning threshold. +snmp_crit | **Optional.** The critical threshold. +snmp_interface | **Optional.** Network interface name. Default to regex "eth0". +snmp_interface_perf | **Optional.** Check the input/ouput bandwidth of the interface. Defaults to true. +snmp_interface_label | **Optional.** Add label before speed in output: in=, out=, errors-out=, etc. +snmp_interface_bits_bytes | **Optional.** Output performance data in bits/s or Bytes/s. **Depends** on snmp_interface_kbits set to true. Defaults to true. +snmp_interface_percent | **Optional.** Output performance data in % of max speed. Defaults to false. +snmp_interface_kbits | **Optional.** Make the warning and critical levels in KBits/s. Defaults to true. +snmp_interface_megabytes | **Optional.** Make the warning and critical levels in Mbps or MBps. **Depends** on snmp_interface_kbits set to true. Defaults to true. +snmp_interface_64bit | **Optional.** Use 64 bits counters instead of the standard counters when checking bandwidth & performance data for interface >= 1Gbps. Defaults to false. +snmp_interface_errors | **Optional.** Add error & discard to Perfparse output. Defaults to true. +snmp_interface_noregexp | **Optional.** Do not use regexp to match interface name in description OID. Defaults to false. +snmp_interface_delta | **Optional.** Delta time of perfcheck. Defaults to "300" (5 min). +snmp_interface_warncrit_percent | **Optional.** Make the warning and critical levels in % of reported interface speed. If set, **snmp_interface_megabytes** needs to be set to false. Defaults to false. +snmp_interface_ifname | **Optional.** Switch from IF-MIB::ifDescr to IF-MIB::ifName when looking up the interface's name +snmp_perf | **Optional.** Enable perfdata values. Defaults to true. +snmp_timeout | **Optional.** The command timeout in seconds. Defaults to 5 seconds. + +### snmp-process + +Check command object for the [check_snmp_process.pl](http://nagios.manubulon.com/snmp_process.html) plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +snmp_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +snmp_nocrypt | **Optional.** Define SNMP encryption. If set, **snmp_v3** needs to be set. Defaults to false. +snmp_community | **Optional.** The SNMP community. Defaults to "public". +snmp_port | **Optional.** The SNMP port connection. +snmp_v2 | **Optional.** SNMP version to 2c. Defaults to false. +snmp_v3 | **Optional.** SNMP version to 3. Defaults to false. +snmp_login | **Optional.** SNMP version 3 username. Defaults to "snmpuser". +snmp_password | **Required.** SNMP version 3 password. No value defined as default. +snmp_v3_use_privpass | **Optional.** Define to use SNMP version 3 priv password. Defaults to false. +snmp_authprotocol | **Optional.** SNMP version 3 authentication protocol. Defaults to "md5,des". +snmp_privpass | **Required.** SNMP version 3 priv password. No value defined as default.. +snmp_warn | **Optional.** The warning threshold. +snmp_crit | **Optional.** The critical threshold. +snmp_process_name | **Optional.** Name of the process (regexp). No trailing slash!. Defaults to ".*". +snmp_perf | **Optional.** Enable perfdata values. Defaults to true. +snmp_timeout | **Optional.** The command timeout in seconds. Defaults to 5 seconds. +snmp_process_use_params | **Optional.** Add process parameters to process name for regexp matching. Example: "named.*-t /var/named/chroot" will only select named process with this parameter. Defaults to false. + + + +## Contributed Plugin Check Commands + +The contributed Plugin Check Commands provides various additional command definitions +contributed by community members. + +These check commands assume that the global constant named `PluginContribDir` +is set to the path where the user installs custom plugins and can be enabled by +uncommenting the corresponding line in [icinga2.conf](4-configuring-icinga-2.md#icinga2-conf): + + include + +### Databases + +All database plugins go in this category. + +#### db2_health + +The plugin `db2_health` utilises Perl DBD::DB2. +For release tarballs and detailed documentation especially on the different modes and required permissions see [https://labs.consol.de](https://labs.consol.de/nagios/check_db2_health/). For development check [https://github.com](https://github.com/lausser/check_db2_health). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------------------|------------------------------------------------------------------------------------------------------------------------------ +db2_health_database | **Required.** The name of the database. (If it was catalogued locally, this parameter is the only you need. Otherwise you must specify database, hostname and port) +db2_health_username | **Optional.** The username for the database connection. +db2_health_password | **Optional.** The password for the database connection. +db2_health_port | **Optional.** The port where DB2 is listening. +db2_health_warning | **Optional.** The warning threshold depending on the mode. +db2_health_critical | **Optional.** The critical threshold depending on the mode. +db2_health_mode | **Required.** The mode uses predefined keywords for the different checks. For example "connection-time", "database-usage" or "sql". +db2_health_method | **Optional.** This tells the plugin how to connect to the database. The only method implemented yet is “dbi” which is the default. (It means, the plugin uses the perl module DBD::DB2). +db2_health_name | **Optional.** The tablespace, datafile, wait event, latch, enqueue depending on the mode or SQL statement to be executed with "db2_health_mode" sql. +db2_health_name2 | **Optional.** If "db2_health_name" is a sql statement, "db2_health_name2" can be used to appear in the output and the performance data. +db2_health_regexp | **Optional.** If set to true, "db2_health_name" will be interpreted as a regular expression. Defaults to false. +db2_health_units | **Optional.** This is used for a better output of mode=sql and for specifying thresholds for mode=tablespace-free. Possible values are "%", "KB", "MB" and "GB". +db2_health_maxinactivity | **Optional.** Used for the maximum amount of time a certain event has not happened. +db2_health_mitigation | **Optional.** Classifies the severity of an offline tablespace. +db2_health_lookback | **Optional.** How many days in the past db2_health check should look back to calculate exitcode. +db2_health_env_db2_home | **Required.** Specifies the location of the db2 client libraries as environment variable `DB2_HOME`. Defaults to "/opt/ibm/db2/V10.5". +db2_health_env_db2_version | **Optional.** Specifies the DB2 version as environment variable `DB2_VERSION`. + +#### mssql_health + +The plugin `mssql_health` utilises Perl DBD::Sybase based on FreeTDS to connect to MSSQL databases for monitoring. +For release tarballs, detailed documentation especially on the different modes and scripts for creating a monitoring user see [https://labs.consol.de](https://labs.consol.de/nagios/check_mssql_health/). For development check [https://github.com](https://github.com/lausser/check_mssql_health). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------------------|------------------------------------------------------------------------------------------------------------------------------ +mssql_health_hostname | **Optional.** Specifies the database hostname or address. No default because you typically use "mssql_health_server". +mssql_health_port | **Optional.** Specifies the database port. No default because you typically use "mssql_health_server". +mssql_health_server | **Optional.** The name of a predefined connection (in freetds.conf). +mssql_health_currentdb | **Optional.** The name of a database which is used as the current database for the connection. +mssql_health_username | **Optional.** The username for the database connection. +mssql_health_password | **Optional.** The password for the database connection. +mssql_health_warning | **Optional.** The warning threshold depending on the mode. +mssql_health_critical | **Optional.** The critical threshold depending on the mode. +mssql_health_mode | **Required.** The mode uses predefined keywords for the different checks. For example "connection-time", "database-free" or "sql". +mssql_health_method | **Optional.** How the plugin should connect to the database (dbi for the perl module `DBD::Sybase` (default) and `sqlrelay` for the SQLRelay proxy). +mssql_health_name | **Optional.** Depending on the mode this could be the database name or a SQL statement. +mssql_health_name2 | **Optional.** If "mssql_health_name" is a sql statement, "mssql_health_name2" can be used to appear in the output and the performance data. +mssql_health_regexp | **Optional.** If set to true, "mssql_health_name" will be interpreted as a regular expression. Defaults to false. +mssql_health_units | **Optional.** This is used for a better output of mode=sql and for specifying thresholds for mode=tablespace-free. Possible values are "%", "KB", "MB" and "GB". +mssql_health_offlineok | **Optional.** Set this to true if offline databases are perfectly ok for you. Defaults to false. +mssql_health_commit | **Optional.** Set this to true to turn on autocommit for the dbd::sybase module. Defaults to false. + +#### mysql_health + +The plugin `mysql_health` utilises Perl DBD::MySQL to connect to MySQL databases for monitoring. +For release tarballs and detailed documentation especially on the different modes and required permissions see [https://labs.consol.de](https://labs.consol.de/nagios/check_mysql_health/). For development check [https://github.com](https://github.com/lausser/check_mysql_health). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------------------|------------------------------------------------------------------------------------------------------------------------------ +mysql_health_hostname | **Required.** Specifies the database hostname or address. Defaults to "$address$" or "$address6$" if the `address` attribute is not set. +mysql_health_port | **Optional.** Specifies the database port. Defaults to 3306 (or 1186 for "mysql_health_mode" cluster). +mysql_health_socket | **Optional.** Specifies the database unix socket. No default. +mysql_health_username | **Optional.** The username for the database connection. +mysql_health_password | **Optional.** The password for the database connection. +mysql_health_database | **Optional.** The database to connect to. Defaults to information_schema. +mysql_health_warning | **Optional.** The warning threshold depending on the mode. +mysql_health_critical | **Optional.** The critical threshold depending on the mode. +mysql_health_warningx | **Optional.** The extended warning thresholds depending on the mode. +mysql_health_criticalx | **Optional.** The extended critical thresholds depending on the mode. +mysql_health_mode | **Required.** The mode uses predefined keywords for the different checks. For example "connection-time", "slave-lag" or "sql". +mysql_health_method | **Optional.** How the plugin should connect to the database (`dbi` for using DBD::Mysql (default), `mysql` for using the mysql-Tool). +mysql_health_commit | **Optional.** Turns on autocommit for the dbd::* module. +mysql_health_notemp | **Optional.** Ignore temporary databases/tablespaces. +mysql_health_nooffline | **Optional.** Skip the offline databases. +mysql_health_regexp | **Optional.** Parameter name/name2/name3 will be interpreted as (perl) regular expression. +mysql_health_name | **Optional.** The name of a specific component to check. +mysql_health_name2 | **Optional.** The secondary name of a component. +mysql_health_name3 | **Optional.** The tertiary name of a component. +mysql_health_units | **Optional.** This is used for a better output of mode=sql and for specifying thresholds for mode=tablespace-free. Possible values are "%", "KB", "MB" and "GB". +mysql_health_labelformat | **Optional.** One of those formats pnp4nagios or groundwork. Defaults to pnp4nagios. +mysql_health_extraopts | **Optional.** Read command line arguments from an external file. +mysql_health_blacklist | **Optional.** Blacklist some (missing/failed) components" +mysql_health_mitigation | **Optional.** "The parameter allows you to change a critical error to a warning." +mysql_health_lookback | **Optional.** The amount of time you want to look back when calculating average rates." +mysql_health_environment | **Optional.** Add a variable to the plugin's environment." +mysql_health_morphmessage | **Optional.** Modify the final output message." +mysql_health_morphperfdata | **Optional.** The parameter allows you to change performance data labels." +mysql_health_selectedperfdata | **Optional.** The parameter allows you to limit the list of performance data." +mysql_health_report | **Optional.** Can be used to shorten the output." +mysql_health_multiline | **Optional.** Multiline output." +mysql_health_negate | **Optional.** Emulate the negate plugin. --negate warning=critical --negate unknown=critical." +mysql_health_withmymodulesdyndir | **Optional.** Add-on modules for the my-modes will be searched in this directory." +mysql_health_statefilesdir | **Optional.** An alternate directory where the plugin can save files." +mysql_health_isvalidtime | **Optional.** Signals the plugin to return OK if now is not a valid check time." + +#### oracle_health + +The plugin `oracle_health` utilises Perl DBD::Oracle based on oracle-instantclient-sdk or sqlplus to connect to Oracle databases for monitoring. +For release tarballs and detailed documentation especially on the different modes and required permissions see [https://labs.consol.de](https://labs.consol.de/nagios/check_oracle_health/). For development check [https://github.com](https://github.com/lausser/check_oracle_health). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------------------|------------------------------------------------------------------------------------------------------------------------------ +oracle_health_connect | **Required.** Specifies the database connection string (from tnsnames.ora). +oracle_health_username | **Optional.** The username for the database connection. +oracle_health_password | **Optional.** The password for the database connection. +oracle_health_warning | **Optional.** The warning threshold depending on the mode. +oracle_health_critical | **Optional.** The critical threshold depending on the mode. +oracle_health_mode | **Required.** The mode uses predefined keywords for the different checks. For example "connection-time", "flash-recovery-area-usage" or "sql". +oracle_health_method | **Optional.** How the plugin should connect to the database (`dbi` for using DBD::Oracle (default), `sqlplus` for using the sqlplus-Tool). +oracle_health_name | **Optional.** The tablespace, datafile, wait event, latch, enqueue depending on the mode or SQL statement to be executed with "oracle_health_mode" sql. +oracle_health_name2 | **Optional.** If "oracle_health_name" is a sql statement, "oracle_health_name2" can be used to appear in the output and the performance data. +oracle_health_regexp | **Optional.** If set to true, "oracle_health_name" will be interpreted as a regular expression. Defaults to false. +oracle_health_units | **Optional.** This is used for a better output of mode=sql and for specifying thresholds for mode=tablespace-free. Possible values are "%", "KB", "MB" and "GB". +oracle_health_ident | **Optional.** If set to true, outputs instance and database names. Defaults to false. +oracle_health_commit | **Optional.** Set this to true to turn on autocommit for the dbd::oracle module. Defaults to false. +oracle_health_noperfdata | **Optional.** Set this to true if you want to disable perfdata. Defaults to false. + +Environment Macros: + +Name | Description +--------------------|------------------------------------------------------------------------------------------------------------------------------------------ +ORACLE_HOME | **Required.** Specifies the location of the oracle instant client libraries. Defaults to "/usr/lib/oracle/11.2/client64/lib". Can be overridden by setting "oracle_home". +TNS_ADMIN | **Required.** Specifies the location of the tnsnames.ora including the database connection strings. Defaults to "/etc/icinga2/plugin-configs". Can be overridden by setting "oracle_tns_admin". + +#### postgres + +The plugin `postgres` utilises the psql binary to connect to PostgreSQL databases for monitoring. +For release tarballs and detailed documentation especially the different actions and required persmissions see [https://bucardo.org/wiki/Check_postgres](https://bucardo.org/wiki/Check_postgres). For development check [https://github.com](https://github.com/bucardo/check_postgres). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------------------|------------------------------------------------------------------------------------------------------------------------------ +postgres_host | **Optional.** Specifies the database hostname or address. Defaults to "$address$" or "$address6$" if the `address` attribute is not set. If "postgres_unixsocket" is set to true, falls back to unix socket. +postgres_port | **Optional.** Specifies the database port. Defaults to 5432. +postgres_dbname | **Optional.** Specifies the database name to connect to. Defaults to "postgres" or "template1". +postgres_dbuser | **Optional.** The username for the database connection. Defaults to "postgres". +postgres_dbpass | **Optional.** The password for the database connection. You can use a .pgpass file instead. +postgres_dbservice | **Optional.** Specifies the service name to use inside of pg_service.conf. +postgres_warning | **Optional.** Specifies the warning threshold, range depends on the action. +postgres_critical | **Optional.** Specifies the critical threshold, range depends on the action. +postgres_include | **Optional.** Specifies name(s) items to specifically include (e.g. tables), depends on the action. +postgres_exclude | **Optional.** Specifies name(s) items to specifically exclude (e.g. tables), depends on the action. +postgres_includeuser | **Optional.** Include objects owned by certain users. +postgres_excludeuser | **Optional.** Exclude objects owned by certain users. +postgres_standby | **Optional.** Assume that the server is in continious WAL recovery mode if set to true. Defaults to false. +postgres_production | **Optional.** Assume that the server is in production mode if set to true. Defaults to false. +postgres_action | **Required.** Determines the test executed. +postgres_unixsocket | **Optional.** If "postgres_unixsocket" is set to true, the unix socket is used instead of an address. Defaults to false. +postgres_query | **Optional.** Query for "custom_query" action. +postgres_valtype | **Optional.** Value type of query result for "custom_query". +postgres_reverse | **Optional.** If "postgres_reverse" is set, warning and critical values are reversed for "custom_query" action. + +#### mongodb + +The plugin `mongodb` utilises Python PyMongo. +For development check [https://github.com](https://github.com/mzupan/nagios-plugin-mongodb). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------------------|------------------------------------------------------------------------------------------------------------------------------ +mongodb_host | **Required.** Specifies the hostname or address. +mongodb_port | **Required.** The port mongodb is runnung on. +mongodb_user | **Optional.** The username you want to login as +mongodb_passwd | **Optional.** The password you want to use for that user +mongodb_warning | **Optional.** The warning threshold we want to set +mongodb_critical | **Optional.** The critical threshold we want to set +mongodb_action | **Required.** The action you want to take +mongodb_maxlag | **Optional.** Get max replication lag (for replication_lag action only) +mongodb_mappedmemory | **Optional.** Get mapped memory instead of resident (if resident memory can not be read) +mongodb_perfdata | **Optional.** Enable output of Nagios performance data +mongodb_database | **Optional.** Specify the database to check +mongodb_alldatabases | **Optional.** Check all databases (action database_size) +mongodb_ssl | **Optional.** Connect using SSL +mongodb_replicaset | **Optional.** Connect to replicaset +mongodb_replcheck | **Optional.** If set to true, will enable the mongodb_replicaset value needed for "replica_primary" check +mongodb_querytype | **Optional.** The query type to check [query\|insert\|update\|delete\|getmore\|command] from queries_per_second +mongodb_collection | **Optional.** Specify the collection to check +mongodb_sampletime | **Optional.** Time used to sample number of pages faults + +#### elasticsearch + +An [ElasticSearch](https://www.elastic.co/products/elasticsearch) availability +and performance monitoring plugin available for download at [GitHub](https://github.com/anchor/nagios-plugin-elasticsearch). +The plugin requires the HTTP API enabled on your ElasticSearch node. + +Name | Description +-----------------------------|------------------------------------------------------------------------------------------------------- +elasticsearch_failuredomain | **Optional.** A comma-separated list of ElasticSearch attributes that make up your cluster's failure domain. +elasticsearch_host | **Optional.** Hostname or network address to probe. Defaults to 'localhost'. +elasticsearch_masternodes | **Optional.** Issue a warning if the number of master-eligible nodes in the cluster drops below this number. By default, do not monitor the number of nodes in the cluster. +elasticsearch_port | **Optional.** TCP port to probe. The ElasticSearch API should be listening here. Defaults to 9200. +elasticsearch_prefix | **Optional.** Optional prefix (e.g. 'es') for the ElasticSearch API. Defaults to ''. +elasticsearch_yellowcritical | **Optional.** Instead of issuing a 'warning' for a yellow cluster state, issue a 'critical' alert. Defaults to false. + +#### redis + +The plugin `redis` can measure response time, hitrate, memory utilization, check replication sync and more. It can also test data in a specified key (if necessary, doing average or sum on range). +It is provided by `William Leibzon` at [https://github.com](https://github.com/willixix/naglio-plugins/blob/master/check_redis.pl). + +Name | Description +-------------------------|-------------------------------------------------------------------------------------------------------------- +redis_hostname | **Required.** Hostname or IP Address to check. Defaults to "127.0.0.1". +redis_port | **Optional.** Port number to query. Default to "6379". +redis_database | **Optional.** Database name (usually a number) to query, needed for **redis_query**. +redis_password | **Optional.** Password for Redis authentication. Safer alternative is to put them in a file and use **redis_credentials**. +redis_credentials | **Optional.** Credentials file to read for Redis authentication. +redis_timeout | **Optional.** Allows to set timeout for execution of this plugin. +redis_variables | **Optional.** List of variables from info data to do threshold checks on. +redis_warn | **Optional.** This option can only be used if **redis_variables** is used and the number of values listed here must exactly match number of variables specified. +redis_crit | **Optional.** This option can only be used if **redis_variables** is used and the number of values listed here must exactly match number of variables specified. +redis_perfparse | **Optional.** This should only be used with variables and causes variable data not only to be printed as part of main status line but also as perfparse compatible output. Defaults to false. +redis_perfvars | **Optional.** This allows to list variables which values will go only into perfparse output (and not for threshold checking). +redis_prev_perfdata | **Optional.** If set to true, previous performance data are used to calculate rate of change for counter statistics variables and for proper calculation of hitrate. Defaults to false. +redis_rate_label | **Optional.** Prefix or Suffix label used to create a new variable which has rate of change of another base variable. You can specify PREFIX or SUFFIX or both as one string separated by ",". Default if not specified is suffix "_rate". +redis_query | **Optional.** Option specifies key to query and optional variable name to assign the results to after. +redis_option | **Optional.** Specifiers are separated by "," and must include NAME or PATTERN. +redis_response_time | **Optional.** If this is used, plugin will measure and output connection response time in seconds. With **redis_perfparse** this would also be provided on perf variables. +redis_hitrate | **Optional.** Calculates Hitrate and specify values are interpreted as WARNING and CRITICAL thresholds. +redis_memory_utilization | **Optional.** This calculates percent of total memory on system used by redis. Total_memory on server must be specified with **redis_total_memory**. If you specify by itself, the plugin will just output this info. Parameter values are interpreted as WARNING and CRITICAL thresholds. +redis_total_memory | **Optional.** Amount of memory on a system for memory utilization calculation. Use system memory or max_memory setting of redis. +redis_replication_delay | **Optional.** Allows to set threshold on replication delay info. + + +### Hardware + +This category includes all plugins for various hardware checks. + +#### hpasm + +The plugin [check_hpasm](https://labs.consol.de/de/nagios/check_hpasm/index.html) is a plugin to monitor HP hardware through the HP Insight Agent via SNMP. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------------------|----------------------------------------------------------------------- +hpasm_hostname | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +hpasm_community | **Optional.** SNMP community of the server (SNMP v1/2 only). +hpasm_protocol | **Optional.** The SNMP protocol to use (default: 2c, other possibilities: 1,3). +hpasm_port | **Optional.** The SNMP port to use (default: 161). +hpasm_blacklist | **Optional.** Blacklist some (missing/failed) components. +hpasm_ignore-dimms | **Optional.** Ignore "N/A"-DIMM status on misc. servers (e.g. older DL320). +hpasm_ignore-fan-redundancy | **Optional.** Ignore missing redundancy partners. +hpasm_customthresholds | **Optional.** Use custom thresholds for certain temperatures. +hpasm_eventrange | **Optional.** Period of time before critical IML events respecively become warnings or vanish. A range is descibed as a number and a unit (s, m, h, d), e.g. --eventrange 1h/20m. +hpasm_perfdata | **Optional.** Output performance data. If your performance data string becomes too long and is truncated by Nagios, then you can use --perfdata=short instead. This will output temperature tags without location information. +hpasm_username | **Optional.** The securityName for the USM security model (SNMPv3 only). +hpasm_authpassword | **Optional.** The authentication password for SNMPv3. +hpasm_authprotocol | **Optional.** The authentication protocol for SNMPv3 (md5\|sha). +hpasm_privpassword | **Optional.** The password for authPriv security level. +hpasm_privprotocol | **Optional.** The private protocol for SNMPv3 (des\|aes\|aes128\|3des\|3desde). +hpasm_servertype | **Optional.** The type of the server: proliant (default) or bladesystem. +hpasm_eval-nics | **Optional.** Check network interfaces (and groups). Try it and report me whyt you think about it. I need to build up some know how on this subject. If you get an error and think, it is not justified for your configuration, please tell me about it. (alwasy send the output of "snmpwalk -On .... 1.3.6.1.4.1.232" and a description how you setup your nics and why it is correct opposed to the plugins error message. + + +### IcingaCLI + +This category includes all plugins using the icingacli provided by Icinga Web 2. + +#### Business Process + +This subcommand is provided by the [business process module](https://exchange.icinga.org/icinga/Business+Process) and executed as `icingacli-businessprocess`. The module is hosted by the Icinga project on its [project homepage](https://dev.icinga.org/projects/icingaweb2-module-businessprocess). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------------------------|----------------------------------------------------------------------------------------- +icingacli_businessprocess_process | **Required.** Business process to monitor. +icingacli_businessprocess_config | **Optional.** Configuration file containing your business process without file extension. +icingacli_businessprocess_details | **Optional.** Get details for root cause analyses. Defaults to false. + + +### IPMI Devices + +This category includes all plugins for IPMI devices. + +#### ipmi-sensor + +With the plugin `ipmi-sensor` provided by Thomas-Krenn.AG you can monitor sensor data for IPMI devices. See https://www.thomas-krenn.com/en/wiki/IPMI_Sensor_Monitoring_Plugin for installation and configuration instructions. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------------------------|----------------------------------------------------------------------------------------------------- +ipmi_address | **Required.** Specifies the remote host (IPMI device) to check. Defaults to "$address$". +ipmi_config_file | **Optional.** Path to the FreeIPMI configuration file. It should contain IPMI username, IPMI password, and IPMI privilege-level. +ipmi_username | **Optional.** The IPMI username. +ipmi_password | **Optional.** The IPMI password. +ipmi_privilege_level | **Optional.** The IPMI privilege level of the IPMI user. +ipmi_backward_compatibility_mode | **Optional.** Enable backward compatibility mode, useful for FreeIPMI 0.5.* (this omits FreeIPMI options "--quiet-cache" and "--sdr-cache-recreate"). +ipmi_sensor_type | **Optional.** Limit sensors to query based on IPMI sensor type. Examples for IPMI sensor types are 'Fan', 'Temperature' and 'Voltage'. +ipmi_exclude_sensor_id | **Optional.** Exclude sensor matching ipmi_sensor_id. +ipmi_sensor_id | **Optional.** Include sensor matching ipmi_sensor_id. +ipmi_protocal_lan_version | **Optional.** Change the protocol LAN version. Defaults to "LAN_2_0". +ipmi_number_of_active_fans | **Optional.** Number of fans that should be active. Otherwise a WARNING state is returned. +ipmi_show_fru | **Optional.** Print the product serial number if it is available in the IPMI FRU data. +ipmi_no_sel_checking | **Optional.** Turn off system event log checking via ipmi-sel. + +### Metrics + +This category includes all plugins for metric-based checks. + +#### graphite + +Check command object for the [check_graphite](https://github.com/obfuscurity/nagios-scripts) plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------------------|----------------------------------------------------------------------------------------------------- +graphite_url | **Required.** Target url. +graphite_metric | **Required.** Metric path string. +graphite_shortname | **Optional.** Metric short name (used for performance data). +graphite_duration | **Optional.** Length, in minute of data to parse (default: 5). +graphite_function | **Optional.** Function applied to metrics for thresholds (default: average). +graphite_warning | **Required.** Warning threshold. +graphite_critical | **Required.** Critical threshold. +graphite_units | **Optional.** Adds a text tag to the metric count in the plugin output. Useful to identify the metric units. Doesn't affect data queries. +graphite_message | **Optional.** Text message to output (default: "metric count:"). +graphite_zero_on_error | **Optional.** Return 0 on a graphite 500 error. +graphite_link_graph | **Optional.** Add a link in the plugin output, showing a 24h graph for this metric in graphite. + +### Network Components + +This category includes all plugins for various network components like routers, switches and firewalls. + +#### interfacetable + +The plugin `interfacetable` generates a html page containing information about the monitored node and all of its interfaces. The actively developed and maintained version is `interfacetable_v3t` provided by `Yannick Charton` on [http://www.tontonitch.com](http://www.tontonitch.com/tiki/tiki-index.php?page=Nagios+plugins+-+interfacetable_v3t) or [https://github.com](https://github.com/Tontonitch/interfacetable_v3t). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------------------|----------------------------------------------------------------------------------------------------- +interfacetable_hostquery | **Required.** Specifies the remote host to poll. Defaults to "$address$". +interfacetable_hostdisplay | **Optional.** Specifies the hostname to display in the HTML link. Defaults to "$host.display_name$". +interfacetable_regex | **Optional.** Interface names and property names for some other options will be interpreted as regular expressions. Defaults to false. +interfacetable_outputshort | **Optional.** Reduce the verbosity of the plugin output. Defaults to false. +interfacetable_exclude | **Optional.** Comma separated list of interfaces globally excluded from the monitoring. +interfacetable_include | **Optional.** Comma separated list of interfaces globally included in the monitoring. +interfacetable_aliasmatching | **Optional.** Allow you to specify alias in addition to interface names. Defaults to false. +interfacetable_excludetraffic | **Optional.** Comma separated list of interfaces excluded from traffic checks. +interfacetable_includetraffic | **Optional.** Comma separated list of interfaces included for traffic checks. +interfacetable_warningtraffic | **Optional.** Interface traffic load percentage leading to a warning alert. +interfacetable_criticaltraffic | **Optional.** Interface traffic load percentage leading to a critical alert. +interfacetable_pkt | **Optional.** Add unicast/non-unicast pkt stats for each interface. +interfacetable_trafficwithpkt | **Optional.** Enable traffic calculation using pkt counters instead of octet counters. Useful when using 32-bit counters to track the load on > 1GbE interfaces. Defaults to false. +interfacetable_trackproperty | **Optional.** List of tracked properties. +interfacetable_excludeproperty | **Optional.** Comma separated list of interfaces excluded from the property tracking. +interfacetable_includeproperty | **Optional.** Comma separated list of interfaces included in the property tracking. +interfacetable_community | **Optional.** Specifies the snmp v1/v2c community string. Defaults to "public" if using snmp v1/v2c, ignored using v3. +interfacetable_snmpv2 | **Optional.** Use snmp v2c. Defaults to false. +interfacetable_login | **Optional.** Login for snmpv3 authentication. +interfacetable_passwd | **Optional.** Auth password for snmpv3 authentication. +interfacetable_privpass | **Optional.** Priv password for snmpv3 authentication. +interfacetable_protocols | **Optional.** Authentication protocol,Priv protocol for snmpv3 authentication. +interfacetable_domain | **Optional.** SNMP transport domain. +interfacetable_contextname | **Optional.** Context name for the snmp requests. +interfacetable_port | **Optional.** SNMP port. Defaults to standard port. +interfacetable_64bits | **Optional.** Use SNMP 64-bits counters. Defaults to false. +interfacetable_maxrepetitions | **Optional.** Increasing this value may enhance snmp query performances by gathering more results at one time. +interfacetable_snmptimeout | **Optional.** Define the Transport Layer timeout for the snmp queries. +interfacetable_snmpretries | **Optional.** Define the number of times to retry sending a SNMP message. +interfacetable_snmpmaxmsgsize | **Optional.** Size of the SNMP message in octets, usefull in case of too long responses. Be carefull with network filters. Range 484 - 65535. Apply only to netsnmp perl bindings. The default is 1472 octets for UDP/IPv4, 1452 octets for UDP/IPv6, 1460 octets for TCP/IPv4, and 1440 octets for TCP/IPv6. +interfacetable_unixsnmp | **Optional.** Use unix snmp utilities for snmp requests. Defaults to false, which means use the perl bindings. +interfacetable_enableperfdata | **Optional.** Enable port performance data. Defaults to false. +interfacetable_perfdataformat | **Optional.** Define which performance data will be generated. Possible values are "full" (default), "loadonly", "globalonly". +interfacetable_perfdatathreshold | **Optional.** Define which thresholds are printed in the generated performance data. Possible values are "full" (default), "loadonly", "globalonly". +interfacetable_perfdatadir | **Optional.** When specified, the performance data are also written directly to a file, in the specified location. +interfacetable_perfdataservicedesc | **Optional.** Specify additional parameters for output performance data to PNP. Defaults to "$service.name$", only affects **interfacetable_perfdatadir**. +interfacetable_grapher | **Optional.** Specify the used graphing solution. Possible values are "pnp4nagios" (default), "nagiosgrapher", "netwaysgrapherv2" and "ingraph". +interfacetable_grapherurl | **Optional.** Graphing system url. Default depends on **interfacetable_grapher**. +interfacetable_portperfunit | **Optional.** Traffic could be reported in bits (counters) or in bps (calculated value). +interfacetable_nodetype | **Optional.** Specify the node type, for specific information to be printed / specific oids to be used. Possible values: "standard" (default), "cisco", "hp", "netscreen", "netapp", "bigip", "bluecoat", "brocade", "brocade-nos", "nortel", "hpux". +interfacetable_duplex | **Optional.** Add the duplex mode property for each interface in the interface table. Defaults to false. +interfacetable_stp | **Optional.** Add the stp state property for each interface in the interface table. Defaults to false. +interfacetable_vlan | **Optional.** Add the vlan attribution property for each interface in the interface table. Defaults to false. This option is available only for the following nodetypes: "cisco", "hp", "nortel" +interfacetable_noipinfo | **Optional.** Remove the ip information for each interface from the interface table. Defaults to false. +interfacetable_alias | **Optional.** Add the alias information for each interface in the interface table. Defaults to false. +interfacetable_accessmethod | **Optional.** Access method for a shortcut to the host in the HTML page. Format is : [:] Where method can be: ssh, telnet, http or https. +interfacetable_htmltablelinktarget | **Optional.** Specifies the windows or the frame where the [details] link will load the generated html page. Possible values are: "_blank", "_self" (default), "_parent", "_top", or a frame name. +interfacetable_delta | **Optional.** Set the delta used for interface throuput calculation in seconds. +interfacetable_ifs | **Optional.** Input field separator. Defaults to ",". +interfacetable_cache | **Optional.** Define the retention time of the cached data in seconds. +interfacetable_noifloadgradient | **Optional.** Disable color gradient from green over yellow to red for the load percentage. Defaults to false. +interfacetable_nohuman | **Optional.** Do not translate bandwidth usage in human readable format. Defaults to false. +interfacetable_snapshot | **Optional.** Force the plugin to run like if it was the first launch. Defaults to false. +interfacetable_timeout | **Optional.** Define the global timeout limit of the plugin in seconds. Defaults to "15s". +interfacetable_css | **Optional.** Define the css stylesheet used by the generated html files. Possible values are "classic", "icinga", "icinga-alternate1" or "nagiosxi". +interfacetable_config | **Optional.** Specify a config file to load. +interfacetable_noconfigtable | **Optional.** Disable configuration table on the generated HTML page. Defaults to false. +interfacetable_notips | **Optional.** Disable the tips in the generated html tables. Defaults to false. +interfacetable_defaulttablesorting | **Optional.** Default table sorting can be "index" (default) or "name". +interfacetable_tablesplit | **Optional.** Generate multiple interface tables, one per interface type. Defaults to false. +interfacetable_notype | **Optional.** Remove the interface type for each interface. Defaults to false. + +#### iftraffic + +The plugin [check_iftraffic](https://exchange.icinga.org/exchange/iftraffic) +checks the utilization of a given interface name using the SNMP protocol. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|--------------------------------------------------------- +iftraffic_address | **Required.** Specifies the remote host. Defaults to "$address$". +iftraffic_community | **Optional.** SNMP community. Defaults to "public'" if omitted. +iftraffic_interface | **Required.** Queried interface name. +iftraffic_bandwidth | **Required.** Interface maximum speed in kilo/mega/giga/bits per second. +iftraffic_units | **Optional.** Interface units can be one of these values: `g` (gigabits/s),`m` (megabits/s), `k` (kilobits/s),`b` (bits/s) +iftraffic_warn | **Optional.** Percent of bandwidth usage necessary to result in warning status (defaults to `85`). +iftraffic_crit | **Optional.** Percent of bandwidth usage necessary to result in critical status (defaults to `98`). +iftraffic_max_counter | **Optional.** Maximum counter value of net devices in kilo/mega/giga/bytes. + +#### iftraffic64 + +The plugin [check_iftraffic64](https://exchange.icinga.org/exchange/iftraffic64) +checks the utilization of a given interface name using the SNMP protocol. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|--------------------------------------------------------- +iftraffic64_address | **Required.** Specifies the remote host. Defaults to "$address$". +iftraffic64_community | **Optional.** SNMP community. Defaults to "public'" if omitted. +iftraffic64_interface | **Required.** Queried interface name. +iftraffic64_bandwidth | **Required.** Interface maximum speed in kilo/mega/giga/bits per second. +iftraffic64_units | **Optional.** Interface units can be one of these values: `g` (gigabits/s),`m` (megabits/s), `k` (kilobits/s),`b` (bits/s) +iftraffic64_warn | **Optional.** Percent of bandwidth usage necessary to result in warning status (defaults to `85`). +iftraffic64_crit | **Optional.** Percent of bandwidth usage necessary to result in critical status (defaults to `98`). +iftraffic64_max_counter | **Optional.** Maximum counter value of net devices in kilo/mega/giga/bytes. + +#### interfaces + +The plugin [check_interfaces](https://www.netways.org/projects/check-interfaces) +Check interfaces and utilization. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------------|--------------------------------------------------------- +interfaces_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +interfaces_regex | **Optional.** Interface list regexp. +interfaces_exclude_regex | **Optional.** Interface list negative regexp. +interfaces_errors | **Optional.** Number of in errors (CRC errors for cisco) to consider a warning (default 50). +interface_out_errors | **Optional.** Number of out errors (collisions for cisco) to consider a warning (default same as in errors). +interfaces_perfdata | **Optional.** perfdata from last check result. +interfaces_prefix | **Optional.** Prefix interface names with this label. +interfaces_lastcheck | **Optional.** Last checktime (unixtime). +interfaces_bandwidth | **Optional.** Bandwidth warn level in percent. +interfaces_speed | **Optional.** Override speed detection with this value (bits per sec). +interfaces_trim | **Optional.** Cut this number of characters from the start of interface descriptions. +interfaces_mode | **Optional.** Special operating mode (default,cisco,nonbulk,bintec). +interfaces_auth_proto | **Optional.** SNMPv3 Auth Protocol (SHA\|MD5) +interfaces_auth_phrase | **Optional.** SNMPv3 Auth Phrase +interfaces_priv_proto | **Optional.** SNMPv3 Privacy Protocol (AES\|DES) +interfaces_priv_phrase | **Optional.** SNMPv3 Privacy Phrase +interfaces_user | **Optional.** SNMPv3 User +interfaces_down_is_ok | **Optional.** Disables critical alerts for down interfaces. +interfaces_aliases | **Optional.** Retrieves the interface description. +interfaces_match_aliases | **Optional.** Also match against aliases (Option --aliases automatically enabled). +interfaces_timeout | **Optional.** Sets the SNMP timeout (in ms). +interfaces_sleep | **Optional.** Sleep between every SNMP query (in ms). + +#### nwc_health + +The plugin [check_nwc_health](https://labs.consol.de/de/nagios/check_nwc_health/index.html) +Check switches, router, there interfaces and utilization. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +--------------------------------|--------------------------------------------------------- +nwc_health_hostname | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +nwc_health_mode | **Optional.** The plugin mode. A list of all available modes can be found in the [plugin documentation](https://labs.consol.de/nagios/check_nwc_health/index.html). +nwc_health_timeout | **Optional.** Seconds before plugin times out (default: 15) +nwc_health_blacklist | **Optional.** Blacklist some (missing/failed) components. +nwc_health_port | **Optional.** The SNMP port to use (default: 161). +nwc_health_domain | **Optional.** The transport domain to use (default: udp/ipv4, other possible values: udp6, udp/ipv6, tcp, tcp4, tcp/ipv4, tcp6, tcp/ipv6). +nwc_health_protocol | **Optional.** The SNMP protocol to use (default: 2c, other possibilities: 1,3). +nwc_health_community | **Optional.** SNMP community of the server (SNMP v1/2 only). +nwc_health_username | **Optional.** The securityName for the USM security model (SNMPv3 only). +nwc_health_authpassword | **Optional.** The authentication password for SNMPv3. +nwc_health_authprotocol | **Optional.** The authentication protocol for SNMPv3 (md5\|sha). +nwc_health_privpassword | **Optional.** The password for authPriv security level. +nwc_health_privprotocol | **Optional.** The private protocol for SNMPv3 (des\|aes\|aes128\|3des\|3desde). +nwc_health_contextengineid | **Optional.** The context engine id for SNMPv3 (10 to 64 hex characters). +nwc_health_contextname | **Optional.** The context name for SNMPv3 (empty represents the default context). +nwc_health_name | **Optional.** The name of an interface (ifDescr). +nwc_health_drecksptkdb | **Optional.** This parameter must be used instead of --name, because Devel::ptkdb is stealing the latter from the command line. +nwc_health_alias | **Optional.** The alias name of a 64bit-interface (ifAlias) +nwc_health_regexp | **Optional.** A flag indicating that --name is a regular expression +nwc_health_ifspeedin | **Optional.** Override the ifspeed oid of an interface (only inbound) +nwc_health_ifspeedout | **Optional.** Override the ifspeed oid of an interface (only outbound) +nwc_health_ifspeed | **Optional.** Override the ifspeed oid of an interface +nwc_health_units | **Optional.** One of %, B, KB, MB, GB, Bit, KBi, MBi, GBi. (used for e.g. mode interface-usage) +nwc_health_name2 | **Optional.** The secondary name of a component. +nwc_health_role | **Optional.** The role of this device in a hsrp group (active/standby/listen). +nwc_health_report | **Optional.** Can be used to shorten the output. +nwc_health_lookback | **Optional.** The amount of time you want to look back when calculating average rates. Use it for mode interface-errors or interface-usage. Without --lookback the time between two runs of check_nwc_health is the base for calculations. If you want your checkresult to be based for example on the past hour, use --lookback 3600. +nwc_health_warning | **Optional.** The warning threshold +nwc_health_critical | **Optional.** The critical threshold +nwc_health_warningx | **Optional.** The extended warning thresholds +nwc_health_criticalx | **Optional.** The extended critical thresholds +nwc_health_mitigation | **Optional.** The parameter allows you to change a critical error to a warning. +nwc_health_selectedperfdata | **Optional.** The parameter allows you to limit the list of performance data. It's a perl regexp. Only matching perfdata show up in the output. +nwc_health_morphperfdata | **Optional.** The parameter allows you to change performance data labels. It's a perl regexp and a substitution. --morphperfdata '(.*)ISATAP(.*)'='$1patasi$2' +nwc_health_negate | **Optional.** The parameter allows you to map exit levels, such as warning=critical. +nwc_health_mymodules-dyn-dir | **Optional.** A directory where own extensions can be found. +nwc_health_servertype | **Optional.** The type of the network device: cisco (default). Use it if auto-detection is not possible. +nwc_health_statefilesdir | **Optional.** An alternate directory where the plugin can save files. +nwc_health_oids | **Optional.** A list of oids which are downloaded and written to a cache file. Use it together with --mode oidcache. +nwc_health_offline | **Optional.** The maximum number of seconds since the last update of cache file before it is considered too old. +nwc_health_multiline | **Optional.** Multiline output + + +### Web + +This category includes all plugins for web-based checks. + +#### webinject + +Check command object for the [check_webinject](http://www.webinject.org/manual.html) plugin. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +webinject_config_file | **Optional.** There is a configuration file named 'config.xml' that is used to store configuration settings for your project. You can use this to specify which test case files to run and to set some constants and settings to be used by WebInject. +webinject_output | **Optional.** This option is followed by a directory name or a prefix to prepended to the output files. This is used to specify the location for writing output files (http.log, results.html, and results.xml). If a directory name is supplied (use either an absolute or relative path and make sure to add the trailing slash), all output files are written to this directory. If the trailing slash is ommitted, it is assumed to a prefix and this will be prepended to the output files. You may also use a combination of a directory and prefix. +webinject_no_output | **Optional.** Suppresses all output to STDOUT except the results summary. +webinject_timeout | **Optional.** The value [given in seconds] will be compared to the global time elapsed to run all the tests. If the tests have all been successful, but have taken more time than the 'globaltimeout' value, a warning message is sent back to Icinga. +webinject_report_type | **Optional.** This setting is used to enable output formatting that is compatible for use with specific external programs. The available values you can set this to are: nagios, mrtg, external and standard. +webinject_testcase_file | **Optional.** When you launch WebInject in console mode, you can optionally supply an argument for a testcase file to run. It will look for this file in the directory that webinject.pl resides in. If no filename is passed from the command line, it will look in config.xml for testcasefile declarations. If no files are specified, it will look for a default file named 'testcases.xml' in the current [webinject] directory. If none of these are found, the engine will stop and give you an error. + +#### jmx4perl + +The plugin `jmx4perl` utilizes the api provided by the jolokia web application to query java message beans on an application server. It is part of the perl module provided by Roland Huß on [cpan](http://search.cpan.org/~roland/jmx4perl/) including a detailed [documentation](http://search.cpan.org/~roland/jmx4perl/scripts/check_jmx4perl) containing installation tutorial, security advices und usage examples. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-----------------------------|--------------------------------------------------------------------------------------------------------------------------------------------------------- +jmx4perl_url | **Required.** URL to agent web application. Defaults to "http://$address$:8080/jolokia". +jmx4perl_product | **Optional.** Name of app server product (e.g. jboss), by default is uses an autodetection facility. +jmx4perl_alias | **Optional.** Alias name for attribute (e.g. MEMORY_HEAP_USED). All availables aliases can be viewed by executing `jmx4perl aliases` on the command line. +jmx4perl_mbean | **Optional.** MBean name (e.g. java.lang:type=Memory). +jmx4perl_attribute | **Optional.** Attribute name (e.g. HeapMemoryUsage). +jmx4perl_operation | **Optional.** Operation to execute. +jmx4perl_value | **Optional.** Shortcut for specifying mbean/attribute/path. Slashes within names must be escaped with backslash. +jmx4perl_delta | **Optional.** Switches on incremental mode. Optional argument are seconds used for normalizing. +jmx4perl_path | **Optional.** Inner path for extracting a single value from a complex attribute or return value (e.g. used). +jmx4perl_target | **Optional.** JSR-160 Service URL specifing the target server. +jmx4perl_target_user | **Optional.** Username to use for JSR-160 connection. +jmx4perl_target_password | **Optional.** Password to use for JSR-160 connection. +jmx4perl_proxy | **Optional.** Proxy to use. +jmx4perl_user | **Optional.** User for HTTP authentication. +jmx4perl_password | **Optional.** Password for HTTP authentication. +jmx4perl_name | **Optional.** Name to use for output, by default a standard value based on the MBean and attribute will be used. +jmx4perl_method | **Optional.** HTTP method to use, either get or post. By default a method is determined automatically based on the request type. +jmx4perl_base | **Optional.** Base name, which when given, interprets critical and warning values as relative in the range 0 .. 100%. Must be given in the form mbean/attribute/path. +jmx4perl_base_mbean | **Optional.** Base MBean name, interprets critical and warning values as relative in the range 0 .. 100%. Requires "jmx4perl_base_attribute". +jmx4perl_base_attribute | **Optional.** Base attribute for a relative check. Requires "jmx4perl_base_mbean". +jmx4perl_base_path | **Optional.** Base path for relative checks, where this path is used on the base attribute's value. +jmx4perl_unit | **Optional.** Unit of measurement of the data retreived. Recognized values are [B\|KB\|MN\|GB\|TB] for memory values and [us\|ms\|s\|m\|h\|d] for time values. +jmx4perl_null | **Optional.** Value which should be used in case of a null return value of an operation or attribute. Defaults to null. +jmx4perl_string | **Optional.** Force string comparison for critical and warning checks. Defaults to false. +jmx4perl_numeric | **Optional.** Force numeric comparison for critical and warning checks. Defaults to false. +jmx4perl_critical | **Optional.** Critical threshold for value. +jmx4perl_warning | **Optional.** Warning threshold for value. +jmx4perl_label | **Optional.** Label to be used for printing out the result of the check. For placeholders which can be used see the documentation. +jmx4perl_perfdata | **Optional.** Whether performance data should be omitted, which are included by default. Defaults to "on" for numeric values, to "off" for strings. +jmx4perl_unknown_is_critical | **Optional.** Map UNKNOWN errors to errors with a CRITICAL status. Defaults to false. +jmx4perl_timeout | **Optional.** Seconds before plugin times out. Defaults to "15". +jmx4perl_config | **Optional.** Path to configuration file. +jmx4perl_server | **Optional.** Symbolic name of server url to use, which needs to be configured in the configuration file. +jmx4perl_check | **Optional.** Name of a check configuration as defined in the configuration file, use array if you need arguments. + +#### squid + +Plugin for monitoring [Squid](https://exchange.icinga.org/exchange/check_squid). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|---------------------------------------------------------------------------------- +squid_hostname | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, "$address6$" otherwise. +squid_data | **Optional.** Data to fetch (default: Connections) available data: Connections Cache Resources Memory FileDescriptors. +squid_port | **Optional.** Port number (default: 3128). +squid_user | **Optional.** WWW user +squid_password | **Optional.** WWW password +squid_warning | **Optional.** Warning threshold. See http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT for the threshold format. +squid_critical | **Optional.** Critical threshold. See http://nagiosplug.sourceforge.net/developer-guidelines.html#THRESHOLDFORMAT for the threshold format. +squid_client | **Optional.** Path of squidclient (default: /usr/bin/squidclient). +squid_timeout | **Optional.** Seconds before plugin times out (default: 15). + + +#### nginx_status + +Plugin for monitoring [nginx_status](https://github.com/regilero/check_nginx_status). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|---------------------------------------------------------------------------------- +nginx_status_host_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, `address6` otherwise. +nginx_status_port | **Optional.** the http port. +nginx_status_url | **Optional.** URL to use, instead of the default (http://`nginx_status_hostname`/nginx_status). +nginx_status_servername | **Optional.** ServerName to use if you specified an IP to match the good Virtualhost in your target +nginx_status_ssl | **Optional.** set to use ssl connection +nginx_status_disable_sslverify | **Optional.** set to disable SSL hostname verification +nginx_status_user | **Optional.** Username for basic auth +nginx_status_pass | **Optional.** Password for basic auth +nginx_status_realm | **Optional.** Realm for basic auth +nginx_status_maxreach | **Optional.** Number of max processes reached (since last check) that should trigger an alert +nginx_status_timeout | **Optional.** timeout in seconds +nginx_status_warn | **Optional.** Warning threshold (number of active connections, ReqPerSec or ConnPerSec that will cause a WARNING) like '10000,100,200'. +nginx_status_critical | **Optional.** Critical threshold (number of active connections, ReqPerSec or ConnPerSec that will cause a CRITICAL) like '20000,200,300'. + + +#### apache_status + +Plugin for monitoring [apache_status](https://github.com/lbetz/check_apache_status). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|---------------------------------------------------------------------------------- +apache_status_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, `address6` otherwise. +apache_status_port | **Optional.** the http port. +apache_status_url | **Optional.** URL to use, instead of the default (http://`apache_status_address`/server-status). +apache_status_ssl | **Optional.** set to use ssl connection +apache_status_timeout | **Optional.** timeout in seconds +apache_status_warning | **Optional.** Warning threshold (number of open slots, busy workers and idle workers that will cause a WARNING) like ':20,50,:50'. +apache_status_critical | **Optional.** Critical threshold (number of open slots, busy workers and idle workers that will cause a CRITICAL) like ':10,25,:20'. + + +#### kdc + +Plugin for monitoring [kdc](https://exchange.nagios.org/directory/Plugins/Security/check_kdc/details). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------------------------------------------------------------------- +kdc_address | **Optional.** The host's address. Defaults to "$address$" if the host's `address` attribute is set, `address6` otherwise. +kdc_port | **Optional** Port on which KDC runs (default 88). +kdc_principal | **Required** Principal name to authenticate as (including realm). +kdc_keytab | **Required** Keytab file containing principal's key. + + +#### rbl + +Plugin for monitoring [rbl](https://github.com/matteocorti/check_rbl) + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +----------------|-------------------------------------------------------------------------- +rbl_hostname | **Optional.** The address or name of the SMTP server to check. Defaults to "$address$" if the host's `address` attribute is set, `address6` otherwise. +rbl_server | **Required** List of RBL servers as an array. +rbl_warning | **Optional** Number of blacklisting servers for a warning. +rbl_critical | **Optional** Number of blacklisting servers for a critical. +tbl_timeout | **Optional** Seconds before plugin times out (default: 15). + + +### Operating System + +In this category you can find plugins for gathering information about your operating system or the system beneath like memory usage. + +#### mem + +The plugin `mem` is used for gathering information about memory usage on linux and unix hosts. It is able to count cache memory as free when comparing it to the thresholds. It is provided by `Justin Ellison` on [https://github.com](https://github.com/justintime/nagios-plugins). For more details see the developers blog [http://sysadminsjourney.com](http://sysadminsjourney.com/content/2009/06/04/new-and-improved-checkmempl-nagios-plugin). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +-------------|----------------------------------------------------------------------------------------------------------------------- +mem_used | **Optional.** Tell the plugin to check for used memory in opposite of **mem_free**. Must specify one of these as true. +mem_free | **Optional.** Tell the plugin to check for free memory in opposite of **mem_used**. Must specify one of these as true. +mem_cache | **Optional.** If set to true, plugin will count cache as free memory. Defaults to false. +mem_warning | **Required.** Specify the warning threshold as number interpreted as percent. +mem_critical | **Required.** Specify the critical threshold as number interpreted as percent. + +#### running_kernel + +Check command object for the `check_running_kernel` plugin +provided by the `nagios-plugin-contrib` package on Debian. + +Custom attributes: + +Name | Description +---------------------------|------------- +running\_kernel\_use\_sudo | Whether to run the plugin with `sudo`. Defaults to false except on Ubuntu where it defaults to true. + +#### iostat + +The plugin [check_iostat](https://github.com/dnsmichi/icinga-plugins/blob/master/scripts/check_iostat) is used to monitor I/O with `iostat` on a linux host. The default thresholds are rather high so you can use a grapher for baselining before setting your own. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +---------------|----------------------------------------------------------------------------------------------------------------------- +iostat\_disk | **Required.** The device to monitor without path. e.g. sda or vda. (default: sda) +iostat\_wtps | **Required.** Warning threshold for tps (default: 100) +iostat\_wread | **Required.** Warning threshold for KB/s reads (default: 100) +iostat\_wwrite | **Required.** Warning threshold for KB/s writes (default: 100) +iostat\_ctps | **Required.** Critical threshold for tps (default: 200) +iostat\_cread | **Required.** Critical threshold for KB/s reads (default: 200) +iostat\_cwrite | **Required.** Critical threshold for KB/s writes (default: 200) + +#### yum + +The plugin [check_yum](https://github.com/calestyo/check_yum) is used to check the YUM package +management system for package updates. +The plugin requires the `yum-plugin-security` package to differentiate between security and normal updates. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- +yum_all_updates | **Optional.** Set to true to not distinguish between security and non-security updates, but returns critical for any available update. This may be used if the YUM security plugin is absent or you want to maintain every single package at the latest version. You may want to use **yum_warn_on_any_update** instead of this option. Defaults to false. +yum_warn_on_any_update | **Optional.** Set to true to warn if there are any (non-security) package updates available. Defaults to false. +yum_cache_only | **Optional.** If set to true, plugin runs entirely from cache and does not update the cache when running YUM. Useful if you have `yum makecache` cronned. Defaults to false. +yum_no_warn_on_lock | **Optional.** If set to true, returns OK instead of WARNING when YUM is locked and fails to check for updates due to another instance running. Defaults to false. +yum_no_warn_on_updates | **Optional.** If set to true, returns OK instead of WARNING even when updates are available. The plugin output still shows the number of available updates. Defaults to false. +yum_enablerepo | **Optional.** Explicitly enables a reposity when calling YUM. Can take a comma separated list of repositories. Note that enabling repositories can lead to unexpected results, for example when protected repositories are enabled. +yum_disablerepo | **Optional.** Explicitly disables a reposity when calling YUM. Can take a comma separated list of repositories. Note that enabling repositories can lead to unexpected results, for example when protected repositories are enabled. +yum_installroot | **Optional.** Specifies another installation root directory (for example a chroot). +yum_timeout | **Optional.** Set a timeout in seconds after which the plugin will exit (defaults to 55 seconds). + +### Virtualization + +This category includes all plugins for various virtualization technologies. + +#### esxi_hardware + +The plugin `esxi_hardware` is a plugin to monitor hardware of ESXi servers through the vmware api and cim service. It is provided by `Claudio Kuenzler` on [http://www.claudiokuenzler.com](http://www.claudiokuenzler.com/nagios-plugins/check_esxi_hardware.php). For instruction on creating the required local user and workarounds for some hardware types have a look on his homepage. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +esxi_hardware_host | **Required.** Specifies the host to monitor. Defaults to "$address$". +esxi_hardware_user | **Required.** Specifies the user for polling. Must be a local user of the root group on the system. Can also be provided as a file path file:/path/to/.passwdfile, then first string of file is used. +esxi_hardware_pass | **Required.** Password of the user. Can also be provided as a file path file:/path/to/.passwdfile, then second string of file is used. +esxi_hardware_port | **Optional.** Specifies the CIM port to connect to. Defaults to 5989. +esxi_hardware_vendor | **Optional.** Defines the vendor of the server: "auto", "dell", "hp", "ibm", "intel", "unknown" (default). +esxi_hardware_html | **Optional.** Add web-links to hardware manuals for Dell servers (use your country extension). Only useful with **esxi_hardware_vendor** = dell. +esxi_hardware_ignore | **Optional.** Comma separated list of elements to ignore. +esxi_hardware_perfdata | **Optional.** Add performcedata for graphers like PNP4Nagios to the output. Defaults to false. +esxi_hardware_nopower | **Optional.** Do not collect power performance data, when **esxi_hardware_perfdata** is set to true. Defaults to false. +esxi_hardware_novolts | **Optional.** Do not collect voltage performance data, when **esxi_hardware_perfdata** is set to true. Defaults to false. +esxi_hardware_nocurrent | **Optional.** Do not collect current performance data, when **esxi_hardware_perfdata** is set to true. Defaults to false. +esxi_hardware_notemp | **Optional.** Do not collect temperature performance data, when **esxi_hardware_perfdata** is set to true. Defaults to false. +esxi_hardware_nofan | **Optional.** Do not collect fan performance data, when **esxi_hardware_perfdata** is set to true. Defaults to false. + +### VMware + +Check commands for the [check_vmware_esx](https://github.com/BaldMansMojo/check_vmware_esx) plugin. + +#### vmware-esx-dc-volumes + +Check command object for the `check_vmware_esx` plugin. Shows all datastore volumes info. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Required.** Datacenter/vCenter hostname. +vmware_cluster | **Optional.** ESX or ESXi clustername. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_subselect | **Optional.** Volume name to be checked the free space. +vmware_gigabyte | **Optional.** Output in GB instead of MB. +vmware_usedspace | **Optional.** Output used space instead of free. Defaults to "false". +vmware_alertonly | **Optional.** List only alerting volumes. Defaults to "false". +vmware_exclude | **Optional.** Blacklist volumes name. No value defined as default. +vmware_include | **Optional.** Whitelist volumes name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_dc_volume_used | **Optional.** Output used space instead of free. Defaults to "true". +vmware_warn | **Optional.** The warning threshold for volumes. Defaults to "80%". +vmware_crit | **Optional.** The critical threshold for volumes. Defaults to "90%". + + +#### vmware-esx-dc-runtime-info + +Check command object for the `check_vmware_esx` plugin. Shows all runtime info for the datacenter/Vcenter. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Required.** Datacenter/vCenter hostname. +vmware_cluster | **Optional.** ESX or ESXi clustername. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-dc-runtime-listvms + +Check command object for the `check_vmware_esx` plugin. List of vmware machines and their power state. BEWARE!! In larger environments systems can cause trouble displaying the informations needed due to the mass of data. Use **vmware_alertonly** to avoid this. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Required.** Datacenter/vCenter hostname. +vmware_cluster | **Optional.** ESX or ESXi clustername. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_alertonly | **Optional.** List only alerting VMs. Important here to avoid masses of data. +vmware_exclude | **Optional.** Blacklist VMs name. No value defined as default. +vmware_include | **Optional.** Whitelist VMs name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-dc-runtime-listhost + +Check command object for the `check_vmware_esx` plugin. List of VMware ESX hosts and their power state. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Required.** Datacenter/vCenter hostname. +vmware_cluster | **Optional.** ESX or ESXi clustername. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_alertonly | **Optional.** List only alerting hosts. Important here to avoid masses of data. +vmware_exclude | **Optional.** Blacklist VMware ESX hosts. No value defined as default. +vmware_include | **Optional.** Whitelist VMware ESX hosts. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-dc-runtime-listcluster + +Check command object for the `check_vmware_esx` plugin. List of VMware clusters and their states. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Required.** Datacenter/vCenter hostname. +vmware_cluster | **Optional.** ESX or ESXi clustername. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_alertonly | **Optional.** List only alerting hosts. Important here to avoid masses of data. +vmware_exclude | **Optional.** Blacklist VMware cluster. No value defined as default. +vmware_include | **Optional.** Whitelist VMware cluster. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-dc-runtime-issues + +Check command object for the `check_vmware_esx` plugin. All issues for the host. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Required.** Datacenter/vCenter hostname. +vmware_cluster | **Optional.** ESX or ESXi clustername. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist issues. No value defined as default. +vmware_include | **Optional.** Whitelist issues. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-dc-runtime-status + +Check command object for the `check_vmware_esx` plugin. Overall object status (gray/green/red/yellow). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Required.** Datacenter/vCenter hostname. +vmware_cluster | **Optional.** ESX or ESXi clustername. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-dc-runtime-tools + +Check command object for the `check_vmware_esx` plugin. Vmware Tools status. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Required.** Datacenter/vCenter hostname. +vmware_cluster | **Optional.** ESX or ESXi clustername. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_poweredonly | **Optional.** List only VMs which are powered on. No value defined as default. +vmware_alertonly | **Optional.** List only alerting VMs. Important here to avoid masses of data. +vmware_exclude | **Optional.** Blacklist VMs. No value defined as default. +vmware_include | **Optional.** Whitelist VMs. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. +vmware_openvmtools | **Optional** Prevent CRITICAL state for installed and running Open VM Tools. + + +#### vmware-esx-soap-host-check + +Check command object for the `check_vmware_esx` plugin. Simple check to verify a successfull connection to VMware SOAP API. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-host-uptime + +Check command object for the `check_vmware_esx` plugin. Displays uptime of the VMware host. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-host-cpu + +Check command object for the `check_vmware_esx` plugin. CPU usage in percentage. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold in percent. Defaults to "80%". +vmware_crit | **Optional.** The critical threshold in percent. Defaults to "90%". + + +#### vmware-esx-soap-host-cpu-ready + +Check command object for the `check_vmware_esx` plugin. Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. CPU ready time is dependent on the number of virtual machines on the host and their CPU loads. High or growing ready time can be a hint CPU bottlenecks. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-host-cpu-wait + +Check command object for the `check_vmware_esx` plugin. CPU time spent in wait state. The wait total includes time spent the CPU idle, CPU swap wait, and CPU I/O wait states. High or growing wait time can be a hint I/O bottlenecks. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-host-cpu-usage + +Check command object for the `check_vmware_esx` plugin. Actively used CPU of the host, as a percentage of the total available CPU. Active CPU is approximately equal to the ratio of the used CPU to the available CPU. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold in percent. Defaults to "80%". +vmware_crit | **Optional.** The critical threshold in percent. Defaults to "90%". + + +#### vmware-esx-soap-host-mem + +Check command object for the `check_vmware_esx` plugin. All mem info(except overall and no thresholds). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-host-mem-usage + +Check command object for the `check_vmware_esx` plugin. Average mem usage in percentage. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold in percent. Defaults to "80%". +vmware_crit | **Optional.** The critical threshold in percent. Defaults to "90%". + + +#### vmware-esx-soap-host-mem-consumed + +Check command object for the `check_vmware_esx` plugin. Amount of machine memory used on the host. Consumed memory includes Includes memory used by the Service Console, the VMkernel vSphere services, plus the total consumed metrics for all running virtual machines in MB. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold in percent. No value defined as default. +vmware_crit | **Optional.** The critical threshold in percent. No value defined as default. + + +#### vmware-esx-soap-host-mem-swapused + +Check command object for the `check_vmware_esx` plugin. Amount of memory that is used by swap. Sum of memory swapped of all powered on VMs and vSphere services on the host in MB. In case of an error all VMs with their swap used will be displayed. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold in percent. No value defined as default. +vmware_crit | **Optional.** The critical threshold in percent. No value defined as default. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-host-mem-overhead + +Check command object for the `check_vmware_esx` plugin. Additional mem used by VM Server in MB. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold in percent. No value defined as default. +vmware_crit | **Optional.** The critical threshold in percent. No value defined as default. + + +#### vmware-esx-soap-host-mem-memctl + +Check command object for the `check_vmware_esx` plugin. The sum of all vmmemctl values in MB for all powered-on virtual machines, plus vSphere services on the host. If the balloon target value is greater than the balloon value, the VMkernel inflates the balloon, causing more virtual machine memory to be reclaimed. If the balloon target value is less than the balloon value, the VMkernel deflates the balloon, which allows the virtual machine to consume additional memory if needed (used by VM memory control driver). In case of an error all VMs with their vmmemctl values will be displayed. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold in percent. No value defined as default. +vmware_crit | **Optional.** The critical threshold in percent. No value defined as default. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-host-net + +Check command object for the `check_vmware_esx` plugin. Shows net info. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist NICs. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist expression as regexp. + + +#### vmware-esx-soap-host-net-usage + +Check command object for the `check_vmware_esx` plugin. Overall network usage in KBps(Kilobytes per Second). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold in KBps(Kilobytes per Second). No value defined as default. +vmware_crit | **Optional.** The critical threshold in KBps(Kilobytes per Second). No value defined as default. + + +#### vmware-esx-soap-host-net-receive + +Check command object for the `check_vmware_esx` plugin. Data receive in KBps(Kilobytes per Second). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold in KBps(Kilobytes per Second). No value defined as default. +vmware_crit | **Optional.** The critical threshold in KBps(Kilobytes per Second). No value defined as default. + + +#### vmware-esx-soap-host-net-send + +Check command object for the `check_vmware_esx` plugin. Data send in KBps(Kilobytes per Second). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold in KBps(Kilobytes per Second). No value defined as default. +vmware_crit | **Optional.** The critical threshold in KBps(Kilobytes per Second). No value defined as default. + + +#### vmware-esx-soap-host-net-nic + +Check command object for the `check_vmware_esx` plugin. Check all active NICs. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist NICs. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist expression as regexp. + + +#### vmware-esx-soap-host-volumes + +Check command object for the `check_vmware_esx` plugin. Shows all datastore volumes info. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_subselect | **Optional.** Volume name to be checked the free space. +vmware_gigabyte | **Optional.** Output in GB instead of MB. +vmware_usedspace | **Optional.** Output used space instead of free. Defaults to "false". +vmware_alertonly | **Optional.** List only alerting volumes. Defaults to "false". +vmware_exclude | **Optional.** Blacklist volumes name. No value defined as default. +vmware_include | **Optional.** Whitelist volumes name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_warn | **Optional.** The warning threshold for volumes. Defaults to "80%". +vmware_crit | **Optional.** The critical threshold for volumes. Defaults to "90%". +vmware_spaceleft | **Optional.** This has to be used in conjunction with thresholds as mentioned above. + + +#### vmware-esx-soap-host-io + +Check command object for the `check_vmware_esx` plugin. Shows all disk io info. Without subselect no thresholds can be given. All I/O values are aggregated from historical intervals over the past 24 hours with a 5 minute sample rate. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-host-io-aborted + +Check command object for the `check_vmware_esx` plugin. Number of aborted SCSI commands. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-io-resets + +Check command object for the `check_vmware_esx` plugin. Number of SCSI bus resets. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-io-read + +Check command object for the `check_vmware_esx` plugin. Average number of kilobytes read from the disk each second. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-io-read-latency + +Check command object for the `check_vmware_esx` plugin. Average amount of time (ms) to process a SCSI read command issued from the Guest OS to the virtual machine. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-io-write + +Check command object for the `check_vmware_esx` plugin. Average number of kilobytes written to disk each second. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-io-write-latency + +Check command object for the `check_vmware_esx` plugin. Average amount of time (ms) taken to process a SCSI write command issued by the Guest OS to the virtual machine. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-io-usage + +Check command object for the `check_vmware_esx` plugin. Aggregated disk I/O rate. For hosts, this metric includes the rates for all virtual machines running on the host. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-io-kernel-latency + +Check command object for the `check_vmware_esx` plugin. Average amount of time (ms) spent by VMkernel processing each SCSI command. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-io-device-latency + +Check command object for the `check_vmware_esx` plugin. Average amount of time (ms) to complete a SCSI command from the physical device. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-io-queue-latency + +Check command object for the `check_vmware_esx` plugin. Average amount of time (ms) spent in the VMkernel queue. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-io-total-latency + +Check command object for the `check_vmware_esx` plugin. Average amount of time (ms) taken during the collection interval to process a SCSI command issued by the guest OS to the virtual machine. The sum of kernelWriteLatency and deviceWriteLatency. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-host-media + +Check command object for the `check_vmware_esx` plugin. List vm's with attached host mounted media like cd,dvd or floppy drives. This is important for monitoring because a virtual machine with a mount cd or dvd drive can not be moved to another host. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist VMs name. No value defined as default. +vmware_include | **Optional.** Whitelist VMs name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-host-service + +Check command object for the `check_vmware_esx` plugin. Shows host service info. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist services name. No value defined as default. +vmware_include | **Optional.** Whitelist services name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-host-runtime + +Check command object for the `check_vmware_esx` plugin. Shows runtime info: VMs, overall status, connection state, health, storagehealth, temperature and sensor are represented as one value and without thresholds. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-host-runtime-con + +Check command object for the `check_vmware_esx` plugin. Shows connection state. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-host-runtime-listvms + +Check command object for the `check_vmware_esx` plugin. List of VMware machines and their status. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist VMs name. No value defined as default. +vmware_include | **Optional.** Whitelist VMs name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-host-runtime-status + +Check command object for the `check_vmware_esx` plugin. Overall object status (gray/green/red/yellow). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-host-runtime-health + +Check command object for the `check_vmware_esx` plugin. Checks cpu/storage/memory/sensor status. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist status name. No value defined as default. +vmware_include | **Optional.** Whitelist status name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. + + +#### vmware-esx-soap-host-runtime-health-listsensors + +Check command object for the `check_vmware_esx` plugin. List all available sensors(use for listing purpose only). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist status name. No value defined as default. +vmware_include | **Optional.** Whitelist status name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. + + +#### vmware-esx-soap-host-runtime-health-nostoragestatus + +Check command object for the `check_vmware_esx` plugin. This is to avoid a double alarm if you use **vmware-esx-soap-host-runtime-health** and **vmware-esx-soap-host-runtime-storagehealth**. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist status name. No value defined as default. +vmware_include | **Optional.** Whitelist status name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. + + +#### vmware-esx-soap-host-runtime-storagehealth + +Check command object for the `check_vmware_esx` plugin. Local storage status check. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist storage name. No value defined as default. +vmware_include | **Optional.** Whitelist storage name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-host-runtime-temp + +Check command object for the `check_vmware_esx` plugin. Lists all temperature sensors. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist sensor name. No value defined as default. +vmware_include | **Optional.** Whitelist sensor name. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-host-runtime-issues + +Check command object for the `check_vmware_esx` plugin. Lists all configuration issues for the host. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist configuration issues. No value defined as default. +vmware_include | **Optional.** Whitelist configuration issues. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-host-storage + +Check command object for the `check_vmware_esx` plugin. Shows Host storage info. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist adapters, luns and paths. No value defined as default. +vmware_include | **Optional.** Whitelist adapters, luns and paths. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. + + +#### vmware-esx-soap-host-storage-adapter + +Check command object for the `check_vmware_esx` plugin. List host bus adapters. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist adapters. No value defined as default. +vmware_include | **Optional.** Whitelist adapters. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-host-storage-lun + +Check command object for the `check_vmware_esx` plugin. List SCSI logical units. The listing will include: LUN, canonical name of the disc, all of displayed name which is not part of the canonical name and status. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_exclude | **Optional.** Blacklist luns. No value defined as default. +vmware_include | **Optional.** Whitelist luns. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-host-storage-path + +Check command object for the `check_vmware_esx` plugin. List multipaths and the associated paths. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_host | **Required.** ESX or ESXi hostname. +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. In case the check is done through a Datacenter/vCenter host. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_alertonly | **Optional.** List only alerting units. Important here to avoid masses of data. Defaults to "false". +vmware_exclude | **Optional.** Blacklist paths. No value defined as default. +vmware_include | **Optional.** Whitelist paths. No value defined as default. +vmware_isregexp | **Optional.** Treat blacklist and whitelist expressions as regexp. +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + + +#### vmware-esx-soap-vm-cpu + +Check command object for the `check_vmware_esx` plugin. Shows all CPU usage info. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + + +#### vmware-esx-soap-vm-cpu-ready + +Check command object for the `check_vmware_esx` plugin. Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-vm-cpu-wait + +Check command object for the `check_vmware_esx` plugin. CPU time spent in wait state. The wait total includes time spent the CPU idle, CPU swap wait, and CPU I/O wait states. High or growing wait time can be a hint I/O bottlenecks. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-vm-cpu-usage + +Check command object for the `check_vmware_esx` plugin. Amount of actively used virtual CPU, as a percentage of total available CPU. This is the host's view of the CPU usage, not the guest operating system view. It is the average CPU utilization over all available virtual CPUs in the virtual machine. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** Warning threshold in percent. Defaults to "80%". +vmware_crit | **Optional.** Critical threshold in percent. Defaults to "90%". + + +#### vmware-esx-soap-vm-mem + +Check command object for the `check_vmware_esx` plugin. Shows all memory info, except overall. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-vm-mem-usage + +Check command object for the `check_vmware_esx` plugin. Average mem usage in percentage of configured virtual machine "physical" memory. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** Warning threshold in percent. Defaults to "80%". +vmware_crit | **Optional.** Critical threshold in percent. Defaults to "90%". + + +#### vmware-esx-soap-vm-mem-consumed + +Check command object for the `check_vmware_esx` plugin. Amount of guest physical memory in MB consumed by the virtual machine for guest memory. Consumed memory does not include overhead memory. It includes shared memory and memory that might be reserved, but not actually used. Use this metric for charge-back purposes.
    +**vm consumed memory = memory granted -- memory saved** + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-vm-mem-memctl + +Check command object for the `check_vmware_esx` plugin. Amount of guest physical memory that is currently reclaimed from the virtual machine through ballooning. This is the amount of guest physical memory that has been allocated and pinned by the balloon driver. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + + +#### vmware-esx-soap-vm-net + +Check command object for the `check_vmware_esx` plugin. Shows net info. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-vm-net-usage + +Check command object for the `check_vmware_esx` plugin. Overall network usage in KBps(Kilobytes per Second). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-vm-net-receive + +Check command object for the `check_vmware_esx` plugin. Receive in KBps(Kilobytes per Second). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-vm-net-send + +Check command object for the `check_vmware_esx` plugin. Send in KBps(Kilobytes per Second). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-vm-io + +Check command object for the `check_vmware_esx` plugin. SShows all disk io info. Without subselect no thresholds can be given. All I/O values are aggregated from historical intervals over the past 24 hours with a 5 minute sample rate. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-vm-io-read + +Check command object for the `check_vmware_esx` plugin. Average number of kilobytes read from the disk each second. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session - IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-vm-io-write + +Check command object for the `check_vmware_esx` plugin. Average number of kilobytes written to disk each second. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-vm-io-usage + +Check command object for the `check_vmware_esx` plugin. Aggregated disk I/O rate. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-vm-runtime + +Check command object for the `check_vmware_esx` plugin. Shows virtual machine runtime info. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-vm-runtime-con + +Check command object for the `check_vmware_esx` plugin. Shows the connection state. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-vm-runtime-powerstate + +Check command object for the `check_vmware_esx` plugin. Shows virtual machine power state: poweredOn, poweredOff or suspended. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-vm-runtime-status + +Check command object for the `check_vmware_esx` plugin. Overall object status (gray/green/red/yellow). + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + + +#### vmware-esx-soap-vm-runtime-consoleconnections + +Check command object for the `check_vmware_esx` plugin. Console connections to virtual machine. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_warn | **Optional.** The warning threshold. No value defined as default. +vmware_crit | **Optional.** The critical threshold. No value defined as default. + + +#### vmware-esx-soap-vm-runtime-gueststate + +Check command object for the `check_vmware_esx` plugin. Guest OS status. Needs VMware Tools installed and running. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd + +#### vmware-esx-soap-vm-runtime-tools + +Check command object for the `check_vmware_esx` plugin. Guest OS status. VMware tools status. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_openvmtools | **Optional** Prevent CRITICAL state for installed and running Open VM Tools. + + +#### vmware-esx-soap-vm-runtime-issues + +Check command object for the `check_vmware_esx` plugin. All issues for the virtual machine. + +Custom attributes passed as [command parameters](3-monitoring-basics.md#command-passing-parameters): + +Name | Description +------------------------|-------------- +vmware_datacenter | **Optional.** Datacenter/vCenter hostname. Conflicts with **vmware_host**. +vmware_host | **Optional.** ESX or ESXi hostname. Conflicts with **vmware_datacenter**. +vmware_vmname | **Required.** Virtual machine name. +vmware_sslport | **Optional.** SSL port connection. Defaults to "443". +vmware_ignoreunknown | **Optional.** Sometimes 3 (unknown) is returned from a component. But the check itself is ok. With this option the plugin will return OK (0) instead of UNKNOWN (3). Defaults to "false". +vmware_ignorewarning | **Optional.** Sometimes 2 (warning) is returned from a component. But the check itself is ok (from an operator view). With this option the plugin will return OK (0) instead of WARNING (1). Defaults to "false". +vmware_timeout | **Optional.** Seconds before plugin times out. Defaults to "90". +vmware_trace | **Optional.** Set verbosity level of vSphere API request/respond trace. +vmware_sessionfile | **Optional.** Session file name enhancement. +vmware_sessionfiledir | **Optional.** Path to store the **vmware_sessionfile** file. Defaults to "/var/spool/icinga2/tmp". +vmware_nosession | **Optional.** No auth session -- IT SHOULD BE USED FOR TESTING PURPOSES ONLY!. Defaults to "false". +vmware_username | **Optional.** The username to connect to Host or vCenter server. No value defined as default. +vmware_password | **Optional.** The username's password. No value defined as default. +vmware_authfile | **Optional.** Use auth file instead username/password to session connect. No effect if **vmware_username** and **vmware_password** are defined
    **Autentication file content:**
    username=vmuser
    password=p@ssw0rd +vmware_multiline | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\** for the GUI. No value defined as default. + +### Storage + +This category includes all plugins for various storage and object storage technologies. + +#### glusterfs + +The plugin `glusterfs` is a plugin to checks the GlusterFS storage health on the server. It is provided by `Philippe Kueck` on [https://www.unixadm.org/software/nagios-stuff/checks/check_glusterfs). This plugin needs sudo to run properly. + +Name | Description +---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ +glusterfs_perfdata | **Optional.** Print perfdata of all or the specified volume. +glusterfs_warnonfailedheal | **Optional.** Warn if the *heal-failed* log contains entries. The log can be cleared by restarting glusterd. +glusterfs_volume | **Optional.** Only check the specified *VOLUME*. If --volume is not set, all volumes are checked. +glusterfs_disk_warning | **Optional.** Warn if disk usage is above *DISKWARN*. Defaults to 90 (percent). +glusterfs_disk_critical | **Optional.** Return a critical error if disk usage is above *DISKCRIT*. Defaults to 95 (percent). +glusterfs_inode_warning | **Optional.** Warn if inode usage is above *DISKWARN*. Defaults to 90 (percent). +glusterfs_inode_critical | **Optional.** Return a critical error if inode usage is above *DISKCRIT*. Defaults to 95 (percent). diff --git a/vim/bundle/icinga2/doc/11-cli-commands.md b/vim/bundle/icinga2/doc/11-cli-commands.md new file mode 100644 index 0000000..31fea0f --- /dev/null +++ b/vim/bundle/icinga2/doc/11-cli-commands.md @@ -0,0 +1,632 @@ +# Icinga 2 CLI Commands + +Icinga 2 comes with a number of CLI commands which support bash autocompletion. + +These CLI commands will allow you to use certain functionality +provided by and around the Icinga 2 daemon. + +Each CLI command provides its own help and usage information, so please +make sure to always run them with the `--help` parameter. + +Run `icinga2` without any arguments to get a list of all available global +options. + + # icinga2 + icinga2 - The Icinga 2 network monitoring daemon (version: v2.5.0) + + Usage: + icinga2 [] + + Supported commands: + * console (Icinga console) + * daemon (starts Icinga 2) + * feature disable (disables specified feature) + * feature enable (enables specified feature) + * feature list (lists all enabled features) + * node add (add node) + * node blacklist add (adds a new blacklist filter) + * node blacklist list (lists all blacklist filters) + * node blacklist remove (removes a blacklist filter) + * node list (lists all nodes) + * node remove (removes node) + * node set (set node attributes) + * node setup (set up node) + * node update-config (update node config) + * node whitelist add (adds a new whitelist filter) + * node whitelist list (lists all whitelist filters) + * node whitelist remove (removes a whitelist filter) + * node wizard (wizard for node setup) + * object list (lists all objects) + * pki new-ca (sets up a new CA) + * pki new-cert (creates a new CSR) + * pki request (requests a certificate) + * pki save-cert (saves another Icinga 2 instance's certificate) + * pki sign-csr (signs a CSR) + * pki ticket (generates a ticket) + * repository clear-changes (clear uncommitted repository changes) + * repository commit (commit repository changes) + * repository endpoint add (adds a new Endpoint object) + * repository endpoint list (lists all Endpoint objects) + * repository endpoint remove (removes a Endpoint object) + * repository host add (adds a new Host object) + * repository host list (lists all Host objects) + * repository host remove (removes a Host object) + * repository service add (adds a new Service object) + * repository service list (lists all Service objects) + * repository service remove (removes a Service object) + * repository zone add (adds a new Zone object) + * repository zone list (lists all Zone objects) + * repository zone remove (removes a Zone object) + * troubleshoot (collect information for troubleshooting) + * variable get (gets a variable) + * variable list (lists all variables) + + Global options: + -h [ --help ] show this help message + -V [ --version ] show version information + --color use VT100 color codes even when stdout is not a + terminal + -D [ --define ] arg define a constant + -a [ --app ] arg application library name (default: icinga) + -l [ --library ] arg load a library + -I [ --include ] arg add include search directory + -x [ --log-level ] arg specify the log level for the console log + + Command options: + + Report bugs at + Icinga home page: + + +## Icinga 2 CLI Bash Autocompletion + +Bash Auto-Completion (pressing ``) is provided only for the corresponding context. + +While `--config` will suggest and auto-complete files and directories on disk, +`feature enable` will only suggest disabled features. `repository` will know +about object specific attributes, and so on. Try it yourself. + +RPM and Debian packages install the bash completion files into +`/etc/bash_completion.d/icinga2`. + +You will need to install the `bash-completion` package if not already installed. + +RHEL/CentOS/Fedora: + + # yum install bash-completion + +SUSE: + + # zypper install bash-completion + +Debian/Ubuntu: + + # apt-get install bash-completion + +## Icinga 2 CLI Global Options + +### Application Type + +By default the `icinga2` binary loads the `icinga` library. A different application type +can be specified with the `--app` command-line option. + +### Libraries + +Instead of loading libraries using the [`library` config directive](17-language-reference.md#library) +you can also use the `--library` command-line option. + +### Constants + +[Global constants](17-language-reference.md#constants) can be set using the `--define` command-line option. + +### Config Include Path + +When including files you can specify that the include search path should be +checked. You can do this by putting your configuration file name in angle +brackets like this: + + include + +This would cause Icinga 2 to search its include path for the configuration file +`test.conf`. By default the installation path for the Icinga Template Library +is the only search directory. + +Using the `--include` command-line option additional search directories can be +added. + + +## CLI command: Console + +The CLI command `console` can be used to evaluate Icinga config expressions, e.g. to test +[functions](17-language-reference.md#functions). + + $ icinga2 console + Icinga 2 (version: v2.4.0) + <1> => function test(name) { + <1> .. log("Hello " + name) + <1> .. } + null + <2> => test("World") + information/config: Hello World + null + <3> => + + +On operating systems without the `libedit` library installed there is no +support for line-editing or a command history. However you can +use the `rlwrap` program if you require those features: + + $ rlwrap icinga2 console + +The `console` can be used to connect to a running Icinga 2 instance using +the [REST API](12-icinga2-api.md#icinga2-api). [API permissions](12-icinga2-api.md#icinga2-api-permissions) +are required for executing config expressions and auto-completion. + +> **Note** +> The console does not currently support SSL certificate verification. + +You can specify the API URL using the `--connect` parameter. + +Although the password can be specified there process arguments on UNIX platforms are usually visible to other users (e.g. through `ps`). In order to securely specify the user credentials the console supports two environment variables: + + Environment variable | Description + ---------------------|------------- + ICINGA2_API_USERNAME | The API username. + ICINGA2_API_PASSWORD | The API password. + +Here's an example: + + $ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/' + Icinga 2 (version: v2.4.0) + <1> => + +Once connected you can inspect variables and execute other expressions by entering them at the prompt: + + <1> => var h = get_host("example.localdomain") + null + <2> => h.last_check_result + { + active = true + check_source = "example.localdomain" + command = [ "/usr/local/sbin/check_ping", "-H", "127.0.0.1", "-c", "5000,100%", "-w", "3000,80%" ] + execution_end = 1446653527.174983 + execution_start = 1446653523.152673 + exit_status = 0.000000 + output = "PING OK - Packet loss = 0%, RTA = 0.11 ms" + performance_data = [ "rta=0.114000ms;3000.000000;5000.000000;0.000000", "pl=0%;80;100;0" ] + schedule_end = 1446653527.175133 + schedule_start = 1446653583.150000 + state = 0.000000 + type = "CheckResult" + vars_after = { + attempt = 1.000000 + reachable = true + state = 0.000000 + state_type = 1.000000 + } + vars_before = { + attempt = 1.000000 + reachable = true + state = 0.000000 + state_type = 1.000000 + } + } + <3> => + + +You can use the `--eval` parameter to evaluate a single expression in batch mode. Using the `--file` option you can specify a file which should be evaluated. The output format for batch mode is JSON. + +The `--syntax-only` option can be used in combination with `--eval` or `--file` to check a script for syntax errors. In this mode the script is parsed to identify syntax errors but not evaluated. + +Here's an example that retrieves the command that was used by Icinga to check the `example.localdomain` host: + + $ ICINGA2_API_PASSWORD=icinga icinga2 console --connect 'https://root@localhost:5665/' --eval 'get_host("example.localdomain").last_check_result.command' | python -m json.tool + [ + "/usr/local/sbin/check_ping", + "-H", + "127.0.0.1", + "-c", + "5000,100%", + "-w", + "3000,80%" + ] + +## CLI command: Daemon + +The CLI command `daemon` provides the functionality to start/stop Icinga 2. +Furthermore it provides the [configuration validation](11-cli-commands.md#config-validation). + + # icinga2 daemon --help + icinga2 - The Icinga 2 network monitoring daemon (version: v2.5.0) + + Usage: + icinga2 daemon [] + + Starts Icinga 2. + + Global options: + -h [ --help ] show this help message + -V [ --version ] show version information + --color use VT100 color codes even when stdout is not a + terminal + -D [ --define ] arg define a constant + -a [ --app ] arg application library name (default: icinga) + -l [ --library ] arg load a library + -I [ --include ] arg add include search directory + -x [ --log-level ] arg specify the log level for the console log + + Command options: + -c [ --config ] arg parse a configuration file + -z [ --no-config ] start without a configuration file + -C [ --validate ] exit after validating the configuration + -e [ --errorlog ] arg log fatal errors to the specified log file (only works + in combination with --daemonize) + -d [ --daemonize ] detach from the controlling terminal + + Report bugs at + Icinga home page: + +### Config Files + +Using the `--config` option you can specify one or more configuration files. +Config files are processed in the order they're specified on the command-line. + +When no configuration file is specified and the `--no-config` is not used +Icinga 2 automatically falls back to using the configuration file +`SysconfDir + "/icinga2/icinga2.conf"` (where SysconfDir is usually `/etc`). + +### Config Validation + +The `--validate` option can be used to check if your configuration files +contain errors. If any errors are found, the exit status is 1, otherwise 0 +is returned. More details in the [configuration validation](11-cli-commands.md#config-validation) chapter. + + +## CLI command: Feature + +The `feature enable` and `feature disable` commands can be used to enable and disable features: + + # icinga2 feature disable + checker --color --define --help --include --library --log-level mainlog notification --version + + # icinga2 feature enable + api command debuglog graphite icingastatus ido-pgsql --library --log-level statusdata --version + --color compatlog --define --help ido-mysql --include livestatus perfdata syslog + +The `feature list` command shows which features are currently enabled: + + # icinga2 feature list + Disabled features: agent command compatlog debuglog gelf graphite icingastatus notification perfdata statusdata syslog + Enabled features: api checker livestatus mainlog + + +## CLI command: Node + +Provides the functionality to install and manage master and client +nodes in a [distributed monitoring](6-distributed-monitoring.md#distributed-monitoring) scenario. + + + # icinga2 node --help + icinga2 - The Icinga 2 network monitoring daemon (version: v2.5.0) + + Usage: + icinga2 [] + + Supported commands: + * node add (add node) + * node blacklist add (adds a new blacklist filter) + * node blacklist list (lists all blacklist filters) + * node blacklist remove (removes a blacklist filter) + * node list (lists all nodes) + * node remove (removes node) + * node set (set node attributes) + * node setup (set up node) + * node update-config (update node config) + * node whitelist add (adds a new whitelist filter) + * node whitelist list (lists all whitelist filters) + * node whitelist remove (removes a whitelist filter) + * node wizard (wizard for node setup) + + Global options: + -h [ --help ] show this help message + -V [ --version ] show version information + --color use VT100 color codes even when stdout is not a + terminal + -D [ --define ] arg define a constant + -a [ --app ] arg application library name (default: icinga) + -l [ --library ] arg load a library + -I [ --include ] arg add include search directory + -x [ --log-level ] arg specify the log level for the console log + + Command options: + + Report bugs at + Icinga home page: + + +## CLI command: Object + +The `object` CLI command can be used to list all configuration objects and their +attributes. The command also shows where each of the attributes was modified. +That way you can also identify which objects have been created from your [apply rules](17-language-reference.md#apply). + +More information can be found in the [troubleshooting](15-troubleshooting.md#list-configuration-objects) section. + + # icinga2 object --help + icinga2 - The Icinga 2 network monitoring daemon (version: v2.5.0) + + Usage: + icinga2 [] + + Supported commands: + * object list (lists all objects) + + Global options: + -h [ --help ] show this help message + -V [ --version ] show version information + --color use VT100 color codes even when stdout is not a + terminal + -D [ --define ] arg define a constant + -a [ --app ] arg application library name (default: icinga) + -l [ --library ] arg load a library + -I [ --include ] arg add include search directory + -x [ --log-level ] arg specify the log level for the console log + + Command options: + + Report bugs at + Icinga home page: + + + +## CLI command: Pki + +Provides the CLI commands to + +* generate a new local CA +* generate a new CSR or self-signed certificate +* sign a CSR and return a certificate +* save a master certificate manually +* request a signed certificate from the master +* generate a new ticket for the client setup + +This functionality is used by the [node setup/wizard](11-cli-commands.md#cli-command-pki) CLI commands too. + + # icinga2 pki --help + icinga2 - The Icinga 2 network monitoring daemon (version: v2.5.0) + + Usage: + icinga2 [] + + Supported commands: + * pki new-ca (sets up a new CA) + * pki new-cert (creates a new CSR) + * pki request (requests a certificate) + * pki save-cert (saves another Icinga 2 instance's certificate) + * pki sign-csr (signs a CSR) + * pki ticket (generates a ticket) + + Global options: + -h [ --help ] show this help message + -V [ --version ] show version information + --color use VT100 color codes even when stdout is not a + terminal + -D [ --define ] arg define a constant + -a [ --app ] arg application library name (default: icinga) + -l [ --library ] arg load a library + -I [ --include ] arg add include search directory + -x [ --log-level ] arg specify the log level for the console log + + Command options: + + Report bugs at + Icinga home page: + + +## CLI command: Repository + +This command is not supported anymore. Parts of its functionality +are used in the [node update-config](11-cli-commands.md#cli-command-node) cli command. + +## CLI command: Troubleshoot + +Collects basic information like version, paths, log files and crash reports for troubleshooting purposes and prints them to a file or the console. See [troubleshooting](15-troubleshooting.md#troubleshooting-information-required). + +Its output defaults to a file named `troubleshooting-[TIMESTAMP].log` so it won't overwrite older troubleshooting files. + +> **Note** +> Keep in mind that this tool can not collect information from other icinga2 nodes, you will have to run it on +> each of one of you instances. +> This is only a tool to collect information to help others help you, it will not attempt to fix anything. + + + # icinga2 troubleshoot --help + icinga2 - The Icinga 2 network monitoring daemon (version: v2.2.0-551-g1d0f6ed) + + Usage: + icinga2 troubleshoot [] + + Global options: + -h [ --help ] show this help message + -V [ --version ] show version information + --color use VT100 color codes even when stdout is not aterminal + -D [ --define ] arg define a constant + -a [ --app ] arg application library name (default: icinga) + -l [ --library ] arg load a library + -I [ --include ] arg add include search directory + -x [ --log-level ] arg specify the log level for the console log + + Command options: + -c [ --console ] print to console instead of file + -o [ --output ] arg path to output file + --include-vars print variables to separate file + --inluce-objects print object to separate file + + Report bugs at + Icinga home page: + +## CLI command: Variable + +Lists all configured variables (constants) in a similar fasion like [object list](11-cli-commands.md#cli-command-object). + + # icinga2 variable --help + icinga2 - The Icinga 2 network monitoring daemon (version: v2.5.0) + + Usage: + icinga2 [] + + Supported commands: + * variable get (gets a variable) + * variable list (lists all variables) + + Global options: + -h [ --help ] show this help message + -V [ --version ] show version information + --color use VT100 color codes even when stdout is not a + terminal + -D [ --define ] arg define a constant + -a [ --app ] arg application library name (default: icinga) + -l [ --library ] arg load a library + -I [ --include ] arg add include search directory + -x [ --log-level ] arg specify the log level for the console log + + Command options: + + Report bugs at + Icinga home page: + + +## Enabling/Disabling Features + +Icinga 2 provides configuration files for some commonly used features. These +are installed in the `/etc/icinga2/features-available` directory and can be +enabled and disabled using the `icinga2 feature enable` and `icinga2 feature disable` +[CLI commands](11-cli-commands.md#cli-command-feature), respectively. + +The `icinga2 feature enable` CLI command creates symlinks in the +`/etc/icinga2/features-enabled` directory which is included by default +in the example configuration file. + +You can view a list of enabled and disabled features: + + # icinga2 feature list + Disabled features: api command compatlog debuglog graphite icingastatus ido-mysql ido-pgsql livestatus notification perfdata statusdata syslog + Enabled features: checker mainlog notification + +Using the `icinga2 feature enable` command you can enable features: + + # icinga2 feature enable graphite + Enabling feature graphite. Make sure to restart Icinga 2 for these changes to take effect. + + +You can disable features using the `icinga2 feature disable` command: + + # icinga2 feature disable ido-mysql livestatus + Disabling feature ido-mysql. Make sure to restart Icinga 2 for these changes to take effect. + Disabling feature livestatus. Make sure to restart Icinga 2 for these changes to take effect. + + +The `icinga2 feature enable` and `icinga2 feature disable` commands do not +restart Icinga 2. You will need to restart Icinga 2 using the init script +after enabling or disabling features. + + + +## Configuration Validation + +Once you've edited the configuration files make sure to tell Icinga 2 to validate +the configuration changes. Icinga 2 will log any configuration error including +a hint on the file, the line number and the affected configuration line itself. + +The following example creates an apply rule without any `assign` condition. + + apply Service "5872-ping4" { + import "generic-service" + check_command = "ping4" + //assign where match("5872-*", host.name) + } + +Validate the configuration with the init script option `checkconfig`: + + # /etc/init.d/icinga2 checkconfig + +> **Note** +> +> Using [systemd](2-getting-started.md#systemd-service) you need to manually validate the configuration using +> the CLI command below. + +Or manually passing the `-C` argument: + + # /usr/sbin/icinga2 daemon -c /etc/icinga2/icinga2.conf -C + + [2014-05-22 17:07:25 +0200] critical/ConfigItem: Location: + /etc/icinga2/conf.d/tests/5872.conf(5): } + /etc/icinga2/conf.d/tests/5872.conf(6): + /etc/icinga2/conf.d/tests/5872.conf(7): apply Service "5872-ping4" { + ^^^^^^^^^^^^^ + /etc/icinga2/conf.d/tests/5872.conf(8): import "test-generic-service" + /etc/icinga2/conf.d/tests/5872.conf(9): check_command = "ping4" + + Config error: 'apply' is missing 'assign' + [2014-05-22 17:07:25 +0200] critical/ConfigItem: 1 errors, 0 warnings. + Icinga 2 detected configuration errors. + +> **Tip** +> +> Icinga 2 will automatically detect the default path for `icinga2.conf` +> in `SysconfDir + /icinga2/icinga2.conf` and you can safely omit this parameter. +> +> `# icinga2 daemon -C` + +If you encounter errors during configuration validation, please make sure +to read the [troubleshooting](15-troubleshooting.md#troubleshooting) chapter. + +You can also use the [CLI command](11-cli-commands.md#cli-command-object) `icinga2 object list` +after validation passes to analyze object attributes, inheritance or created +objects by apply rules. +Find more on troubleshooting with `object list` in [this chapter](15-troubleshooting.md#list-configuration-objects). + +Example filtered by `Service` objects with the name `ping*`: + + # icinga2 object list --type Service --name *ping* + Object 'icinga.org!ping4' of type 'Service': + * __name = 'icinga.org!ping4' + * check_command = 'ping4' + % = modified in '/etc/icinga2/conf.d/services.conf', lines 17:3-17:25 + * check_interval = 60 + % = modified in '/etc/icinga2/conf.d/templates.conf', lines 28:3-28:21 + * host_name = 'icinga.org' + % = modified in '/etc/icinga2/conf.d/services.conf', lines 14:1-14:21 + * max_check_attempts = 3 + % = modified in '/etc/icinga2/conf.d/templates.conf', lines 27:3-27:24 + * name = 'ping4' + % = modified in '/etc/icinga2/conf.d/services.conf', lines 14:1-14:21 + * retry_interval = 30 + % = modified in '/etc/icinga2/conf.d/templates.conf', lines 29:3-29:22 + * templates = [ 'ping4', 'generic-service' ] + % += modified in '/etc/icinga2/conf.d/services.conf', lines 14:1-14:21 + % += modified in '/etc/icinga2/conf.d/templates.conf', lines 26:1-30:1 + * type = 'Service' + * vars + % += modified in '/etc/icinga2/conf.d/services.conf', lines 18:3-18:19 + * sla = '24x7' + % = modified in '/etc/icinga2/conf.d/services.conf', lines 18:3-18:19 + + + +## Reload on Configuration Changes + +Everytime you have changed your configuration you should first tell Icinga 2 +to [validate](11-cli-commands.md#config-validation). If there are no validation errors, you can +safely reload the Icinga 2 daemon. + + # /etc/init.d/icinga2 reload + +> **Note** +> +> The `reload` action will send the `SIGHUP` signal to the Icinga 2 daemon +> which will validate the configuration in a separate process and not stop +> the other events like check execution, notifications, etc. +> +> Details can be found [here](22-migrating-from-icinga-1x.md#differences-1x-2-real-reload). + diff --git a/vim/bundle/icinga2/doc/12-icinga2-api.md b/vim/bundle/icinga2/doc/12-icinga2-api.md new file mode 100644 index 0000000..0ed18f2 --- /dev/null +++ b/vim/bundle/icinga2/doc/12-icinga2-api.md @@ -0,0 +1,1845 @@ +# Icinga 2 API + +## Setting up the API + +You can run the CLI command `icinga2 api setup` to enable the +`api` [feature](11-cli-commands.md#enable-features) and set up +certificates as well as a new API user `root` with an auto-generated password in the +`/etc/icinga2/conf.d/api-users.conf` configuration file: + + # icinga2 api setup + +Make sure to restart Icinga 2 to enable the changes you just made: + + # service icinga2 restart + +If you prefer to set up the API manually, you will have to perform the following steps: + +* Set up X.509 certificates for Icinga 2 +* Enable the `api` feature (`icinga2 feature enable api`) +* Create an `ApiUser` object for authentication + +The next chapter provides a quick overview of how you can use the API. + +## Introduction + +The Icinga 2 API allows you to manage configuration objects +and resources in a simple, programmatic way using HTTP requests. + +The URL endpoints are logically separated allowing you to easily +make calls to + +* query, create, modify and delete [config objects](12-icinga2-api.md#icinga2-api-config-objects) +* perform [actions](12-icinga2-api.md#icinga2-api-actions) (reschedule checks, etc.) +* subscribe to [event streams](12-icinga2-api.md#icinga2-api-event-streams) +* [manage configuration packages](12-icinga2-api.md#icinga2-api-config-management) +* evaluate [script expressions](12-icinga2-api.md#icinga2-api-console) + +### Requests + +Any tool capable of making HTTP requests can communicate with +the API, for example [curl](http://curl.haxx.se). + +Requests are only allowed to use the HTTPS protocol so that +traffic remains encrypted. + +By default the Icinga 2 API listens on port `5665` which is shared with +the cluster stack. The port can be changed by setting the `bind_port` attribute +for the [ApiListener](9-object-types.md#objecttype-apilistener) +object in the `/etc/icinga2/features-available/api.conf` +configuration file. + +Supported request methods: + + Method | Usage + -------|-------- + GET | Retrieve information about configuration objects. Any request using the GET method is read-only and does not affect any objects. + POST | Update attributes of a specified configuration object. + PUT | Create a new object. The PUT request must include all attributes required to create a new object. + DELETE | Remove an object created by the API. The DELETE method is idempotent and does not require any check if the object actually exists. + +All requests apart from `GET` require that the following `Accept` header is set: + + Accept: application/json + +Each URL is prefixed with the API version (currently "/v1"). + +### Responses + +Successful requests will send back a response body containing a `results` +list. Depending on the number of affected objects in your request, the +`results` list may contain more than one entry. + +The output will be sent back as a JSON object: + + + { + "results": [ + { + "code": 200.0, + "status": "Object was created." + } + ] + } + +> **Note** +> +> Future versions of Icinga 2 might set additional fields. Your application +> should gracefully handle fields it is not familiar with, for example by +> ignoring them. + +### HTTP Statuses + +The API will return standard [HTTP statuses](https://www.ietf.org/rfc/rfc2616.txt) +including error codes. + +When an error occurs, the response body will contain additional information +about the problem and its source. + +A status code between 200 and 299 generally means that the request was +successful. + +Return codes within the 400 range indicate that there was a problem with the +request. Either you did not authenticate correctly, you are missing the authorization +for your requested action, the requested object does not exist or the request +was malformed. + +A status in the range of 500 generally means that there was a server-side problem +and Icinga 2 is unable to process your request. + +### Authentication + +There are two different ways for authenticating against the Icinga 2 API: + +* username and password using HTTP basic auth +* X.509 certificate + +In order to configure a new API user you'll need to add a new [ApiUser](9-object-types.md#objecttype-apiuser) +configuration object. In this example `root` will be the basic auth username +and the `password` attribute contains the basic auth password. + + # vim /etc/icinga2/conf.d/api-users.conf + + object ApiUser "root" { + password = "icinga" + } + +Alternatively you can use X.509 client certificates by specifying the `client_cn` +the API should trust. The X.509 certificate has to be signed by the CA certificate +that is configured in the [ApiListener](9-object-types.md#objecttype-apilistener) object. + + # vim /etc/icinga2/conf.d/api-users.conf + + object ApiUser "root" { + client_cn = "CertificateCommonName" + } + +An `ApiUser` object can have both authentication methods configured. + +You can test authentication by sending a GET request to the API: + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1' + +In case you get an error message make sure to check the API user credentials. + +When using client certificates for authentication you'll need to pass your client certificate +and private key to the curl call: + + $ curl -k --cert example.localdomain.crt --key example.localdomain.key 'https://example.localdomain:5665/v1/status' + +In case of an error make sure to verify the client certificate and CA. + +The curl parameter `-k` disables certificate verification and should therefore +only be used for testing. In order to securely check each connection you'll need to +specify the trusted CA certificate using the curl parameter`--cacert`: + + $ curl -u root:icinga --cacert ca.crt 'icinga2.node1.localdomain:5665/v1' + +Read the next chapter on [API permissions](12-icinga2-api.md#icinga2-api-permissions) +in order to configure authorization settings for your newly created API user. + +### Permissions + +By default an API user does not have any permissions to perform +actions on the URL endpoints. + +Permissions for API users must be specified in the `permissions` attribute +as array. The array items can be a list of permission strings with wildcard +matches. + +Example for an API user with all permissions: + + permissions = [ "*" ] + +Note that you can use wildcards. Here's another example that only allows the user +to perform read-only object queries for hosts and services: + + permissions = [ "objects/query/Host", "objects/query/Service" ] + +You can also further restrict permissions by specifying a filter expression. The +filter expression has to be a [lambda function](17-language-reference.md#nullary-lambdas) +which must return a boolean value. + +The following example allows the API user to query all hosts and services which have a +custom attribute `os` that matches the regular expression `^Linux`. + + permissions = [ + { + permission = "objects/query/Host" + filter = {{ regex("^Linux", host.vars.os) }} + }, + { + permission = "objects/query/Service" + filter = {{ regex("^Linux", service.vars.os) }} + } + ] + +More information about filters can be found in the [filters](12-icinga2-api.md#icinga2-api-filters) chapter. + +Available permissions for specific URL endpoints: + + Permissions | URL Endpoint | Supports Filters + ------------------------------|---------------|----------------- + actions/<action> | /v1/actions | Yes + config/query | /v1/config | No + config/modify | /v1/config | No + console | /v1/console | No + events/<type> | /v1/events | No + objects/query/<type> | /v1/objects | Yes + objects/create/<type> | /v1/objects | No + objects/modify/<type> | /v1/objects | Yes + objects/delete/<type> | /v1/objects | Yes + status/query | /v1/status | Yes + templates/<type> | /v1/templates | Yes + types | /v1/types | Yes + variables | /v1/variables | Yes + +The required actions or types can be replaced by using a wildcard match ("\*"). + +### Parameters + +Depending on the request method there are two ways of +passing parameters to the request: + +* JSON object as request body (all request methods other than `GET`) +* Query string as URL parameter (all request methods) + +Reserved characters by the HTTP protocol must be [URL-encoded](https://en.wikipedia.org/wiki/Percent-encoding) +as query string, e.g. a space character becomes `%20`. + +Example for a URL-encoded query string: + + /v1/objects/hosts?filter=match(%22example.localdomain*%22,host.name)&attrs=name&attrs=state + +Here are the exact same query parameters as a JSON object: + + { "filter": "match(\"example.localdomain*\",host.name)", "attrs": [ "host.name", "host.state" ] } + +### Request Method Override + +`GET` requests do not allow you to send a request body. In case you cannot pass everything as URL parameters (e.g. complex filters or JSON-encoded dictionaries) you can use the `X-HTTP-Method-Override` header. This comes in handy when you are using HTTP proxies disallowing `PUT` or `DELETE` requests too. + +Query an existing object by sending a `POST` request with `X-HTTP-Method-Override: GET` as request header: + + $ curl -k -s -u 'root:icinga' -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/hosts' + +Delete an existing object by sending a `POST` request with `X-HTTP-Method-Override: DELETE` as request header: + + $ curl -k -s -u 'root:icinga' -H 'X-HTTP-Method-Override: DELETE' -X POST 'https://localhost:5665/v1/objects/hosts/example.localdomain' + +### Filters + +#### Simple Filters + +By default actions and queries operate on all objects unless further restricted by the user. For +example, the following query returns all `Host` objects: + + https://localhost:5665/v1/objects/hosts + +If you're only interested in a single object, you can limit the output to that object by specifying its name: + + https://localhost:5665/v1/objects/hosts?host=localhost + +**The name of the URL parameter is the lower-case version of the type the query applies to.** For +example, for `Host` objects the URL parameter therefore is `host`, for `Service` objects it is +`service` and so on. + +You can also specify multiple objects: + + https://localhost:5665/v1/objects/hosts?hosts=first-host&hosts=second-host + +Again -- like in the previous example -- the name of the URL parameter is the lower-case version of the type. However, because we're specifying multiple objects here the **plural form** of the type is used. + +When specifying names for objects which have composite names like for example services the +full name has to be used: + + https://localhost:5665/v1/objects/services?service=localhost!ping6 + +The full name of an object can be obtained by looking at the `__name` attribute. + +#### Advanced Filters + +Most of the information provided in this chapter applies to both permission filters (as used when +configuring `ApiUser` objects) and filters specified in queries. + +Advanced filters allow users to filter objects using lambda expressions. The syntax for these filters is the same like for [apply rule expressions](3-monitoring-basics.md#using-apply-expressions). + +> **Note** +> +> Filters used as URL parameter must be URL-encoded. The following examples +> are **not URL-encoded** for better readability. + +Example matching all services in NOT-OK state: + + https://localhost:5665/v1/objects/services?filter=service.state!=ServiceOK + +Example matching all hosts by name: + + https://localhost:5665/v1/objects/hosts?filter=match("example.localdomain*",host.name) + +Example for all hosts which are in the host group `linux-servers`: + + https://localhost:5665/v1/objects/hosts?filter="linux-servers" in host.groups + +User-specified filters are run in a sandbox environment which ensures that filters cannot +modify Icinga's state, for example object attributes or global variables. + +When querying objects of a specific type the filter expression is evaluated for each object +of that type. The object is made available to the filter expression as a variable whose name +is the lower-case version of the object's type name. + +For example when querying objects of type `Host` the variable in the filter expression is named +`host`. Additionally related objects such as the host's check command are also made available +(e.g., via the `check_command` variable). The variable names are the exact same as for the `joins` +query parameter; see [object query joins](12-icinga2-api.md#icinga2-api-config-objects-query-joins) +for details. + +The object is also made available via the `obj` variable. This makes it easier to build +filters which can be used for more than one object type (e.g., for permissions). + +Some queries can be performed for more than just one object type. One example is the 'reschedule-check' +action which can be used for both hosts and services. When using advanced filters you will also have to specify the +type using the `type` parameter: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/reschedule-check' \ + -d '{ "type": "Service", "filter": "service.name==\"ping6\"" }' | python -m json.tool + +When building filters you have to ensure that values such as +`"linux-servers"` are escaped properly according to the rules of the Icinga 2 configuration +language. + +To make using the API in scripts easier you can use the `filter_vars` attribute to specify +variables which should be made available to your filter expression. This way you don't have +to worry about escaping values: + + $ curl -k -s -u 'root:icinga' -H 'X-HTTP-Method-Override: GET' -X POST 'https://localhost:5665/v1/objects/hosts' \ + -d '{ "filter": "host.vars.os == os", "filter_vars": { "os": "Linux" } }' + +We're using X-HTTP-Method-Override here because the HTTP specification does +not allow message bodies for GET requests. + +The `filters_vars` attribute can only be used inside the request body, but not as +a URL parameter because there is no way to specify a dictionary in a URL. + +## Config Objects + +Provides methods to manage configuration objects: + +* [creating objects](12-icinga2-api.md#icinga2-api-config-objects-create) +* [querying objects](12-icinga2-api.md#icinga2-api-config-objects-query) +* [modifying objects](12-icinga2-api.md#icinga2-api-config-objects-modify) +* [deleting objects](12-icinga2-api.md#icinga2-api-config-objects-delete) + +### API Objects and Cluster Config Sync + +Newly created or updated objects can be synced throughout your +Icinga 2 cluster. Set the `zone` attribute to the zone this object +belongs to and let the API and cluster handle the rest. + +Objects without a zone attribute are only synced in the same zone the Icinga instance belongs to. + +> **Note** +> +> Cluster nodes must accept configuration for creating, modifying +> and deleting objects. Ensure that `accept_config` is set to `true` +> in the [ApiListener](9-object-types.md#objecttype-apilistener) object +> on each node. + +If you add a new cluster instance, or reconnect an instance which has been offline +for a while, Icinga 2 takes care of the initial object sync for all objects +created by the API. + +### Querying Objects + +You can request information about configuration objects by sending +a `GET` query to the `/v1/objects/` URL endpoint. ` Object Queries Result + +Each response entry in the results array contains the following attributes: + + Attribute | Type | Description + -----------|------------|-------------- + name | string | Full object name. + type | string | Object type. + attrs | dictionary | Object attributes (can be filtered using the URL parameter `attrs`). + joins | dictionary | [Joined object types](12-icinga2-api.md#icinga2-api-config-objects-query-joins) as key, attributes as nested dictionary. Disabled by default. + meta | dictionary | Contains `used_by` object references. Disabled by default, enable it using `?meta=used_by` as URL parameter. + +#### Object Query Joins + +Icinga 2 knows about object relations. For example it can optionally return +information about the host when querying service objects. + +The following query retrieves all host attributes: + + https://localhost:5665/v1/objects/services?joins=host + +Instead of requesting all host attributes you can also limit the output to specific +attributes: + + https://localhost:5665/v1/objects/services?joins=host.name&joins=host.address + +You can request that all available joins are returned in the result set by using +the `all_joins` query parameter. + + https://localhost:5665/v1/objects/services?all_joins=1 + +> **Note** +> +> For performance reasons you should only request attributes which your application +> requires. + +The following joins are available: + + Object Type | Object Relations (`joins` prefix name) + -------------|------------------------------------------ + Service | host, check\_command, check\_period, event\_command, command\_endpoint + Host | check\_command, check\_period, event\_command, command\_endpoint + Notification | host, service, command, period + Dependency | child\_host, child\_service, parent\_host, parent\_service, period + User | period + Zones | parent + +Here's an example that retrieves all service objects for hosts which have had their `os` +custom attribute set to `Linux`. The result set contains the `display_name` and `check_command` +attributes for the service. The query also returns the host's `name` and `address` attribute +via a join: + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/objects/services?attrs=display_name&attrs=check_command&joins=host.name&joins=host.address&filter=host.vars.os==%22Linux%22' | python -m json.tool + + { + "results": [ + { + "attrs": { + "check_command": "ping4", + "display_name": "ping4" + }, + "joins": { + "host": { + "address": "192.168.1.1", + "name": "example.localdomain" + } + }, + "meta": {}, + "name": "example.localdomain!ping4", + "type": "Service" + }, + { + "attrs": { + "check_command": "ssh", + "display_name": "ssh" + }, + "joins": { + "host": { + "address": "192.168.1.1", + "name": "example.localdomain" + } + }, + "meta": {}, + "name": "example.localdomain!ssh", + "type": "Service" + } + ] + } + +In case you want to fetch all [comments](9-object-types.md#objecttype-comment) +for hosts and services, you can use the following query URL (similar example +for downtimes): + + https://localhost:5665/v1/objects/comments?joins=host&joins=service + +### Creating Config Objects + +New objects must be created by sending a PUT request. The following +parameters need to be passed inside the JSON body: + + Parameters | Type | Description + -----------|--------------|-------------------------- + templates | string array | **Optional.** Import existing configuration templates for this object type. + attrs | dictionary | **Required.** Set specific object attributes for this [object type](9-object-types.md#object-types). + +The object name must be specified as part of the URL path. For objects with composite names (e.g. services) +the full name (e.g. `localhost!http`) must be specified. + +If attributes are of the Dictionary type, you can also use the indexer format. This might be necessary to only override specific custom variables and keep all other existing custom variables (e.g. from templates): + + "attrs": { "vars.os": "Linux" } + +Example for creating the new host object `example.localdomain`: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X PUT 'https://localhost:5665/v1/objects/hosts/example.localdomain' \ + -d '{ "templates": [ "generic-host" ], "attrs": { "address": "192.168.1.1", "check_command": "hostalive", "vars.os" : "Linux" } }' \ + | python -m json.tool + { + "results": [ + { + "code": 200.0, + "status": "Object was created." + } + ] + } + +If the configuration validation fails, the new object will not be created and the response body +contains a detailed error message. The following example is missing the `check_command` attribute +which is required for host objects: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X PUT 'https://localhost:5665/v1/objects/hosts/example.localdomain' \ + -d '{ "attrs": { "address": "192.168.1.1", "vars.os" : "Linux" } }' \ + | python -m json.tool + { + "results": [ + { + "code": 500.0, + "errors": [ + "Error: Validation failed for object 'example.localdomain' of type 'Host'; Attribute 'check_command': Attribute must not be empty." + ], + "status": "Object could not be created." + } + ] + } + +Service objects must be created using their full name ("hostname!servicename") referencing an existing host object: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X PUT 'https://localhost:5665/v1/objects/services/localhost!realtime-load' \ + -d '{ "templates": [ "generic-service" ], "attrs": { "check_command": "load", "check_interval": 1,"retry_interval": 1 } }' + + +Example for a new CheckCommand object: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X PUT 'https://localhost:5665/v1/objects/checkcommands/mytest' \ + -d '{ "templates": [ "plugin-check-command" ], "attrs": { "command": [ "/usr/local/sbin/check_http" ], "arguments": { "-I": "$mytest_iparam$" } } }' + + +### Modifying Objects + +Existing objects must be modified by sending a `POST` request. The following +parameters need to be passed inside the JSON body: + + Parameters | Type | Description + -----------|------------|--------------------------- + attrs | dictionary | **Required.** Set specific object attributes for this [object type](9-object-types.md#object-types). + +In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) should be provided. + +**Note**: Modified attributes do not trigger a re-evaluation of existing +static [apply rules](3-monitoring-basics.md#using-apply) and [group assignments](3-monitoring-basics.md#group-assign-intro). +Delete and re-create the objects if you require such changes. + + +If attributes are of the Dictionary type, you can also use the indexer format: + + "attrs": { "vars.os": "Linux" } + +The following example updates the `address` attribute and the custom attribute `os` for the `example.localdomain` host: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/objects/hosts/example.localdomain' \ + -d '{ "attrs": { "address": "192.168.1.2", "vars.os" : "Windows" } }' \ + | python -m json.tool + { + "results": [ + { + "code": 200.0, + "name": "example.localdomain", + "status": "Attributes updated.", + "type": "Host" + } + ] + } + + +### Deleting Objects + +You can delete objects created using the API by sending a `DELETE` +request. + + Parameters | Type | Description + -----------|---------|--------------- + cascade | boolean | **Optional.** Delete objects depending on the deleted objects (e.g. services on a host). + +In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) should be provided. + +Example for deleting the host object `example.localdomain`: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X DELETE 'https://localhost:5665/v1/objects/hosts/example.localdomain?cascade=1' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "name": "example.localdomain", + "status": "Object was deleted.", + "type": "Host" + } + ] + } + +## Config Templates + +Provides methods to manage configuration templates: + +* [querying templates](12-icinga2-api.md#icinga2-api-config-templates-query) + +### Querying Templates + +You can request information about configuration templates by sending +a `GET` query to the `/v1/templates/` URL endpoint. ` Variables + +Provides methods to manage global variables: + +* [querying variables](12-icinga2-api.md#icinga2-api-variables-query) + +### Querying Variables + +You can request information about global variables by sending +a `GET` query to the `/v1/variables/` URL endpoint: + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/variables' + +A [filter](12-icinga2-api.md#icinga2-api-filters) may be provided for this query type. The +variable information object can be accessed in the filter using the `variable` variable: + + $ curl -u root:root -k 'https://localhost:5661/v1/variables' -H "Accept: application/json" -X PUT -H "X-HTTP-Method-Override: GET" \ + -d '{ "filter": "variable.type in [ \"String\", \"Number\" ]" }' + +Instead of using a filter you can optionally specify the variable name in the +URL path when querying a single variable: + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/variables/PrefixDir' + +The result set contains the type, name and value of the global variable. + +## Actions + +There are several actions available for Icinga 2 provided by the `/v1/actions` +URL endpoint. You can run actions by sending a `POST` request. + +In case you have been using the [external commands](14-features.md#external-commands) +in the past, the API actions provide a similar interface with filter +capabilities for some of the more common targets which do not directly change +the configuration. + +All actions return a 200 `OK` or an appropriate error code for each +action performed on each object matching the supplied filter. + +Actions which affect the Icinga Application itself such as disabling +notification on a program-wide basis must be applied by updating the +[IcingaApplication object](12-icinga2-api.md#icinga2-api-config-objects) +called `app`. + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/objects/icingaapplications/app' -d '{ "attrs": { "enable_notifications": false } }' + +### process-check-result + +Process a check result for a host or a service. + +Send a `POST` request to the URL endpoint `/v1/actions/process-check-result`. + + Parameter | Type | Description + ------------------|--------------|-------------- + exit\_status | integer | **Required.** For services: 0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN, for hosts: 0=OK, 1=CRITICAL. + plugin\_output | string | **Required.** The plugins main output. Does **not** contain the performance data. + performance\_data | string array | **Optional.** The performance data. + check\_command | string array | **Optional.** The first entry should be the check commands path, then one entry for each command line option followed by an entry for each of its argument. + check\_source | string | **Optional.** Usually the name of the `command_endpoint` + +In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host` and `Service`. + +Example: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/process-check-result?service=example.localdomain!passive-ping6' \ + -d '{ "exit_status": 2, "plugin_output": "PING CRITICAL - Packet loss = 100%", "performance_data": [ "rta=5000.000000ms;3000.000000;5000.000000;0.000000", "pl=100%;80;100;0" ], "check_source": "example.localdomain" }' | python -m json.tool + + { + "results": [ + { + "code": 200.0, + "status": "Successfully processed check result for object 'localdomain!passive-ping6'." + } + ] + } + +### reschedule-check + +Reschedule a check for hosts and services. The check can be forced if required. + +Send a `POST` request to the URL endpoint `/v1/actions/reschedule-check`. + + Parameter | Type | Description + -------------|-----------|-------------- + next\_check | timestamp | **Optional.** The next check will be run at this time. If omitted, the current time is used. + force\_check | boolean | **Optional.** Defaults to `false`. If enabled, the checks are executed regardless of time period restrictions and checks being disabled per object or on a global basis. + +In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host` and `Service`. + +The example reschedules all services with the name "ping6" to immediately perform a check +(`next_check` default), ignoring any time periods or whether active checks are +allowed for the service (`force_check=true`). + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/reschedule-check' \ + -d '{ "type": "Service", "filter": "service.name==\"ping6\"", "force_check": true }' | python -m json.tool + + { + "results": [ + { + "code": 200.0, + "status": "Successfully rescheduled check for object 'localhost!ping6'." + } + ] + } + + +### send-custom-notification + +Send a custom notification for hosts and services. This notification +type can be forced being sent to all users. + +Send a `POST` request to the URL endpoint `/v1/actions/send-custom-notification`. + + Parameter | Type | Description + ----------|---------|-------------- + author | string | **Required.** Name of the author, may be empty. + comment | string | **Required.** Comment text, may be empty. + force | boolean | **Optional.** Default: false. If true, the notification is sent regardless of downtimes or whether notifications are enabled or not. + +In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host` and `Service`. + +Example for a custom host notification announcing a global maintenance to +host owners: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/send-custom-notification' \ + -d '{ "type": "Host", "author": "icingaadmin", "comment": "System is going down for maintenance", "force": true }' | python -m json.tool + + { + "results": [ + { + "code": 200.0, + "status": "Successfully sent custom notification for object 'host0'." + }, + { + "code": 200.0, + "status": "Successfully sent custom notification for object 'host1'." + } + } + +### delay-notification + +Delay notifications for a host or a service. +Note that this will only have an effect if the service stays in the same problem +state that it is currently in. If the service changes to another state, a new +notification may go out before the time you specify in the `timestamp` argument. + +Send a `POST` request to the URL endpoint `/v1/actions/delay-notification`. + + Parameter | Type | Description + ----------|-----------|-------------- + timestamp | timestamp | **Required.** Delay notifications until this timestamp. + +In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host` and `Service`. + +Example: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/delay-notification' \ + -d '{ "type": "Service", "timestamp": 1446389894 }' | python -m json.tool + + { + "results": [ + { + "code": 200.0, + "status": "Successfully delayed notifications for object 'host0!service0'." + }, + { + "code": 200.0, + "status": "Successfully delayed notifications for object 'host1!service1'." + } + } + +### acknowledge-problem + +Allows you to acknowledge the current problem for hosts or services. By +acknowledging the current problem, future notifications (for the same state if `sticky` is set to `false`) +are disabled. + +Send a `POST` request to the URL endpoint `/v1/actions/acknowledge-problem`. + + Parameter | Type | Description + ----------|-----------|-------------- + author | string | **Required.** Name of the author, may be empty. + comment | string | **Required.** Comment text, may be empty. + expiry | timestamp | **Optional.** If set, the acknowledgement will vanish after this timestamp. + sticky | boolean | **Optional.** If `true`, the default, the acknowledgement will remain until the service or host fully recovers. + notify | boolean | **Optional.** If `true`, a notification will be sent out to contacts to indicate this problem has been acknowledged. The default is false. + +In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host` and `Service`. + +The following example acknowledges all services which are in a hard critical state and sends out +a notification for them: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/acknowledge-problem?type=Service&filter=service.state==2&service.state_type=1' \ + -d '{ "author": "icingaadmin", "comment": "Global outage. Working on it.", "notify": true }' | python -m json.tool + + { + "results": [ + { + "code": 200.0, + "status": "Successfully acknowledged problem for object 'example2.localdomain!ping4'." + }, + { + "code": 200.0, + "status": "Successfully acknowledged problem for object 'example.localdomain!ping4'." + } + } + + +### remove-acknowledgement + +Removes the acknowledgements for services or hosts. Once the acknowledgement has +been removed notifications will be sent out again. + +Send a `POST` request to the URL endpoint `/v1/actions/remove-acknowledgement`. + +A [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host` and `Service`. + +The example removes all service acknowledgements: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/remove-acknowledgement?type=Service' | python -m json.tool + + { + "results": [ + { + "code": 200.0, + "status": "Successfully removed acknowledgement for object 'host0!service0'." + }, + { + "code": 200.0, + "status": "Successfully removed acknowledgement for object 'example2.localdomain!aws-health'." + } + } + +### add-comment + +Adds a `comment` from an `author` to services or hosts. + +Send a `POST` request to the URL endpoint `/v1/actions/add-comment`. + + Parameter | Type | Description + ----------|--------|-------------- + author | string | **Required.** Name of the author, may be empty. + comment | string | **Required.** Comment text, may be empty. + +In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host` and `Service`. + +The following example adds a comment for all `ping4` services: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/add-comment?type=Service&filter=service.name==%22ping4%22' -d '{ "author": "icingaadmin", "comment": "Troubleticket #123456789 opened." }' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "legacy_id": 26.0, + "name": "example.localdomain!ping4!example.localdomain-1446824161-0", + "status": "Successfully added comment 'example.localdomain!ping4!example.localdomain-1446824161-0' for object 'example.localdomain!ping4'." + }, + { + "code": 200.0, + "legacy_id": 27.0, + "name": "example2.localdomain!ping4!example.localdomain-1446824161-1", + "status": "Successfully added comment 'example2.localdomain!ping4!example.localdomain-1446824161-1' for object 'example2.localdomain!ping4'." + } + ] + } + +### remove-comment + +Remove the comment using its `name` attribute , returns `OK` if the +comment did not exist. +**Note**: This is **not** the legacy ID but the comment name returned by +Icinga 2 when [adding a comment](12-icinga2-api.md#icinga2-api-actions-add-comment). + +Send a `POST` request to the URL endpoint `/v1/actions/remove-comment`. + +A [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host`, `Service` and `Comment`. + +Example for a simple filter using the `comment` URL parameter: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/remove-comment?comment=example2.localdomain!ping4!mbmif.local-1446986367-0' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "status": "Successfully removed comment 'example2.localdomain!ping4!mbmif.local-1446986367-0'." + } + ] + } + +Example for removing all service comments using a service name filter for `ping4`: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/remove-comment?filter=service.name==%22ping4%22&type=Service' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "status": "Successfully removed all comments for object 'example2.localdomain!ping4'." + }, + { + "code": 200.0, + "status": "Successfully removed all comments for object 'example.localdomain!ping4'." + } + ] + } + + +### schedule-downtime + +Schedule a downtime for hosts and services. + +Send a `POST` request to the URL endpoint `/v1/actions/schedule-downtime`. + + Parameter | Type | Description + --------------|-----------|-------------- + author | string | **Required.** Name of the author. + comment | string | **Required.** Comment text. + start\_time | timestamp | **Required.** Timestamp marking the beginning of the downtime. + end\_time | timestamp | **Required.** Timestamp marking the end of the downtime. + duration | integer | **Required.** Duration of the downtime in seconds if `fixed` is set to false. + fixed | boolean | **Optional.** Defaults to `true`. If true, the downtime is `fixed` otherwise `flexible`. See [downtimes](8-advanced-topics.md#downtimes) for more information. + trigger\_name | string | **Optional.** Sets the trigger for a triggered downtime. See [downtimes](8-advanced-topics.md#downtimes) for more information on triggered downtimes. + +In addition to these parameters a [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host` and `Service`. + +Example: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/schedule-downtime?type=Service&filter=service.name==%22ping4%22' -d '{ "start_time": 1446388806, "end_time": 1446389806, "duration": 1000, "author": "icingaadmin", "comment": "IPv4 network maintenance" }' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "legacy_id": 2.0, + "name": "example2.localdomain!ping4!example.localdomain-1446822004-0", + "status": "Successfully scheduled downtime 'example2.localdomain!ping4!example.localdomain-1446822004-0' for object 'example2.localdomain!ping4'." + }, + { + "code": 200.0, + "legacy_id": 3.0, + "name": "example.localdomain!ping4!example.localdomain-1446822004-1", + "status": "Successfully scheduled downtime 'example.localdomain!ping4!example.localdomain-1446822004-1' for object 'example.localdomain!ping4'." + } + ] + } + +### remove-downtime + +Remove the downtime using its `name` attribute , returns `OK` if the +downtime did not exist. +**Note**: This is **not** the legacy ID but the downtime name returned by +Icinga 2 when [scheduling a downtime](12-icinga2-api.md#icinga2-api-actions-schedule-downtime). + +Send a `POST` request to the URL endpoint `/v1/actions/remove-downtime`. + +A [filter](12-icinga2-api.md#icinga2-api-filters) must be provided. The valid types for this action are `Host`, `Service` and `Downtime`. + +Example for a simple filter using the `downtime` URL parameter: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/remove-downtime?downtime=example.localdomain!ping4!mbmif.local-1446979168-6' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "status": "Successfully removed downtime 'example.localdomain!ping4!mbmif.local-1446979168-6'." + } + ] + } + +Example for removing all host downtimes using a host name filter for `example.localdomain`: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/remove-downtime?filter=host.name==%22example.localdomain%22&type=Host' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "status": "Successfully removed all downtimes for object 'example.localdomain'." + } + ] + } + +Example for removing a downtime from a host but not the services filtered by the author name. This example uses +filter variables explained in the [advanced filters](12-icinga2-api.md#icinga2-api-advanced-filters) chapter. + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/remove-downtime' \ + -d $'{ + "type": "Downtime", + "filter": "host.name == filterHost && !service && downtime.author == filterAuthor", + "filter_vars": { + "filterHost": "example.localdomain", + "filterAuthor": "icingaadmin" + } + }' | python -m json.tool + + { + "results": [ + { + "code": 200.0, + "status": "Successfully removed downtime 'example.localdomain!mbmif.local-1463043129-3'." + } + ] + } + +### shutdown-process + +Shuts down Icinga2. May or may not return. + +Send a `POST` request to the URL endpoint `/v1/actions/shutdown-process`. + +This action does not support a target type or filter. + +Example: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/shutdown-process' | python -m json.tool + + { + "results": [ + { + "code": 200.0, + "status": "Shutting down Icinga 2." + } + ] + } + +### restart-process + +Restarts Icinga2. May or may not return. + +Send a `POST` request to the URL endpoint `/v1/actions/restart-process`. + +This action does not support a target type or filter. + +Example: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/restart-process' | python -m json.tool + + { + "results": [ + { + "code": 200.0, + "status": "Restarting Icinga 2." + } + ] + } + +### generate-ticket + +Generates a PKI ticket for [CSR auto-signing](6-distributed-monitoring.md#distributed-monitoring-setup-csr-auto-signing). +This can be used in combination with satellite/client setups requesting this ticket number. + +Send a `POST` request to the URL endpoint `/v1/actions/generate-ticket`. + + Parameter | Type | Description + --------------|-----------|-------------- + cn | string | **Required.** The host's common name for which the ticket should be geenerated. + +Example: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/actions/generate-ticket' \ + -d '{ "cn": "icinga2-client1.localdomain" }' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "status": "Generated PKI ticket '4f75d2ecd253575fe9180938ebff7cbca262f96e' for common name 'icinga2-client1.localdomain'.", + "ticket": "4f75d2ecd253575fe9180938ebff7cbca262f96e" + } + ] + } + + +## Event Streams + +You can subscribe to event streams by sending a `POST` request to the URL endpoint `/v1/events`. +The following parameters need to be specified (either as URL parameters or in a JSON-encoded message body): + + Parameter | Type | Description + -----------|--------------|------------- + types | string array | **Required.** Event type(s). Multiple types as URL parameters are supported. + queue | string | **Required.** Unique queue name. Multiple HTTP clients can use the same queue as long as they use the same event types and filter. + filter | string | **Optional.** Filter for specific event attributes using [filter expressions](12-icinga2-api.md#icinga2-api-filters). + +### Event Stream Types + +The following event stream types are available: + + Type | Description + -----------------------|-------------- + CheckResult | Check results for hosts and services. + StateChange | Host/service state changes. + Notification | Notification events including notified users for hosts and services. + AcknowledgementSet | Acknowledgement set on hosts and services. + AcknowledgementCleared | Acknowledgement cleared on hosts and services. + CommentAdded | Comment added for hosts and services. + CommentRemoved | Comment removed for hosts and services. + DowntimeAdded | Downtime added for hosts and services. + DowntimeRemoved | Downtime removed for hosts and services. + DowntimeTriggered | Downtime triggered for hosts and services. + +Note: Each type requires [API permissions](12-icinga2-api.md#icinga2-api-permissions) +being set. + +Example for all downtime events: + + &types=DowntimeAdded&types=DowntimeRemoved&types=DowntimeTriggered + + +### Event Stream Filter + +Event streams can be filtered by attributes using the prefix `event.`. + +Example for the `CheckResult` type with the `exit_code` set to `2`: + + &types=CheckResult&filter=event.check_result.exit_status==2 + +Example for the `CheckResult` type with the service matching the string "random": + + &types=CheckResult&filter=match%28%22random*%22,event.service%29 + + +### Event Stream Response + +The event stream response is separated with new lines. The HTTP client +must support long-polling and HTTP/1.1. HTTP/1.0 is not supported. + +Example: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/events?queue=michi&types=CheckResult&filter=event.check_result.exit_status==2' + + {"check_result":{ ... },"host":"example.localdomain","service":"ping4","timestamp":1445421319.7226390839,"type":"CheckResult"} + {"check_result":{ ... },"host":"example.localdomain","service":"ping4","timestamp":1445421324.7226390839,"type":"CheckResult"} + {"check_result":{ ... },"host":"example.localdomain","service":"ping4","timestamp":1445421329.7226390839,"type":"CheckResult"} + + +## Status and Statistics + +Send a `GET` request to the URL endpoint `/v1/status` to retrieve status information and statistics for Icinga 2. + +Example: + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/status' | python -m json.tool + { + "results": [ + { + "name": "ApiListener", + "perfdata": [ ... ], + "status": [ ... ] + }, + ... + { + "name": "IcingaAplication", + "perfdata": [ ... ], + "status": [ ... ] + }, + ... + ] + } + +You can limit the output by specifying a status type in the URL, e.g. `IcingaApplication`: + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/status/IcingaApplication' | python -m json.tool + { + "results": [ + { + "perfdata": [], + "status": { + "icingaapplication": { + "app": { + "enable_event_handlers": true, + "enable_flapping": true, + "enable_host_checks": true, + "enable_notifications": true, + "enable_perfdata": true, + "enable_service_checks": true, + "node_name": "example.localdomain", + "pid": 59819.0, + "program_start": 1443019345.093372, + "version": "v2.3.0-573-g380a131" + } + } + } + } + ] + } + + +## Configuration Management + +The main idea behind configuration management is to allow external applications +creating configuration packages and stages based on configuration files and +directory trees. This replaces any additional SSH connection and whatnot to +dump configuration files to Icinga 2 directly. +In case you are pushing a new configuration stage to a package, Icinga 2 will +validate the configuration asynchronously and populate a status log which +can be fetched in a separated request. + + +### Creating a Config Package + +Send a `POST` request to a new config package called `example-cmdb` in this example. This +will create a new empty configuration package. + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST \ + 'https://localhost:5665/v1/config/packages/example-cmdb' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "package": "example-cmdb", + "status": "Created package." + } + ] + } + +Package names starting with an underscore are reserved for internal packages and must not be used. + +### Uploading configuration for a Config Package + +Configuration files in packages are managed in stages. +Stages provide a way to maintain multiple configuration versions for a package. + +Send a `POST` request to the URL endpoint `/v1/config/stages` and add the name of an existing +configuration package to the URL path (e.g. `example-cmdb`). +The request body must contain the `files` attribute with the value being +a dictionary of file targets and their content. + +The file path requires one of these two directories inside its path: + + Directory | Description + ------------|------------------------------------ + conf.d | Local configuration directory. + zones.d | Configuration directory for cluster zones, each zone must be put into its own zone directory underneath. Supports the [cluster config sync](6-distributed-monitoring.md#distributed-monitoring-top-down-config-sync). + +Example for a local configuration in the `conf.d` directory: + + "files": { "conf.d/host1.conf": "object Host \"local-host\" { address = \"127.0.0.1\", check_command = \"hostalive\" }" } + +Example for a host configuration inside the `satellite` zone in the `zones.d` directory: + + "files": { "zones.d/satellite/host2.conf": "object Host \"satellite-host\" { address = \"192.168.1.100\", check_command = \"hostalive\" }" } + + +The example below will create a new file called `test.conf` in the `conf.d` +directory. Note: This example contains an error (`chec_command`). This is +intentional. + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST \ + -d '{ "files": { "conf.d/test.conf": "object Host \"cmdb-host\" { chec_command = \"dummy\" }" } }' \ + 'https://localhost:5665/v1/config/stages/example-cmdb' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "package": "example-cmdb", + "stage": "example.localdomain-1441625839-0", + "status": "Created stage." + } + ] + } + +The Icinga 2 API returns the `package` name this stage was created for, and also +generates a unique name for the `stage` attribute you'll need for later requests. + +Icinga 2 automatically restarts the daemon in order to activate the new config stage. +If the validation for the new config stage failed, the old stage and its configuration objects +will remain active. + +> **Note** +> +> Old stages are not purged automatically. You can [remove stages](12-icinga2-api.md#icinga2-api-config-management-delete-config-stage) that are no longer in use. + +Icinga 2 will create the following files in the configuration package +stage after configuration validation: + + File | Description + ------------|-------------- + status | Contains the [configuration validation](11-cli-commands.md#config-validation) exit code (everything else than 0 indicates an error). + startup.log | Contains the [configuration validation](11-cli-commands.md#config-validation) output. + +You can [fetch these files](12-icinga2-api.md#icinga2-api-config-management-fetch-config-package-stage-files) +in order to verify that the new configuration was deployed successfully. + + +### List Configuration Packages and their Stages + +A list of packages and their stages can be retrieved by sending a `GET` request to the URL endpoint `/v1/config/packages`. + +The following example contains one configuration package `example-cmdb`. The package does not currently +have an active stage. + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/config/packages' | python -m json.tool + { + "results": [ + { + "active-stage": "", + "name": "example-cmdb", + "stages": [ + "example.localdomain-1441625839-0" + ] + } + ] + } + + +### List Configuration Packages and their Stages + +In order to retrieve a list of files for a stage you can send a `GET` request to +the URL endpoint `/v1/config/stages`. You need to include +the package name (`example-cmdb`) and stage name (`example.localdomain-1441625839-0`) in the URL: + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/config/stages/example-cmdb/example.localdomain-1441625839-0' | python -m json.tool + { + "results": [ + ... + { + "name": "startup.log", + "type": "file" + }, + { + "name": "status", + "type": "file" + }, + { + "name": "conf.d", + "type": "directory" + }, + { + "name": "zones.d", + "type": "directory" + }, + { + "name": "conf.d/test.conf", + "type": "file" + } + ] + } + +### Fetch Configuration Package Stage Files + +Send a `GET` request to the URL endpoint `/v1/config/files` and add +the package name, the stage name and the relative path to the file to the URL path. + +> **Note** +> +> The returned files are plain-text instead of JSON-encoded. + +The following example fetches the configuration file `conf.d/test.conf`: + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/config/files/example-cmdb/example.localdomain-1441625839-0/conf.d/test.conf' + + object Host "cmdb-host" { chec_command = "dummy" } + +You can fetch a [list of existing files](12-icinga2-api.md#icinga2-api-config-management-list-config-package-stage-files) +in a configuration stage and then specifically request their content. + +### Configuration Package Stage Errors + +Now that we don't have an active stage for `example-cmdb` yet seen [here](12-icinga2-api.md#icinga2-api-config-management-list-config-packages), +there must have been an error. + +In order to check for validation errors you can fetch the `startup.log` file +by sending a `GET` request to the URL endpoint `/v1/config/files`. You must include +the package name, stage name and the `startup.log` in the URL path. + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/config/files/example-cmdb/example.localdomain-1441133065-1/startup.log' + ... + + critical/config: Error: Attribute 'chec_command' does not exist. + Location: + /var/lib/icinga2/api/packages/example-cmdb/example.localdomain-1441133065-1/conf.d/test.conf(1): object Host "cmdb-host" { chec_command = "dummy" } + ^^^^^^^^^^^^^^^^^^^^^^ + + critical/config: 1 error + +The output is similar to the manual [configuration validation](11-cli-commands.md#config-validation). + +> **Note** +> +> The returned output is plain-text instead of JSON-encoded. + + +### Deleting Configuration Package Stage + +You can send a `DELETE` request to the URL endpoint `/v1/config/stages` +in order to purge a configuration stage. You must include the package and +stage name inside the URL path. + +The following example removes the failed configuration stage `example.localdomain-1441133065-1` +in the `example-cmdb` configuration package: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X DELETE \ + 'https://localhost:5665/v1/config/stages/example-cmdb/example.localdomain-1441133065-1' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "status": "Stage deleted." + } + ] + } + + +### Deleting Configuration Package + +In order to completely purge a configuration package and its stages +you can send a `DELETE` request to the URL endpoint `/v1/config/packages` +with the package name in the URL path. + +This example entirely deletes the configuration package `example-cmdb`: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X DELETE \ + 'https://localhost:5665/v1/config/packages/example-cmdb' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "package": "example-cmdb", + "status": "Deleted package." + } + ] + } + + +## Types + +You can retrieve the configuration object types by sending a `GET` request to URL +endpoint `/v1/types`. + +Each response entry in the results array contains the following attributes: + + Attribute | Type | Description + ---------------|--------------|--------------------- + name | string | The type name. + plural_name | string | The plural type name. + fields | dictionary | Available fields including details on e.g. the type and attribute accessibility. + abstract | boolean | Whether objects can be instantiated for this type. + base | boolean | The base type (e.g. `Service` inherits fields and prototype methods from `Checkable`). + prototype_keys | string array | Available prototype methods. + +In order to view a specific configuration object type specify its name inside the URL path: + + $ curl -k -s -u root:icinga 'https://localhost:5665/v1/types/Object' | python -m json.tool + { + "results": [ + { + "abstract": false, + "fields": { + "type": { + "array_rank": 0.0, + "attributes": { + "config": false, + "navigation": false, + "no_user_modify": false, + "no_user_view": false, + "required": false, + "state": false + }, + "id": 0.0, + "type": "String" + } + }, + "name": "Object", + "plural_name": "Objects", + "prototype_keys": [ + "clone", + "notify_attribute", + "to_string" + ] + } + ] + } + + +## Console + +You can inspect variables and execute other expressions by sending a `POST` request to the URL endpoint `/v1/console/execute-script`. +In order to receive auto-completion suggestions, send a `POST` request to the URL endpoint `/v1/console/auto-complete-script`. + +The following parameters need to be specified (either as URL parameters or in a JSON-encoded message body): + + Parameter | Type | Description + -----------|--------------|------------- + session | string | **Optional.** The session ID. Ideally this should be a GUID or some other unique identifier. + command | string | **Required.** Command expression for execution or auto-completion. + sandboxed | number | **Optional.** Whether runtime changes are allowed or forbidden. Defaults to disabled. + +The [API permission](12-icinga2-api.md#icinga2-api-permissions) `console` is required for executing +expressions. + +If you specify a session identifier, the same script context can be reused for multiple requests. This allows you to, for example, set a local variable in a request and use that local variable in another request. Sessions automatically expire after a set period of inactivity (currently 30 minutes). + +Example for fetching the command line from the local host's last check result: + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/console/execute-script?command=get_host(NodeName).last_check_result.command&sandboxed=0&session=bb75fd7c-c686-407d-9688-582c04227756' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "result": [ + "/usr/local/sbin/check_ping", + "-H", + "127.0.0.1", + "-c", + "5000,100%", + "-w", + "3000,80%" + ], + "status": "Executed successfully." + } + ] + } + +Example for fetching auto-completion suggestions for the `Host.` type. This works in a +similar fashion when pressing TAB inside the [console CLI command](11-cli-commands.md#cli-command-console): + + $ curl -k -s -u root:icinga -H 'Accept: application/json' -X POST 'https://localhost:5665/v1/console/auto-complete-script?command=Host.&sandboxed=0&session=bb75fd7c-c686-407d-9688-582c04227756' | python -m json.tool + { + "results": [ + { + "code": 200.0, + "status": "Auto-completed successfully.", + "suggestions": [ + "Host.type", + "Host.name", + "Host.prototype", + "Host.base", + "Host.register_attribute_handler", + "Host.clone", + "Host.notify_attribute", + "Host.to_string" + ] + } + ] + } + + +## API Clients + +There are a couple of existing clients which can be used with the Icinga 2 API: + +* [curl](http://curl.haxx.se) or any other HTTP client really +* [Icinga 2 console (CLI command)](12-icinga2-api.md#icinga2-api-clients-cli-console) +* [Icinga Studio](12-icinga2-api.md#icinga2-api-clients-icinga-studio) +* [Icinga Web 2 Director](https://dev.icinga.org/projects/icingaweb2-modules) + +Demo cases: + +* [Dashing](https://github.com/Icinga/dashing-icinga2) +* [API examples](https://github.com/Icinga/icinga2-api-examples) + +Additional [programmatic examples](12-icinga2-api.md#icinga2-api-clients-programmatic-examples) +will help you getting started using the Icinga 2 API in your environment. + +### Icinga Studio + +Icinga Studio is a graphical application to query configuration objects provided by the API. + +![Icinga Studio Connection](images/icinga2-api/icinga2_api_icinga_studio_connect.png) + +![Icinga Studio Overview](images/icinga2-api/icinga2_api_icinga_studio_overview.png) + +Please check the package repository of your distribution for available +packages. + +> **Note** +> Icinga Studio does not currently support SSL certificate verification. + +The Windows installer already includes Icinga Studio. On Debian and Ubuntu the package +`icinga2-studio` can be used to install Icinga Studio. + +### Icinga 2 Console + +By default the [console CLI command](11-cli-commands.md#cli-command-console) evaluates expressions in a local interpreter, i.e. independently from your Icinga 2 daemon. Using the `--connect` parameter you can use the Icinga 2 console to evaluate expressions via the API. + +### API Clients Programmatic Examples + +The programmatic examples use HTTP basic authentication and SSL certificate +verification. The CA file is expected in `pki/icinga2-ca.crt` +but you may adjust the examples for your likings. + +The request method is `POST` using `X-HTTP-Method-Override: GET` +which allows you to send a JSON request body. The examples request +specific service attributes joined with host attributes. `attrs` +and `joins` are therefore specified as array. +The `filter` attribute matches on all services with `ping` in their name. + +#### Example API Client in Python + +The following example uses **Python** and the `requests` and `json` module: + + # pip install requests + # pip install json + + $ vim icinga2-api-example.py + + #!/usr/bin/env python + + import requests, json + + # Replace 'localhost' with your FQDN and certificate CN + # for SSL verification + request_url = "https://localhost:5665/v1/objects/services" + headers = { + 'Accept': 'application/json', + 'X-HTTP-Method-Override': 'GET' + } + data = { + "attrs": [ "name", "state", "last_check_result" ], + "joins": [ "host.name", "host.state", "host.last_check_result" ], + "filter": "match(\"ping*\", service.name)", + } + + r = requests.post(request_url, + headers=headers, + auth=('root', 'icinga'), + data=json.dumps(data), + verify="pki/icinga2-ca.crt") + + print "Request URL: " + str(r.url) + print "Status code: " + str(r.status_code) + + if (r.status_code == 200): + print "Result: " + json.dumps(r.json()) + else: + print r.text + r.raise_for_status() + + $ python icinga2-api-example.py + + +#### Example API Client in Ruby + +The following example uses **Ruby** and the `rest_client` gem: + + # gem install rest_client + + $ vim icinga2-api-example.rb + + #!/usr/bin/ruby + + require 'rest_client' + + # Replace 'localhost' with your FQDN and certificate CN + # for SSL verification + request_url = "https://localhost:5665/v1/objects/services" + headers = { + "Accept" => "application/json", + "X-HTTP-Method-Override" => "GET" + } + data = { + "attrs" => [ "name", "state", "last_check_result" ], + "joins" => [ "host.name", "host.state", "host.last_check_result" ], + "filter" => "match(\"ping*\", service.name)", + } + + r = RestClient::Resource.new( + URI.encode(request_url), + :headers => headers, + :user => "root", + :password => "icinga", + :ssl_ca_file => "pki/icinga2-ca.crt") + + begin + response = r.post(data.to_json) + rescue => e + response = e.response + end + + puts "Status: " + response.code.to_s + if response.code == 200 + puts "Result: " + (JSON.pretty_generate JSON.parse(response.body)) + else + puts "Error: " + response + end + + $ ruby icinga2-api-example.rb + +A more detailed example can be found in the [Dashing demo](https://github.com/Icinga/dashing-icinga2). + +#### Example API Client in PHP + +The following example uses **PHP** and its `curl` library: + + $ vim icinga2-api-example.php + + #!/usr/bin/env php + array('name', 'state', 'last_check_result'), + joins => array('host.name', 'host.state', 'host.last_check_result'), + filter => 'match("ping*", service.name)', + ); + + $ch = curl_init(); + curl_setopt_array($ch, array( + CURLOPT_URL => $request_url, + CURLOPT_HTTPHEADER => $headers, + CURLOPT_USERPWD => $username . ":" . $password, + CURLOPT_RETURNTRANSFER => true, + CURLOPT_CAINFO => "pki/icinga2-ca.crt", + CURLOPT_POST => count($data), + CURLOPT_POSTFIELDS => json_encode($data) + )); + + $response = curl_exec($ch); + if ($response === false) { + print "Error: " . curl_error($ch) . "(" . $response . ")\n"; + } + + $code = curl_getinfo($ch, CURLINFO_HTTP_CODE); + curl_close($ch); + print "Status: " . $code . "\n"; + + if ($code == 200) { + $response = json_decode($response, true); + print_r($response); + } + ?> + + $ php icinga2-api-example.php + +#### Example API Client in Perl + +The following example uses **Perl** and the `Rest::Client` module: + + # perl -MCPAN -e 'install REST::Client' + # perl -MCPAN -e 'install JSON' + # perl -MCPAN -e 'install MIME::Base64' + # perl -MCPAN -e 'install Data::Dumper' + + $ vim icinga2-api-example.pl + + #!/usr/bin/env perl + + use strict; + use warnings; + use REST::Client; + use MIME::Base64; + use JSON; + use Data::Dumper; + + # Replace 'localhost' with your FQDN and certificate CN + # for SSL verification + my $request_host = "https://localhost:5665"; + my $userpass = "root:icinga"; + + my $client = REST::Client->new(); + $client->setHost($request_host); + $client->setCa("pki/icinga2-ca.crt"); + $client->addHeader("Accept", "application/json"); + $client->addHeader("X-HTTP-Method-Override", "GET"); + $client->addHeader("Authorization", "Basic " . encode_base64($userpass)); + my %json_data = ( + attrs => ['name', 'state', 'last_check_result'], + joins => ['host.name', 'host.state', 'host.last_check_result'], + filter => 'match("ping*", service.name)', + ); + my $data = encode_json(\%json_data); + $client->POST("/v1/objects/services", $data); + + my $status = $client->responseCode(); + print "Status: " . $status . "\n"; + my $response = $client->responseContent(); + if ($status == 200) { + print "Result: " . Dumper(decode_json($response)) . "\n"; + } else { + print "Error: " . $response . "\n"; + } + + $ perl icinga2-api-example.pl + diff --git a/vim/bundle/icinga2/doc/13-addons.md b/vim/bundle/icinga2/doc/13-addons.md new file mode 100644 index 0000000..435fb6d --- /dev/null +++ b/vim/bundle/icinga2/doc/13-addons.md @@ -0,0 +1,195 @@ +# Icinga 2 Addons + +## Graphing + +### PNP + +[PNP](http://www.pnp4nagios.org) is a graphing addon. + +[PNP](http://www.pnp4nagios.org) is an addon which adds a graphical representation of the performance data collected +by the monitoring plugins. The data is stored as rrd (round robin database) files. + +Use your distribution's package manager to install the `pnp4nagios` package. + +If you're planning to use it, configure it to use the +[bulk mode with npcd and npcdmod](http://docs.pnp4nagios.org/pnp-0.6/modes#bulk_mode_with_npcd_and_npcdmod) +in combination with Icinga 2's [PerfdataWriter](14-features.md#performance-data). NPCD collects the performance +data files which Icinga 2 generates. + +Enable performance data writer in icinga 2 + + # icinga2 feature enable perfdata + +Configure npcd to use the performance data created by Icinga 2: + + vim /etc/pnp4nagios/npcd.cfg + +Set `perfdata_spool_dir = /var/spool/icinga2/perfdata` and restart the `npcd` daemon. + +There's also an Icinga Web 2 module for direct PNP graph integration +available at [Icinga Exchange](https://exchange.icinga.org/icinga/PNP). + +More information on [action_url as attribute](13-addons.md#addons-graphing-pnp-action-url) +and [graph template names](13-addons.md#addons-graphing-pnp-custom-templates). + + +### Graphite + +[Graphite](http://graphite.readthedocs.org/en/latest/) is a time-series database +storing collected metrics and making them available through restful apis +and web interfaces. + +Graphite consists of 3 software components: + +* carbon -- a Twisted daemon that listens for time-series data +* whisper -- a simple database library for storing time-series data (similar in design to RRD) +* graphite webapp -- a Django webapp that renders graphs on-demand using Cairo + +Use the [GraphiteWriter](14-features.md#graphite-carbon-cache-writer) feature +for sending real-time metrics from Icinga 2 to Graphite. + + # icinga2 feature enable graphite + +There are Graphite addons available for collecting the performance data files too (e.g. `Graphios`). + +A popular alternative frontend for Graphite is for example [Grafana](http://grafana.org). + +### InfluxDB + +[InfluxDB](https://influxdb.com) is a time series, metrics, and analytics database. +It’s written in Go and has no external dependencies. + +Use the [InfluxdbWriter](14-features.md#influxdb-writer) feature +for sending real-time metrics from Icinga 2 to InfluxDB. + + # icinga2 feature enable influxdb + +A popular frontend for InfluxDB is for example [Grafana](http://grafana.org). + +## Visualization + +### Icinga Reporting + +By enabling the [DB IDO](14-features.md#db-ido) feature you can use the +[Icinga Reporting package](https://wiki.icinga.org/display/howtos/Setting+up+Icinga+with+Reporting). + +### NagVis + +By using either [Livestatus](14-features.md#setting-up-livestatus) or +[DB IDO](14-features.md#db-ido) as a backend you can create your own network maps +based on your monitoring configuration and status data using [NagVis](http://www.nagvis.org). + +The configuration in nagvis.ini.php should look like this for Livestatus for example: + + [backend_live_1] + backendtype="mklivestatus" + socket="unix:/var/run/icinga2/cmd/livestatus" + +If you are planning an integration into Icinga Web 2, look at [this module](https://github.com/Icinga/icingaweb2-module-nagvis). + +### Thruk + +[Thruk](http://www.thruk.org) is an alternative web interface which can be used with Icinga 2 +and the [Livestatus](14-features.md#setting-up-livestatus) feature. + +## Log Monitoring + +Using [Logstash](https://www.elastic.co/guide/en/logstash/current/introduction.html) or +[Graylog](https://www.graylog.org) in your infrastructure and correlate events with your monitoring +is even simpler these days. + +* Use the `GelfWriter` feature to write Icinga 2's check and notification events to Graylog or Logstash. +* Configure the logstash `nagios` output to send passive traps to Icinga 2 using the external command pipe. +* Execute a plugin to check Graylog alert streams. + +More details can be found in [this blog post](https://www.icinga.org/2014/12/02/team-icinga-at-osmc-2014/). + +## Notification Scripts and Interfaces + +There's a variety of resources available, for example different notification scripts such as: + +* E-Mail ([examples](3-monitoring-basics.md#notifications) provided) +* SMS +* Pager (XMPP, etc.) +* Twitter +* IRC +* Ticket systems +* etc. + +Additionally external services can be [integrated with Icinga 2](https://www.icinga.org/icinga/integration/): + +* [Pagerduty](https://www.icinga.org/partners/pagerduty/) +* [VictorOps](https://www.icinga.org/partners/victorops/) +* [StackStorm](https://www.icinga.org/partners/stackstorm/) + +More information can be found on the [Icinga Website](https://www.icinga.org/) +and the [Icinga Wiki](https://wiki.icinga.org/display/howtos/Home). + +## Configuration Management Tools + +If you require your favourite configuration tool to export the Icinga 2 configuration, please get in +touch with their developers. The Icinga project does not provide a configuration web interface +yet. Follow the [Icinga Blog](https://www.icinga.org/blog/) for updates on this topic. + +If you're looking for puppet manifests, chef cookbooks, ansible recipes, etc. -- we're happy +to integrate them upstream, so please get in touch with the [Icinga team](https://www.icinga.org/community/get-involved/). + +These tools are currently in development and require feedback and tests: + +* [Ansible Roles](https://github.com/Icinga/icinga2-ansible) +* [Puppet Module](https://github.com/Icinga/puppet-icinga2) +* [Chef Cookbook](https://github.com/Icinga/chef-icinga2) + +## More Addon Integration Hints + +### PNP Action Url + +They work in a similar fashion for Icinga 2 and are used for 1.x web interfaces (Icinga Web 2 doesn't require +the action url attribute in its own module). + + template Service "pnp-hst" { + action_url = "/pnp4nagios/graph?host=$HOSTNAME$" + } + + template Service "pnp-svc" { + action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$" + } + +### PNP Custom Templates with Icinga 2 + +PNP automatically determines the graph template from the check command name (or the argument's name). +This behavior changed in Icinga 2 compared to Icinga 1.x. Though there are certain possibilities to +fix this: + +* Create a symlink for example from the `templates.dist/check_ping.php` template to the actual check name in Icinga 2 (`templates/ping4.php`) +* Pass the check command name inside the [format template configuration](14-features.md#writing-performance-data-files) + +The latter becomes difficult with agent based checks like NRPE or SSH where the first command argument acts as +graph template identifier. There is the possibility to define the pnp template name as custom attribute +and use that inside the formatting templates as `SERVICECHECKCOMMAND` for instance. + +Example for services: + + # vim /etc/icinga2/features-enabled/perfdata.conf + + service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tSERVICEDESC::$service.name$\tSERVICEPERFDATA::$service.perfdata$\tSERVICECHECKCOMMAND::$service.check_command$$pnp_check_arg1$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.state_type$\tSERVICESTATE::$service.state$\tSERVICESTATETYPE::$service.state_type$" + + # vim /etc/icinga2/conf.d/services.conf + + template Service "pnp-svc" { + action_url = "/pnp4nagios/graph?host=$HOSTNAME$&srv=$SERVICEDESC$" + vars.pnp_check_arg1 = "" + } + + apply Service "nrpe-check" { + import "pnp-svc" + check_command = nrpe + vars.nrpe_command = "check_disk" + + vars.pnp_check_arg1 = "!$nrpe_command$" + } + +If there are warnings about unresolved macros, make sure to specify a default value for `vars.pnp_check_arg1` inside the + +In PNP, the custom template for nrpe is then defined in `/etc/pnp4nagios/custom/nrpe.cfg` +and the additional command arg string will be seen in the xml too for other templates. diff --git a/vim/bundle/icinga2/doc/14-features.md b/vim/bundle/icinga2/doc/14-features.md new file mode 100644 index 0000000..c34dd5f --- /dev/null +++ b/vim/bundle/icinga2/doc/14-features.md @@ -0,0 +1,697 @@ +# Icinga 2 Features + +## Logging + +Icinga 2 supports three different types of logging: + +* File logging +* Syslog (on *NIX-based operating systems) +* Console logging (`STDOUT` on tty) + +You can enable additional loggers using the `icinga2 feature enable` +and `icinga2 feature disable` commands to configure loggers: + +Feature | Description +---------|------------ +debuglog | Debug log (path: `/var/log/icinga2/debug.log`, severity: `debug` or higher) +mainlog | Main log (path: `/var/log/icinga2/icinga2.log`, severity: `information` or higher) +syslog | Syslog (severity: `warning` or higher) + +By default file the `mainlog` feature is enabled. When running Icinga 2 +on a terminal log messages with severity `information` or higher are +written to the console. + +## DB IDO + +The IDO (Icinga Data Output) modules for Icinga 2 take care of exporting all +configuration and status information into a database. The IDO database is used +by a number of projects including Icinga Web 1.x and 2. + +Details on the installation can be found in the [Configuring DB IDO](2-getting-started.md#configuring-db-ido-mysql) +chapter. Details on the configuration can be found in the +[IdoMysqlConnection](9-object-types.md#objecttype-idomysqlconnection) and +[IdoPgsqlConnection](9-object-types.md#objecttype-idopgsqlconnection) +object configuration documentation. +The DB IDO feature supports [High Availability](6-distributed-monitoring.md#distributed-monitoring-high-availability-db-ido) in +the Icinga 2 cluster. + +The following example query checks the health of the current Icinga 2 instance +writing its current status to the DB IDO backend table `icinga_programstatus` +every 10 seconds. By default it checks 60 seconds into the past which is a reasonable +amount of time -- adjust it for your requirements. If the condition is not met, +the query returns an empty result. + +> **Tip** +> +> Use [check plugins](5-service-monitoring.md#service-monitoring-plugins) to monitor the backend. + +Replace the `default` string with your instance name if different. + +Example for MySQL: + + # mysql -u root -p icinga -e "SELECT status_update_time FROM icinga_programstatus ps + JOIN icinga_instances i ON ps.instance_id=i.instance_id + WHERE (UNIX_TIMESTAMP(ps.status_update_time) > UNIX_TIMESTAMP(NOW())-60) + AND i.instance_name='default';" + + +---------------------+ + | status_update_time | + +---------------------+ + | 2014-05-29 14:29:56 | + +---------------------+ + + +Example for PostgreSQL: + + # export PGPASSWORD=icinga; psql -U icinga -d icinga -c "SELECT ps.status_update_time FROM icinga_programstatus AS ps + JOIN icinga_instances AS i ON ps.instance_id=i.instance_id + WHERE ((SELECT extract(epoch from status_update_time) FROM icinga_programstatus) > (SELECT extract(epoch from now())-60)) + AND i.instance_name='default'"; + + status_update_time + ------------------------ + 2014-05-29 15:11:38+02 + (1 Zeile) + + +A detailed list on the available table attributes can be found in the [DB IDO Schema documentation](23-appendix.md#schema-db-ido). + + +## External Commands + +Icinga 2 provides an external command pipe for processing commands +triggering specific actions (for example rescheduling a service check +through the web interface). + +In order to enable the `ExternalCommandListener` configuration use the +following command and restart Icinga 2 afterwards: + + # icinga2 feature enable command + +Icinga 2 creates the command pipe file as `/var/run/icinga2/cmd/icinga2.cmd` +using the default configuration. + +Web interfaces and other Icinga addons are able to send commands to +Icinga 2 through the external command pipe, for example for rescheduling +a forced service check: + + # /bin/echo "[`date +%s`] SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;`date +%s`" >> /var/run/icinga2/cmd/icinga2.cmd + + # tail -f /var/log/messages + + Oct 17 15:01:25 icinga-server icinga2: Executing external command: [1382014885] SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;1382014885 + Oct 17 15:01:25 icinga-server icinga2: Rescheduling next check for service 'ping4' + +A list of currently supported external commands can be found [here](23-appendix.md#external-commands-list-detail). + +Detailed information on the commands and their required parameters can be found +on the [Icinga 1.x documentation](http://docs.icinga.org/latest/en/extcommands2.html). + +## Performance Data + +When a host or service check is executed plugins should provide so-called +`performance data`. Next to that additional check performance data +can be fetched using Icinga 2 runtime macros such as the check latency +or the current service state (or additional custom attributes). + +The performance data can be passed to external applications which aggregate and +store them in their backends. These tools usually generate graphs for historical +reporting and trending. + +Well-known addons processing Icinga performance data are [PNP4Nagios](13-addons.md#addons-graphing-pnp), +[Graphite](13-addons.md#addons-graphing-graphite) or [OpenTSDB](14-features.md#opentsdb-writer). + +### Writing Performance Data Files + +PNP4Nagios and Graphios use performance data collector daemons to fetch +the current performance files for their backend updates. + +Therefore the Icinga 2 [PerfdataWriter](9-object-types.md#objecttype-perfdatawriter) +feature allows you to define the output template format for host and services helped +with Icinga 2 runtime vars. + + host_format_template = "DATATYPE::HOSTPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tHOSTPERFDATA::$host.perfdata$\tHOSTCHECKCOMMAND::$host.check_command$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.state_type$" + service_format_template = "DATATYPE::SERVICEPERFDATA\tTIMET::$icinga.timet$\tHOSTNAME::$host.name$\tSERVICEDESC::$service.name$\tSERVICEPERFDATA::$service.perfdata$\tSERVICECHECKCOMMAND::$service.check_command$\tHOSTSTATE::$host.state$\tHOSTSTATETYPE::$host.state_type$\tSERVICESTATE::$service.state$\tSERVICESTATETYPE::$service.state_type$" + +The default templates are already provided with the Icinga 2 feature configuration +which can be enabled using + + # icinga2 feature enable perfdata + +By default all performance data files are rotated in a 15 seconds interval into +the `/var/spool/icinga2/perfdata/` directory as `host-perfdata.` and +`service-perfdata.`. +External collectors need to parse the rotated performance data files and then +remove the processed files. + +### Graphite Carbon Cache Writer + +While there are some [Graphite](13-addons.md#addons-graphing-graphite) +collector scripts and daemons like Graphios available for Icinga 1.x it's more +reasonable to directly process the check and plugin performance +in memory in Icinga 2. Once there are new metrics available, Icinga 2 will directly +write them to the defined Graphite Carbon daemon tcp socket. + +You can enable the feature using + + # icinga2 feature enable graphite + +By default the [GraphiteWriter](9-object-types.md#objecttype-graphitewriter) feature +expects the Graphite Carbon Cache to listen at `127.0.0.1` on TCP port `2003`. + +#### Current Graphite Schema + +The current naming schema is defined as follows. The official Icinga Web 2 Graphite +module will use that schema too. + +The default prefix for hosts and services is configured using +[runtime macros](3-monitoring-basics.md#runtime-macros)like this: + + icinga2.$host.name$.host.$host.check_command$ + icinga2.$host.name$.services.$service.name$.$service.check_command$ + +You can customize the prefix name by using the `host_name_template` and +`service_name_template` configuration attributes. + +The additional levels will allow fine granular filters and also template +capabilities, e.g. by using the check command `disk` for specific +graph templates in web applications rendering the Graphite data. + +The following characters are escaped in prefix labels: + + Character | Escaped character + --------------|-------------------------- + whitespace | _ + . | _ + \ | _ + / | _ + +Metric values are stored like this: + + .perfdata..value + +The following characters are escaped in perfdata labels: + + Character | Escaped character + --------------|-------------------------- + whitespace | _ + \ | _ + / | _ + :: | . + +Note that perfdata labels may contain dots (`.`) allowing to +add more subsequent levels inside the Graphite tree. +`::` adds support for [multi performance labels](http://my-plugin.de/wiki/projects/check_multi/configuration/performance) +and is therefore replaced by `.`. + +By enabling `enable_send_thresholds` Icinga 2 automatically adds the following threshold metrics: + + .perfdata..min + .perfdata..max + .perfdata..warn + .perfdata..crit + +By enabling `enable_send_metadata` Icinga 2 automatically adds the following metadata metrics: + + .metadata.current_attempt + .metadata.downtime_depth + .metadata.acknowledgement + .metadata.execution_time + .metadata.latency + .metadata.max_check_attempts + .metadata.reachable + .metadata.state + .metadata.state_type + +Metadata metric overview: + + metric | description + -------------------|------------------------------------------ + current_attempt | current check attempt + max_check_attempts | maximum check attempts until the hard state is reached + reachable | checked object is reachable + downtime_depth | number of downtimes this object is in + acknowledgement | whether the object is acknowledged or not + execution_time | check execution time + latency | check latency + state | current state of the checked object + state_type | 0=SOFT, 1=HARD state + +The following example illustrates how to configure the storage schemas for Graphite Carbon +Cache. + + [icinga2_default] + # intervals like PNP4Nagios uses them per default + pattern = ^icinga2\. + retentions = 1m:2d,5m:10d,30m:90d,360m:4y + +#### Graphite Schema < 2.4 + +In order to restore the old legacy schema, you'll need to adopt the `GraphiteWriter` +configuration: + + object GraphiteWriter "graphite" { + + enable_legacy_mode = true + + host_name_template = "icinga.$host.name$" + service_name_template = "icinga.$host.name$.$service.name$" + } + +The old legacy naming schema is + + icinga.. + icinga... + +You can customize the metric prefix name by using the `host_name_template` and +`service_name_template` configuration attributes. + +The example below uses [runtime macros](3-monitoring-basics.md#runtime-macros) and a +[global constant](17-language-reference.md#constants) named `GraphiteEnv`. The constant name +is freely definable and should be put in the [constants.conf](4-configuring-icinga-2.md#constants-conf) file. + + const GraphiteEnv = "icinga.env1" + + object GraphiteWriter "graphite" { + host_name_template = GraphiteEnv + ".$host.name$" + service_name_template = GraphiteEnv + ".$host.name$.$service.name$" + } + +To make sure Icinga 2 writes a valid label into Graphite some characters are replaced +with `_` in the target name: + + \/.- (and space) + +The resulting name in Graphite might look like: + + www-01 / http-cert / response time + icinga.www_01.http_cert.response_time + +In addition to the performance data retrieved from the check plugin, Icinga 2 sends +internal check statistic data to Graphite: + + metric | description + -------------------|------------------------------------------ + current_attempt | current check attempt + max_check_attempts | maximum check attempts until the hard state is reached + reachable | checked object is reachable + downtime_depth | number of downtimes this object is in + acknowledgement | whether the object is acknowledged or not + execution_time | check execution time + latency | check latency + state | current state of the checked object + state_type | 0=SOFT, 1=HARD state + +The following example illustrates how to configure the storage-schemas for Graphite Carbon +Cache. Please make sure that the order is correct because the first match wins. + + [icinga_internals] + pattern = ^icinga\..*\.(max_check_attempts|reachable|current_attempt|execution_time|latency|state|state_type) + retentions = 5m:7d + + [icinga_default] + # intervals like PNP4Nagios uses them per default + pattern = ^icinga\. + retentions = 1m:2d,5m:10d,30m:90d,360m:4y + +### InfluxDB Writer + +Once there are new metrics available, Icinga 2 will directly write them to the +defined InfluxDB HTTP API. + +You can enable the feature using + + # icinga2 feature enable influxdb + +By default the [InfluxdbWriter](9-object-types.md#objecttype-influxdbwriter) feature +expects the InfluxDB daemon to listen at `127.0.0.1` on port `8086`. + +More configuration details can be found [here](9-object-types.md#objecttype-influxdbwriter). + +### GELF Writer + +The `Graylog Extended Log Format` (short: [GELF](http://www.graylog2.org/resources/gelf)) +can be used to send application logs directly to a TCP socket. + +While it has been specified by the [graylog2](http://www.graylog2.org/) project as their +[input resource standard](http://www.graylog2.org/resources/gelf), other tools such as +[Logstash](http://www.logstash.net) also support `GELF` as +[input type](http://logstash.net/docs/latest/inputs/gelf). + +You can enable the feature using + + # icinga2 feature enable gelf + +By default the `GelfWriter` object expects the GELF receiver to listen at `127.0.0.1` on TCP port `12201`. +The default `source` attribute is set to `icinga2`. You can customize that for your needs if required. + +Currently these events are processed: +* Check results +* State changes +* Notifications + +### OpenTSDB Writer + +While there are some OpenTSDB collector scripts and daemons like tcollector available for +Icinga 1.x it's more reasonable to directly process the check and plugin performance +in memory in Icinga 2. Once there are new metrics available, Icinga 2 will directly +write them to the defined TSDB TCP socket. + +You can enable the feature using + + # icinga2 feature enable opentsdb + +By default the `OpenTsdbWriter` object expects the TSD to listen at +`127.0.0.1` on port `4242`. + +The current naming schema is + + icinga.host. + icinga.service.. + +for host and service checks. The tag host is always applied. + +To make sure Icinga 2 writes a valid metric into OpenTSDB some characters are replaced +with `_` in the target name: + + \ (and space) + +The resulting name in OpenTSDB might look like: + + www-01 / http-cert / response time + icinga.http_cert.response_time + +In addition to the performance data retrieved from the check plugin, Icinga 2 sends +internal check statistic data to OpenTSDB: + + metric | description + -------------------|------------------------------------------ + current_attempt | current check attempt + max_check_attempts | maximum check attempts until the hard state is reached + reachable | checked object is reachable + downtime_depth | number of downtimes this object is in + acknowledgement | whether the object is acknowledged or not + execution_time | check execution time + latency | check latency + state | current state of the checked object + state_type | 0=SOFT, 1=HARD state + +While reachable, state and state_type are metrics for the host or service the +other metrics follow the current naming schema + + icinga.check. + +with the following tags + + tag | description + --------|------------------------------------------ + type | the check type, one of [host, service] + host | hostname, the check ran on + service | the service name (if type=service) + +> **Note** +> +> You might want to set the tsd.core.auto_create_metrics setting to `true` +> in your opentsdb.conf configuration file. + + +## Livestatus + +The [MK Livestatus](http://mathias-kettner.de/checkmk_livestatus.html) project +implements a query protocol that lets users query their Icinga instance for +status information. It can also be used to send commands. + +> **Tip** +> +> Only install the Livestatus feature if your web interface or addon requires +> you to do so (for example, [Icinga Web 2](2-getting-started.md#setting-up-icingaweb2)). +> Icinga Classic UI 1.x and Icinga Web 1.x do not use Livestatus as backend. + +The Livestatus component that is distributed as part of Icinga 2 is a +re-implementation of the Livestatus protocol which is compatible with MK +Livestatus. + +Details on the available tables and attributes with Icinga 2 can be found +in the [Livestatus Schema](23-appendix.md#schema-livestatus) section. + +You can enable Livestatus using icinga2 feature enable: + + # icinga2 feature enable livestatus + +After that you will have to restart Icinga 2: + +Debian/Ubuntu, RHEL/CentOS 6 and SUSE: + + # service icinga2 restart + +RHEL/CentOS 7 and Fedora: + + # systemctl restart icinga2 + +By default the Livestatus socket is available in `/var/run/icinga2/cmd/livestatus`. + +In order for queries and commands to work you will need to add your query user +(e.g. your web server) to the `icingacmd` group: + + # usermod -a -G icingacmd www-data + +The Debian packages use `nagios` as the user and group name. Make sure to change `icingacmd` to +`nagios` if you're using Debian. + +Change `www-data` to the user you're using to run queries. + +In order to use the historical tables provided by the livestatus feature (for example, the +`log` table) you need to have the `CompatLogger` feature enabled. By default these logs +are expected to be in `/var/log/icinga2/compat`. A different path can be set using the +`compat_log_path` configuration attribute. + + # icinga2 feature enable compatlog + + +### Livestatus Sockets + +Other to the Icinga 1.x Addon, Icinga 2 supports two socket types + +* Unix socket (default) +* TCP socket + +Details on the configuration can be found in the [LivestatusListener](9-object-types.md#objecttype-livestatuslistener) +object configuration. + +### Livestatus GET Queries + +> **Note** +> +> All Livestatus queries require an additional empty line as query end identifier. +> The `nc` tool (`netcat`) provides the `-U` parameter to communicate using +> a unix socket. + +There also is a Perl module available in CPAN for accessing the Livestatus socket +programmatically: [Monitoring::Livestatus](http://search.cpan.org/~nierlein/Monitoring-Livestatus-0.74/) + + +Example using the unix socket: + + # echo -e "GET services\n" | /usr/bin/nc -U /var/run/icinga2/cmd/livestatus + +Example using the tcp socket listening on port `6558`: + + # echo -e 'GET services\n' | netcat 127.0.0.1 6558 + + # cat servicegroups < Livestatus COMMAND Queries + +A list of available external commands and their parameters can be found [here](23-appendix.md#external-commands-list-detail) + + $ echo -e 'COMMAND ' | netcat 127.0.0.1 6558 + + +### Livestatus Filters + +and, or, negate + + Operator | Negate | Description + ----------|------------------------ + = | != | Equality + ~ | !~ | Regex match + =~ | !=~ | Equality ignoring case + ~~ | !~~ | Regex ignoring case + < | | Less than + > | | Greater than + <= | | Less than or equal + >= | | Greater than or equal + + +### Livestatus Stats + +Schema: "Stats: aggregatefunction aggregateattribute" + + Aggregate Function | Description + -------------------|-------------- + sum |   + min |   + max |   + avg | sum / count + std | standard deviation + suminv | sum (1 / value) + avginv | suminv / count + count | ordinary default for any stats query if not aggregate function defined + +Example: + + GET hosts + Filter: has_been_checked = 1 + Filter: check_type = 0 + Stats: sum execution_time + Stats: sum latency + Stats: sum percent_state_change + Stats: min execution_time + Stats: min latency + Stats: min percent_state_change + Stats: max execution_time + Stats: max latency + Stats: max percent_state_change + OutputFormat: json + ResponseHeader: fixed16 + +### Livestatus Output + +* CSV + +CSV output uses two levels of array separators: The members array separator +is a comma (1st level) while extra info and host|service relation separator +is a pipe (2nd level). + +Separators can be set using ASCII codes like: + + Separators: 10 59 44 124 + +* JSON + +Default separators. + +### Livestatus Error Codes + + Code | Description + ----------|-------------- + 200 | OK + 404 | Table does not exist + 452 | Exception on query + +### Livestatus Tables + + Table | Join |Description + --------------|-----------|---------------------------- + hosts |   | host config and status attributes, services counter + hostgroups |   | hostgroup config, status attributes and host/service counters + services | hosts | service config and status attributes + servicegroups |   | servicegroup config, status attributes and service counters + contacts |   | contact config and status attributes + contactgroups |   | contact config, members + commands |   | command name and line + status |   | programstatus, config and stats + comments | services | status attributes + downtimes | services | status attributes + timeperiods |   | name and is inside flag + endpoints |   | config and status attributes + log | services, hosts, contacts, commands | parses [compatlog](9-object-types.md#objecttype-compatlogger) and shows log attributes + statehist | hosts, services | parses [compatlog](9-object-types.md#objecttype-compatlogger) and aggregates state change attributes + hostsbygroup | hostgroups | host attributes grouped by hostgroup and its attributes + servicesbygroup | servicegroups | service attributes grouped by servicegroup and its attributes + servicesbyhostgroup | hostgroups | service attributes grouped by hostgroup and its attributes + +The `commands` table is populated with `CheckCommand`, `EventCommand` and `NotificationCommand` objects. + +A detailed list on the available table attributes can be found in the [Livestatus Schema documentation](23-appendix.md#schema-livestatus). + + +## Status Data Files + +Icinga 1.x writes object configuration data and status data in a cyclic +interval to its `objects.cache` and `status.dat` files. Icinga 2 provides +the `StatusDataWriter` object which dumps all configuration objects and +status updates in a regular interval. + + # icinga2 feature enable statusdata + +Icinga 1.x Classic UI requires this data set as part of its backend. + +> **Note** +> +> If you are not using any web interface or addon which uses these files, +> you can safely disable this feature. + + +## Compat Log Files + +The Icinga 1.x log format is considered being the `Compat Log` +in Icinga 2 provided with the `CompatLogger` object. + +These logs are not only used for informational representation in +external web interfaces parsing the logs, but also to generate +SLA reports and trends in Icinga 1.x Classic UI. Furthermore the +[Livestatus](14-features.md#setting-up-livestatus) feature uses these logs for answering queries to +historical tables. + +The `CompatLogger` object can be enabled with + + # icinga2 feature enable compatlog + +By default, the Icinga 1.x log file called `icinga.log` is located +in `/var/log/icinga2/compat`. Rotated log files are moved into +`var/log/icinga2/compat/archives`. + +The format cannot be changed without breaking compatibility to +existing log parsers. + + # tail -f /var/log/icinga2/compat/icinga.log + + [1382115688] LOG ROTATION: HOURLY + [1382115688] LOG VERSION: 2.0 + [1382115688] HOST STATE: CURRENT;localhost;UP;HARD;1; + [1382115688] SERVICE STATE: CURRENT;localhost;disk;WARNING;HARD;1; + [1382115688] SERVICE STATE: CURRENT;localhost;http;OK;HARD;1; + [1382115688] SERVICE STATE: CURRENT;localhost;load;OK;HARD;1; + [1382115688] SERVICE STATE: CURRENT;localhost;ping4;OK;HARD;1; + [1382115688] SERVICE STATE: CURRENT;localhost;ping6;OK;HARD;1; + [1382115688] SERVICE STATE: CURRENT;localhost;processes;WARNING;HARD;1; + [1382115688] SERVICE STATE: CURRENT;localhost;ssh;OK;HARD;1; + [1382115688] SERVICE STATE: CURRENT;localhost;users;OK;HARD;1; + [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;disk;1382115705 + [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;http;1382115705 + [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;load;1382115705 + [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;ping4;1382115705 + [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;ping6;1382115705 + [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;processes;1382115705 + [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;ssh;1382115705 + [1382115706] EXTERNAL COMMAND: SCHEDULE_FORCED_SVC_CHECK;localhost;users;1382115705 + [1382115731] EXTERNAL COMMAND: PROCESS_SERVICE_CHECK_RESULT;localhost;ping6;2;critical test| + [1382115731] SERVICE ALERT: localhost;ping6;CRITICAL;SOFT;2;critical test + + +## Check Result Files + +Icinga 1.x writes its check result files to a temporary spool directory +where they are processed in a regular interval. +While this is extremely inefficient in performance regards it has been +rendered useful for passing passive check results directly into Icinga 1.x +skipping the external command pipe. + +Several clustered/distributed environments and check-aggregation addons +use that method. In order to support step-by-step migration of these +environments, Icinga 2 supports the `CheckResultReader` object. + +There is no feature configuration available, but it must be defined +on-demand in your Icinga 2 objects configuration. + + object CheckResultReader "reader" { + spool_dir = "/data/check-results" + } + diff --git a/vim/bundle/icinga2/doc/15-troubleshooting.md b/vim/bundle/icinga2/doc/15-troubleshooting.md new file mode 100644 index 0000000..b2e90d5 --- /dev/null +++ b/vim/bundle/icinga2/doc/15-troubleshooting.md @@ -0,0 +1,396 @@ +# Icinga 2 Troubleshooting + +## Which information is required + +* Run `icinga2 troubleshoot` to collect required troubleshooting information +* Alternative, manual steps: + * `icinga2 --version` + * `icinga2 feature list` + * `icinga2 daemon --validate` + * Relevant output from your main and debug log ( `icinga2 object list --type='filelogger'` ) + * The newest Icinga 2 crash log if relevant + * Your icinga2.conf and, if you run multiple Icinga 2 instances, your zones.conf +* How was Icinga 2 installed (and which repository in case) and which distribution are you using +* Provide complete configuration snippets explaining your problem in detail +* If the check command failed, what's the output of your manual plugin tests? +* In case of [debugging](20-development.md#development) Icinga 2, the full back traces and outputs + +## Enable Debug Output + +Enable the `debuglog` feature: + + # icinga2 feature enable debuglog + # service icinga2 restart + +You can find the debug log file in `/var/log/icinga2/debug.log`. + +Alternatively you may run Icinga 2 in the foreground with debugging enabled. Specify the console +log severity as an additional parameter argument to `-x`. + + # /usr/sbin/icinga2 daemon -x notice + +The log level can be one of `critical`, `warning`, `information`, `notice` +and `debug`. + +## List Configuration Objects + +The `icinga2 object list` CLI command can be used to list all configuration objects and their +attributes. The tool also shows where each of the attributes was modified. + +> **Tip** +> +> Use the Icinga 2 API to access [config objects at runtime](12-icinga2-api.md#icinga2-api-config-objects) directly. + +That way you can also identify which objects have been created from your [apply rules](17-language-reference.md#apply). + + # icinga2 object list + + Object 'localhost!ssh' of type 'Service': + * __name = 'localhost!ssh' + * check_command = 'ssh' + % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 5:3-5:23 + * check_interval = 60 + % = modified in '/etc/icinga2/conf.d/templates.conf', lines 24:3-24:21 + * host_name = 'localhost' + % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 4:3-4:25 + * max_check_attempts = 3 + % = modified in '/etc/icinga2/conf.d/templates.conf', lines 23:3-23:24 + * name = 'ssh' + * retry_interval = 30 + % = modified in '/etc/icinga2/conf.d/templates.conf', lines 25:3-25:22 + * templates = [ 'ssh', 'generic-service' ] + % += modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 1:0-7:1 + % += modified in '/etc/icinga2/conf.d/templates.conf', lines 22:1-26:1 + * type = 'Service' + * vars + % += modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 6:3-6:19 + * sla = '24x7' + % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 6:3-6:19 + + [...] + +You can also filter by name and type: + + # icinga2 object list --name *ssh* --type Service + Object 'localhost!ssh' of type 'Service': + * __name = 'localhost!ssh' + * check_command = 'ssh' + % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 5:3-5:23 + * check_interval = 60 + % = modified in '/etc/icinga2/conf.d/templates.conf', lines 24:3-24:21 + * host_name = 'localhost' + % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 4:3-4:25 + * max_check_attempts = 3 + % = modified in '/etc/icinga2/conf.d/templates.conf', lines 23:3-23:24 + * name = 'ssh' + * retry_interval = 30 + % = modified in '/etc/icinga2/conf.d/templates.conf', lines 25:3-25:22 + * templates = [ 'ssh', 'generic-service' ] + % += modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 1:0-7:1 + % += modified in '/etc/icinga2/conf.d/templates.conf', lines 22:1-26:1 + * type = 'Service' + * vars + % += modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 6:3-6:19 + * sla = '24x7' + % = modified in '/etc/icinga2/conf.d/hosts/localhost/ssh.conf', lines 6:3-6:19 + + Found 1 Service objects. + + [2014-10-15 14:27:19 +0200] information/cli: Parsed 175 objects. + +## Where are the check command definitions? + +Icinga 2 features a number of built-in [check command definitions](10-icinga-template-library.md#plugin-check-commands) which are +included using + + include + include + +in the [icinga2.conf](4-configuring-icinga-2.md#icinga2-conf) configuration file. These files are not considered configuration files and will be overridden +on upgrade, so please send modifications as proposed patches upstream. The default include path is set to +`LocalStateDir + "/share/icinga2/includes"`. + +You should add your own command definitions to a new file in `conf.d/` called `commands.conf` +or similar. + +## Checks + +### Executed Command for Checks + +* Use the Icinga 2 API to [query](12-icinga2-api.md#icinga2-api-config-objects-query) host/service objects +for their check result containing the executed shell command. +* Use the Icinga 2 [console cli command](11-cli-commands.md#cli-command-console) +to fetch the checkable object, its check result and the executed shell command. +* Alternatively enable the [debug log](15-troubleshooting.md#troubleshooting-enable-debug-output) and look for the executed command. + +### Checks are not executed + +* Check the [debug log](15-troubleshooting.md#troubleshooting-enable-debug-output) to see if the check command gets executed. +* Verify that failed depedencies do not prevent command execution. +* Make sure that the plugin is executable by the Icinga 2 user (run a manual test). +* Make sure the [checker](11-cli-commands.md#enable-features) feature is enabled. +* Use the Icinga 2 API [event streams](12-icinga2-api.md#icinga2-api-event-streams) to receive live check result streams. + +Examples: + + # sudo -u icinga /usr/lib/nagios/plugins/check_ping -4 -H 127.0.0.1 -c 5000,100% -w 3000,80% + + # icinga2 feature enable checker + The feature 'checker' is already enabled. + +Fetch all check result events matching the `event.service` name `random`: + + $ curl -k -s -u root:icinga -X POST 'https://localhost:5665/v1/events?queue=debugchecks&types=CheckResult&filter=match%28%22random*%22,event.service%29' + + +## Notifications are not sent + +* Check the debug log to see if a notification is triggered. +* If yes, verify that all conditions are satisfied. +* Are any errors on the notification command execution logged? + +Verify the following configuration: + +* Is the host/service `enable_notifications` attribute set, and if so, to which value? +* Do the notification attributes `states`, `types`, `period` match the notification conditions? +* Do the user attributes `states`, `types`, `period` match the notification conditions? +* Are there any notification `begin` and `end` times configured? +* Make sure the [notification](11-cli-commands.md#enable-features) feature is enabled. +* Does the referenced NotificationCommand work when executed as Icinga user on the shell? + +If notifications are to be sent via mail, make sure that the mail program specified inside the +[NotificationCommand object](9-object-types.md#objecttype-notificationcommand) exists. +The name and location depends on the distribution so the preconfigured setting might have to be +changed on your system. + + +Examples: + + # icinga2 feature enable notification + The feature 'notification' is already enabled. + +You can use the Icinga 2 API [event streams](12-icinga2-api.md#icinga2-api-event-streams) to receive live notification streams: + + $ curl -k -s -u root:icinga -X POST 'https://localhost:5665/v1/events?queue=debugnotifications&types=Notification' + + +## Feature is not working + +* Make sure that the feature configuration is enabled by symlinking from `features-available/` +to `features-enabled` and that the latter is included in [icinga2.conf](4-configuring-icinga-2.md#icinga2-conf). +* Are the feature attributes set correctly according to the documentation? +* Any errors on the logs? + +## Configuration is ignored + +* Make sure that the line(s) are not [commented out](17-language-reference.md#comments) (starting with `//` or `#`, or +encapsulated by `/* ... */`). +* Is the configuration file included in [icinga2.conf](4-configuring-icinga-2.md#icinga2-conf)? + +## Configuration attributes are inherited from + +Icinga 2 allows you to import templates using the [import](17-language-reference.md#template-imports) keyword. If these templates +contain additional attributes, your objects will automatically inherit them. You can override +or modify these attributes in the current object. + +## Configuration Value with Single Dollar Sign + +In case your configuration validation fails with a missing closing dollar sign error message, you +did not properly escape the single dollar sign preventing its usage as [runtime macro](3-monitoring-basics.md#runtime-macros). + + critical/config: Error: Validation failed for Object 'ping4' (Type: 'Service') at /etc/icinga2/zones.d/global-templates/windows.conf:24: Closing $ not found in macro format string 'top-syntax=${list}'. + + +## Cluster and Clients Troubleshooting + +This applies to any Icinga 2 node in a [distributed monitoring setup](6-distributed-monitoring.md#distributed-monitoring-scenarios). + +You should configure the [cluster health checks](6-distributed-monitoring.md#distributed-monitoring-health-checks) if you haven't +done so already. + +> **Note** +> +> Some problems just exist due to wrong file permissions or packet filters applied. Make +> sure to check these in the first place. + +### Cluster Troubleshooting Connection Errors + +General connection errors normally lead you to one of the following problems: + +* Wrong network configuration +* Packet loss on the connection +* Firewall rules preventing traffic + +Use tools like `netstat`, `tcpdump`, `nmap`, etc. to make sure that the cluster communication +happens (default port is `5665`). + + # tcpdump -n port 5665 -i any + + # netstat -tulpen | grep icinga + + # nmap yourclusternode.localdomain + +### Cluster Troubleshooting SSL Errors + +If the cluster communication fails with SSL error messages, make sure to check +the following + +* File permissions on the SSL certificate files +* Does the used CA match for all cluster endpoints? + * Verify the `Issuer` being your trusted CA + * Verify the `Subject` containing your endpoint's common name (CN) + * Check the validity of the certificate itself + +Steps on the client `icinga2-node2.localdomain`: + + # ls -la /etc/icinga2/pki + + # cd /etc/icinga2/pki/ + # openssl x509 -in icinga2-node2.localdomain.crt -text + Certificate: + Data: + Version: 1 (0x0) + Serial Number: 2 (0x2) + Signature Algorithm: sha1WithRSAEncryption + Issuer: C=DE, ST=Bavaria, L=Nuremberg, O=NETWAYS GmbH, OU=Monitoring, CN=Icinga CA + Validity + Not Before: Jan 7 13:17:38 2014 GMT + Not After : Jan 5 13:17:38 2024 GMT + Subject: C=DE, ST=Bavaria, L=Nuremberg, O=NETWAYS GmbH, OU=Monitoring, CN=icinga2-node2.localdomain + Subject Public Key Info: + Public Key Algorithm: rsaEncryption + Public-Key: (4096 bit) + Modulus: + ... + +Try to manually connect from `icinga2-node2.localdomain` to the master node `icinga2-node1.localdomain`: + + # openssl s_client -CAfile /etc/icinga2/pki/ca.crt -cert /etc/icinga2/pki/icinga2-node2.localdomain.crt -key /etc/icinga2/pki/icinga2-node2.localdomain.key -connect icinga2-node1.localdomain:5665 + + CONNECTED(00000003) + --- + ... + +If the connection attempt fails or your CA does not match, [verify the master and client certificates](15-troubleshooting.md#troubleshooting-cluster-ssl-certificate-verification). + +#### Cluster Troubleshooting Unauthenticated Clients + +Unauthenticated nodes are able to connect. This is required for client setups. + +Master: + + [2015-07-13 18:29:25 +0200] information/ApiListener: New client connection for identity 'icinga-client' (unauthenticated) + +Client as command execution bridge: + + [2015-07-13 18:29:26 +1000] notice/ApiEvents: Discarding 'execute command' message from 'icinga-master': Invalid endpoint origin (client not allowed). + +If these messages do not go away, make sure to [verify the master and client certificates](15-troubleshooting.md#troubleshooting-cluster-ssl-certificate-verification). + +#### Cluster Troubleshooting SSL Certificate Verification + +Make sure to verify the client's certificate and its received `ca.crt` in `/etc/icinga2/pki` and ensure that +both instances are signed by the **same CA**. + + # openssl verify -verbose -CAfile /etc/icinga2/pki/ca.crt /etc/icinga2/pki/icinga2-node1.localdomain.crt + icinga2-node1.localdomain.crt: OK + + # openssl verify -verbose -CAfile /etc/icinga2/pki/ca.crt /etc/icinga2/pki/icinga2-node2.localdomain.crt + icinga2-node2.localdomain.crt: OK + +Fetch the `ca.crt` file from the client node and compare it to your master's `ca.crt` file: + + # scp icinga2-node2:/etc/icinga2/pki/ca.crt test-client-ca.crt + # diff -ur /etc/icinga2/pki/ca.crt test-client-ca.crt + +On SLES11 you'll need to use the `openssl1` command instead of `openssl`. + +### Cluster Troubleshooting Message Errors + +At some point, when the network connection is broken or gone, the Icinga 2 instances +will be disconnected. If the connection can't be re-established between endpoints in the same HA zone, +they remain in a Split-Brain-mode and history may differ. + +Although the Icinga 2 cluster protocol stores historical events in a [replay log](15-troubleshooting.md#troubleshooting-cluster-replay-log) +for later synchronisation, you should make sure to check why the network connection failed. + +### Cluster Troubleshooting Command Endpoint Errors + +Command endpoints can be used [for clients](6-distributed-monitoring.md#distributed-monitoring-top-down-command-endpoint) +as well as inside an [High-Availability cluster](6-distributed-monitoring.md#distributed-monitoring-scenarios). + +There is no cli command for manually executing the check, but you can verify +the following (e.g. by invoking a forced check from the web interface): + +* `/var/log/icinga2/icinga2.log` contains connection and execution errors. + * The ApiListener is not enabled to [accept commands](6-distributed-monitoring.md#distributed-monitoring-top-down-command-endpoint). + * `CheckCommand` definition not found on the remote client. + * Referenced check plugin not found on the remote client. + * Runtime warnings and errors, e.g. unresolved runtime macros or configuration problems. +* Specific error messages are also populated into `UNKNOWN` check results including a detailed error message in their output. +* Verify the `check_source` object attribute. This is populated by the node executing the check. +* More verbose logs are found inside the [debug log](15-troubleshooting.md#troubleshooting-enable-debug-output). + +* Use the Icinga 2 API [event streams](12-icinga2-api.md#icinga2-api-event-streams) to receive live check result streams. + +Fetch all check result events matching the `event.service` name `remote-client`: + + $ curl -k -s -u root:icinga -X POST 'https://localhost:5665/v1/events?queue=debugcommandendpoint&types=CheckResult&filter=match%28%22remote-client*%22,event.service%29' + + + +### Cluster Troubleshooting Config Sync + +If the cluster zones do not sync their configuration, make sure to check the following: + +* Within a config master zone, only one configuration master is allowed to have its config in `/etc/icinga2/zones.d`. +** The master syncs the configuration to `/var/lib/icinga2/api/zones/` during startup and only syncs valid configuration to the other nodes. +** The other nodes receive the configuration into `/var/lib/icinga2/api/zones/`. +* The `icinga2.log` log file in `/var/log/icinga2` will indicate whether this ApiListener +[accepts config](6-distributed-monitoring.md#distributed-monitoring-top-down-config-sync), or not. + +Verify the object's [version](9-object-types.md#object-types) attribute on all nodes to +check whether the config update and reload was succesful or not. + +### Cluster Troubleshooting Overdue Check Results + +If your master does not receive check results (or any other events) from the child zones +(satellite, clients, etc.), make sure to check whether the client sending in events +is allowed to do so. + +The [distributed monitoring conventions](6-distributed-monitoring.md#distributed-monitoring-conventions) +apply. So, if there's a mismatch between your client node's endpoint name and its provided +certificate's CN, the master will deny all events. + +> **Tip** +> +> [Icinga Web 2](2-getting-started.md#setting-up-icingaweb2) provides a dashboard view +> for overdue check results. + +Enable the [debug log](15-troubleshooting.md#troubleshooting-enable-debug-output) on the master +for more verbose insights. + +If the client cannot authenticate, it's a more general [problem](15-troubleshooting.md#troubleshooting-cluster-unauthenticated-clients). + +The client's endpoint is not configured on nor trusted by the master node: + + Discarding 'check result' message from 'icinga2b': Invalid endpoint origin (client not allowed). + +The check result message sent by the client does not belong to the zone the checkable object is +in on the master: + + Discarding 'check result' message from 'icinga2b': Unauthorized access. + + +### Cluster Troubleshooting Replay Log + +If your `/var/lib/icinga2/api/log` directory grows, it generally means that your cluster +cannot replay the log on connection loss and re-establishment. A master node for example +will store all events for not connected endpoints in the same and child zones. + +Check the following: + +* All clients are connected? (e.g. [cluster health check](6-distributed-monitoring.md#distributed-monitoring-health-checks)). +* Check your [connection](15-troubleshooting.md#troubleshooting-cluster-connection-errors) in general. +* Does the log replay work, e.g. are all events processed and the directory gets cleared up over time? +* Decrease the `log_duration` attribute value for that specific [endpoint](9-object-types.md#objecttype-endpoint). diff --git a/vim/bundle/icinga2/doc/16-upgrading-icinga-2.md b/vim/bundle/icinga2/doc/16-upgrading-icinga-2.md new file mode 100644 index 0000000..e3f8a50 --- /dev/null +++ b/vim/bundle/icinga2/doc/16-upgrading-icinga-2.md @@ -0,0 +1,56 @@ +# Upgrading Icinga 2 + +Upgrading Icinga 2 is usually quite straightforward. Ordinarily the only manual steps involved +are scheme updates for the IDO database. + +## Upgrading the MySQL database + +If you're upgrading an existing Icinga 2 instance, you should check the +`/usr/share/icinga2-ido-mysql/schema/upgrade` directory for an incremental schema upgrade file. + +> **Note** +> +> If there isn't an upgrade file for your current version available, there's nothing to do. + +Apply all database schema upgrade files incrementally. + + # mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/upgrade/.sql + +The Icinga 2 DB IDO module will check for the required database schema version on startup +and generate an error message if not satisfied. + + +**Example:** You are upgrading Icinga 2 from version `2.0.2` to `2.3.0`. Look into +the *upgrade* directory: + + $ ls /usr/share/icinga2-ido-mysql/schema/upgrade/ + 2.0.2.sql 2.1.0.sql 2.2.0.sql 2.3.0.sql + +There are two new upgrade files called `2.1.0.sql`, `2.2.0.sql` and `2.3.0.sql` +which must be applied incrementally to your IDO database. + +## Upgrading the PostgreSQL database + +If you're updating an existing Icinga 2 instance, you should check the +`/usr/share/icinga2-ido-pgsql/schema/upgrade` directory for an incremental schema upgrade file. + +> **Note** +> +> If there isn't an upgrade file for your current version available, there's nothing to do. + +Apply all database schema upgrade files incrementally. + + # export PGPASSWORD=icinga + # psql -U icinga -d icinga < /usr/share/icinga2-ido-pgsql/schema/upgrade/.sql + +The Icinga 2 DB IDO module will check for the required database schema version on startup +and generate an error message if not satisfied. + +**Example:** You are upgrading Icinga 2 from version `2.0.2` to `2.3.0`. Look into +the *upgrade* directory: + + $ ls /usr/share/icinga2-ido-pgsql/schema/upgrade/ + 2.0.2.sql 2.1.0.sql 2.2.0.sql 2.3.0.sql + +There are two new upgrade files called `2.1.0.sql`, `2.2.0.sql` and `2.3.0.sql` +which must be applied incrementally to your IDO database. diff --git a/vim/bundle/icinga2/doc/17-language-reference.md b/vim/bundle/icinga2/doc/17-language-reference.md new file mode 100644 index 0000000..b29d96d --- /dev/null +++ b/vim/bundle/icinga2/doc/17-language-reference.md @@ -0,0 +1,974 @@ +# Language Reference + +## Object Definition + +Icinga 2 features an object-based configuration format. You can define new +objects using the `object` keyword: + + object Host "host1.example.org" { + display_name = "host1" + + address = "192.168.0.1" + address6 = "::1" + } + +In general you need to write each statement on a new line. Expressions started +with `{`, `(` and `[` extend until the matching closing character and can be broken +up into multiple lines. + +Alternatively you can write multiple statements on a single line by separating +them with a semicolon: + + object Host "host1.example.org" { + display_name = "host1" + + address = "192.168.0.1"; address6 = "::1" + } + +Each object is uniquely identified by its type (`Host`) and name +(`host1.example.org`). Some types have composite names, e.g. the +`Service` type which uses the `host_name` attribute and the name +you specified to generate its object name. + +Exclamation marks (!) are not permitted in object names. + +Objects can contain a comma-separated list of property +declarations. Instead of commas semicolons may also be used. +The following data types are available for property values: + +All objects have at least the following attributes: + +Attribute | Description +---------------------|----------------------------- +name | The name of the object. This attribute can be modified in the object definition to override the name specified with the `object` directive. +type | The type of the object. + +## Expressions + +The following expressions can be used on the right-hand side of assignments. + +### Numeric Literals + +A floating-point number. + +Example: + + 27.3 + +### Duration Literals + +Similar to floating-point numbers except for the fact that they support +suffixes to help with specifying time durations. + +Example: + + 2.5m + +Supported suffixes include ms (milliseconds), s (seconds), m (minutes), +h (hours) and d (days). + +Duration literals are converted to seconds by the config parser and +are treated like numeric literals. + +### String Literals + +A string. + +Example: + + "Hello World!" + +Certain characters need to be escaped. The following escape sequences +are supported: + +Character | Escape sequence +--------------------------|------------------------------------ +" | \\" +\\ | \\\\ +<TAB> | \\t +<CARRIAGE-RETURN> | \\r +<LINE-FEED> | \\n +<BEL> | \\b +<FORM-FEED> | \\f + +In addition to these pre-defined escape sequences you can specify +arbitrary ASCII characters using the backslash character (\\) followed +by an ASCII character in octal encoding. + +### Multi-line String Literals + +Strings spanning multiple lines can be specified by enclosing them in +{{{ and }}}. + +Example: + + {{{This + is + a multi-line + string.}}} + +Unlike in ordinary strings special characters do not have to be escaped +in multi-line string literals. + +### Boolean Literals + +The keywords `true` and `false` are used to denote truth values. + +### Null Value + +The `null` keyword can be used to specify an empty value. + +### Dictionary + +An unordered list of key-value pairs. Keys must be unique and are +compared in a case-sensitive manner. + +Individual key-value pairs must either be comma-separated or on separate lines. +The comma after the last key-value pair is optional. + +Example: + + { + address = "192.168.0.1" + port = 443 + } + +Identifiers may not contain certain characters (e.g. space) or start +with certain characters (e.g. digits). If you want to use a dictionary +key that is not a valid identifier, you can enclose the key in double +quotes. + +### Array + +An ordered list of values. + +Individual array elements must be comma-separated. +The comma after the last element is optional. + +Example: + + [ "hello", 42 ] + +An array may simultaneously contain values of different types, such as +strings and numbers. + +### Operators + +The following operators are supported in expressions. The operators are by descending precedence. + +Operator | Precedence | Examples (Result) | Description +---------|------------|-----------------------------------------------|-------------------------------- +() | 1 | (3 + 3) * 5 | Groups sub-expressions +() | 1 | Math.random() | Calls a function +[] | 1 | a[3] | Array subscript +. | 1 | a.b | Element access +! | 2 | !"Hello" (false), !false (true) | Logical negation of the operand +~ | 2 | ~true (false) | Bitwise negation of the operand ++ | 2 | +3 | Unary plus +- | 2 | -3 | Unary minus +* | 3 | 5m * 10 (3000) | Multiplies two numbers +/ | 3 | 5m / 5 (60) | Divides two numbers +% | 3 | 17 % 12 (5) | Remainder after division ++ | 4 | 1 + 3 (4), "hello " + "world" ("hello world") | Adds two numbers; concatenates strings +- | 4 | 3 - 1 (2) | Subtracts two numbers +<< | 5 | 4 << 8 (1024) | Left shift +>> | 5 | 1024 >> 4 (64) | Right shift +< | 6 | 3 < 5 (true) | Less than +> | 6 | 3 > 5 (false) | Greater than +<= | 6 | 3 <= 3 (true) | Less than or equal +>= | 6 | 3 >= 3 (true) | Greater than or equal +in | 7 | "foo" in [ "foo", "bar" ] (true) | Element contained in array +!in | 7 | "foo" !in [ "bar", "baz" ] (true) | Element not contained in array +== | 8 | "hello" == "hello" (true), 3 == 5 (false) | Equal to +!= | 8 | "hello" != "world" (true), 3 != 3 (false) | Not equal to +& | 9 | 7 & 3 (3) | Binary AND +^ | 10 | 17 ^ 12 (29) | Bitwise XOR +| | 11 | 2 | 3 (3) | Binary OR +&& | 13 | true && false (false), 3 && 7 (7), 0 && 7 (0) | Logical AND +|| | 14 | true || false (true), 0 || 7 (7)| Logical OR += | 12 | a = 3 | Assignment +=> | 15 | x => x * x (function with arg x) | Lambda, for loop + +### Function Calls + +Functions can be called using the `()` operator: + + const MyGroups = [ "test1", "test" ] + + { + check_interval = len(MyGroups) * 1m + } + +A list of available functions is available in the [Library Reference](18-library-reference.md#library-reference) chapter. + +## Assignments + +In addition to the `=` operator shown above a number of other operators +to manipulate attributes are supported. Here's a list of all +available operators: + +### Operator = + +Sets an attribute to the specified value. + +Example: + + { + a = 5 + a = 7 + } + +In this example `a` has the value `7` after both instructions are executed. + +### Operator += + +The += operator is a shortcut. The following expression: + + { + a = [ "hello" ] + a += [ "world" ] + } + +is equivalent to: + + { + a = [ "hello" ] + a = a + [ "world" ] + } + +### Operator -= + +The -= operator is a shortcut. The following expression: + + { + a = 10 + a -= 5 + } + +is equivalent to: + + { + a = 10 + a = a - 5 + } + +### Operator \*= + +The *= operator is a shortcut. The following expression: + + { + a = 60 + a *= 5 + } + +is equivalent to: + + { + a = 60 + a = a * 5 + } + +### Operator /= + +The /= operator is a shortcut. The following expression: + + { + a = 300 + a /= 5 + } + +is equivalent to: + + { + a = 300 + a = a / 5 + } + +## Indexer + +The indexer syntax provides a convenient way to set dictionary elements. + +Example: + + { + hello.key = "world" + } + +Example (alternative syntax): + + { + hello["key"] = "world" + } + +This is equivalent to writing: + + { + hello += { + key = "world" + } + } + +If the `hello` attribute does not already have a value, it is automatically initialized to an empty dictionary. + +## Template Imports + +Objects can import attributes from other objects. + +Example: + + template Host "default-host" { + vars.colour = "red" + } + + template Host "test-host" { + import "default-host" + + vars.colour = "blue" + } + + object Host "localhost" { + import "test-host" + + address = "127.0.0.1" + address6 = "::1" + } + +The `default-host` and `test-host` objects are marked as templates +using the `template` keyword. Unlike ordinary objects templates are not +instantiated at run-time. Parent objects do not necessarily have to be +templates, however in general they are. + +The `vars` dictionary for the `localhost` object contains all three +custom attributes and the custom attribute `colour` has the value `"blue"`. + +Parent objects are resolved in the order they're specified using the +`import` keyword. + +Default templates which are automatically imported into all object definitions +can be specified using the `default` keyword: + + template CheckCommand "plugin-check-command" default { + // ... + } + +Default templates are imported before any other user-specified statement in an +object definition is evaluated. + +If there are multiple default templates the order in which they are imported +is unspecified. + +## Constants + +Global constants can be set using the `const` keyword: + + const VarName = "some value" + +Once defined a constant can be accessed from any file. Constants cannot be changed +once they are set. + +Icinga 2 provides a number of special global constants. Some of them can be overridden using the `--define` command line parameter: + +Variable |Description +--------------------|------------------- +PrefixDir |**Read-only.** Contains the installation prefix that was specified with cmake -DCMAKE_INSTALL_PREFIX. Defaults to "/usr/local". +SysconfDir |**Read-only.** Contains the path of the sysconf directory. Defaults to PrefixDir + "/etc". +ZonesDir |**Read-only.** Contains the path of the zones.d directory. Defaults to SysconfDir + "/zones.d". +LocalStateDir |**Read-only.** Contains the path of the local state directory. Defaults to PrefixDir + "/var". +RunDir |**Read-only.** Contains the path of the run directory. Defaults to LocalStateDir + "/run". +PkgDataDir |**Read-only.** Contains the path of the package data directory. Defaults to PrefixDir + "/share/icinga2". +StatePath |**Read-write.** Contains the path of the Icinga 2 state file. Defaults to LocalStateDir + "/lib/icinga2/icinga2.state". +ObjectsPath |**Read-write.** Contains the path of the Icinga 2 objects file. Defaults to LocalStateDir + "/cache/icinga2/icinga2.debug". +PidPath |**Read-write.** Contains the path of the Icinga 2 PID file. Defaults to RunDir + "/icinga2/icinga2.pid". +Vars |**Read-write.** Contains a dictionary with global custom attributes. Not set by default. +NodeName |**Read-write.** Contains the cluster node name. Set to the local hostname by default. +UseVfork |**Read-write.** Whether to use vfork(). Only available on *NIX. Defaults to true. +EventEngine |**Read-write.** The name of the socket event engine, can be "poll" or "epoll". The epoll interface is only supported on Linux. +AttachDebugger |**Read-write.** Whether to attach a debugger when Icinga 2 crashes. Defaults to false. +RunAsUser |**Read-write.** Defines the user the Icinga 2 daemon is running as. Used in the `init.conf` configuration file. +RunAsGroup |**Read-write.** Defines the group the Icinga 2 daemon is running as. Used in the `init.conf` configuration file. +PlatformName |**Read-only.** The name of the operating system, e.g. "Ubuntu". +PlatformVersion |**Read-only.** The version of the operating system, e.g. "14.04.3 LTS". +PlatformKernel |**Read-only.** The name of the operating system kernel, e.g. "Linux". +PlatformKernelVersion|**Read-only.** The version of the operating system kernel, e.g. "3.13.0-63-generic". +BuildCompilerName |**Read-only.** The name of the compiler Icinga was built with, e.g. "Clang". +BuildCompilerVersion|**Read-only.** The version of the compiler Icinga was built with, e.g. "7.3.0.7030031". +BuildHostName |**Read-only.** The name of the host Icinga was built on, e.g. "acheron". + +## Apply + +The `apply` keyword can be used to create new objects which are associated with +another group of objects. + + apply Service "ping" to Host { + import "generic-service" + + check_command = "ping4" + + assign where host.name == "localhost" + } + +In this example the `assign where` condition is a boolean expression which is +evaluated for all objects of type `Host` and a new service with name "ping" +is created for each matching host. [Expression operators](17-language-reference.md#expression-operators) +may be used in `assign where` conditions. + +The `to` keyword and the target type may be omitted if there is only one target +type, e.g. for the `Service` type. + +Depending on the object type used in the `apply` expression additional local +variables may be available for use in the `where` condition: + +Source Type | Target Type | Variables +------------------|-------------|-------------- +Service | Host | host +Dependency | Host | host +Dependency | Service | host, service +Notification | Host | host +Notification | Service | host, service +ScheduledDowntime | Host | host +ScheduledDowntime | Service | host, service + +Any valid config attribute can be accessed using the `host` and `service` +variables. For example, `host.address` would return the value of the host's +"address" attribute -- or null if that attribute isn't set. + +More usage examples are documented in the [monitoring basics](3-monitoring-basics.md#using-apply-expressions) +chapter. + +## Apply For + +[Apply](17-language-reference.md#apply) rules can be extended with the +[for loop](17-language-reference.md#for-loops) keyword. + + apply Service "prefix-" for (key => value in host.vars.dictionary) to Host { + import "generic-service" + + check_command = "ping4" + vars.host_value = value + } + + +Any valid config attribute can be accessed using the `host` and `service` +variables. The attribute must be of the Array or Dictionary type. In this example +`host.vars.dictionary` is of the Dictionary type which needs a key-value-pair +as iterator. + +In this example all generated service object names consist of `prefix-` and +the value of the `key` iterator. The prefix string can be omitted if not required. + +The `key` and `value` variables can be used for object attribute assignment, e.g. for +setting the `check_command` attribute or custom attributes as command parameters. + +`apply for` rules are first evaluated against all objects matching the `for loop` list +and afterwards the `assign where` and `ignore where` conditions are evaluated. + +It is not necessary to check attributes referenced in the `for loop` expression +for their existance using an additional `assign where` condition. + +More usage examples are documented in the [monitoring basics](3-monitoring-basics.md#using-apply-for) +chapter. + +## Group Assign + +Group objects can be assigned to specific member objects using the `assign where` +and `ignore where` conditions. + + object HostGroup "linux-servers" { + display_name = "Linux Servers" + + assign where host.vars.os == "Linux" + } + +In this example the `assign where` condition is a boolean expression which is evaluated +for all objects of the type `Host`. Each matching host is added as member to the host group +with the name "linux-servers". Membership exclusion can be controlled using the `ignore where` +condition. [Expression operators](17-language-reference.md#expression-operators) may be used in `assign where` and +`ignore where` conditions. + +Source Type | Variables +------------------|-------------- +HostGroup | host +ServiceGroup | host, service +UserGroup | user + + +## Boolean Values + +The `assign where`, `ignore where`, `if` and `while` statements, the `!` operator as +well as the `bool()` function convert their arguments to a boolean value based on the +following rules: + +Description | Example Value | Boolean Value +---------------------|-------------------|-------------- +Empty value | null | false +Zero | 0 | false +Non-zero integer | -23945 | true +Empty string | "" | false +Non-empty string | "Hello" | true +Empty array | [] | false +Non-empty array | [ "Hello" ] | true +Empty dictionary | {} | false +Non-empty dictionary | { key = "value" } | true + +For a list of supported expression operators for `assign where` and `ignore where` +statements, see [expression operators](17-language-reference.md#expression-operators). + +## Comments + +The Icinga 2 configuration format supports C/C++-style and shell-style comments. + +Example: + + /* + This is a comment. + */ + object Host "localhost" { + check_interval = 30 // this is also a comment. + retry_interval = 15 # yet another comment + } + +## Includes + +Other configuration files can be included using the `include` directive. +Paths must be relative to the configuration file that contains the +`include` directive. + +Example: + + include "some/other/file.conf" + include "conf.d/*.conf" + +Wildcard includes are not recursive. + +Icinga also supports include search paths similar to how they work in a +C/C++ compiler: + + include + +Note the use of angle brackets instead of double quotes. This causes the +config compiler to search the include search paths for the specified +file. By default $PREFIX/share/icinga2/include is included in the list of search +paths. Additional include search paths can be added using +[command-line options](11-cli-commands.md#config-include-path). + +Wildcards are not permitted when using angle brackets. + +## Recursive Includes + +The `include_recursive` directive can be used to recursively include all +files in a directory which match a certain pattern. + +Example: + + include_recursive "conf.d", "*.conf" + include_recursive "templates" + +The first parameter specifies the directory from which files should be +recursively included. + +The file names need to match the pattern given in the second parameter. +When no pattern is specified the default pattern "*.conf" is used. + +## Zone Includes + +The `include_zones` recursively includes all subdirectories for the +given path. + +In addition to that it sets the `zone` attribute for all objects created +in these subdirectories to the name of the subdirectory. + +Example: + + include_zones "etc", "zones.d", "*.conf" + include_zones "puppet", "puppet-zones" + +The first parameter specifies a tag name for this directive. Each `include_zones` +invocation should use a unique tag name. When copying the zones' configuration +files Icinga uses the tag name as the name for the destination directory in +`/var/lib/icinga2/api/config`. + +The second parameter specifies the directory which contains the subdirectories. + +The file names need to match the pattern given in the third parameter. +When no pattern is specified the default pattern "*.conf" is used. + +## Library directive + +The `library` directive can be used to manually load additional +libraries. Libraries can be used to provide additional object types and +functions. + +Example: + + library "snmphelper" + +## Functions + +Functions can be defined using the `function` keyword. + +Example: + + function multiply(a, b) { + return a * b + } + +When encountering the `return` keyword further execution of the function is terminated and +the specified value is supplied to the caller of the function: + + log(multiply(3, 5)) + +In this example the `multiply` function we declared earlier is invoked with two arguments (3 and 5). +The function computes the product of those arguments and makes the result available to the +function's caller. + +When no value is supplied for the `return` statement the function returns `null`. + +Functions which do not have a `return` statement have their return value set to the value of the +last expression which was performed by the function. For example, we could have also written our +`multiply` function like this: + + function multiply(a, b) { + a * b + } + +Anonymous functions can be created by omitting the name in the function definition. The +resulting function object can be used like any other value: + + var fn = function() { 3 } + + fn() /* Returns 3 */ + +## Lambda Expressions + +Functions can also be declared using the alternative lambda syntax. + +Example: + + f = (x) => x * x + +Multiple statements can be used by putting the function body into braces: + + f = (x) => { + log("Lambda called") + x * x + } + +Just like with ordinary functions the return value is the value of the last statement. + +For lambdas which take exactly one argument the braces around the arguments can be omitted: + + f = x => x * x + +## Abbreviated Lambda Syntax + +Lambdas which take no arguments can also be written using the abbreviated lambda syntax. + +Example: + + f = {{ 3 }} + +This creates a new function which returns the value 3. + +## Variable Scopes + +When setting a variable Icinga checks the following scopes in this order whether the variable +already exists there: + +* Local Scope +* `this` Scope +* Global Scope + +The local scope contains variables which only exist during the invocation of the current function, +object or apply statement. Local variables can be declared using the `var` keyword: + + function multiply(a, b) { + var temp = a * b + return temp + } + +Each time the `multiply` function is invoked a new `temp` variable is used which is in no way +related to previous invocations of the function. + +When setting a variable which has not previously been declared as local using the `var` keyword +the `this` scope is used. + +The `this` scope refers to the current object which the function or object/apply statement +operates on. + + object Host "localhost" { + check_interval = 5m + } + +In this example the `this` scope refers to the "localhost" object. The `check_interval` attribute +is set for this particular host. + +You can explicitly access the `this` scope using the `this` keyword: + + object Host "localhost" { + var check_interval = 5m + + /* This explicitly specifies that the attribute should be set + * for the host, if we had omitted `this.` the (poorly named) + * local variable `check_interval` would have been modified instead. + */ + this.check_interval = 1m + } + +Similarly the keywords `locals` and `globals` are available to access the local and global scope. + +Functions also have a `this` scope. However unlike for object/apply statements the `this` scope for +a function is set to whichever object was used to invoke the function. Here's an example: + + hm = { + h_word = null + + function init(word) { + h_word = word + } + } + + /* Let's invoke the init() function */ + hm.init("hello") + +We're using `hm.init` to invoke the function which causes the value of `hm` to become the `this` +scope for this function call. + +## Closures + +By default `function`s, `object`s and `apply` rules do not have access to variables declared +outside of their scope (except for global variables). + +In order to access variables which are defined in the outer scope the `use` keyword can be used: + + function MakeHelloFunction(name) { + return function() use(name) { + log("Hello, " + name) + } + } + +In this case a new variable `name` is created inside the inner function's scope which has the +value of the `name` function argument. + +Alternatively a different value for the inner variable can be specified: + + function MakeHelloFunction(name) { + return function() use (greeting = "Hello, " + name) { + log(greeting) + } + } + +## Conditional Statements + +Sometimes it can be desirable to only evaluate statements when certain conditions are met. The if/else +construct can be used to accomplish this. + +Example: + + a = 3 + + if (a < 5) { + a *= 7 + } else if (a > 10) { + a *= 5 + } else { + a *= 2 + } + +An if/else construct can also be used in place of any other value. The value of an if/else statement +is the value of the last statement which was evaluated for the branch which was taken: + + a = if (true) { + log("Taking the 'true' branch") + 7 * 3 + } else { + log("Taking the 'false' branch") + 9 + } + +This example prints the log message "Taking the 'true' branch" and the `a` variable is set to 21 (7 * 3). + +The value of an if/else construct is null if the condition evaluates to false and no else branch is given. + +## While Loops + +The `while` statement checks a condition and executes the loop body when the condition evaluates to `true`. +This is repeated until the condition is no longer true. + +Example: + + var num = 5 + + while (num > 5) { + log("Test") + num -= 1 + } + +The `continue` and `break` keywords can be used to control how the loop is executed: The `continue` keyword +skips over the remaining expressions for the loop body and begins the next loop evaluation. The `break` keyword +breaks out of the loop. + +## For Loops + +The `for` statement can be used to iterate over arrays and dictionaries. + +Example: + + var list = [ "a", "b", "c" ] + + for (item in list) { + log("Item: " + item) + } + +The loop body is evaluated once for each item in the array. The variable `item` is declared as a local +variable just as if the `var` keyword had been used. + +Iterating over dictionaries can be accomplished in a similar manner: + + var dict = { a = 3, b = 7 } + + for (key => value in dict) { + log("Key: " + key + ", Value: " + value) + } + +The `continue` and `break` keywords can be used to control how the loop is executed: The `continue` keyword +skips over the remaining expressions for the loop body and begins the next loop evaluation. The `break` keyword +breaks out of the loop. + +## Constructors + +In order to create a new value of a specific type constructor calls may be used. + +Example: + + var pd = PerfdataValue() + pd.label = "test" + pd.value = 10 + +You can also try to convert an existing value to another type by specifying it as an argument for the constructor call. + +Example: + + var s = String(3) /* Sets s to "3". */ + +## Exceptions + +Built-in commands may throw exceptions to signal errors such as invalid arguments. User scripts can throw exceptions +using the `throw` keyword. + +Example: + + throw "An error occurred." + +There is currently no way for scripts to catch exceptions. + +## Breakpoints + +The `debugger` keyword can be used to insert a breakpoint. It may be used at any place where an assignment would also be a valid expression. + +By default breakpoints have no effect unless Icinga is started with the `--script-debugger` command-line option. When the script debugger is enabled Icinga stops execution of the script when it encounters a breakpoint and spawns a console which lets the user inspect the current state of the execution environment. + +## Types + +All values have a static type. The `typeof` function can be used to determine the type of a value: + + typeof(3) /* Returns an object which represents the type for numbers */ + +The following built-in types are available: + +Type | Examples | Description +-----------|-------------------|------------------------ +Number | 3.7 | A numerical value. +Boolean | true, false | A boolean value. +String | "hello" | A string. +Array | [ "a", "b" ] | An array. +Dictionary | { a = 3 } | A dictionary. + +Depending on which libraries are loaded additional types may become available. The `icinga` +library implements a whole bunch of other [object types](9-object-types.md#object-types), +e.g. Host, Service, CheckCommand, etc. + +Each type has an associated type object which describes the type's semantics. These +type objects are made available using global variables which match the type's name: + + /* This logs 'true' */ + log(typeof(3) == Number) + +The type object's `prototype` property can be used to find out which methods a certain type +supports: + + /* This returns: ["contains","find","len","lower","replace","reverse","split","substr","to_string","trim","upper"] */ + keys(String.prototype) + +Additional documentation on type methods is available in the +[library reference](18-library-reference.md#library-reference). + +## Location Information + +The location of the currently executing script can be obtained using the +`current_filename` and `current_line` keywords. + +Example: + + log("Hello from '" + current_filename + "' in line " + current_line) + +## Reserved Keywords + +These keywords are reserved and must not be used as constants or custom attributes. + + object + template + include + include_recursive + ignore_on_error + library + null + true + false + const + var + this + use + apply + to + where + import + assign + ignore + function + return + for + if + else + in + current_filename + current_line + +You can escape reserved keywords using the `@` character. The following example +tries to set `vars.include` which references a reserved keyword and generates +an error: + + [2014-09-15 17:24:00 +0200] critical/config: Location: + /etc/icinga2/conf.d/hosts/localhost.conf(13): vars.sla = "24x7" + /etc/icinga2/conf.d/hosts/localhost.conf(14): + /etc/icinga2/conf.d/hosts/localhost.conf(15): vars.include = "some cmdb export field" + ^^^^^^^ + /etc/icinga2/conf.d/hosts/localhost.conf(16): } + /etc/icinga2/conf.d/hosts/localhost.conf(17): + + Config error: in /etc/icinga2/conf.d/hosts/localhost.conf: 15:8-15:14: syntax error, unexpected include (T_INCLUDE), expecting T_IDENTIFIER + [2014-09-15 17:24:00 +0200] critical/config: 1 errors, 0 warnings. + +You can escape the `include` keyword by prefixing it with an additional `@` character: + + object Host "localhost" { + import "generic-host" + + address = "127.0.0.1" + address6 = "::1" + + vars.os = "Linux" + vars.sla = "24x7" + + vars.@include = "some cmdb export field" + } + diff --git a/vim/bundle/icinga2/doc/18-library-reference.md b/vim/bundle/icinga2/doc/18-library-reference.md new file mode 100644 index 0000000..577c7fd --- /dev/null +++ b/vim/bundle/icinga2/doc/18-library-reference.md @@ -0,0 +1,904 @@ +# Library Reference + +## Global functions + +Function | Description +--------------------------------|----------------------- +regex(pattern, text) | Returns true if the regex pattern matches the text, false otherwise. +match(pattern, text) | Returns true if the wildcard pattern matches the text, false otherwise. +cidr_match(pattern, ip) | Returns true if the CIDR pattern matches the IP address, false otherwise. IPv4 addresses are converted to IPv4-mapped IPv6 addresses before being matched against the pattern. +len(value) | Returns the length of the value, i.e. the number of elements for an array or dictionary, or the length of the string in bytes. +union(array, array, ...) | Returns an array containing all unique elements from the specified arrays. +intersection(array, array, ...) | Returns an array containing all unique elements which are common to all specified arrays. +keys(dict) | Returns an array containing the dictionary's keys. +string(value) | Converts the value to a string. +number(value) | Converts the value to a number. +bool(value) | Converts the value to a bool. +random() | Returns a random value between 0 and RAND_MAX (as defined in stdlib.h). +log(value) | Writes a message to the log. Non-string values are converted to a JSON string. +log(severity, facility, value) | Writes a message to the log. `severity` can be one of `LogDebug`, `LogNotice`, `LogInformation`, `LogWarning`, and `LogCritical`. Non-string values are converted to a JSON string. +typeof(value) | Returns the [Type](18-library-reference.md#type-type) object for a value. +get_time() | Returns the current UNIX timestamp. +parse_performance_data(pd) | Parses a performance data string and returns an array describing the values. +dirname(path) | Returns the directory portion of the specified path. +basename(path) | Returns the filename portion of the specified path. +escape\_shell\_arg(text) | Escapes a string for use as a single shell argument. +escape\_shell\_cmd(text) | Escapes shell meta characters in a string. +escape\_create\_process\_arg(text)| (Windows only) Escapes a string for use as an argument for CreateProcess(). +exit(integer) | Terminates the application. +sleep(interval) | Sleeps for the specified amount of time (in seconds). + +## Object Accessor Functions + +These functions can be used to retrieve a reference to another object by name. + +### get_check_command + +Signature: + + function get_check_command(name); + +Returns the CheckCommand object with the specified name, or `null` if no such CheckCommand object exists. + +### get_event_command + +Signature: + + function get_event_command(name); + +Returns the EventCommand object with the specified name, or `null` if no such EventCommand object exists. + +### get_notification_command + +Signature: + + function get_notification_command(name); + +Returns the NotificationCommand object with the specified name, or `null` if no such NotificationCommand object exists. + +### get_host + +Signature: + + function get_host(host_name); + +Returns the Host object with the specified name, or `null` if no such Host object exists. + + +### get_service + +Signature: + + function get_service(host_name, service_name); + +Returns the Service object with the specified name, or `null` if no such Service object exists. + + +### get_user + +Signature: + + function get_user(name); + +Returns the User object with the specified name, or `null` if no such User object exists. + +### get_host_group + +Signature: + + function get_host_group(name); + +Returns the HostGroup object with the specified name, or `null` if no such HostGroup object exists. + + +### get_service_group + +Signature: + + function get_service_group(name); + +Returns the ServiceGroup object with the specified name, or `null` if no such ServiceGroup object exists. + +### get_user_group + +Signature: + + function get_user_group(name); + +Returns the UserGroup object with the specified name, or `null` if no such UserGroup object exists. + + +### get_time_period + +Signature: + + function get_time_period(name); + +Returns the TimePeriod object with the specified name, or `null` if no such TimePeriod object exists. + + +### get_object + +Signature: + + function get_object(type, name); + +Returns the object with the specified type and name, or `null` if no such object exists. `type` must refer +to a type object. + + +### get_objects + +Signature: + + function get_objects(type); + +Returns an array of objects whose type matches the specified type. `type` must refer +to a type object. + + +## Math object + +The global `Math` object can be used to access a number of mathematical constants +and functions. + +### Math.E + +Euler's constant. + +### Math.LN2 + +Natural logarithm of 2. + +### Math.LN10 + +Natural logarithm of 10. + +### Math.LOG2E + +Base 2 logarithm of E. + +### Math.PI + +The mathematical constant Pi. + +### Math.SQRT1_2 + +Square root of 1/2. + +### Math.SQRT2 + +Square root of 2. + +### Math.abs + +Signature: + + function abs(x); + +Returns the absolute value of `x`. + +### Math.acos + +Signature: + + function acos(x); + +Returns the arccosine of `x`. + +### Math.asin + +Signature: + + function asin(x); + +Returns the arcsine of `x`. + +### Math.atan + +Signature: + + function atan(x); + +Returns the arctangent of `x`. + +### Math.atan2 + +Signature: + + function atan2(y, x); + +Returns the arctangent of the quotient of `y` and `x`. + +### Math.ceil + +Signature: + + function ceil(x); + +Returns the smallest integer value not less than `x`. + +### Math.cos + +Signature: + + function cos(x); + +Returns the cosine of `x`. + +### Math.exp + +Signature: + + function exp(x); + +Returns E raised to the `x`th power. + +### Math.floor + +Signature: + + function floor(x); + +Returns the largest integer value not greater than `x`. + +### Math.isinf + +Signature: + + function isinf(x); + +Returns whether `x` is infinite. + +### Math.isnan + +Signature: + + function isnan(x); + +Returns whether `x` is NaN (not-a-number). + +### Math.log + +Signature: + + function log(x); + +Returns the natural logarithm of `x`. + +### Math.max + +Signature: + + function max(...); + +Returns the largest argument. A variable number of arguments can be specified. +If no arguments are given, -Infinity is returned. + +### Math.min + +Signature: + + function min(...); + +Returns the smallest argument. A variable number of arguments can be specified. +If no arguments are given, +Infinity is returned. + +### Math.pow + +Signature: + + function pow(x, y); + +Returns `x` raised to the `y`th power. + +### Math.random + +Signature: + + function random(); + +Returns a pseudo-random number between 0 and 1. + +### Math.round + +Signature: + + function round(x); + +Returns `x` rounded to the nearest integer value. + +### Math.sign + +Signature: + + function sign(x); + +Returns -1 if `x` is negative, 1 if `x` is positive +and 0 if `x` is 0. + +### Math.sin + +Signature: + + function sin(x); + +Returns the sine of `x`. + +### Math.sqrt + +Signature: + + function sqrt(x); + +Returns the square root of `x`. + +### Math.tan + +Signature: + + function tan(x); + +Returns the tangent of `x`. + +## Json object + +The global `Json` object can be used to encode and decode JSON. + +### Json.encode + +Signature: + + function encode(x); + +Encodes an arbitrary value into JSON. + +### Json.decode + +Signature: + + function decode(x); + +Decodes a JSON string. + +## Number type + +### Number#to_string + +Signature: + + function to_string(); + +The `to_string` method returns a string representation of the number. + +Example: + + var example = 7 + example.to_string() /* Returns "7" */ + +## Boolean type + +### Boolean#to_string + +Signature: + + function to_string(); + +The `to_string` method returns a string representation of the boolean value. + +Example: + + var example = true + example.to_string() /* Returns "true" */ + +## String type + +### String#find + +Signature: + + function find(str, start); + +Returns the zero-based index at which the string `str` was found in the string. If the string +was not found, -1 is returned. `start` specifies the zero-based index at which `find` should +start looking for the string (defaults to 0 when not specified). + +Example: + + "Hello World".find("World") /* Returns 6 */ + +### String#contains + +Signature: + + function contains(str); + +Returns `true` if the string `str` was found in the string. If the string +was not found, `false` is returned. Use [find](18-library-reference.md#string-find) +for getting the index instead. + +Example: + + "Hello World".contains("World") /* Returns true */ + +### String#len + +Signature + + function len(); + +Returns the length of the string in bytes. Note that depending on the encoding type of the string +this is not necessarily the number of characters. + +Example: + + "Hello World".len() /* Returns 11 */ + +### String#lower + +Signature: + + function lower(); + +Returns a copy of the string with all of its characters converted to lower-case. + +Example: + + "Hello World".lower() /* Returns "hello world" */ + +### String#upper + +Signature: + + function upper(); + +Returns a copy of the string with all of its characters converted to upper-case. + +Example: + + "Hello World".upper() /* Returns "HELLO WORLD" */ + +### String#replace + +Signature: + + function replace(search, replacement); + +Returns a copy of the string with all occurences of the string specified in `search` replaced +with the string specified in `replacement`. + +### String#split + +Signature: + + function split(delimiters); + +Splits a string into individual parts and returns them as an array. The `delimiters` argument +specifies the characters which should be used as delimiters between parts. + +Example: + + "x-7,y".split("-,") /* Returns [ "x", "7", "y" ] */ + +### String#substr + +Signature: + + function substr(start, len); + +Returns a part of a string. The `start` argument specifies the zero-based index at which the part begins. +The optional `len` argument specifies the length of the part ("until the end of the string" if omitted). + +Example: + + "Hello World".substr(6) /* Returns "World" */ + +### String#to_string + +Signature: + + function to_string(); + +Returns a copy of the string. + +### String#reverse + +Signature: + + function reverse(); + +Returns a copy of the string in reverse order. + +### String#trim + +Signature: + + function trim(); + +Removes trailing whitespaces and returns the string. + +## Object type + +This is the base type for all types in the Icinga application. + +### Object#clone + +Signature: + + function clone(); + +Returns a copy of the object. Note that for object elements which are +reference values (e.g. objects such as arrays or dictionaries) the entire +object is recursively copied. + +### Object#to_string + +Signature: + + function to_string(); + +Returns a string representation for the object. Unless overridden this returns a string +of the format "Object of type ''" where is the name of the +object's type. + +Example: + + [ 3, true ].to_string() /* Returns "[ 3.000000, true ]" */ + +### Object#type + +Signature: + + String type; + +Returns the object's type name. This attribute is read-only. + +Example: + + get_host("localhost").type /* Returns "Host" */ + +## Type type + +Inherits methods from the [Object type](18-library-reference.md#object-type). + +The `Type` type provides information about the underlying type of an object or scalar value. + +All types are registered as global variables. For example, in order to obtain a reference to the `String` type the global variable `String` can be used. + +### Type#base + +Signature: + + Type base; + +Returns a reference to the type's base type. This attribute is read-only. + +Example: + + Dictionary.base == Object /* Returns true, because the Dictionary type inherits directly from the Object type. */ + +### Type#name + +Signature: + + String name; + +Returns the name of the type. + +### Type#prototype + +Signature: + + Object prototype; + +Returns the prototype object for the type. When an attribute is accessed on an object that doesn't exist the prototype object is checked to see if an attribute with the requested name exists. If it does, the attribute's value is returned. + +The prototype functionality is used to implement methods. + +Example: + + 3.to_string() /* Even though '3' does not have a to_string property the Number type's prototype object does. */ + +## Array type + +Inherits methods from the [Object type](18-library-reference.md#object-type). + +### Array#add + +Signature: + + function add(value); + +Adds a new value after the last element in the array. + +### Array#clear + +Signature: + + function clear(); + +Removes all elements from the array. + +### Array#shallow_clone + + function shallow_clone(); + +Returns a copy of the array. Note that for elements which are reference values (e.g. objects such +as arrays and dictionaries) only the references are copied. + +### Array#contains + +Signature: + + function contains(value); + +Returns true if the array contains the specified value, false otherwise. + +### Array#len + +Signature: + + function len(); + +Returns the number of elements contained in the array. + +### Array#remove + +Signature: + + function remove(index); + +Removes the element at the specified zero-based index. + +### Array#set + +Signature: + + function set(index, value); + +Sets the element at the zero-based index to the specified value. The `index` must refer to an element +which already exists in the array. + +### Array#get + +Signature: + + function get(index); + +Retrieves the element at the specified zero-based index. + +### Array#sort + +Signature: + + function sort(less_cmp); + +Returns a copy of the array where all items are sorted. The items are +compared using the `<` (less-than) operator. A custom comparator function +can be specified with the `less_cmp` argument. + +### Array#join + +Signature: + + function join(separator); + +Joins all elements of the array using the specified separator. + +### Array#reverse + +Signature: + + function reverse(); + +Returns a new array with all elements of the current array in reverse order. + +### Array#map + +Signature: + + function map(func); + +Calls `func(element)` for each of the elements in the array and returns +a new array containing the return values of these function calls. + +### Array#reduce + +Signature: + + function reduce(func); + +Reduces the elements of the array into a single value by calling the provided +function `func` as `func(a, b)` repeatedly where `a` and `b` are elements of the array +or results from previous function calls. + +### Array#filter + +Signature: + + function filter(func); + +Returns a copy of the array containing only the elements for which `func(element)` +is true. + +### Array#unique + +Signature: + + function unique(); + +Returns a copy of the array with all duplicate elements removed. The original order +of the array is not preserved. + +## Dictionary type + +Inherits methods from the [Object type](18-library-reference.md#object-type). + +### Dictionary#shallow_clone + +Signature: + + function shallow_clone(); + +Returns a copy of the dictionary. Note that for elements which are reference values (e.g. objects such +as arrays and dictionaries) only the references are copied. + +### Dictionary#contains + +Signature: + + function contains(key); + +Returns true if a dictionary item with the specified `key` exists, false otherwise. + +### Dictionary#len + +Signature: + + function len(); + +Returns the number of items contained in the dictionary. + +### Dictionary#remove + +Signature: + + function remove(key); + +Removes the item with the specified `key`. Trying to remove an item which does not exist +is a no-op. + +### Dictionary#set + +Signature: + + function set(key, value); + +Creates or updates an item with the specified `key` and `value`. + +### Dictionary#get + +Signature: + + function get(key); + +Retrieves the value for the specified `key`. Returns `null` if they `key` does not exist +in the dictionary. + +### Dictionary#keys + +Signature: + + function keys(); + +Returns a list of keys for all items that are currently in the dictionary. + +## Function type + +Inherits methods from the [Object type](18-library-reference.md#object-type). + +### Function#call + +Signature: + + function call(thisArg, ...); + +Invokes the function using an alternative `this` scope. The `thisArg` argument specifies the `this` +scope for the function. All other arguments are passed directly to the function. + +Example: + + function set_x(val) { + this.x = val + } + + dict = {} + + set_x.call(dict, 7) /* Invokes set_x using `dict` as `this` */ + +### Function#callv + +Signature: + + function callv(thisArg, args); + +Invokes the function using an alternative `this` scope. The `thisArg` argument specifies the `this` +scope for the function. The items in the `args` array are passed to the function as individual arguments. + +Example: + + function set_x(val) { + this.x = val + } + + var dict = {} + + var args = [ 7 ] + + set_x.callv(dict, args) /* Invokes set_x using `dict` as `this` */ + +## DateTime type + +Inherits methods from the [Object type](18-library-reference.md#object-type). + +### DateTime constructor + +Signature: + + function DateTime() + function DateTime(unixTimestamp) + function DateTime(year, month, day) + function DateTime(year, month, day, hours, minutes, seconds) + +Constructs a new DateTime object. When no arguments are specified for the constructor a new +DateTime object representing the current time is created. + +Example: + + var d1 = DateTime() /* current time */ + var d2 = DateTime(2016, 5, 21) /* midnight April 21st, 2016 (local time) */ + +### DateTime arithmetic + +Subtracting two DateTime objects yields the interval between them, in seconds. + +Example: + + var delta = DateTime() - DateTime(2016, 5, 21) /* seconds since midnight April 21st, 2016 */ + +Subtracting a number from a DateTime object yields a new DateTime object that is further in the past: + +Example: + + var dt = DateTime() - 2 * 60 * 60 /* Current time minus 2 hours */ + +Adding a number to a DateTime object yields a new DateTime object that is in the future: + +Example: + + var dt = DateTime() + 24 * 60 60 /* Current time plus 24 hours */ + +### DateTime#format + +Signature: + + function format(fmt) + +Returns a string representation for the DateTime object using the specified format string. +The format string may contain format conversion placeholders as specified in strftime(3). + +Example: + + var s = DateTime(2016, 4, 21).format("%A") /* Sets s to "Thursday". */ + +### DateTime#to_string + +Signature: + + function to_string() + +Returns a string representation for the DateTime object. Uses a suitable default format. + +Example: + + var s = DateTime(2016, 4, 21).to_string() /* Sets s to "2016-04-21 00:00:00 +0200". */ diff --git a/vim/bundle/icinga2/doc/19-script-debugger.md b/vim/bundle/icinga2/doc/19-script-debugger.md new file mode 100644 index 0000000..f852436 --- /dev/null +++ b/vim/bundle/icinga2/doc/19-script-debugger.md @@ -0,0 +1,105 @@ +# Script Debugger + +You can run the Icinga 2 daemon with the `-X` (`--script-debugger`) +parameter to enable the script debugger: + + # icinga2 daemon -X + +When an exception occurs or the [debugger](17-language-reference.md#breakpoints) +keyword is encountered in a user script, Icinga 2 launches a console that +allows the user to debug the script. + +Here is a list of common errors which can be diagnosed with the script debugger: + +* Configuration errors (apply) +* Errors in user-defined functions + +## Debugging Configuration Errors + +The following example illustrates the problem of a service [apply rule](3-monitoring-basics.md#using-apply-for) +which expects a dictionary value for `config`, but the host custom attribute only +provides a string value: + + object Host "script-debugger-host" { + check_command = "icinga" + + vars.http_vhosts["example.org"] = "192.168.1.100" // a string value + } + + apply Service for (http_vhost => config in host.vars.http_vhosts) { + import "generic-service" + + vars += config // expects a dictionary + + check_command = "http" + } + +The error message on config validation will warn about the wrong value type, +but does not provide any context which objects are affected. + +Enable the script debugger and run the config validation: + + # icinga2 daemon -C -X + + Breakpoint encountered in /etc/icinga2/conf.d/services.conf: 59:67-65:1 + Exception: Error: Error while evaluating expression: Cannot convert value of type 'String' to an object. + Location: + /etc/icinga2/conf.d/services.conf(62): check_command = "http" + /etc/icinga2/conf.d/services.conf(63): + /etc/icinga2/conf.d/services.conf(64): vars += config + ^^^^^^^^^^^^^^ + /etc/icinga2/conf.d/services.conf(65): } + /etc/icinga2/conf.d/services.conf(66): + You can inspect expressions (such as variables) by entering them at the prompt. + To leave the debugger and continue the program use "$continue". + <1> => + +You can print the variables `vars` and `config` to get an idea about +their values: + + <1> => vars + null + <2> => config + "192.168.1.100" + <3> => + +The `vars` attribute has to be a dictionary. Trying to set this attribute to a string caused +the error in our configuration example. + +In order to determine the name of the host where the value of the `config` variable came from +you can inspect attributes of the service object: + + <3> => host_name + "script-debugger-host-01" + <4> => name + "http" + +Additionally you can view the service object attributes by printing the value of `this`. + +## Using Breakpoints + +In order to halt execution in a script you can use the `debugger` keyword: + + object Host "script-debugger-host-02" { + check_command = "dummy" + check_interval = 5s + + vars.dummy_text = {{ + var text = "Hello from " + macro("$name$") + debugger + return text + }} + } + +Icinga 2 will spawn a debugger console every time the function is executed: + + # icinga2 daemon -X + ... + Breakpoint encountered in /etc/icinga2/tests/script-debugger.conf: 7:5-7:12 + You can inspect expressions (such as variables) by entering them at the prompt. + To leave the debugger and continue the program use "$continue". + <1> => text + "Hello from script-debugger-host-02" + <2> => $continue + + diff --git a/vim/bundle/icinga2/doc/2-getting-started.md b/vim/bundle/icinga2/doc/2-getting-started.md new file mode 100644 index 0000000..3cf416c --- /dev/null +++ b/vim/bundle/icinga2/doc/2-getting-started.md @@ -0,0 +1,775 @@ +# Getting Started + +This tutorial is a step-by-step introduction to installing [Icinga 2](2-getting-started.md#setting-up-icinga2) +and [Icinga Web 2](2-getting-started.md#setting-up-icingaweb2). +It assumes that you are familiar with the operating system you're using to install Icinga 2. + +## Setting up Icinga 2 + +First off you will have to install Icinga 2. The preferred way of doing this +is to use the official package repositories depending on which operating system +and distribution you are running. + + Distribution | Repository + ------------------------|--------------------------- + Debian | [debmon](https://debmon.org/packages/debmon-jessie/icinga2), [Icinga Repository](http://packages.icinga.org/debian/) + Ubuntu | [Icinga PPA](https://launchpad.net/~formorer/+archive/ubuntu/icinga), [Icinga Repository](http://packages.icinga.org/ubuntu/) + RHEL/CentOS | [Icinga Repository](http://packages.icinga.org/epel/) + openSUSE | [Icinga Repository](http://packages.icinga.org/openSUSE/), [Server Monitoring Repository](https://build.opensuse.org/package/show/server:monitoring/icinga2) + SLES | [Icinga Repository](http://packages.icinga.org/SUSE/) + Gentoo | [Upstream](http://packages.gentoo.org/package/net-analyzer/icinga2) + FreeBSD | [Upstream](http://www.freshports.org/net-mgmt/icinga2) + ArchLinux | [Upstream](https://aur.archlinux.org/packages/icinga2) + +Packages for distributions other than the ones listed above may also be +available. Please contact your distribution packagers. + +### Package Repositories + +You need to add the Icinga repository to your package management configuration. +Below is a list with examples for the various distributions. + +Debian (debmon): + + # wget -O - https://debmon.org/debmon/repo.key 2>/dev/null | apt-key add - + # echo 'deb http://debmon.org/debmon debmon-jessie main' >/etc/apt/sources.list.d/debmon.list + # apt-get update + +Ubuntu (PPA): + + # add-apt-repository ppa:formorer/icinga + # apt-get update + +RHEL/CentOS 7: + + yum install https://packages.icinga.org/epel/7/release/noarch/icinga-rpm-release-7-1.el7.centos.noarch.rpm + +RHEL/CentOS 6: + + yum install https://packages.icinga.org/epel/6/release/noarch/icinga-rpm-release-6-1.el6.noarch.rpm + +RHEL/CentOS 5: + + rpm -i http://packages.icinga.org/epel/5/release/noarch/icinga-rpm-release-5-1.el5.centos.noarch.rpm + +Fedora 23: + + dnf install https://packages.icinga.org/fedora/23/release/noarch/icinga-rpm-release-23-1.fc23.noarch.rpm + +Fedora 22: + + dnf install https://packages.icinga.org/fedora/22/release/noarch/icinga-rpm-release-22-1.fc22.noarch.rpm + +Fedora 21: + + yum install http://packages.icinga.org/fedora/21/release/noarch/icinga-rpm-release-21-1.fc21.noarch.rpm + +SLES 11: + + # zypper ar http://packages.icinga.org/SUSE/ICINGA-release-11.repo + # zypper ref + +SLES 12: + + # zypper ar http://packages.icinga.org/SUSE/ICINGA-release.repo + # zypper ref + +openSUSE: + + # zypper ar http://packages.icinga.org/openSUSE/ICINGA-release.repo + # zypper ref + + +#### RHEL/CentOS EPEL Repository + +The packages for RHEL/CentOS depend on other packages which are distributed +as part of the [EPEL repository](http://fedoraproject.org/wiki/EPEL). + +CentOS 7/6/5: + + yum install epel-release + +If you are using RHEL you need enable the `optional` repository and then install +the [EPEL rpm package](http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F). + +#### SLES Security Repository + +The packages for SLES 11 depend on the `openssl1` package which is distributed +as part of the [SLES 11 Security Module](https://www.suse.com/communities/conversations/introducing-the-suse-linux-enterprise-11-security-module/). + +### Installing Icinga 2 + +You can install Icinga 2 by using your distribution's package manager +to install the `icinga2` package. + +Debian/Ubuntu: + + # apt-get install icinga2 + +RHEL/CentOS 5/6: + + # yum install icinga2 + # chkconfig icinga2 on + # service icinga2 start + +RHEL/CentOS 7 and Fedora: + + # yum install icinga2 + # systemctl enable icinga2 + # systemctl start icinga2 + +SLES/openSUSE: + + # zypper install icinga2 + +FreeBSD: + + # pkg install icinga2 + +### Enabled Features during Installation + +The default installation will enable three features required for a basic +Icinga 2 installation: + +* `checker` for executing checks +* `notification` for sending notifications +* `mainlog` for writing the `icinga2.log` file + +You can verify that by calling `icinga2 feature list` +[CLI command](11-cli-commands.md#cli-command-feature) to see which features are +enabled and disabled. + + # icinga2 feature list + Disabled features: api command compatlog debuglog graphite icingastatus ido-mysql ido-pgsql livestatus notification perfdata statusdata syslog + Enabled features: checker mainlog notification + + +### Installation Paths + +By default Icinga 2 uses the following files and directories: + + Path | Description + ------------------------------------|------------------------------------ + /etc/icinga2 | Contains Icinga 2 configuration files. + /etc/init.d/icinga2 | The Icinga 2 init script. + /usr/sbin/icinga2 | The Icinga 2 binary. + /usr/share/doc/icinga2 | Documentation files that come with Icinga 2. + /usr/share/icinga2/include | The Icinga Template Library and plugin command configuration. + /var/run/icinga2 | PID file. + /var/run/icinga2/cmd | Command pipe and Livestatus socket. + /var/cache/icinga2 | status.dat/objects.cache, icinga2.debug files + /var/spool/icinga2 | Used for performance data spool files. + /var/lib/icinga2 | Icinga 2 state file, cluster log, local CA and configuration files. + /var/log/icinga2 | Log file location and compat/ directory for the CompatLogger feature. + +FreeBSD uses slightly different paths: + +By default Icinga 2 uses the following files and directories: + + Path | Description + ------------------------------------|------------------------------------ + /usr/local/etc/icinga2 | Contains Icinga 2 configuration files. + /usr/local/etc/rc.d/icinga2 | The Icinga 2 init script. + /usr/local/sbin/icinga2 | The Icinga 2 binary. + /usr/local/share/doc/icinga2 | Documentation files that come with Icinga 2. + /usr/local/share/icinga2/include | The Icinga Template Library and plugin command configuration. + /var/run/icinga2 | PID file. + /var/run/icinga2/cmd | Command pipe and Livestatus socket. + /var/cache/icinga2 | status.dat/objects.cache, icinga2.debug files + /var/spool/icinga2 | Used for performance data spool files. + /var/lib/icinga2 | Icinga 2 state file, cluster log, local CA and configuration files. + /var/log/icinga2 | Log file location and compat/ directory for the CompatLogger feature. + +## Setting up Check Plugins + +Without plugins Icinga 2 does not know how to check external services. The +[Monitoring Plugins Project](https://www.monitoring-plugins.org/) provides +an extensive set of plugins which can be used with Icinga 2 to check whether +services are working properly. + +These plugins are required to make the [example configuration](4-configuring-icinga-2.md#configuring-icinga2-overview) +work out-of-the-box. + +For your convenience here is a list of package names for some of the more +popular operating systems/distributions: + +OS/Distribution | Package Name | Repository | Installation Path +-----------------------|--------------------|---------------------------|---------------------------- +RHEL/CentOS | nagios-plugins-all | [EPEL](http://fedoraproject.org/wiki/EPEL) | /usr/lib/nagios/plugins or /usr/lib64/nagios/plugins +SLES/OpenSUSE | monitoring-plugins | [server:monitoring](https://build.opensuse.org/project/repositories/server:monitoring) | /usr/lib/nagios/plugins +Debian/Ubuntu | nagios-plugins | - | /usr/lib/nagios/plugins +FreeBSD | monitoring-plugins | - | /usr/local/libexec/nagios +OS X | nagios-plugins | [MacPorts](http://www.macports.org), [Homebrew](http://brew.sh) | /opt/local/libexec or /usr/local/sbin + +The recommended way of installing these standard plugins is to use your +distribution's package manager. + +Debian/Ubuntu: + + # apt-get install nagios-plugins + +RHEL/CentOS: + + # yum install nagios-plugins-all + +The packages for RHEL/CentOS depend on other packages which are distributed +as part of the [EPEL repository](http://fedoraproject.org/wiki/EPEL). Please +make sure to enable this repository by following +[these instructions](http://fedoraproject.org/wiki/EPEL#How_can_I_use_these_extra_packages.3F). + +Fedora: + + # dnf install nagios-plugins-all + +SLES/openSUSE: + + # zypper install monitoring-plugins + +The packages for SLES/OpenSUSE depend on other packages which are distributed +as part of the [server:monitoring repository](https://build.opensuse.org/project/repositories/server:monitoring). +Please make sure to enable this repository beforehand. + +FreeBSD: + + # pkg install monitoring-plugins + +Depending on which directory your plugins are installed into you may need to +update the global `PluginDir` constant in your [Icinga 2 configuration](4-configuring-icinga-2.md#constants-conf). +This constant is used by the check command definitions contained in the Icinga Template Library +to determine where to find the plugin binaries. + +> **Note** +> +> Please refer to the [service monitoring](5-service-monitoring.md#service-monitoring-plugins) chapter for details about how to integrate +> additional check plugins into your Icinga 2 setup. + +## Running Icinga 2 + +### Init Script + +Icinga 2's init script is installed in `/etc/init.d/icinga2` (`/usr/local/etc/rc.d/icinga2` on FreeBSD) by default: + + # /etc/init.d/icinga2 + Usage: /etc/init.d/icinga2 {start|stop|restart|reload|checkconfig|status} + +The init script supports the following actions: + + Command | Description + --------------------|------------------------ + start | The `start` action starts the Icinga 2 daemon. + stop | The `stop` action stops the Icinga 2 daemon. + restart | The `restart` action is a shortcut for running the `stop` action followed by `start`. + reload | The `reload` action sends the `HUP` signal to Icinga 2 which causes it to restart. Unlike the `restart` action `reload` does not wait until Icinga 2 has restarted. + checkconfig | The `checkconfig` action checks if the `/etc/icinga2/icinga2.conf` configuration file contains any errors. + status | The `status` action checks if Icinga 2 is running. + +By default the Icinga 2 daemon is running as `icinga` user and group +using the init script. Using Debian packages the user and group are set to +`nagios` for historical reasons. + +### systemd Service + +Some distributions (e.g. Fedora, openSUSE and RHEL/CentOS 7) use systemd. The +Icinga 2 packages automatically install the necessary systemd unit files. + +The Icinga 2 systemd service can be (re-)started, reloaded, stopped and also +queried for its current status. + + # systemctl status icinga2 + icinga2.service - Icinga host/service/network monitoring system + Loaded: loaded (/usr/lib/systemd/system/icinga2.service; disabled) + Active: active (running) since Mi 2014-07-23 13:39:38 CEST; 15s ago + Process: 21692 ExecStart=/usr/sbin/icinga2 -c ${ICINGA2_CONFIG_FILE} -d -e ${ICINGA2_ERROR_LOG} -u ${ICINGA2_USER} -g ${ICINGA2_GROUP} (code=exited, status=0/SUCCESS) + Process: 21674 ExecStartPre=/usr/sbin/icinga2-prepare-dirs /etc/sysconfig/icinga2 (code=exited, status=0/SUCCESS) + Main PID: 21727 (icinga2) + CGroup: /system.slice/icinga2.service + 21727 /usr/sbin/icinga2 -c /etc/icinga2/icinga2.conf -d -e /var/log/icinga2/error.log -u icinga -g icinga --no-stack-rlimit + + Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 309 Service(s). + Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 User(s). + Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 15 Notification(s). + Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 4 ScheduledDowntime(s). + Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 UserGroup(s). + Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 1 IcingaApplication(s). + Jul 23 13:39:38 nbmif icinga2[21692]: [2014-07-23 13:39:38 +0200] information/ConfigItem: Checked 8 Dependency(s). + Jul 23 13:39:38 nbmif systemd[1]: Started Icinga host/service/network monitoring system. + +The `systemctl` command supports the following actions: + + Command | Description + --------------------|------------------------ + start | The `start` action starts the Icinga 2 daemon. + stop | The `stop` action stops the Icinga 2 daemon. + restart | The `restart` action is a shortcut for running the `stop` action followed by `start`. + reload | The `reload` action sends the `HUP` signal to Icinga 2 which causes it to restart. Unlike the `restart` action `reload` does not wait until Icinga 2 has restarted. + status | The `status` action checks if Icinga 2 is running. + enable | The `enable` action enables the service being started at system boot time (similar to `chkconfig`) + +Examples: + + # systemctl enable icinga2 + + # systemctl restart icinga2 + Job for icinga2.service failed. See 'systemctl status icinga2.service' and 'journalctl -xn' for details. + +If you're stuck with configuration errors, you can manually invoke the +[configuration validation](11-cli-commands.md#config-validation). + +### FreeBSD + +On FreeBSD you need to enable icinga2 in your rc.conf + + # sysrc icinga2_enable=yes + + # service icinga2 restart + +## Configuration Syntax Highlighting + +Icinga 2 ships configuration examples for syntax highlighting using the `vim` and `nano` editors. +The RHEL and SUSE package `icinga2-common` installs these files into `/usr/share/doc/icinga2-common-[x.x.x]/syntax` +(where `[x.x.x]` is the version number, e.g. `2.4.3` or `2.4.4`). Sources provide these files in `tools/syntax`. +On Debian systems the `icinga2-common` package provides only the Nano configuration file (`/usr/share/nano/icinga2.nanorc`); +to obtain the Vim configuration, please install the extra package `vim-icinga2`. The files are located in `/usr/share/vim/addons`. + +### Configuration Syntax Highlighting using Vim + +Install the package `vim-icinga2` with your distribution's package manager. + +Debian/Ubuntu: + + $ apt-get install vim-icinga2 vim-addon-manager + $ vim-addon-manager -w install icinga2 + Info: installing removed addon 'icinga2' to /var/lib/vim/addons + +RHEL/CentOS/Fedora: + + $ yum install vim-icinga2 + +SLES/openSUSE: + + $ zypper install vim-icinga2 + +Ensure that syntax highlighting is enabled e.g. by editing the user's `vimrc` +configuration file: + + $ vim ~/.vimrc + syntax on + +Test it: + + $ vim /etc/icinga2/conf.d/templates.conf + +![Vim with syntax highlighting](images/getting-started/vim-syntax.png "Vim with Icinga 2 syntax highlighting") + + +### Configuration Syntax Highlighting using Nano + +Install the package `nano-icinga2` with your distribution's package manager. + +Debian/Ubuntu: + +**Note:** The syntax files are installed with the `icinga2-common` package already. + +RHEL/CentOS/Fedora: + + $ yum install nano-icinga2 + +SLES/openSUSE: + + $ zypper install nano-icinga2 + +Copy the `/etc/nanorc` sample file to your home directory. + + $ cp /etc/nanorc ~/.nanorc + +Include the `icinga2.nanorc` file. + + $ vim ~/.nanorc + + ## Icinga 2 + include "/usr/share/nano/icinga2.nanorc" + +Test it: + + $ nano /etc/icinga2/conf.d/templates.conf + +![Nano with syntax highlighting](images/getting-started/nano-syntax.png "Nano with Icinga 2 syntax highlighting") + +## Setting up Icinga Web 2 + +Icinga 2 can be used with Icinga Web 2 and a number of other web interfaces. +This chapter explains how to set up Icinga Web 2. + +The DB IDO (Database Icinga Data Output) modules for Icinga 2 take care of +exporting all configuration and status information into a database. The IDO +database is used by a number of projects including +[Icinga Web 2](2-getting-started.md#setting-up-icingaweb2), Icinga Reporting +or Icinga Web 1.x. + +There is a separate module for each database backend. At present support for +both MySQL and PostgreSQL is implemented. + +### Configuring DB IDO MySQL + +#### Installing MySQL database server + +Debian/Ubuntu: + + # apt-get install mysql-server mysql-client + +RHEL/CentOS 5/6: + + # yum install mysql-server mysql + # chkconfig mysqld on + # service mysqld start + # mysql_secure_installation + +RHEL/CentOS 7 and Fedora: + + # yum install mariadb-server mariadb + # systemctl enable mariadb + # systemctl start mariadb + # mysql_secure_installation + +SUSE: + + # zypper install mysql mysql-client + # chkconfig mysqld on + # service mysqld start + +FreeBSD: + + # pkg install mysql56-server + # sysrc mysql_enable=yes + # service mysql-server restart + # mysql_secure_installation + +#### Installing the IDO modules for MySQL + +The next step is to install the `icinga2-ido-mysql` package using your +distribution's package manager. + +Debian/Ubuntu: + + # apt-get install icinga2-ido-mysql + +RHEL/CentOS: + + # yum install icinga2-ido-mysql + +SUSE: + + # zypper install icinga2-ido-mysql + +FreeBSD: + +On FreeBSD the IDO modules for MySQL are included with the icinga2 package +and located at /usr/local/share/icinga2-ido-mysql/schema/mysql.sql + +> **Note** +> +> The Debian/Ubuntu packages provide a database configuration wizard by +> default. You can skip the automated setup and install/upgrade the +> database manually if you prefer that. + +#### Setting up the MySQL database + +Set up a MySQL database for Icinga 2: + + # mysql -u root -p + + mysql> CREATE DATABASE icinga; + mysql> GRANT SELECT, INSERT, UPDATE, DELETE, DROP, CREATE VIEW, INDEX, EXECUTE ON icinga.* TO 'icinga'@'localhost' IDENTIFIED BY 'icinga'; + mysql> quit + +![setting up the database on CentOS 7](images/getting-started/mariadb-centos7.png "Setting up the database on CentOS 7") + +After creating the database you can import the Icinga 2 IDO schema using the +following command: + + # mysql -u root -p icinga < /usr/share/icinga2-ido-mysql/schema/mysql.sql + + +#### Enabling the IDO MySQL module + +The package provides a new configuration file that is installed in +`/etc/icinga2/features-available/ido-mysql.conf`. You will need to +update the database credentials in this file. + +All available attributes are explained in the +[IdoMysqlConnection object](9-object-types.md#objecttype-idomysqlconnection) +chapter. + +You can enable the `ido-mysql` feature configuration file using +`icinga2 feature enable`: + + # icinga2 feature enable ido-mysql + Module 'ido-mysql' was enabled. + Make sure to restart Icinga 2 for these changes to take effect. + +After enabling the ido-mysql feature you have to restart Icinga 2: + +Debian/Ubuntu, RHEL/CentOS 6 and SUSE: + + # service icinga2 restart + +RHEL/CentOS 7 and Fedora: + + # systemctl restart icinga2 + +FreeBSD: + + # service icinga2 restart + +### Configuring DB IDO PostgreSQL + +#### Installing PostgreSQL database server + +Debian/Ubuntu: + + # apt-get install postgresql + +RHEL/CentOS 5/6: + + # yum install postgresql-server postgresql + # chkconfig postgresql on + # service postgresql start + +RHEL/CentOS 7: + + # yum install postgresql-server postgresql + # postgresql-setup initdb + # systemctl enable postgresql + # systemctl start postgresql + +SUSE: + + # zypper install postgresql postgresql-server + # chkconfig postgresql on + # service postgresql start + +FreeBSD: + + # pkg install postgresql93-server + # sysrc postgresql_enable=yes + # service postgresql start + +#### Installing the IDO modules for PostgreSQL + +The next step is to install the `icinga2-ido-pgsql` package using your +distribution's package manager. + +Debian/Ubuntu: + + # apt-get install icinga2-ido-pgsql + +RHEL/CentOS: + + # yum install icinga2-ido-pgsql + +SUSE: + + # zypper install icinga2-ido-pgsql + +FreeBSD: + +On FreeBSD the IDO modules for PostgreSQL are included with the icinga2 package +and located at /usr/local/share/icinga2-ido-pgsql/schema/pgsql.sql + +> **Note** +> +> Upstream Debian packages provide a database configuration wizard by default. +> You can skip the automated setup and install/upgrade the database manually +> if you prefer that. + +#### Setting up the PostgreSQL database + +Set up a PostgreSQL database for Icinga 2: + + # cd /tmp + # sudo -u postgres psql -c "CREATE ROLE icinga WITH LOGIN PASSWORD 'icinga'" + # sudo -u postgres createdb -O icinga -E UTF8 icinga + # sudo -u postgres createlang plpgsql icinga + +> **Note** +> +> When using PostgreSQL 9.x you can omit the `createlang` command. +> Also it is assumed here that your locale is set to utf-8, you may run into +> problems otherwise. + +Locate your pg\_hba.conf (Debian: `/etc/postgresql/*/main/pg_hba.conf`, +RHEL/SUSE: `/var/lib/pgsql/data/pg_hba.conf`), add the icinga user with md5 +authentication method and restart the postgresql server. + + # icinga + local icinga icinga md5 + host icinga icinga 127.0.0.1/32 md5 + host icinga icinga ::1/128 md5 + + # "local" is for Unix domain socket connections only + local all all ident + # IPv4 local connections: + host all all 127.0.0.1/32 ident + # IPv6 local connections: + host all all ::1/128 ident + + # service postgresql restart + + +After creating the database and permissions you can import the Icinga 2 IDO +schema using the following command: + + # export PGPASSWORD=icinga + # psql -U icinga -d icinga < /usr/share/icinga2-ido-pgsql/schema/pgsql.sql + +![importing the Icinga 2 IDO schema](images/getting-started/postgr-import-ido.png "Importing the Icinga 2 IDO schema on Debian Jessie") + + +#### Enabling the IDO PostgreSQL module + +The package provides a new configuration file that is installed in +`/etc/icinga2/features-available/ido-pgsql.conf`. You will need to update +the database credentials in this file. + +All available attributes are explained in the +[IdoPgsqlConnection object](9-object-types.md#objecttype-idopgsqlconnection) +chapter. + +You can enable the `ido-pgsql` feature configuration file using +`icinga2 feature enable`: + + # icinga2 feature enable ido-pgsql + Module 'ido-pgsql' was enabled. + Make sure to restart Icinga 2 for these changes to take effect. + +After enabling the ido-pgsql feature you have to restart Icinga 2: + +Debian/Ubuntu, RHEL/CentOS 6, SUSE and FreeBSD: + + # service icinga2 restart + +RHEL/CentOS 7 and Fedora: + + # systemctl restart icinga2 + + +### Webserver + +Debian/Ubuntu: + + # apt-get install apache2 + +RHEL/CentOS 6: + + # yum install httpd + # chkconfig httpd on + # service httpd start + +RHEL/CentOS 7/Fedora: + + # yum install httpd + # systemctl enable httpd + # systemctl start httpd + +SUSE: + + # zypper install apache2 + # chkconfig on + # service apache2 start + +FreeBSD (nginx, but you could also use the apache24 package): + + # pkg install nginx php56-gettext php56-ldap php56-openssl php56-mysql php56-pdo_mysql php56-pgsql php56-pdo_pgsql php56-sockets php56-gd pecl-imagick pecl-intl + # sysrc php_fpm_enable=yes + # sysrc nginx_enable=yes + # sed -i '' "s/listen\ =\ 127.0.0.1:9000/listen\ =\ \/var\/run\/php5-fpm.sock/" /usr/local/etc/php-fpm.conf + # sed -i '' "s/;listen.owner/listen.owner/" /usr/local/etc/php-fpm.conf + # sed -i '' "s/;listen.group/listen.group/" /usr/local/etc/php-fpm.conf + # sed -i '' "s/;listen.mode/listen.mode/" /usr/local/etc/php-fpm.conf + # service php-fpm start + # service nginx start + +### Firewall Rules + +Example: + + # iptables -A INPUT -p tcp -m tcp --dport 80 -j ACCEPT + # service iptables save + +RHEL/CentOS 7 specific: + + # firewall-cmd --add-service=http + # firewall-cmd --permanent --add-service=http + +FreeBSD: +Please consult the [FreeBSD Handbook](https://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/firewalls.html) how to configure one of FreeBSD's firewalls. + + +### Setting Up External Command Pipe + +Web interfaces and other Icinga addons are able to send commands to +Icinga 2 through the external command pipe. + +You can enable the External Command Pipe using the CLI: + + # icinga2 feature enable command + +After that you will have to restart Icinga 2: + +Debian/Ubuntu, RHEL/CentOS 6 and SUSE: + + # service icinga2 restart + +RHEL/CentOS 7 and Fedora: + + # systemctl restart icinga2 + +FreeBSD: + + # service icinga2 restart + +By default the command pipe file is owned by the group `icingacmd` with +read/write permissions. Add your webserver's user to the group `icingacmd` to +enable sending commands to Icinga 2 through your web interface: + + # usermod -a -G icingacmd www-data + +FreeBSD: +On FreeBSD the rw directory is owned by the group `www`. You do not need to add the +user `icinga` to the group `www`. + +Debian packages use `nagios` as the default user and group name. Therefore +change `icingacmd` to `nagios`. + +The webserver's user is different between distributions so you might have to +change `www-data` to `wwwrun`, `www`, or `apache`. + +Change `www-data` to the user you're using to run queries. + +You can verify that the user has been successfully added to the `icingacmd` +group using the `id` command: + + $ id + +![id command on CentOS 7](images/getting-started/id-apache-centos7.png "Confirm that the webserver's user +(here: `apache` on a CentOS 7 system) is a member of the group `icingacmd`.") + +### Installing Icinga Web 2 + +Please consult the [installation documentation](https://github.com/Icinga/icingaweb2/blob/master/doc/02-Installation.md) +for further instructions on how to install Icinga Web 2. + + +## Addons + +A number of additional features are available in the form of addons. A list of +popular addons is available in the +[Addons and Plugins](13-addons.md#addons) chapter. + +## Backup + +Ensure to include the following in your backups: + +* Configuration files in `/etc/icinga2` +* Runtime files in `/var/lib/icinga2` (the master's CA is stored here as well) +* Optional: IDO database backup diff --git a/vim/bundle/icinga2/doc/20-development.md b/vim/bundle/icinga2/doc/20-development.md new file mode 100644 index 0000000..3e0ea54 --- /dev/null +++ b/vim/bundle/icinga2/doc/20-development.md @@ -0,0 +1,318 @@ +# Develop Icinga 2 + +This chapter provides hints on Icinga 2 development +especially for debugging purposes. + +> **Note** +> +> If you are planning to build your own development environment, +> please consult the `INSTALL.md` file from the source tree. + +## Debug Requirements + +Make sure that the debug symbols are available for Icinga 2. +The Icinga 2 packages provide a debug package which must be +installed separately for all involved binaries, like `icinga2-bin` +or `icinga2-ido-mysql`. + +Debian/Ubuntu: + + # apt-get install icinga2-dbg + +RHEL/CentOS: + + # yum install icinga2-debuginfo + +SLES/openSUSE: + + # zypper install icinga2-bin-debuginfo icinga2-ido-mysql-debuginfo + + +Furthermore, you may also have to install debug symbols for Boost and your C library. + +If you're building your own binaries, you should use the `-DCMAKE_BUILD_TYPE=Debug` cmake +build flag for debug builds. + + +## GDB + +Install gdb: + +Debian/Ubuntu: + + # apt-get install gdb + +RHEL/CentOS/Fedora: + + # yum install gdb + +SLES/openSUSE: + + # zypper install gdb + + +Install the `boost`, `python` and `icinga2` pretty printers. Absolute paths are required, +so please make sure to update the installation paths accordingly (`pwd`). + + $ mkdir -p ~/.gdb_printers && cd ~/.gdb_printers + +Boost Pretty Printers compatible with Python 3: + + $ git clone https://github.com/mateidavid/Boost-Pretty-Printer.git && cd Boost-Pretty-Printer + $ git checkout python-3 + $ pwd + /home/michi/.gdb_printers/Boost-Pretty-Printer + +Python Pretty Printers: + + $ cd ~/.gdb_printers + $ svn co svn://gcc.gnu.org/svn/gcc/trunk/libstdc++-v3/python + +Icinga 2 Pretty Printers: + + $ mkdir -p ~/.gdb_printers/icinga2 && cd ~/.gdb_printers/icinga2 + $ wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/debug/gdb/icingadbg.py + +Now you'll need to modify/setup your `~/.gdbinit` configuration file. +You can download the one from Icinga 2 and modify all paths. + +Example on Fedora 22: + + $ wget https://raw.githubusercontent.com/Icinga/icinga2/master/tools/debug/gdb/gdbinit -O ~/.gdbinit + $ vim ~/.gdbinit + + set print pretty on + + python + import sys + sys.path.insert(0, '/home/michi/.gdb_printers/icinga2') + from icingadbg import register_icinga_printers + register_icinga_printers() + end + + python + import sys + sys.path.insert(0, '/home/michi/.gdb_printers/python') + from libstdcxx.v6.printers import register_libstdcxx_printers + try: + register_libstdcxx_printers(None) + except: + pass + end + + python + import sys + sys.path.insert(0, '/home/michi/.gdb_printers/Boost-Pretty-Printer') + import boost_print + boost_print.register_printers() + end + + +If you are getting the following error when running gdb, the `libstdcxx` +printers are already preloaded in your environment and you can remove +the duplicate import in your `~/.gdbinit` file. + + RuntimeError: pretty-printer already registered: libstdc++-v6 + +### GDB Run + +Call GDB with the binary (`/usr/sbin/icinga2` is a wrapper script calling +`/usr/lib64/icinga2/sbin/icinga2` since 2.4) and all arguments and run it in foreground. +If VFork causes trouble, disable it inside the gdb run. + + # gdb --args /usr/lib64/icinga2/sbin/icinga2 daemon -x debug -DUseVfork=0 --no-stack-rlimit + +The exact path to the Icinga 2 binary differs on each distribution. On Ubuntu +it is installed into `/usr/lib/x86_64-linux-gnu/icinga2/sbin/icinga2` on 64-bit systems +for example. + +> **Note** +> +> If gdb tells you it's missing debug symbols, quit gdb and install +> them: `Missing separate debuginfos, use: debuginfo-install ...` + +Run the application. + + (gdb) r + +Kill the running application. + + (gdb) k + +Continue after breakpoint. + + (gdb) c + +### GDB Core Dump + +Either attach to the running process using `gdb -p PID` or start +a new gdb run. + + (gdb) r + (gdb) generate-core-file + +### GDB Backtrace + +If Icinga 2 aborted its operation abnormally, generate a backtrace. + + (gdb) bt + (gdb) thread apply all bt full + +If gdb stops at a SIGPIPE signal please disable the signal before +running Icinga 2. + + (gdb) handle SIGPIPE nostop noprint pass + (gdb) r + +If you're opening an issue at [https://dev.icinga.org], make sure +to attach as much detail as possible. + +### GDB Backtrace from Running Process + +If Icinga 2 is still running, generate a full backtrace from the running +process and store it into a new file (e.g. for debugging dead locks): + + # gdb -p $(pidof icinga2) -batch -ex "thread apply all bt full" -ex "detach" -ex "q" > gdb_bt.log + +### GDB Backtrace Stepping + +Identifying the problem may require stepping into the backtrace, analysing +the current scope, attributes, and possible unmet requirements. `p` prints +the value of the selected variable or function call result. + + (gdb) up + (gdb) down + (gdb) p checkable + (gdb) p checkable.px->m_Name + + +### GDB Breakpoints + +To set a breakpoint to a specific function call, or file specific line. + + (gdb) b checkable.cpp:125 + (gdb) b icinga::Checkable::SetEnablePerfdata + +GDB will ask about loading the required symbols later, select `yes` instead +of `no`. + +Then run Icinga 2 until it reaches the first breakpoint. Continue with `c` +afterwards. + + (gdb) run + (gdb) c + +If you want to delete all breakpoints, use `d` and select `yes`. + + (gdb) d + +> **Tip** +> +> When debugging exceptions, set your breakpoint like this: `b __cxa_throw`. + +Breakpoint Example: + + (gdb) b __cxa_throw + (gdb) r + (gdb) up + .... + (gdb) up + #11 0x00007ffff7cbf9ff in icinga::Utility::GlobRecursive(icinga::String const&, icinga::String const&, boost::function const&, int) (path=..., pattern=..., callback=..., type=1) + at /home/michi/coding/icinga/icinga2/lib/base/utility.cpp:609 + 609 callback(cpath); + (gdb) l + 604 + 605 #endif /* _WIN32 */ + 606 + 607 std::sort(files.begin(), files.end()); + 608 BOOST_FOREACH(const String& cpath, files) { + 609 callback(cpath); + 610 } + 611 + 612 std::sort(dirs.begin(), dirs.end()); + 613 BOOST_FOREACH(const String& cpath, dirs) { + (gdb) p files + $3 = std::vector of length 11, capacity 16 = {{static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/agent.conf"}, {static NPos = 18446744073709551615, + m_Data = "/etc/icinga2/conf.d/commands.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/downtimes.conf"}, {static NPos = 18446744073709551615, + m_Data = "/etc/icinga2/conf.d/groups.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/notifications.conf"}, {static NPos = 18446744073709551615, + m_Data = "/etc/icinga2/conf.d/satellite.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/services.conf"}, {static NPos = 18446744073709551615, + m_Data = "/etc/icinga2/conf.d/templates.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/test.conf"}, {static NPos = 18446744073709551615, + m_Data = "/etc/icinga2/conf.d/timeperiods.conf"}, {static NPos = 18446744073709551615, m_Data = "/etc/icinga2/conf.d/users.conf"}} + + +## Core Dump + +When the Icinga 2 daemon crashes with a `SIGSEGV` signal +a core dump file should be written. This will help +developers to analyze and fix the problem. + +### Core Dump File Size Limit + +This requires setting the core dump file size to `unlimited`. + +Example for Systemd: + + vim /usr/lib/systemd/system/icinga2.service + + [Service] + ... + LimitCORE=infinity + + systemctl daemon-reload + + systemctl restart icinga2 + +Example for init script: + + vim /etc/init.d/icinga2 + ... + ulimit -c unlimited + + service icinga2 restart + +Verify that the Icinga 2 process core file size limit is set to `unlimited`. + + cat /proc/`pidof icinga2`/limits + ... + Max core file size unlimited unlimited bytes + + +### Core Dump Kernel Format + +The Icinga 2 daemon runs with the SUID bit set. Therefore you need +to explicitly enable core dumps for SUID on Linux. + + sysctl -w fs.suid_dumpable=1 + +Adjust the coredump kernel format and file location on Linux: + + sysctl -w kernel.core_pattern=/var/lib/cores/core.%e.%p + + install -m 1777 -d /var/lib/cores + +MacOS: + + sysctl -w kern.corefile=/cores/core.%P + + chmod 777 /cores + +### Core Dump Analysis + +Once Icinga 2 crashes again a new coredump file will be written. Please +attach this file to your bug report in addition to the general details. + +Simple test case for a `SIGSEGV` simulation with `sleep`: + + ulimit -c unlimited + sleep 1800& + [1] + kill -SEGV + gdb `which sleep` /var/lib/cores/core.sleep. + (gdb) bt + rm /var/lib/cores/core.sleep.* + +Analyzing Icinga 2: + + gdb /usr/lib64/icinga2/sbin/icinga2 core.icinga2. + (gdb) bt + diff --git a/vim/bundle/icinga2/doc/21-selinux.md b/vim/bundle/icinga2/doc/21-selinux.md new file mode 100644 index 0000000..a4b4e6e --- /dev/null +++ b/vim/bundle/icinga2/doc/21-selinux.md @@ -0,0 +1,232 @@ +# SELinux + +## Introduction + +SELinux is a mandatory access control (MAC) system on Linux which adds a fine granular permission system for access to all resources on the system such as files, devices, networks and inter-process communication. + +The most important questions are answered briefly in the [FAQ of the SELinux Project](http://selinuxproject.org/page/FAQ). For more details on SELinux and how to actually use and administrate it on your systems have a look at [Red Hat Enterprise Linux 7 - SELinux User's and Administrator's Guide](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/SELinux_Users_and_Administrators_Guide/index.html). For an simplified (and funny) introduction download the [SELinux Coloring Book](https://github.com/mairin/selinux-coloring-book). + +This documentation will use a similar format like the SELinux User's and Administrator's Guide. + +### Policy + +Icinga 2 is providing its own SELinux Policy. At the moment it is not upstreamed to the reference policy because it is under development. Target of the development is a policy package for Red Hat Enterprise Linux 7 and its derivates running the targeted policy which confines Icinga2 with all features and all checks executed. All other distributions will require some tweaks. + +### Installation + +There are two ways to install the SELinux Policy for Icinga 2 on Enterprise Linux 7. Installing it from the provided package which is the preferred option and manual installation if you need some fixes not released yet or for development. + +The policy package will run the daemon in a permissive domain so nothing will be denied also if the system runs in enforcing mode, so please make sure to run the system in this mode. + + # sestatus + SELinux status: enabled + SELinuxfs mount: /sys/fs/selinux + SELinux root directory: /etc/selinux + Loaded policy name: targeted + Current mode: enforcing + Mode from config file: enforcing + Policy MLS status: enabled + Policy deny_unknown status: allowed + Max kernel policy version: 28 + +You can change the configured mode by editing `/etc/selinux/config` and the current mode by executing `setenforce 0`. + +#### Package installation + +The packages are provided with release version 2.4 onwards. + +Simply add the selinux subpackage to your installation. + + # yum install icinga2-selinux + +After that restart Icinga 2 and verify it running in its own domain `icinga2_t`. + + # systemctl restart icinga2.service + # ps -eZ | grep icinga2 + system_u:system_r:icinga2_t:s0 2825 ? 00:00:00 icinga2 + +#### Manual installation + +This section describes the installation to support development and testing. It assumes that Icinga 2 is already installed from packages and running on the system. + +As a prerequisite install the `git`, `selinux-policy-devel` and `audit` package. Enable and start the audit daemon afterwards. + + # yum install git selinux-policy-devel audit + # systemctl enable auditd.service + # systemctl start auditd.service + +After that clone the icinga2 git repository. + + # git clone git://git.icinga.org/icinga2.git + +To create and install the policy package run the installation script which also labels the resources. (The script assumes Icinga 2 was started once after system startup, the labeling of the port will only happen once and fail later on.) + + # cd tools/selinux/ + # ./icinga.sh + +After that restart Icinga 2 and verify it running in its own domain `icinga2_t`. + + # systemctl restart icinga2.service + # ps -eZ | grep icinga2 + system_u:system_r:icinga2_t:s0 2825 ? 00:00:00 icinga2 + +### General + +When the SELinux policy package for Icinga 2 is installed, the Icinga 2 daemon (icinga2) runs in its own domain `icinga2_t` and is separated from other confined services. + +Files have to be labeled correctly for allowing icinga2 access to it. For example it writes to its own log files labeled `icinga2_log_t`. Also the API port is labeled `icinga_port_t` and icinga2 is allowed to manage it. Furthermore icinga2 can open high ports and unix sockets to connect to databases and features like graphite. It executes the nagios plugins and transitions to their context if those are labeled for example `nagios_services_plugin_exec_t` or `nagios_system_plugin_exec_t`. + +Additional the Apache webserver is allowed to connect to the Command pipe of Icinga 2 to allow web interfaces sending commands to icinga2. This will perhaps change later on while investigating Icinga Web 2 for SELinux! + +### Types + +The command pipe is labeled `icinga2_command_t` and other services can request access to it by using the interface `icinga2_send_commands`. + +The nagios plugins use their own contexts and icinga2 will transition to it. This means plugins have to be labeled correctly for their required permissions. The plugins installed from package should have set their permissions by the corresponding policy module and you can restore them using `restorecon -R -v /usr/lib64/nagios/plugins/`. To label your own plugins use `chcon -t type /path/to/plugin`, for the type have a look at table below. + +Type | Domain | Use case | Provided by policy package +----------------------------------|------------------------------|------------------------------------------------------------------|--------------------------- +nagios_admin_plugin_exec_t | nagios_admin_plugin_t | Plugins which require require read access on all file attributes | nagios +nagios_checkdisk_plugin_exec_t | nagios_checkdisk_plugin_t | Plugins which require read access to all filesystem attributes | nagios +nagios_mail_plugin_exec_t | nagios_mail_plugin_t | Plugins which access the local mail service | nagios +nagios_services_plugin_exec_t | nagios_services_plugin_t | Plugins monitoring network services | nagios +nagios_system_plugin_exec_t | nagios_system_plugin_t | Plugins checking local system state | nagios +nagios_unconfined_plugin_exec_t | nagios_unconfined_plugin_t | Plugins running without confinement | nagios +nagios_eventhandler_plugin_exec_t | nagios_eventhandler_plugin_t | Eventhandler (actually running unconfined) | nagios +nagios_openshift_plugin_exec_t | nagios_openshift_plugin_t | Plugins monitoring openshift | nagios +nagios_notification_plugin_exec_t | nagios_notification_plugin_t | Notification commands | icinga (will be moved later) + +If one of those plugin domains causes problems you can set it to permissive by executing `semanage permissive -a domain`. + +The policy provides a role `icinga2adm_r` for confining an user which enables an administrative user managing only Icinga 2 on the system. This user will also execute the plugins in their domain instead of the users one, so you can verify their execution with the same restrictions like they have when executed by icinga2. + +### Booleans + +SELinux is based on the least level of access required for a service to run. Using booleans you can grant more access in a defined way. The Icinga 2 policy package provides the following booleans. + +**icinga2_can_connect_all** + +Having this boolean enabled allows icinga2 to connect to all ports. This can be neccesary if you use features which connect to unconfined services. + +### Configuration Examples + +#### Confining a plugin + +Download and install a plugin, for example check_mysql_health. + + # wget http://labs.consol.de/download/shinken-nagios-plugins/check_mysql_health-2.1.9.2.tar.gz + # tar xvzf check_mysql_health-2.1.9.2.tar.gz + # cd check_mysql_health-2.1.9.2/ + # ./configure --libexecdir /usr/lib64/nagios/plugins + # make + # make install + +It is labeled `nagios_unconfined_plugins_exec_t` by default, so it runs without restrictions. + + # ls -lZ /usr/lib64/nagios/plugins/check_mysql_health + -rwxr-xr-x. root root system_u:object_r:nagios_unconfined_plugin_exec_t:s0 /usr/lib64/nagios/plugins/check_mysql_health + +In this case the plugin is monitoring a service, so it should be labeled `nagios_services_plugin_exec_t` to restrict its permissions. + + # chcon -t nagios_services_plugin_exec_t /usr/lib64/nagios/plugins/check_mysql_health + # ls -lZ /usr/lib64/nagios/plugins/check_mysql_health + -rwxr-xr-x. root root system_u:object_r:nagios_services_plugin_exec_t:s0 /usr/lib64/nagios/plugins/check_mysql_health + +The plugin still runs fine but if someone changes the script to do weird stuff it will fail to do so. + +#### Allow icinga to connect to all ports. + +You are running graphite on a different port than `2003` and want `icinga2` to connect to it. + +Change the port value for the graphite feature according to your graphite installation before enabling it. + + # cat /etc/icinga2/features-enabled/graphite.conf + /** + * The GraphiteWriter type writes check result metrics and + * performance data to a graphite tcp socket. + */ + + library "perfdata" + + object GraphiteWriter "graphite" { + //host = "127.0.0.1" + //port = 2003 + port = 2004 + } + # icinga2 feature enable graphite + +Before you restart the icinga2 service allow it to connect to all ports by enabling the boolean ´icinga2_can_connect_all` (now and permanent). + + # setsebool icinga2_can_connect_all true + # setsebool -P icinga2_can_connect_all true + +If you restart the daemon now it will successfully connect to graphite. + +#### Confining a user + +If you want to have an administrative account capable of only managing icinga2 and not the complete system, you can restrict the privileges by confining +this user. This is completly optional! + +Start by adding the Icinga 2 administrator role `icinga2adm_r` to the administrative SELinux user `staff_u`. + + # semanage user -m -R "staff_r sysadm_r system_r unconfined_r icinga2adm_r" staff_u + +Confine your user login and create a sudo rule. + + # semanage login -a dirk -s staff_u + # echo "dirk ALL=(ALL) NOPASSWD: ALL" > /etc/sudoers.d/dirk + +Login to the system using ssh and verify your id. + + $ id -Z + staff_u:staff_r:staff_t:s0-s0:c0.c1023 + +Try to execute some commands as root using sudo. + + $ sudo id -Z + staff_u:staff_r:staff_t:s0-s0:c0.c1023 + $ sudo vi /etc/icinga2/icinga2.conf + "/etc/icinga2/icinga2.conf" [Permission Denied] + $ sudo cat /var/log/icinga2/icinga2.log + cat: /var/log/icinga2/icinga2.log: Keine Berechtigung + $ sudo systemctl reload icinga2.service + Failed to get D-Bus connection: No connection to service manager. + +Those commands fail because you only switch to root but do not change your SELinux role. Try again but tell sudo also to switch the SELinux role and type. + + $ sudo -r icinga2adm_r -t icinga2adm_t id -Z + staff_u:icinga2adm_r:icinga2adm_t:s0-s0:c0.c1023 + $ sudo -r icinga2adm_r -t icinga2adm_t vi /etc/icinga2/icinga2.conf + "/etc/icinga2/icinga2.conf" + $ sudo -r icinga2adm_r -t icinga2adm_t cat /var/log/icinga2/icinga2.log + [2015-03-26 20:48:14 +0000] information/DynamicObject: Dumping program state to file '/var/lib/icinga2/icinga2.state' + $ sudo -r icinga2adm_r -t icinga2adm_t systemctl reload icinga2.service + +Now the commands will work, but you have always to remember to add the arguments, so change the sudo rule to set it by default. + + # echo "dirk ALL=(ALL) ROLE=icinga2adm_r TYPE=icinga2adm_t NOPASSWD: ALL" > /etc/sudoers.d/dirk + +Now try the commands again without providing the role and type and they will work, but if you try to read apache logs or restart apache for example it will still fail. + + $ sudo cat /var/log/httpd/error_log + /bin/cat: /var/log/httpd/error_log: Keine Berechtigung + $ sudo systemctl reload httpd.service + Failed to issue method call: Access denied + +## Bugreports + +If you experience any problems while running in enforcing mode try to reproduce it in permissive mode. If the problem persists it is not related to SELinux because in permissive mode SELinux will not deny anything. + +For now Icinga 2 is running in a permissive domain and adds also some rules for other necessary services so no problems should occure at all. But you can help to enhance the policy by testing Icinga 2 running confined by SELinux. + +When filing a bug report please add the following information additionally to the [normal ones](https://www.icinga.org/icinga/faq/): +* Output of `semodule -l | grep -e icinga2 -e nagios -e apache` +* Output of `ps -eZ | grep icinga2` +* Output of `semanage port -l | grep icinga2` +* Output of `audit2allow -li /var/log/audit/audit.log` + +If access to a file is blocked and you can tell which one please provided the output of `ls -lZ /path/to/file` (and perhaps the directory above). + +If asked for full audit.log add `-w /etc/shadow -p w` to `/etc/audit/rules.d/audit.rules`, restart the audit daemon, reproduce the problem and add `/var/log/audit/audit.log` to the bug report. With the added audit rule it will include the path of files access was denied to. + +If asked to provide full audit log with dontaudit rules disabled executed `semodule -DB` before reproducing the problem. After that enable the rules again to prevent auditd spamming your logfile by executing `semodule -B`. diff --git a/vim/bundle/icinga2/doc/22-migrating-from-icinga-1x.md b/vim/bundle/icinga2/doc/22-migrating-from-icinga-1x.md new file mode 100644 index 0000000..ab352e8 --- /dev/null +++ b/vim/bundle/icinga2/doc/22-migrating-from-icinga-1x.md @@ -0,0 +1,1434 @@ +# Migration from Icinga 1.x + +## Configuration Migration + +The Icinga 2 configuration format introduces plenty of behavioural changes. In +order to ease migration from Icinga 1.x, this section provides hints and tips +on your migration requirements. + +### Manual Config Migration + +For a long-term migration of your configuration you should consider re-creating +your configuration based on the proposed Icinga 2 configuration paradigm. + +Please read the [next chapter](22-migrating-from-icinga-1x.md#differences-1x-2) to find out more about the differences +between 1.x and 2. + +### Manual Config Migration Hints + +These hints should provide you with enough details for manually migrating your configuration, +or to adapt your configuration export tool to dump Icinga 2 configuration instead of +Icinga 1.x configuration. + +The examples are taken from Icinga 1.x test and production environments and converted +straight into a possible Icinga 2 format. If you found a different strategy, please +let us know! + +If you require in-depth explanations, please check the [next chapter](22-migrating-from-icinga-1x.md#differences-1x-2). + +#### Manual Config Migration Hints for Intervals + +By default all intervals without any duration literal are interpreted as seconds. Therefore +all existing Icinga 1.x `*_interval` attributes require an additional `m` duration literal. + +Icinga 1.x: + + define service { + service_description service1 + host_name localhost1 + check_command test_customvar + use generic-service + check_interval 5 + retry_interval 1 + } + +Icinga 2: + + object Service "service1" { + import "generic-service" + host_name = "localhost1" + check_command = "test_customvar" + check_interval = 5m + retry_interval = 1m + } + +#### Manual Config Migration Hints for Services + +If you have used the `host_name` attribute in Icinga 1.x with one or more host names this service +belongs to, you can migrate this to the [apply rules](3-monitoring-basics.md#using-apply) syntax. + +Icinga 1.x: + + define service { + service_description service1 + host_name localhost1,localhost2 + check_command test_check + use generic-service + } + +Icinga 2: + + apply Service "service1" { + import "generic-service" + check_command = "test_check" + + assign where host.name in [ "localhost1", "localhost2" ] + } + +In Icinga 1.x you would have organized your services with hostgroups using the `hostgroup_name` attribute +like the following example: + + define service { + service_description servicewithhostgroups + hostgroup_name hostgroup1,hostgroup3 + check_command test_check + use generic-service + } + +Using Icinga 2 you can migrate this to the [apply rules](3-monitoring-basics.md#using-apply) syntax: + + apply Service "servicewithhostgroups" { + import "generic-service" + check_command = "test_check" + + assign where "hostgroup1" in host.groups + assign where "hostgroup3" in host.groups + } + +#### Manual Config Migration Hints for Group Members + +The Icinga 1.x hostgroup `hg1` has two members `host1` and `host2`. The hostgroup `hg2` has `host3` as +a member and includes all members of the `hg1` hostgroup. + + define hostgroup { + hostgroup_name hg1 + members host1,host2 + } + + define hostgroup { + hostgroup_name hg2 + members host3 + hostgroup_members hg1 + } + +This can be migrated to Icinga 2 and [using group assign](17-language-reference.md#group-assign). The additional nested hostgroup +`hg1` is included into `hg2` with the `groups` attribute. + + + object HostGroup "hg1" { + assign where host.name in [ "host1", "host2" ] + } + + object HostGroup "hg2" { + groups = [ "hg1" ] + assign where host.name == "host3" + } + +These assign rules can be applied for all groups: `HostGroup`, `ServiceGroup` and `UserGroup` +(requires renaming from `contactgroup`). + +> **Tip** +> +> Define custom attributes and assign/ignore members based on these attribute pattern matches. + + + +#### Manual Config Migration Hints for Check Command Arguments + +Host and service check command arguments are separated by a `!` in Icinga 1.x. Their order is important and they +are referenced as `$ARGn$` where `n` is the argument counter. + + define command { + command_name my-ping + command_line $USER1$/check_ping -H $HOSTADDRESS$ -w $ARG1$ -c $ARG2$ -p 5 + } + + define service { + use generic-service + host_name my-server + service_description my-ping + check_command my-ping-check!100.0,20%!500.0,60% + } + +While you could manually migrate this like (please note the new generic command arguments and default argument values!): + + object CheckCommand "my-ping-check" { + command = [ + PluginDir + "/check_ping", "-4" + ] + + arguments = { + "-H" = "$ping_address$" + "-w" = "$ping_wrta$,$ping_wpl$%" + "-c" = "$ping_crta$,$ping_cpl$%" + "-p" = "$ping_packets$" + "-t" = "$ping_timeout$" + } + + vars.ping_address = "$address$" + vars.ping_wrta = 100 + vars.ping_wpl = 5 + vars.ping_crta = 200 + vars.ping_cpl = 15 + } + + object Service "my-ping" { + import "generic-service" + host_name = "my-server" + check_command = "my-ping-check" + + vars.ping_wrta = 100 + vars.ping_wpl = 20 + vars.ping_crta = 500 + vars.ping_cpl = 60 + } + +#### Manual Config Migration Hints for Runtime Macros + +Runtime macros have been renamed. A detailed comparison table can be found [here](22-migrating-from-icinga-1x.md#differences-1x-2-runtime-macros). + +For example, accessing the service check output looks like the following in Icinga 1.x: + + $SERVICEOUTPUT$ + +In Icinga 2 you will need to write: + + $service.output$ + +Another example referencing the host's address attribute in Icinga 1.x: + + $HOSTADDRESS$ + +In Icinga 2 you'd just use the following macro to access all `address` attributes (even overridden from the service objects): + + $address$ + + +#### Manual Config Migration Hints for Runtime Custom Attributes + +Custom variables from Icinga 1.x are available as Icinga 2 custom attributes. + + define command { + command_name test_customvar + command_line echo "Host CV: $_HOSTCVTEST$ Service CV: $_SERVICECVTEST$\n" + } + + define host { + host_name localhost1 + check_command test_customvar + use generic-host + _CVTEST host cv value + } + + define service { + service_description service1 + host_name localhost1 + check_command test_customvar + use generic-service + _CVTEST service cv value + } + +Can be written as the following in Icinga 2: + + object CheckCommand "test_customvar" { + command = "echo "Host CV: $host.vars.CVTEST$ Service CV: $service.vars.CVTEST$\n"" + } + + object Host "localhost1" { + import "generic-host" + check_command = "test_customvar" + vars.CVTEST = "host cv value" + } + + object Service "service1" { + host_name = "localhost1" + check_command = "test_customvar" + vars.CVTEST = "service cv value" + } + +If you are just defining `$CVTEST$` in your command definition, its value depends on the +execution scope -- the host check command will fetch the host attribute value of `vars.CVTEST` +while the service check command resolves its value to the service attribute attribute `vars.CVTEST`. + +> **Note** +> +> Custom attributes in Icinga 2 are case-sensitive. `vars.CVTEST` is not the same as `vars.CvTest`. + +#### Manual Config Migration Hints for Contacts (Users) + +Contacts in Icinga 1.x act as users in Icinga 2, but do not have any notification commands specified. +This migration part is explained in the [next chapter](22-migrating-from-icinga-1x.md#manual-config-migration-hints-notifications). + + define contact{ + contact_name testconfig-user + use generic-user + alias Icinga Test User + service_notification_options c,f,s,u + email icinga@localhost + } + +The `service_notification_options` can be [mapped](22-migrating-from-icinga-1x.md#manual-config-migration-hints-notification-filters) +into generic `state` and `type` filters, if additional notification filtering is required. `alias` gets +renamed to `display_name`. + + object User "testconfig-user" { + import "generic-user" + display_name = "Icinga Test User" + email = "icinga@localhost" + } + +This user can be put into usergroups (former contactgroups) or referenced in newly migration notification +objects. + +#### Manual Config Migration Hints for Notifications + +If you are migrating a host or service notification, you'll need to extract the following information from +your existing Icinga 1.x configuration objects + +* host/service attribute `contacts` and `contact_groups` +* host/service attribute `notification_options` +* host/service attribute `notification_period` +* host/service attribute `notification_interval` + +The clean approach is to refactor your current contacts and their notification command methods into a +generic strategy + +* host or service has a notification type (for example mail) +* which contacts (users) are notified by mail? +* do the notification filters, periods, intervals still apply for them? (do a cleanup during migration) +* assign users and groups to these notifications +* Redesign the notifications into generic [apply rules](3-monitoring-basics.md#using-apply-notifications) + + +The ugly workaround solution could look like this: + +Extract all contacts from the remaining groups, and create a unique list. This is required for determining +the host and service notification commands involved. + +* contact attributes `host_notification_commands` and `service_notification_commands` (can be a comma separated list) +* get the command line for each notification command and store them for later +* create a new notification name and command name + +Generate a new notification object based on these values. Import the generic template based on the type (`host` or `service`). +Assign it to the host or service and set the newly generated notification command name as `command` attribute. + + object Notification "" { + import "mail-host-notification" + host_name = "" + command = "" + + +Convert the `notification_options` attribute from Icinga 1.x to Icinga 2 `states` and `types`. Details +[here](22-migrating-from-icinga-1x.md#manual-config-migration-hints-notification-filters). Add the notification period. + + states = [ OK, Warning, Critical ] + types = [ Recovery, Problem, Custom ] + period = "24x7" + +The current contact acts as `users` attribute. + + users = [ "" ] + } + +Do this in a loop for all notification commands (depending if host or service contact). Once done, dump the +collected notification commands. + +The result of this migration are lots of unnecessary notification objects and commands but it will unroll +the Icinga 1.x logic into the revamped Icinga 2 notification object schema. If you are looking for code +examples, try [LConf](https://www.netways.org). + + + +#### Manual Config Migration Hints for Notification Filters + +Icinga 1.x defines all notification filters in an attribute called `notification_options`. Using Icinga 2 you will +have to split these values into the `states` and `types` attributes. + +> **Note** +> +> `Recovery` type requires the `Ok` state. +> `Custom` and `Problem` should always be set as `type` filter. + + Icinga 1.x option | Icinga 2 state | Icinga 2 type + ----------------------|-----------------------|------------------- + o | OK (Up for hosts) | + w | Warning | Problem + c | Critical | Problem + u | Unknown | Problem + d | Down | Problem + s | . | DowntimeStart / DowntimeEnd / DowntimeRemoved + r | Ok | Recovery + f | . | FlappingStart / FlappingEnd + n | 0 (none) | 0 (none) + . | . | Custom + + + +#### Manual Config Migration Hints for Escalations + +Escalations in Icinga 1.x are a bit tricky. By default service escalations can be applied to hosts and +hostgroups and require a defined service object. + +The following example applies a service escalation to the service `dep_svc01` and all hosts in the `hg_svcdep2` +hostgroup. The default `notification_interval` is set to `10` minutes notifying the `cg_admin` contact. +After 20 minutes (`10*2`, notification_interval * first_notification) the notification is escalated to the +`cg_ops` contactgroup until 60 minutes (`10*6`) have passed. + + define service { + service_description dep_svc01 + host_name dep_hostsvc01,dep_hostsvc03 + check_command test2 + use generic-service + notification_interval 10 + contact_groups cg_admin + } + + define hostgroup { + hostgroup_name hg_svcdep2 + members dep_hostsvc03 + } + + # with hostgroup_name and service_description + define serviceescalation { + hostgroup_name hg_svcdep2 + service_description dep_svc01 + first_notification 2 + last_notification 6 + contact_groups cg_ops + } + +In Icinga 2 the service and hostgroup definition will look quite the same. Save the `notification_interval` +and `contact_groups` attribute for an additional notification. + + apply Service "dep_svc01" { + import "generic-service" + + check_command = "test2" + + assign where host.name == "dep_hostsvc01" + assign where host.name == "dep_hostsvc03" + } + + object HostGroup "hg_svcdep2" { + assign where host.name == "dep_hostsvc03" + } + + apply Notification "email" to Service { + import "service-mail-notification" + + interval = 10m + user_groups = [ "cg_admin" ] + + assign where service.name == "dep_svc01" && (host.name == "dep_hostsvc01" || host.name == "dep_hostsvc03") + } + +Calculate the begin and end time for the newly created escalation notification: + +* begin = first_notification * notification_interval = 2 * 10m = 20m +* end = last_notification * notification_interval = 6 * 10m = 60m = 1h + +Assign the notification escalation to the service `dep_svc01` on all hosts in the hostgroup `hg_svcdep2`. + + apply Notification "email-escalation" to Service { + import "service-mail-notification" + + interval = 10m + user_groups = [ "cg_ops" ] + + times = { + begin = 20m + end = 1h + } + + assign where service.name == "dep_svc01" && "hg_svcdep2" in host.groups + } + +The assign rule could be made more generic and the notification be applied to more than +just this service belonging to hosts in the matched hostgroup. + + +> **Note** +> +> When the notification is escalated, Icinga 1.x suppresses notifications to the default contacts. +> In Icinga 2 an escalation is an additional notification with a defined begin and end time. The +> `email` notification will continue as normal. + + + +#### Manual Config Migration Hints for Dependencies + +There are some dependency examples already in the [basics chapter](3-monitoring-basics.md#dependencies). Dependencies in +Icinga 1.x can be confusing in terms of which host/service is the parent and which host/service acts +as the child. + +While Icinga 1.x defines `notification_failure_criteria` and `execution_failure_criteria` as dependency +filters, this behaviour has changed in Icinga 2. There is no 1:1 migration but generally speaking +the state filter defined in the `execution_failure_criteria` defines the Icinga 2 `state` attribute. +If the state filter matches, you can define whether to disable checks and notifications or not. + +The following example describes service dependencies. If you migrate from Icinga 1.x, you will only +want to use the classic `Host-to-Host` and `Service-to-Service` dependency relationships. + + define service { + service_description dep_svc01 + hostgroup_name hg_svcdep1 + check_command test2 + use generic-service + } + + define service { + service_description dep_svc02 + hostgroup_name hg_svcdep2 + check_command test2 + use generic-service + } + + define hostgroup { + hostgroup_name hg_svcdep2 + members host2 + } + + define host{ + use linux-server-template + host_name host1 + address 192.168.1.10 + } + + # with hostgroup_name and service_description + define servicedependency { + host_name host1 + dependent_hostgroup_name hg_svcdep2 + service_description dep_svc01 + dependent_service_description * + execution_failure_criteria u,c + notification_failure_criteria w,u,c + inherits_parent 1 + } + +Map the dependency attributes accordingly. + + Icinga 1.x | Icinga 2 + ----------------------|--------------------- + host_name | parent_host_name + dependent_host_name | child_host_name (used in assign/ignore) + dependent_hostgroup_name | all child hosts in group (used in assign/ignore) + service_description | parent_service_name + dependent_service_description | child_service_name (used in assign/ignore) + +And migrate the host and services. + + object Host "host1" { + import "linux-server-template" + address = "192.168.1.10" + } + + object HostGroup "hg_svcdep2" { + assign where host.name == "host2" + } + + apply Service "dep_svc01" { + import "generic-service" + check_command = "test2" + + assign where "hp_svcdep1" in host.groups + } + + apply Service "dep_svc02" { + import "generic-service" + check_command = "test2" + + assign where "hp_svcdep2" in host.groups + } + +When it comes to the `execution_failure_criteria` and `notification_failure_criteria` attribute migration, +you will need to map the most common values, in this example `u,c` (`Unknown` and `Critical` will cause the +dependency to fail). Therefore the `Dependency` should be ok on Ok and Warning. `inherits_parents` is always +enabled. + + apply Dependency "all-svc-for-hg-hg_svcdep2-on-host1-dep_svc01" to Service { + parent_host_name = "host1" + parent_service_name = "dep_svc01" + + states = [ Ok, Warning ] + disable_checks = true + disable_notifications = true + + assign where "hg_svcdep2" in host.groups + } + +Host dependencies are explained in the [next chapter](22-migrating-from-icinga-1x.md#manual-config-migration-hints-host-parents). + + + +#### Manual Config Migration Hints for Host Parents + +Host parents from Icinga 1.x are migrated into `Host-to-Host` dependencies in Icinga 2. + +The following example defines the `vmware-master` host as parent host for the guest +virtual machines `vmware-vm1` and `vmware-vm2`. + +By default all hosts in the hostgroup `vmware` should get the parent assigned. This isn't really +solvable with Icinga 1.x parents, but only with host dependencies. + + define host{ + use linux-server-template + host_name vmware-master + hostgroups vmware + address 192.168.1.10 + } + + define host{ + use linux-server-template + host_name vmware-vm1 + hostgroups vmware + address 192.168.27.1 + parents vmware-master + } + + define host{ + use linux-server-template + host_name vmware-vm2 + hostgroups vmware + address 192.168.28.1 + parents vmware-master + } + +By default all hosts in the hostgroup `vmware` should get the parent assigned (but not the `vmware-master` +host itself). This isn't really solvable with Icinga 1.x parents, but only with host dependencies as shown +below: + + define hostdependency { + dependent_hostgroup_name vmware + dependent_host_name !vmware-master + host_name vmware-master + inherits_parent 1 + notification_failure_criteria d,u + execution_failure_criteria d,u + dependency_period testconfig-24x7 + } + +When migrating to Icinga 2, the parents must be changed to a newly created host dependency. + + +Map the following attributes + + Icinga 1.x | Icinga 2 + ----------------------|--------------------- + host_name | parent_host_name + dependent_host_name | child_host_name (used in assign/ignore) + dependent_hostgroup_name | all child hosts in group (used in assign/ignore) + +The Icinga 2 configuration looks like this: + + + object Host "vmware-master" { + import "linux-server-template" + groups += [ "vmware" ] + address = "192.168.1.10" + vars.is_vmware_master = true + } + + object Host "vmware-vm1" { + import "linux-server-template" + groups += [ "vmware" ] + address = "192.168.27.1" + } + + object Host "vmware-vm2" { + import "linux-server-template" + groups += [ "vmware" ] + address = "192.168.28.1" + } + + apply Dependency "vmware-master" to Host { + parent_host_name = "vmware-master" + + assign where "vmware" in host.groups + ignore where host.vars.is_vmware_master + ignore where host.name == "vmware-master" + } + +For easier identification you could add the `vars.is_vmware_master` attribute to the `vmware-master` +host and let the dependency ignore that instead of the hardcoded host name. That's different +to the Icinga 1.x example and a best practice hint only. + + +#### Manual Config Migration Hints for Distributed Setups + +* Icinga 2 does not use active/passive instances calling OSCP commands and requiring the NSCA +daemon for passing check results between instances. +* Icinga 2 does not support any 1.x NEB addons for check load distribution + +* If your current setup consists of instances distributing the check load, you should consider +building a [load distribution](6-distributed-monitoring.md#distributed-monitoring-scenarios) setup with Icinga 2. +* If your current setup includes active/passive clustering with external tools like Pacemaker/DRBD, +consider the [High Availability](6-distributed-monitoring.md#distributed-monitoring-scenarios) setup. +* If you have build your own custom configuration deployment and check result collecting mechanism, +you should re-design your setup and re-evaluate your requirements, and how they may be fulfilled +using the Icinga 2 cluster capabilities. + + +## Differences between Icinga 1.x and 2 + +### Configuration Format + +Icinga 1.x supports two configuration formats: key-value-based settings in the +`icinga.cfg` configuration file and object-based in included files (`cfg_dir`, +`cfg_file`). The path to the `icinga.cfg` configuration file must be passed to +the Icinga daemon at startup. + +icinga.cfg: + + enable_notifications=1 + +objects.cfg: + + define service { + notifications_enabled 0 + } + +Icinga 2 supports objects and (global) variables, but does not make a difference +between the main configuration file or any other included file. + +icinga2.conf: + + const EnableNotifications = true + + object Service "test" { + enable_notifications = false + } + +#### Sample Configuration and ITL + +While Icinga 1.x ships sample configuration and templates spread in various +object files, Icinga 2 moves all templates into the Icinga Template Library (ITL) +and includes them in the sample configuration. + +Additional plugin check commands are shipped with Icinga 2 as well. + +The ITL will be updated on every release and must not be edited by the user. + +There are still generic templates available for your convenience which may or may +not be re-used in your configuration. For instance, `generic-service` includes +all required attributes except `check_command` for a service. + +Sample configuration files are located in the `conf.d/` directory which is +included in `icinga2.conf` by default. + +> **Note** +> +> Add your own custom templates in the `conf.d/` directory as well, e.g. inside +> the [templates.conf](4-configuring-icinga-2.md#templates-conf) file. + +### Main Config File + +In Icinga 1.x there are many global configuration settings available in `icinga.cfg`. +Icinga 2 only uses a small set of [global constants](17-language-reference.md#constants) allowing +you to specify certain different setting such as the `NodeName` in a cluster scenario. + +Aside from that, the [icinga2.conf](4-configuring-icinga-2.md#icinga2-conf) should take care of including +global constants, enabled [features](11-cli-commands.md#enable-features) and the object configuration. + +### Include Files and Directories + +In Icinga 1.x the `icinga.cfg` file contains `cfg_file` and `cfg_dir` +directives. The `cfg_dir` directive recursively includes all files with a `.cfg` +suffix in the given directory. Only absolute paths may be used. The `cfg_file` +and `cfg_dir` directives can include the same file twice which leads to +configuration errors in Icinga 1.x. + + cfg_file=/etc/icinga/objects/commands.cfg + cfg_dir=/etc/icinga/objects + +Icinga 2 supports wildcard includes and relative paths, e.g. for including +`conf.d/*.conf` in the same directory. + + include "conf.d/*.conf" + +If you want to include files and directories recursively, you need to define +a separate option and add the directory and an optional pattern. + + include_recursive "conf.d" + +A global search path for includes is available for advanced features like +the Icinga Template Library (ITL) or additional monitoring plugins check +command configuration. + + include + include + +By convention the `.conf` suffix is used for Icinga 2 configuration files. + +### Resource File and Global Macros + +Global macros such as for the plugin directory, usernames and passwords can be +set in the `resource.cfg` configuration file in Icinga 1.x. By convention the +`USER1` macro is used to define the directory for the plugins. + +Icinga 2 uses global constants instead. In the default config these are +set in the `constants.conf` configuration file: + + /** + * This file defines global constants which can be used in + * the other configuration files. At a minimum the + * PluginDir constant should be defined. + */ + + const PluginDir = "/usr/lib/nagios/plugins" + +[Global macros](17-language-reference.md#constants) can only be defined once. Trying to modify a +global constant will result in an error. + +### Configuration Comments + +In Icinga 1.x comments are made using a leading hash (`#`) or a semi-colon (`;`) +for inline comments. + +In Icinga 2 comments can either be encapsulated by `/*` and `*/` (allowing for +multi-line comments) or starting with two slashes (`//`). A leading hash (`#`) +could also be used. + +### Object Names + +Object names must not contain an exclamation mark (`!`). Use the `display_name` attribute +to specify user-friendly names which should be shown in UIs (supported by +Icinga Web 2 for example). + +Object names are not specified using attributes (e.g. `service_description` for +services) like in Icinga 1.x but directly after their type definition. + + define service { + host_name localhost + service_description ping4 + } + + object Service "ping4" { + host_name = "localhost" + } + +### Templates + +In Icinga 1.x templates are identified using the `register 0` setting. Icinga 2 +uses the `template` identifier: + + template Service "ping4-template" { } + +Icinga 1.x objects inherit from templates using the `use` attribute. +Icinga 2 uses the keyword `import` with template names in double quotes. + + define service { + service_description testservice + use tmpl1,tmpl2,tmpl3 + } + + object Service "testservice" { + import "tmpl1" + import "tmpl2" + import "tmpl3" + } + +The last template overrides previously set values. + +### Object attributes + +Icinga 1.x separates attribute and value pairs with whitespaces/tabs. Icinga 2 +requires an equal sign (=) between them. + + define service { + check_interval 5 + } + + object Service "test" { + check_interval = 5m + } + +Please note that the default time value is seconds if no duration literal +is given. `check_interval = 5` behaves the same as `check_interval = 5s`. + +All strings require double quotes in Icinga 2. Therefore a double quote +must be escaped by a backslash (e.g. in command line). +If an attribute identifier starts with a number, it must be enclosed +in double quotes as well. + +#### Alias vs. Display Name + +In Icinga 1.x a host can have an `alias` and a `display_name` attribute used +for a more descriptive name. A service only can have a `display_name` attribute. +The `alias` is used for group, timeperiod, etc. objects too. +Icinga 2 only supports the `display_name` attribute which is also taken into +account by Icinga web interfaces. + +### Custom Attributes + +Icinga 2 allows you to define custom attributes in the `vars` dictionary. +The `notes`, `notes_url`, `action_url`, `icon_image`, `icon_image_alt` +attributes for host and service objects are still available in Icinga 2. + +`2d_coords` and `statusmap_image` are not supported in Icinga 2. + +#### Custom Variables + +Icinga 1.x custom variable attributes must be prefixed using an underscore (`_`). +In Icinga 2 these attributes must be added to the `vars` dictionary as custom attributes. + + vars.dn = "cn=icinga2-dev-host,ou=icinga,ou=main,ou=IcingaConfig,ou=LConf,dc=icinga,dc=org" + vars.cv = "my custom cmdb description" + +These custom attributes are also used as [command parameters](3-monitoring-basics.md#command-passing-parameters). + +While Icinga 1.x only supports numbers and strings as custom attribute values, +Icinga 2 extends that to arrays and (nested) dictionaries. For more details +look [here](3-monitoring-basics.md#custom-attributes). + +### Host Service Relation + +In Icinga 1.x a service object is associated with a host by defining the +`host_name` attribute in the service definition. Alternate methods refer +to `hostgroup_name` or behaviour changing regular expression. + +The preferred way of associating hosts with services in Icinga 2 is by +using the [apply](3-monitoring-basics.md#using-apply) keyword. + +Direct object relations between a service and a host still allow you to use +the `host_name` [Service](9-object-types.md#objecttype-service) object attribute. + +### Users + +Contacts have been renamed to users (same for groups). A contact does not +only provide (custom) attributes and notification commands used for notifications, +but is also used for authorization checks in Icinga 1.x. + +Icinga 2 changes that behavior and makes the user an attribute provider only. +These attributes can be accessed using [runtime macros](3-monitoring-basics.md#runtime-macros) +inside notification command definitions. + +In Icinga 2 notification commands are not directly associated with users. +Instead the notification command is specified inside `Notification` objects next to +user and user group relations. + +The `StatusDataWriter`, `IdoMySqlConnection` and `LivestatusListener` types will +provide the contact and contactgroups attributes for services for compatibility +reasons. These values are calculated from all services, their notifications, +and their users. + +### Macros + +Various object attributes and runtime variables can be accessed as macros in +commands in Icinga 1.x -- Icinga 2 supports all required [custom attributes](3-monitoring-basics.md#custom-attributes). + +#### Command Arguments + +If you have previously used Icinga 1.x, you may already be familiar with +user and argument definitions (e.g., `USER1` or `ARG1`). Unlike in Icinga 1.x +the Icinga 2 custom attributes may have arbitrary names and arguments are no +longer specified in the `check_command` setting. + +In Icinga 1.x arguments are specified in the `check_command` attribute and +are separated from the command name using an exclamation mark (`!`). + +Please check the migration hints for a detailed +[migration example](22-migrating-from-icinga-1x.md#manual-config-migration-hints-check-command-arguments). + +> **Note** +> +> The Classic UI feature named `Command Expander` does not work with Icinga 2. + +#### Environment Macros + +The global configuration setting `enable_environment_macros` does not exist in +Icinga 2. + +Macros exported into the [environment](3-monitoring-basics.md#command-environment-variables) +can be set using the `env` attribute in command objects. + +#### Runtime Macros + +Icinga 2 requires an object specific namespace when accessing configuration +and stateful runtime macros. Custom attributes can be accessed directly. + +If a runtime macro from Icinga 1.x is not listed here, it is not supported +by Icinga 2. + +Changes to user (contact) runtime macros + + Icinga 1.x | Icinga 2 + -----------------------|---------------------- + CONTACTNAME | user.name + CONTACTALIAS | user.display_name + CONTACTEMAIL | user.email + CONTACTPAGER | user.pager + +`CONTACTADDRESS*` is not supported but can be accessed as `$user.vars.address1$` +if set. + +Changes to service runtime macros + + Icinga 1.x | Icinga 2 + -----------------------|---------------------- + SERVICEDESC | service.name + SERVICEDISPLAYNAME | service.display_name + SERVICECHECKCOMMAND | service.check_command + SERVICESTATE | service.state + SERVICESTATEID | service.state_id + SERVICESTATETYPE | service.state_type + SERVICEATTEMPT | service.check_attempt + MAXSERVICEATTEMPT | service.max_check_attempts + LASTSERVICESTATE | service.last_state + LASTSERVICESTATEID | service.last_state_id + LASTSERVICESTATETYPE | service.last_state_type + LASTSERVICESTATECHANGE | service.last_state_change + SERVICEDOWNTIME | service.downtime_depth + SERVICEDURATIONSEC | service.duration_sec + SERVICELATENCY | service.latency + SERVICEEXECUTIONTIME | service.execution_time + SERVICEOUTPUT | service.output + SERVICEPERFDATA | service.perfdata + LASTSERVICECHECK | service.last_check + SERVICENOTES | service.notes + SERVICENOTESURL | service.notes_url + SERVICEACTIONURL | service.action_url + + +Changes to host runtime macros + + Icinga 1.x | Icinga 2 + -----------------------|---------------------- + HOSTNAME | host.name + HOSTADDRESS | host.address + HOSTADDRESS6 | host.address6 + HOSTDISPLAYNAME | host.display_name + HOSTALIAS | (use `host.display_name` instead) + HOSTCHECKCOMMAND | host.check_command + HOSTSTATE | host.state + HOSTSTATEID | host.state_id + HOSTSTATETYPE | host.state_type + HOSTATTEMPT | host.check_attempt + MAXHOSTATTEMPT | host.max_check_attempts + LASTHOSTSTATE | host.last_state + LASTHOSTSTATEID | host.last_state_id + LASTHOSTSTATETYPE | host.last_state_type + LASTHOSTSTATECHANGE | host.last_state_change + HOSTDOWNTIME | host.downtime_depth + HOSTDURATIONSEC | host.duration_sec + HOSTLATENCY | host.latency + HOSTEXECUTIONTIME | host.execution_time + HOSTOUTPUT | host.output + HOSTPERFDATA | host.perfdata + LASTHOSTCHECK | host.last_check + HOSTNOTES | host.notes + HOSTNOTESURL | host.notes_url + HOSTACTIONURL | host.action_url + TOTALSERVICES | host.num_services + TOTALSERVICESOK | host.num_services_ok + TOTALSERVICESWARNING | host.num_services_warning + TOTALSERVICESUNKNOWN | host.num_services_unknown + TOTALSERVICESCRITICAL | host.num_services_critical + +Changes to command runtime macros + + Icinga 1.x | Icinga 2 + -----------------------|---------------------- + COMMANDNAME | command.name + +Changes to notification runtime macros + + Icinga 1.x | Icinga 2 + -----------------------|---------------------- + NOTIFICATIONTYPE | notification.type + NOTIFICATIONAUTHOR | notification.author + NOTIFICATIONCOMMENT | notification.comment + NOTIFICATIONAUTHORNAME | (use `notification.author`) + NOTIFICATIONAUTHORALIAS | (use `notification.author`) + + +Changes to global runtime macros: + + Icinga 1.x | Icinga 2 + -----------------------|---------------------- + TIMET | icinga.timet + LONGDATETIME | icinga.long_date_time + SHORTDATETIME | icinga.short_date_time + DATE | icinga.date + TIME | icinga.time + PROCESSSTARTTIME | icinga.uptime + +Changes to global statistic macros: + + Icinga 1.x | Icinga 2 + ----------------------------------|---------------------- + TOTALHOSTSUP | icinga.num_hosts_up + TOTALHOSTSDOWN | icinga.num_hosts_down + TOTALHOSTSUNREACHABLE | icinga.num_hosts_unreachable + TOTALHOSTSDOWNUNHANDLED | -- + TOTALHOSTSUNREACHABLEUNHANDLED | -- + TOTALHOSTPROBLEMS | down + TOTALHOSTPROBLEMSUNHANDLED | down-(downtime+acknowledged) + TOTALSERVICESOK | icinga.num_services_ok + TOTALSERVICESWARNING | icinga.num_services_warning + TOTALSERVICESCRITICAL | icinga.num_services_critical + TOTALSERVICESUNKNOWN | icinga.num_services_unknown + TOTALSERVICESWARNINGUNHANDLED | -- + TOTALSERVICESCRITICALUNHANDLED | -- + TOTALSERVICESUNKNOWNUNHANDLED | -- + TOTALSERVICEPROBLEMS | ok+warning+critical+unknown + TOTALSERVICEPROBLEMSUNHANDLED | warning+critical+unknown-(downtime+acknowledged) + + + + +### External Commands + +`CHANGE_CUSTOM_CONTACT_VAR` was renamed to `CHANGE_CUSTOM_USER_VAR`. + +The following external commands are not supported: + + CHANGE_*MODATTR + CHANGE_CONTACT_HOST_NOTIFICATION_TIMEPERIOD + CHANGE_HOST_NOTIFICATION_TIMEPERIOD + CHANGE_SVC_NOTIFICATION_TIMEPERIOD + DEL_DOWNTIME_BY_HOSTGROUP_NAME + DEL_DOWNTIME_BY_START_TIME_COMMENT + DISABLE_ALL_NOTIFICATIONS_BEYOND_HOST + DISABLE_CONTACT_HOST_NOTIFICATIONS + DISABLE_CONTACT_SVC_NOTIFICATIONS + DISABLE_CONTACTGROUP_HOST_NOTIFICATIONS + DISABLE_CONTACTGROUP_SVC_NOTIFICATIONS + DISABLE_FAILURE_PREDICTION + DISABLE_HOST_AND_CHILD_NOTIFICATIONS + DISABLE_HOST_FRESHNESS_CHECKS + DISABLE_NOTIFICATIONS_EXPIRE_TIME + DISABLE_SERVICE_FRESHNESS_CHECKS + ENABLE_ALL_NOTIFICATIONS_BEYOND_HOST + ENABLE_CONTACT_HOST_NOTIFICATIONS + ENABLE_CONTACT_SVC_NOTIFICATIONS + ENABLE_CONTACTGROUP_HOST_NOTIFICATIONS + ENABLE_CONTACTGROUP_SVC_NOTIFICATIONS + ENABLE_FAILURE_PREDICTION + ENABLE_HOST_AND_CHILD_NOTIFICATIONS + ENABLE_HOST_FRESHNESS_CHECKS + ENABLE_SERVICE_FRESHNESS_CHECKS + READ_STATE_INFORMATION + SAVE_STATE_INFORMATION + SCHEDULE_AND_PROPAGATE_HOST_DOWNTIME + SCHEDULE_AND_PROPAGATE_TRIGGERED_HOST_DOWNTIME + SET_HOST_NOTIFICATION_NUMBER + SET_SVC_NOTIFICATION_NUMBER + START_ACCEPTING_PASSIVE_HOST_CHECKS + START_ACCEPTING_PASSIVE_SVC_CHECKS + START_OBSESSING_OVER_HOST + START_OBSESSING_OVER_HOST_CHECKS + START_OBSESSING_OVER_SVC + START_OBSESSING_OVER_SVC_CHECKS + STOP_ACCEPTING_PASSIVE_HOST_CHECKS + STOP_ACCEPTING_PASSIVE_SVC_CHECKS + STOP_OBSESSING_OVER_HOST + STOP_OBSESSING_OVER_HOST_CHECKS + STOP_OBSESSING_OVER_SVC + STOP_OBSESSING_OVER_SVC_CHECKS + +### Asynchronous Event Execution + +Unlike Icinga 1.x, Icinga 2 does not block when it's waiting for a command +being executed -- whether if it's a check, a notification, an event +handler, a performance data writing update, etc. That way you'll +recognize low to zero (check) latencies with Icinga 2. + +### Checks + +#### Check Output + +Icinga 2 does not make a difference between `output` (first line) and +`long_output` (remaining lines) like in Icinga 1.x. Performance Data is +provided separately. + +There is no output length restriction as known from Icinga 1.x using an +[8KB static buffer](http://docs.icinga.org/latest/en/pluginapi.html#outputlengthrestrictions). + +The `StatusDataWriter`, `IdoMysqlConnection` and `LivestatusListener` types +split the raw output into `output` (first line) and `long_output` (remaining +lines) for compatibility reasons. + +#### Initial State + +Icinga 1.x uses the `max_service_check_spread` setting to specify a timerange +where the initial state checks must have happened. Icinga 2 will use the +`retry_interval` setting instead and `check_interval` divided by 5 if +`retry_interval` is not defined. + +### Comments + +Icinga 2 doesn't support non-persistent comments. + +### Commands + +Unlike in Icinga 1.x there are three different command types in Icinga 2: +`CheckCommand`, `NotificationCommand`, and `EventCommand`. + +For example in Icinga 1.x it is possible to accidentally use a notification +command as an event handler which might cause problems depending on which +runtime macros are used in the notification command. + +In Icinga 2 these command types are separated and will generate an error on +configuration validation if used in the wrong context. + +While Icinga 2 still supports the complete command line in command objects, it's +recommended to use [command arguments](3-monitoring-basics.md#command-arguments) +with optional and conditional command line parameters instead. + +It's also possible to define default argument values for the command itself +which can be overridden by the host or service then. + +#### Command Timeouts + +In Icinga 1.x there were two global options defining a host and service check +timeout. This was essentially bad when there only was a couple of check plugins +requiring some command timeouts to be extended. + +Icinga 2 allows you to specify the command timeout directly on the command. So, +if your VMVware check plugin takes 15 minutes, [increase the timeout](9-object-types.md#objecttype-checkcommand) +accordingly. + + +### Groups + +In Icinga 2 hosts, services, and users are added to groups using the `groups` +attribute in the object. The old way of listing all group members in the group's +`members` attribute is available through `assign where` and `ignore where` +expressions by using [group assign](3-monitoring-basics.md#group-assign-intro). + + object Host "web-dev" { + import "generic-host" + } + + object HostGroup "dev-hosts" { + display_name = "Dev Hosts" + assign where match("*-dev", host.name) + } + +#### Add Service to Hostgroup where Host is Member + +In order to associate a service with all hosts in a host group the [apply](3-monitoring-basics.md#using-apply) +keyword can be used: + + apply Service "ping4" { + import "generic-service" + + check_command = "ping4" + + assign where "dev-hosts" in host.groups + } + +### Notifications + +Notifications are a new object type in Icinga 2. Imagine the following +notification configuration problem in Icinga 1.x: + +* Service A should notify contact X via SMS +* Service B should notify contact X via Mail +* Service C should notify contact Y via Mail and SMS +* Contact X and Y should also be used for authorization (e.g. in Classic UI) + +The only way achieving a semi-clean solution is to + +* Create contact X-sms, set service_notification_command for sms, assign contact + to service A +* Create contact X-mail, set service_notification_command for mail, assign + contact to service B +* Create contact Y, set service_notification_command for sms and mail, assign + contact to service C +* Create contact X without notification commands, assign to service A and B + +Basically you are required to create duplicated contacts for either each +notification method or used for authorization only. + +Icinga 2 attempts to solve that problem in this way + +* Create user X, set SMS and Mail attributes, used for authorization +* Create user Y, set SMS and Mail attributes, used for authorization +* Create notification A-SMS, set command for sms, add user X, + assign notification A-SMS to service A +* Create notification B-Mail, set command for mail, add user X, + assign notification Mail to service B +* Create notification C-SMS, set command for sms, add user Y, + assign notification C-SMS to service C +* Create notification C-Mail, set command for mail, add user Y, + assign notification C-Mail to service C + +Previously in Icinga 1.x it looked like this: + + service -> (contact, contactgroup) -> notification command + +In Icinga 2 it will look like this: + + Service -> Notification -> NotificationCommand + -> User, UserGroup + +#### Escalations + +Escalations in Icinga 1.x require a separated object matching on existing +objects. Escalations happen between a defined start and end time which is +calculated from the notification_interval: + + start = notification start + (notification_interval * first_notification) + end = notification start + (notification_interval * last_notification) + +In theory first_notification and last_notification can be set to readable +numbers. In practice users are manipulating those attributes in combination +with notification_interval in order to get a start and end time. + +In Icinga 2 the notification object can be used as notification escalation +if the start and end times are defined within the 'times' attribute using +duration literals (e.g. 30m). + +The Icinga 2 escalation does not replace the current running notification. +In Icinga 1.x it's required to copy the contacts from the service notification +to the escalation to guarantee the normal notifications once an escalation +happens. +That's not necessary with Icinga 2 only requiring an additional notification +object for the escalation itself. + +#### Notification Options + +Unlike Icinga 1.x with the 'notification_options' attribute with comma-separated +state and type filters, Icinga 2 uses two configuration attributes for that. +All state and type filter use long names OR'd with a pipe together + + notification_options w,u,c,r,f,s + + states = [ Warning, Unknown, Critical ] + filters = [ Problem, Recovery, FlappingStart, FlappingEnd, DowntimeStart, DowntimeEnd, DowntimeRemoved ] + +Icinga 2 adds more fine-grained type filters for acknowledgements, downtime, +and flapping type (start, end, ...). + +### Dependencies and Parents + +In Icinga 1.x it's possible to define host parents to determine network reachability +and keep a host's state unreachable rather than down. +Furthermore there are host and service dependencies preventing unnecessary checks and +notifications. A host must not depend on a service, and vice versa. All dependencies +are configured as separate objects and cannot be set directly on the host or service +object. + +A service can now depend on a host, and vice versa. A service has an implicit dependency +(parent) to its host. A host to host dependency acts implicitly as host parent relation. + +The former `host_name` and `dependent_host_name` have been renamed to `parent_host_name` +and `child_host_name` (same for the service attribute). When using apply rules the +child attributes may be omitted. + +For detailed examples on how to use the dependencies please check the [dependencies](3-monitoring-basics.md#dependencies) +chapter. + +Dependencies can be applied to hosts or services using the [apply rules](17-language-reference.md#apply). + +The `StatusDataWriter`, `IdoMysqlConnection` and `LivestatusListener` types +support the Icinga 1.x schema with dependencies and parent attributes for +compatibility reasons. + +### Flapping + +The Icinga 1.x flapping detection uses the last 21 states of a service. This +value is hardcoded and cannot be changed. The algorithm on determining a flapping state +is as follows: + + flapping value = (number of actual state changes / number of possible state changes) + +The flapping value is then compared to the low and high flapping thresholds. + +The algorithm used in Icinga 2 does not store the past states but calculates the flapping +threshold from a single value based on counters and half-life values. Icinga 2 compares +the value with a single flapping threshold configuration attribute. + +### Check Result Freshness + +Freshness of check results must be enabled explicitly in Icinga 1.x. The attribute +`freshness_threshold` defines the threshold in seconds. Once the threshold is triggered, an +active freshness check is executed defined by the `check_command` attribute. Both check +methods (active and passive) use the same freshness check method. + +In Icinga 2 active check freshness is determined by the `check_interval` attribute and no +incoming check results in that period of time (last check + check interval). Passive check +freshness is calculated from the `check_interval` attribute if set. There is no extra +`freshness_threshold` attribute in Icinga 2. If the freshness checks are invalid, a new +service check is forced. + +### Real Reload + +In Nagios / Icinga 1.x a daemon reload does the following: + +* receive reload signal SIGHUP +* stop all events (checks, notifications, etc.) +* read the configuration from disk and validate all config objects in a single threaded fashion +* validation NOT ok: stop the daemon (cannot restore old config state) +* validation ok: start with new objects, dump status.dat / ido + +Unlike Icinga 1.x the Icinga 2 daemon reload does not block any event +execution during config validation: + +* receive reload signal SIGHUP +* fork a child process, start configuration validation in parallel work queues +* parent process continues with old configuration objects and the event scheduling +(doing checks, replicating cluster events, triggering alert notifications, etc.) +* validation NOT ok: child process terminates, parent process continues with old configuration state +(this is **essential** for the [cluster config synchronisation](6-distributed-monitoring.md#distributed-monitoring-top-down-config-sync)) +* validation ok: child process signals parent process to terminate and save its current state +(all events until now) into the icinga2 state file +* parent process shuts down writing icinga2.state file +* child process waits for parent process gone, reads the icinga2 state file and synchronizes all historical and status data +* child becomes the new session leader + +The DB IDO configuration dump and status/historical event updates use a queue +not blocking event execution. Same goes for any other enabled feature. +The configuration validation itself runs in parallel allowing fast verification checks. + +That way your monitoring does not stop during a configuration reload. + + +### State Retention + +Icinga 1.x uses the `retention.dat` file to save its state in order to be able +to reload it after a restart. In Icinga 2 this file is called `icinga2.state`. + +The format is **not** compatible with Icinga 1.x. + +### Logging + +Icinga 1.x supports syslog facilities and writes its own `icinga.log` log file +and archives. These logs are used in Icinga 1.x Classic UI to generate +historical reports. + +Icinga 2 compat library provides the CompatLogger object which writes the icinga.log and archive +in Icinga 1.x format in order to stay compatible with Classic UI and other addons. + +The native Icinga 2 logging facilities are split into three configuration objects: SyslogLogger, +FileLogger, StreamLogger. Each of them has their own severity and target configuration. + +The Icinga 2 daemon log does not log any alerts but is considered an application log only. + +### Broker Modules and Features + +Icinga 1.x broker modules are incompatible with Icinga 2. + +In order to provide compatibility with Icinga 1.x the functionality of several +popular broker modules was implemented for Icinga 2: + +* IDOUtils +* Livestatus +* Cluster (allows for high availability and load balancing) + + +### Distributed Monitoring + +Icinga 1.x uses the native "obsess over host/service" method which requires the NSCA addon +passing the slave's check results passively onto the master's external command pipe. +While this method may be used for check load distribution, it does not provide any configuration +distribution out-of-the-box. Furthermore comments, downtimes, and other stateful runtime data is +not synced between the master and slave nodes. There are addons available solving the check +and configuration distribution problems Icinga 1.x distributed monitoring currently suffers from. + +Icinga 2 implements a new built-in +[distributed monitoring architecture](6-distributed-monitoring.md#distributed-monitoring-scenarios), +including config and check distribution, IPv4/IPv6 support, SSL certificates and zone support for DMZ. +High Availability and load balancing are also part of the Icinga 2 Cluster feature, next to local replay +logs on connection loss ensuring that the event history is kept in sync. diff --git a/vim/bundle/icinga2/doc/23-appendix.md b/vim/bundle/icinga2/doc/23-appendix.md new file mode 100644 index 0000000..2286fb8 --- /dev/null +++ b/vim/bundle/icinga2/doc/23-appendix.md @@ -0,0 +1,705 @@ +# Appendix + +## External Commands List + +Additional details can be found in the [Icinga 1.x Documentation](http://docs.icinga.org/latest/en/extcommands2.html) + + Command name | Parameters | Description + ------------------------------------------|-----------------------------------|-------------------------- + PROCESS_HOST_CHECK_RESULT | ;<host_name>;<status_code>;<plugin_output> (3) | - + PROCESS_SERVICE_CHECK_RESULT | ;<host_name>;<service_name>;<return_code>;<plugin_output> (4) | - + SCHEDULE_HOST_CHECK | ;<host_name>;<check_time> (2) | - + SCHEDULE_FORCED_HOST_CHECK | ;<host_name>;<check_time> (2) | - + SCHEDULE_SVC_CHECK | ;<host_name>;<service_name>;<check_time> (3) | - + SCHEDULE_FORCED_SVC_CHECK | ;<host_name>;<service_name>;<check_time> (3) | - + ENABLE_HOST_CHECK | ;<host_name> (1) | - + DISABLE_HOST_CHECK | ;<host_name> (1) | - + ENABLE_SVC_CHECK | ;<host_name>;<service_name> (2) | - + DISABLE_SVC_CHECK | ;<host_name>;<service_name> (2) | - + SHUTDOWN_PROCESS | - | - + RESTART_PROCESS | - | - + SCHEDULE_FORCED_HOST_SVC_CHECKS | ;<host_name>;<check_time> (2) | - + SCHEDULE_HOST_SVC_CHECKS | ;<host_name>;<check_time> (2) | - + ENABLE_HOST_SVC_CHECKS | ;<host_name> (1) | - + DISABLE_HOST_SVC_CHECKS | ;<host_name> (1) | - + ACKNOWLEDGE_SVC_PROBLEM | ;<host_name>;<service_name>;<sticky>;<notify>;<persistent>;<author>;<comment> (7) | Note: Icinga 2 treats all comments as persistent. + ACKNOWLEDGE_SVC_PROBLEM_EXPIRE | ;<host_name>;<service_name>;<sticky>;<notify>;<persistent>;<timestamp>;<author>;<comment> (8) | Note: Icinga 2 treats all comments as persistent. + REMOVE_SVC_ACKNOWLEDGEMENT | ;<host_name>;<service_name> (2) | - + ACKNOWLEDGE_HOST_PROBLEM | ;<host_name>;<sticky>;<notify>;<persistent>;<author>;<comment> (6) | Note: Icinga 2 treats all comments as persistent. + ACKNOWLEDGE_HOST_PROBLEM_EXPIRE | ;<host_name>;<sticky>;<notify>;<persistent>;<timestamp>;<author>;<comment> (7) | Note: Icinga 2 treats all comments as persistent. + REMOVE_HOST_ACKNOWLEDGEMENT | ;<host_name> (1) | - + DISABLE_HOST_FLAP_DETECTION | ;<host_name> (1) | - + ENABLE_HOST_FLAP_DETECTION | ;<host_name> (1) | - + DISABLE_SVC_FLAP_DETECTION | ;<host_name>;<service_name> (2) | - + ENABLE_SVC_FLAP_DETECTION | ;<host_name>;<service_name> (2) | - + ENABLE_HOSTGROUP_SVC_CHECKS | ;<hostgroup_name> (1) | - + DISABLE_HOSTGROUP_SVC_CHECKS | ;<hostgroup_name> (1) | - + ENABLE_SERVICEGROUP_SVC_CHECKS | ;<servicegroup_name> (1) | - + DISABLE_SERVICEGROUP_SVC_CHECKS | ;<servicegroup_name> (1) | - + ENABLE_PASSIVE_HOST_CHECKS | ;<host_name> (1) | - + DISABLE_PASSIVE_HOST_CHECKS | ;<host_name> (1) | - + ENABLE_PASSIVE_SVC_CHECKS | ;<host_name>;<service_name> (2) | - + DISABLE_PASSIVE_SVC_CHECKS | ;<host_name>;<service_name> (2) | - + ENABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS | ;<servicegroup_name> (1) | - + DISABLE_SERVICEGROUP_PASSIVE_SVC_CHECKS | ;<servicegroup_name> (1) | - + ENABLE_HOSTGROUP_PASSIVE_SVC_CHECKS | ;<hostgroup_name> (1) | - + DISABLE_HOSTGROUP_PASSIVE_SVC_CHECKS | ;<hostgroup_name> (1) | - + PROCESS_FILE | ;<file_name>;<delete> (2) | - + SCHEDULE_SVC_DOWNTIME | ;<host_name>;<service_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (9) | - + DEL_SVC_DOWNTIME | ;<downtime_id> (1) | - + SCHEDULE_HOST_DOWNTIME | ;<host_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | - + DEL_HOST_DOWNTIME | ;<downtime_id> (1) | - + DEL_DOWNTIME_BY_HOST_NAME | ;<host_name>[;<service_name;>[;<start_time;>[;<comment_text;>]]] (1) | - + SCHEDULE_HOST_SVC_DOWNTIME | ;<host_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | - + SCHEDULE_HOSTGROUP_HOST_DOWNTIME | ;<hostgroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | - + SCHEDULE_HOSTGROUP_SVC_DOWNTIME | ;<hostgroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | - + SCHEDULE_SERVICEGROUP_HOST_DOWNTIME | ;<servicegroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | - + SCHEDULE_SERVICEGROUP_SVC_DOWNTIME | ;<servicegroup_name>;<start_time>;<end_time>;<fixed>;<trigger_id>;<duration>;<author>;<comment> (8) | - + ADD_HOST_COMMENT | ;<host_name>;<persistent>;<author>;<comment> (4) | Note: Icinga 2 treats all comments as persistent. + DEL_HOST_COMMENT | ;<comment_id> (1) | - + ADD_SVC_COMMENT | ;<host_name>;<service_name>;<persistent>;<author>;<comment> (5) | Note: Icinga 2 treats all comments as persistent. + DEL_SVC_COMMENT | ;<comment_id> (1) | - + DEL_ALL_HOST_COMMENTS | ;<host_name> (1) | - + DEL_ALL_SVC_COMMENTS | ;<host_name>;<service_name> (2) | - + SEND_CUSTOM_HOST_NOTIFICATION | ;<host_name>;<options>;<author>;<comment> (4) | - + SEND_CUSTOM_SVC_NOTIFICATION | ;<host_name>;<service_name>;<options>;<author>;<comment> (5) | - + DELAY_HOST_NOTIFICATION | ;<host_name>;<notification_time> (2) | - + DELAY_SVC_NOTIFICATION | ;<host_name>;<service_name>;<notification_time> (3) | - + ENABLE_HOST_NOTIFICATIONS | ;<host_name> (1) | - + DISABLE_HOST_NOTIFICATIONS | ;<host_name> (1) | - + ENABLE_SVC_NOTIFICATIONS | ;<host_name>;<service_name> (2) | - + DISABLE_SVC_NOTIFICATIONS | ;<host_name>;<service_name> (2) | - + ENABLE_HOST_SVC_NOTIFICATIONS | ;<host_name> (1) | - + DISABLE_HOST_SVC_NOTIFICATIONS | ;<host_name> (1) | - + DISABLE_HOSTGROUP_HOST_CHECKS | ;<hostgroup_name> (1) | - + DISABLE_HOSTGROUP_PASSIVE_HOST_CHECKS | ;<hostgroup_name> (1) | - + DISABLE_SERVICEGROUP_HOST_CHECKS | ;<servicegroup_name> (1) | - + DISABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS | ;<servicegroup_name> (1) | - + ENABLE_HOSTGROUP_HOST_CHECKS | ;<hostgroup_name> (1) | - + ENABLE_HOSTGROUP_PASSIVE_HOST_CHECKS | ;<hostgroup_name> (1) | - + ENABLE_SERVICEGROUP_HOST_CHECKS | ;<servicegroup_name> (1) | - + ENABLE_SERVICEGROUP_PASSIVE_HOST_CHECKS | ;<servicegroup_name> (1) | - + ENABLE_NOTIFICATIONS | - | - + DISABLE_NOTIFICATIONS | - | - + ENABLE_FLAP_DETECTION | - | - + DISABLE_FLAP_DETECTION | - | - + ENABLE_EVENT_HANDLERS | - | - + DISABLE_EVENT_HANDLERS | - | - + ENABLE_PERFORMANCE_DATA | - | - + DISABLE_PERFORMANCE_DATA | - | - + START_EXECUTING_HOST_CHECKS | - | - + STOP_EXECUTING_HOST_CHECKS | - | - + START_EXECUTING_SVC_CHECKS | - | - + STOP_EXECUTING_SVC_CHECKS | - | - + CHANGE_NORMAL_SVC_CHECK_INTERVAL | ;<host_name>;<service_name>;<check_interval> (3) | - + CHANGE_NORMAL_HOST_CHECK_INTERVAL | ;<host_name>;<check_interval> (2) | - + CHANGE_RETRY_SVC_CHECK_INTERVAL | ;<host_name>;<service_name>;<check_interval> (3) | - + CHANGE_RETRY_HOST_CHECK_INTERVAL | ;<host_name>;<check_interval> (2) | - + ENABLE_HOST_EVENT_HANDLER | ;<host_name> (1) | - + DISABLE_HOST_EVENT_HANDLER | ;<host_name> (1) | - + ENABLE_SVC_EVENT_HANDLER | ;<host_name>;<service_name> (2) | - + DISABLE_SVC_EVENT_HANDLER | ;<host_name>;<service_name> (2) | - + CHANGE_HOST_EVENT_HANDLER | ;<host_name>;<event_command_name> (2) | - + CHANGE_SVC_EVENT_HANDLER | ;<host_name>;<service_name>;<event_command_name> (3) | - + CHANGE_HOST_CHECK_COMMAND | ;<host_name>;<check_command_name> (2) | - + CHANGE_SVC_CHECK_COMMAND | ;<host_name>;<service_name>;<check_command_name> (3) | - + CHANGE_MAX_HOST_CHECK_ATTEMPTS | ;<host_name>;<check_attempts> (2) | - + CHANGE_MAX_SVC_CHECK_ATTEMPTS | ;<host_name>;<service_name>;<check_attempts> (3) | - + CHANGE_HOST_CHECK_TIMEPERIOD | ;<host_name>;<timeperiod_name> (2) | - + CHANGE_SVC_CHECK_TIMEPERIOD | ;<host_name>;<service_name>;<timeperiod_name> | - + CHANGE_CUSTOM_HOST_VAR | ;<host_name>;<var_name>;<var_value> (3) | - + CHANGE_CUSTOM_SVC_VAR | ;<host_name>;<service_name>;<var_name>;<var_value> (4) | - + CHANGE_CUSTOM_USER_VAR | ;<user_name>;<var_name>;<var_value> (3) | - + CHANGE_CUSTOM_CHECKCOMMAND_VAR | ;<check_command_name>;<var_name>;<var_value> (3) | - + CHANGE_CUSTOM_EVENTCOMMAND_VAR | ;<event_command_name>;<var_name>;<var_value> (3) | - + CHANGE_CUSTOM_NOTIFICATIONCOMMAND_VAR | ;<notification_command_name>;<var_name>;<var_value> (3) | - + ENABLE_HOSTGROUP_HOST_NOTIFICATIONS | ;<hostgroup_name> (1) | - + ENABLE_HOSTGROUP_SVC_NOTIFICATIONS | ;<hostgroup_name> (1) | - + DISABLE_HOSTGROUP_HOST_NOTIFICATIONS | ;<hostgroup_name> (1) | - + DISABLE_HOSTGROUP_SVC_NOTIFICATIONS | ;<hostgroup_name> (1) | - + ENABLE_SERVICEGROUP_HOST_NOTIFICATIONS | ;<servicegroup_name> (1) | - + DISABLE_SERVICEGROUP_HOST_NOTIFICATIONS | ;<servicegroup_name> (1) | - + ENABLE_SERVICEGROUP_SVC_NOTIFICATIONS | ;<servicegroup_name> (1) | - + DISABLE_SERVICEGROUP_SVC_NOTIFICATIONS | ;<servicegroup_name> (1) | - + + +## Schemas + +By convention `CheckCommand`, `EventCommand`, and `NotificationCommand` objects +are exported using a prefix. This is mandatory for unique objects in the +command tables. + +Object | Prefix +------------------------|------------------------ +CheckCommand | check_ +EventCommand | event_ +NotificationCommand | notification_ + +### Status Files + +Status files used by Icinga 1.x Classic UI: `status.dat`, `objects.cache`. + +Icinga 2 specific extensions: + +* host and service objects support 'check_source' (added in Classic UI 1.10.0) +* command objects support custom variables (added in Classic UI 1.11.2) +* host and service objects support 'is_reachable' (added in Classic UI 1.11.3) +* 2.2 adds custom attributes with arrays and dictionaries. They are dumped as JSON encoded string and `_is_json` +is set as additional custom variable in `objects.cache`. + +### DB IDO Schema + +There is a detailed documentation for the Icinga IDOUtils 1.x +database schema available on [http://docs.icinga.org/latest/en/db_model.html] + +#### DB IDO Schema Extensions + +Icinga 2 specific extensions are shown below: + +New table: `endpointstatus` + + Table | Column | Type | Default | Description + --------------------|--------------------|----------|---------|------------- + endpoints | endpoint_object_id | bigint | NULL | FK: objects table + endpoints | identity | TEXT | NULL | endpoint name + endpoints | node | TEXT | NULL | local node name + endpoints | zone_object_id | bigint | NULL | zone object where this endpoint is a member of + +New table: `endpointstatus` + + Table | Column | Type | Default | Description + --------------------|--------------------|----------|---------|------------- + endpointstatus | endpoint_object_id | bigint | NULL | FK: objects table + endpointstatus | identity | TEXT | NULL | endpoint name + endpointstatus | node | TEXT | NULL | local node name + endpointstatus | is_connected | smallint | 0 | update on endpoint connect/disconnect + endpointstatus | zone_object_id | bigint | NULL | zone object where this endpoint is a member of + +New tables: `zones` and `zonestatus`: + + Table | Column | Type | Default | Description + --------------------|--------------------|----------|---------|------------- + zones | zone_object_id | bigint | NULL | FK: objects table + zones | parent_zone_object_id | bigint | NULL | FK: zones table + zones | is_global | smallint | 0 | zone is global + + +New columns: + + Table | Column | Type | Default | Description + --------------------|-------------------------|----------|---------|------------- + all status/history | endpoint_object_id | bigint | NULL | FK: objects table + servicestatus | check_source | TEXT | NULL | node name where check was executed + hoststatus | check_source | TEXT | NULL | node name where check was executed + statehistory | check_source | TEXT | NULL | node name where check was executed + servicestatus | is_reachable | integer | NULL | object reachability + hoststatus | is_reachable | integer | NULL | object reachability + logentries | object_id | bigint | NULL | FK: objects table (service associated with column) + {host,service}group | notes | TEXT | NULL | - + {host,service}group | notes_url | TEXT | NULL | - + {host,service}group | action_url | TEXT | NULL | - + customvariable* | is_json | integer | 0 | Defines whether `varvalue` is a json encoded string from custom attributes, or not + servicestatus | original_attributes | TEXT | NULL | JSON encoded dictionary of original attributes if modified at runtime. + hoststatus | original_attributes | TEXT | NULL | JSON encoded dictionary of original attributes if modified at runtime. + +Additional command custom variables populated from 'vars' dictionary. +Additional global custom variables populated from 'Vars' constant (object_id is NULL). + +### Livestatus Schema + +#### Livestatus Schema Extensions + +Icinga 2 specific extensions are shown below: + +New table: `endpoints`: + + Table | Column + ----------|-------------- + endpoints | name + endpoints | identity + endpoints | node + endpoints | is_connected + endpoints | zone + +New table: `zones`: + + Table | Column + ----------|-------------- + zone | name + zone | endpoints + zone | parent + zone | global + +New columns: + + Table | Column + ----------|-------------- + hosts | is_reachable + services | is_reachable + hosts | cv_is_json + services | cv_is_json + contacts | cv_is_json + hosts | check_source + services | check_source + downtimes | triggers + downtimes | trigger_time + commands | custom_variable_names + commands | custom_variable_values + commands | custom_variables + commands | modified_attributes + commands | modified_attributes_list + status | custom_variable_names + status | custom_variable_values + status | custom_variables + hosts | original_attributes + services | original_attributes + +Command custom variables reflect the local 'vars' dictionary. +Status custom variables reflect the global 'Vars' constant. + +#### Livestatus Hosts Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + name | string | . + display_name | string | . + alias | string | same as display_name. + address | string | . + address6 | string | NEW in Icinga. + check_command | string | . + check_command_expanded | string | . + event_handler | string | . + notification_period | string | host with notifications: period. + check_period | string | . + notes | string | . + notes_expanded | string | . + notes_url | string | . + notes_url_expanded | string | . + action_url | string | . + action_url_expanded | string | . + plugin_output | string | . + perf_data | string | . + icon_image | string | . + icon_image_expanded | string | . + icon_image_alt | stirng | . + statusmap_image | string | . + long_plugin_output | string | . + max_check_attempts | int | . + flap_detection_enabled | int | . + check_freshness | int | . + process_performance_data | int | . + accept_passive_checks | int | . + event_handler_enabled | int | . + acknowledgement_type | int | Only 0 or 1. + check_type | int | . + last_state | int | . + last_hard_state | int | . + current_attempt | int | . + last_notification | int | host with notifications: last notification. + next_notification | int | host with notifications: next notification. + next_check | int | . + last_hard_state_change | int | . + has_been_checked | int | . + current_notification_number | int | host with notifications: number. + total_services | int | . + checks_enabled | int | . + notifications_enabled | int | . + acknowledged | int | . + state | int | . + state_type | int | . + no_more_notifications | int | notification_interval == 0 && volatile == false. + last_check | int | . + last_state_change | int | . + last_time_up | int | . + last_time_down | int | . + last_time_unreachable | int | . + is_flapping | int | . + scheduled_downtime_depth | int | . + active_checks_enabled | int | . + modified_attributes | array | . + modified_attributes_list | array | . + check_interval | double | . + retry_interval | double | . + notification_interval | double | host with notifications: smallest interval. + low_flap_threshold | double | flapping_threshold + high_flap_threshold | double | flapping_threshold + latency | double | . + execution_time | double | . + percent_state_change | double | flapping. + in_notification_period | int | host with notifications: matching period. + in_check_period | int | . + contacts | array | host with notifications, users and user groups. + downtimes | array | id. + downtimes_with_info | array | id+author+comment. + comments | array | id. + comments_with_info | array | id+author+comment. + comments_with_extra_info | array | id+author+comment+entry_type+entry_time. + custom_variable_names | array | . + custom_variable_values | array | . + custom_variables | array | Array of custom variable array pair. + parents | array | Direct host parents. + childs | array | Direct host children (Note: `childs` is inherited from the origin MK_Livestatus protocol). + num_services | int | . + worst_service_state | int | All services and their worst state. + num_services_ok | int | All services with Ok state. + num_services_warn | int | All services with Warning state. + num_services_crit | int | All services with Critical state. + num_services_unknown | int | All services with Unknown state. + worst_service_hard_state | int | All services and their worst hard state. + num_services_hard_ok | int | All services in a hard state with Ok state. + num_services_hard_warn | int | All services in a hard state with Warning state. + num_services_hard_crit | int | All services in a hard state with Critical state. + num_services_hard_unknown | int | All services in a hard state with Unknown state. + hard_state | int | Returns OK if state is OK. Returns current state if now a hard state type. Returns last hard state otherwise. + staleness | int | Indicates time since last check normalized onto the check_interval. + groups | array | All hostgroups this host is a member of. + contact_groups | array | All usergroups associated with this host through notifications. + services | array | All services associated with this host. + services_with_state | array | All services associated with this host with state and hasbeenchecked. + services_with_info | array | All services associated with this host with state, hasbeenchecked and output. + +Not supported: `initial_state`, `pending_flex_downtime`, `check_flapping_recovery_notification`, +`is_executing`, `check_options`, `obsess_over_host`, `first_notification_delay`, `x_3d`, `y_3d`, `z_3d`, +`x_2d`, `y_2d`, `filename`, `pnpgraph_present`. + +#### Livestatus Hostgroups Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + name | string | . + alias | string | `display_name` attribute. + notes | string | . + notes_url | string | . + action_url | string | . + members | array | . + members_with_state | array | Host name and state. + worst_host_state | int | Of all group members. + num_hosts | int | In this group. + num_hosts_pending | int | . + num_hosts_up | int | . + num_hosts_down | int | . + num_hosts_unreach | int | . + num_services | int | Number of services associated with hosts in this hostgroup. + worst_services_state | int | . + num_services_pending | int | . + num_services_ok | int | . + num_services_warn | int | . + num_services_crit | int | . + num_services_unknown | int | . + worst_service_hard_state | int | . + num_services_hard_ok | int | . + num_services_hard_warn | int | . + num_services_hard_crit | int | . + num_services_hard_unknown | int | . + +#### Livestatus Services Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + description | string | . + display_name | string | . + alias | string | same as display_name. + check_command | string | . + check_command_expanded | string | . + event_handler | string | . + notification_period | string | host with notifications: period. + check_period | string | . + notes | string | . + notes_expanded | string | . + notes_url | string | . + notes_url_expanded | string | . + action_url | string | . + action_url_expanded | string | . + plugin_output | string | . + perf_data | string | . + icon_image | string | . + icon_image_expanded | string | . + icon_image_alt | stirng | . + statusmap_image | string | . + long_plugin_output | string | . + max_check_attempts | int | . + flap_detection_enabled | int | . + check_freshness | int | . + process_performance_data | int | . + accept_passive_checks | int | . + event_handler_enabled | int | . + acknowledgement_type | int | Only 0 or 1. + check_type | int | . + last_state | int | . + last_hard_state | int | . + current_attempt | int | . + last_notification | int | service with notifications: last notification. + next_notification | int | service with notifications: next notification. + next_check | int | . + last_hard_state_change | int | . + has_been_checked | int | . + current_notification_number | int | service with notifications: number. + checks_enabled | int | . + notifications_enabled | int | . + acknowledged | int | . + state | int | . + state_type | int | . + no_more_notifications | int | notification_interval == 0 && volatile == false. + last_check | int | . + last_state_change | int | . + last_time_ok | int | . + last_time_warning | int | . + last_time_critical | int | . + last_time_unknown | int | . + is_flapping | int | . + scheduled_downtime_depth | int | . + active_checks_enabled | int | . + modified_attributes | array | . + modified_attributes_list | array | . + check_interval | double | . + retry_interval | double | . + notification_interval | double | service with notifications: smallest interval. + low_flap_threshold | double | flapping_threshold + high_flap_threshold | double | flapping_threshold + latency | double | . + execution_time | double | . + percent_state_change | double | flapping. + in_notification_period | int | service with notifications: matching period. + in_check_period | int | . + contacts | array | service with notifications, users and user groups. + downtimes | array | id. + downtimes_with_info | array | id+author+comment. + comments | array | id. + comments_with_info | array | id+author+comment. + comments_with_extra_info | array | id+author+comment+entry_type+entry_time. + custom_variable_names | array | . + custom_variable_values | array | . + custom_variables | array | Array of custom variable array pair. + hard_state | int | Returns OK if state is OK. Returns current state if now a hard state type. Returns last hard state otherwise. + staleness | int | Indicates time since last check normalized onto the check_interval. + groups | array | All hostgroups this host is a member of. + contact_groups | array | All usergroups associated with this host through notifications. + host_ | join | Prefix for attributes from implicit join with hosts table. + +Not supported: `initial_state`, `is_executing`, `check_options`, `obsess_over_service`, `first_notification_delay`, +`pnpgraph_present`. + +#### Livestatus Servicegroups Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + name | string | . + alias | string | `display_name` attribute. + notes | string | . + notes_url | string | . + action_url | string | . + members | array | CSV format uses `host|service` syntax. + members_with_state | array | Host, service, hoststate, servicestate. + worst_service_state | int | . + num_services | int | . + num_services_pending | int | . + num_services_ok | int | . + num_services_warn | int | . + num_services_crit | int | . + num_services_unknown | int | . + num_services_hard_ok | int | . + num_services_hard_warn | int | . + num_services_hard_crit | int | . + num_services_hard_unknown | int | . + +#### Livestatus Contacts Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + name | string | . + alias | string | `display_name` attribute. + email | string | . + pager | string | . + host_notification_period | string | . + service_notification_period | string | . + host_notifications_enabled | int | . + service_notifications_enabled | int | . + in_host_notification_period | int | . + in_service_notification_period | int | . + custom_variable_names | array | . + custom_variable_values | array | . + custom_variables | array | Array of customvariable array pairs. + modified_attributes | array | . + modified_attributes_list | array | . + + +Not supported: `can_submit_commands`. + +#### Livestatus Contactgroups Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + name | string | . + alias | string | `display_name` attribute. + members | array | . + + +#### Livestatus Commands Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + name | string | 3 types of commands in Icinga 2. + line | string | . + + +#### Livestatus Status Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + connections | int | Since application start. + connections_rate | double | . + service_checks | int | Since application start. + service_checks_rate | double | . + host_checks | int | Since application start. + host_checks_rate | double | . + external_commands | int | Since application start. + external_commands_rate | double | . + nagios_pid | string | Application PID. + enable_notifications | int | . + execute_service_checks | int | . + accept_passive_service_checks | int | . + execute_host_checks | int | . + accept_passive_host_checks | int | . + enable_event_handlers | int | . + check_service_freshness | int | . + check_host_freshness | int | . + enable_flap_detection | int | . + process_performance_data | int | . + check_external_commands | int | Always enabled. + program_start | int | In seconds. + last_command_check | int | Always. + interval_length | int | Compatibility mode: 60. + num_hosts | int | . + num_services | int | . + program_version | string | 2.0. + livestatus_active_connections | string | . + +Not supported: `neb_callbacks`, `neb_callbacks_rate`, `requests`, `requests_rate`, `forks`, `forks_rate`, +`log_messages`, `log_messages_rate`, `livechecks`, `livechecks_rate`, `livecheck_overflows`, +`livecheck_overflows_rate`, `obsess_over_services`, `obsess_over_hosts`, `last_log_rotation`, +`external_command_buffer_slots`, `external_command_buffer_usage`, `external_command_buffer_max`, +`cached_log_messages`, `livestatus_queued_connections`, `livestatus_threads`. + + +#### Livestatus Comments Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + author | string | . + comment | string | . + id | int | legacy_id. + entry_time | string | Seconds. + type | int | 1=host, 2=service. + is_service | int | . + persistent | int | Always. + source | string | Always external (1). + entry_type | int | . + expires | int | . + expire_time | string | Seconds. + service_ | join | Prefix for attributes from implicit join with services table. + host_ | join | Prefix for attributes from implicit join with hosts table. + + +#### Livestatus Downtimes Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + author | string | . + comment | string | . + id | int | legacy_id. + entry_time | string | Seconds. + type | int | 1=active, 0=pending. + is_service | int | . + start_time | string | Seconds. + end_time | string | Seconds. + fixed | int | 0=flexible, 1=fixed. + duration | int | . + triggered_by | int | legacy_id. + triggers | int | NEW in Icinga 2. + trigger_time | string | NEW in Icinga 2. + service_ | join | Prefix for attributes from implicit join with services table. + host_ | join | Prefix for attributes from implicit join with hosts table. + + +#### Livestatus Timeperiod Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + name | string | . + alias | string | `display_name` attribute. + in | int | Current time is in timeperiod or not. + +#### Livestatus Log Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + time | int | Time of log event (unix timestamp). + lineno | int | Line number in `CompatLogger` log file. + class | int | Log message class: 0=info, 1=state, 2=program, 3=notification, 4=passive, 5=command. + message | string | Complete message line. + type | string | Text before the colon `:`. + options | string | Text after the colon `:`. + comment | string | Comment if available. + plugin_output | string | Check output if available. + state | int | Host or service state. + state_type | int | State type if available. + attempt | int | Current check attempt. + service_description | string | . + host_name | string | . + contact_name | string | . + command_name | string | . + current_service_ | join | Prefix for attributes from implicit join with services table. + current_host_ | join | Prefix for attributes from implicit join with hosts table. + current_contact_ | join | Prefix for attributes from implicit join with contacts table. + current_command_ | join | Prefix for attributes from implicit join with commands table. + +#### Livestatus Statehist Table Attributes + + Key | Type | Note + ----------------------|-----------|------------------------- + time | int | Time of log event (unix timestamp). + lineno | int | Line number in `CompatLogger` log file. + from | int | Start timestamp (unix timestamp). + until | int | End timestamp (unix timestamp). + duration | int | until-from. + duration_part | double | duration / query_part. + state | int | State: 0=ok, 1=warn, 2=crit, 3=unknown, -1=notmonitored. + host_down | int | Host associated with the service is down or not. + in_downtime | int | Host/service is in downtime. + in_host_downtime | int | Host associated with the service is in a downtime or not. + is_flapping | int | Host/service is flapping. + in_notification_period | int | Host/service notification periods match or not. + notification_period | string | Host/service notification period. + host_name | string | . + service_description | string | . + log_output | string | Log file output for this state. + duration_ok | int | until-from for OK state. + duration_part_ok | double | . + duration_warning | int | until-from for Warning state. + duration_part_warning | double | . + duration_critical | int | until-from for Critical state. + duration_part_critical | double | . + duration_unknown | int | until-from for Unknown state. + duration_part_unknown | double | . + duration_unmonitored | int | until-from for Not-Monitored state. + duration_part_unmonitored | double | . + current_service_ | join | Prefix for attributes from implicit join with services table. + current_host_ | join | Prefix for attributes from implicit join with hosts table. + +Not supported: `debug_info`. + +#### Livestatus Hostsbygroup Table Attributes + +All (hosts)[19-appendix.md#schema-livestatus-hosts-table-attributes] table attributes grouped with +the (hostgroups)[19-appendix.md#schema-livestatus-hostgroups-table-attributes] table prefixed with `hostgroup_`. + +#### Livestatus Servicesbygroup Table Attributes + +All (services)[19-appendix.md#schema-livestatus-services-table-attributes] table attributes grouped with +the (servicegroups)[19-appendix.md#schema-livestatus-servicegroups-table-attributes] table prefixed with `servicegroup_`. + +#### Livestatus Servicesbyhostgroup Table Attributes + +All (services)[19-appendix.md#schema-livestatus-services-table-attributes] table attributes grouped with +the (hostgroups)[19-appendix.md#schema-livestatus-hostgroups-table-attributes] table prefixed with `hostgroup_`. + diff --git a/vim/bundle/icinga2/doc/3-monitoring-basics.md b/vim/bundle/icinga2/doc/3-monitoring-basics.md new file mode 100644 index 0000000..a6aa6bb --- /dev/null +++ b/vim/bundle/icinga2/doc/3-monitoring-basics.md @@ -0,0 +1,1941 @@ +# Monitoring Basics + +This part of the Icinga 2 documentation provides an overview of all the basic +monitoring concepts you need to know to run Icinga 2. +Keep in mind these examples are made with a Linux server in mind. If you are +using Windows, you will need to change the services accordingly. See the [ITL reference](10-icinga-template-library.md#windows-plugins) + for further information. + +## Hosts and Services + +Icinga 2 can be used to monitor the availability of hosts and services. Hosts +and services can be virtually anything which can be checked in some way: + +* Network services (HTTP, SMTP, SNMP, SSH, etc.) +* Printers +* Switches or routers +* Temperature sensors +* Other local or network-accessible services + +Host objects provide a mechanism to group services that are running +on the same physical device. + +Here is an example of a host object which defines two child services: + + object Host "my-server1" { + address = "10.0.0.1" + check_command = "hostalive" + } + + object Service "ping4" { + host_name = "my-server1" + check_command = "ping4" + } + + object Service "http" { + host_name = "my-server1" + check_command = "http" + } + +The example creates two services `ping4` and `http` which belong to the +host `my-server1`. + +It also specifies that the host should perform its own check using the `hostalive` +check command. + +The `address` attribute is used by check commands to determine which network +address is associated with the host object. + +Details on troubleshooting check problems can be found [here](15-troubleshooting.md#troubleshooting). + +### Host States + +Hosts can be in any of the following states: + + Name | Description + ------------|-------------- + UP | The host is available. + DOWN | The host is unavailable. + +### Service States + +Services can be in any of the following states: + + Name | Description + ------------|-------------- + OK | The service is working properly. + WARNING | The service is experiencing some problems but is still considered to be in working condition. + CRITICAL | The service is in a critical state. + UNKNOWN | The check could not determine the service's state. + +### Hard and Soft States + +When detecting a problem with a host/service Icinga re-checks the object a number of +times (based on the `max_check_attempts` and `retry_interval` settings) before sending +notifications. This ensures that no unnecessary notifications are sent for +transient failures. During this time the object is in a `SOFT` state. + +After all re-checks have been executed and the object is still in a non-OK +state the host/service switches to a `HARD` state and notifications are sent. + + Name | Description + ------------|-------------- + HARD | The host/service's state hasn't recently changed. + SOFT | The host/service has recently changed state and is being re-checked. + +### Host and Service Checks + +Hosts and services determine their state by running checks in a regular interval. + + object Host "router" { + check_command = "hostalive" + address = "10.0.0.1" + } + +The `hostalive` command is one of several built-in check commands. It sends ICMP +echo requests to the IP address specified in the `address` attribute to determine +whether a host is online. + +A number of other [built-in check commands](10-icinga-template-library.md#plugin-check-commands) are also +available. In addition to these commands the next few chapters will explain in +detail how to set up your own check commands. + + +## Templates + +Templates may be used to apply a set of identical attributes to more than one +object: + + template Service "generic-service" { + max_check_attempts = 3 + check_interval = 5m + retry_interval = 1m + enable_perfdata = true + } + + apply Service "ping4" { + import "generic-service" + + check_command = "ping4" + + assign where host.address + } + + apply Service "ping6" { + import "generic-service" + + check_command = "ping6" + + assign where host.address6 + } + + +In this example the `ping4` and `ping6` services inherit properties from the +template `generic-service`. + +Objects as well as templates themselves can import an arbitrary number of +other templates. Attributes inherited from a template can be overridden in the +object if necessary. + +You can also import existing non-template objects. Note that templates +and objects share the same namespace, i.e. you can't define a template +that has the same name like an object. + + +## Custom Attributes + +In addition to built-in attributes you can define your own attributes: + + object Host "localhost" { + vars.ssh_port = 2222 + } + +Valid values for custom attributes include: + +* [Strings](17-language-reference.md#string-literals), [numbers](17-language-reference.md#numeric-literals) and [booleans](17-language-reference.md#boolean-literals) +* [Arrays](17-language-reference.md#array) and [dictionaries](17-language-reference.md#dictionary) +* [Functions](3-monitoring-basics.md#custom-attributes-functions) + +### Functions as Custom Attributes + +Icinga 2 lets you specify [functions](17-language-reference.md#functions) for custom attributes. +The special case here is that whenever Icinga 2 needs the value for such a custom attribute it runs +the function and uses whatever value the function returns: + + object CheckCommand "random-value" { + command = [ PluginDir + "/check_dummy", "0", "$text$" ] + + vars.text = {{ Math.random() * 100 }} + } + +This example uses the [abbreviated lambda syntax](17-language-reference.md#nullary-lambdas). + +These functions have access to a number of variables: + + Variable | Description + -------------|--------------- + user | The User object (for notifications). + service | The Service object (for service checks/notifications/event handlers). + host | The Host object. + command | The command object (e.g. a CheckCommand object for checks). + +Here's an example: + + vars.text = {{ host.check_interval }} + +In addition to these variables the `macro` function can be used to retrieve the +value of arbitrary macro expressions: + + vars.text = {{ + if (macro("$address$") == "127.0.0.1") { + log("Running a check for localhost!") + } + + return "Some text" + }} + +The `resolve_arguments` can be used to resolve a command and its arguments much in +the same fashion Icinga does this for the `command` and `arguments` attributes for +commands. The `by_ssh` command uses this functionality to let users specify a +command and arguments that should be executed via SSH: + + arguments = { + "-C" = {{ + var command = macro("$by_ssh_command$") + var arguments = macro("$by_ssh_arguments$") + + if (typeof(command) == String && !arguments) { + return command + } + + var escaped_args = [] + for (arg in resolve_arguments(command, arguments)) { + escaped_args.add(escape_shell_arg(arg)) + } + return escaped_args.join(" ") + }} + ... + } + +Acessing object attributes at runtime inside these functions is described in the +[advanced topics](8-advanced-topics.md#access-object-attributes-at-runtime) chapter. + +## Runtime Macros + +Macros can be used to access other objects' attributes at runtime. For example they +are used in command definitions to figure out which IP address a check should be +run against: + + object CheckCommand "my-ping" { + command = [ PluginDir + "/check_ping", "-H", "$ping_address$" ] + + arguments = { + "-w" = "$ping_wrta$,$ping_wpl$%" + "-c" = "$ping_crta$,$ping_cpl$%" + "-p" = "$ping_packets$" + } + + vars.ping_address = "$address$" + + vars.ping_wrta = 100 + vars.ping_wpl = 5 + + vars.ping_crta = 250 + vars.ping_cpl = 10 + + vars.ping_packets = 5 + } + + object Host "router" { + check_command = "my-ping" + address = "10.0.0.1" + } + +In this example we are using the `$address$` macro to refer to the host's `address` +attribute. + +We can also directly refer to custom attributes, e.g. by using `$ping_wrta$`. Icinga +automatically tries to find the closest match for the attribute you specified. The +exact rules for this are explained in the next section. + +> **Note** +> +> When using the `$` sign as single character you must escape it with an +> additional dollar character (`$$`). + + +### Evaluation Order + +When executing commands Icinga 2 checks the following objects in this order to look +up macros and their respective values: + +1. User object (only for notifications) +2. Service object +3. Host object +4. Command object +5. Global custom attributes in the `Vars` constant + +This execution order allows you to define default values for custom attributes +in your command objects. + +Here's how you can override the custom attribute `ping_packets` from the previous +example: + + object Service "ping" { + host_name = "localhost" + check_command = "my-ping" + + vars.ping_packets = 10 // Overrides the default value of 5 given in the command + } + +If a custom attribute isn't defined anywhere, an empty value is used and a warning is +written to the Icinga 2 log. + +You can also directly refer to a specific attribute -- thereby ignoring these evaluation +rules -- by specifying the full attribute name: + + $service.vars.ping_wrta$ + +This retrieves the value of the `ping_wrta` custom attribute for the service. This +returns an empty value if the service does not have such a custom attribute no matter +whether another object such as the host has this attribute. + + +### Host Runtime Macros + +The following host custom attributes are available in all commands that are executed for +hosts or services: + + Name | Description + -----------------------------|-------------- + host.name | The name of the host object. + host.display_name | The value of the `display_name` attribute. + host.state | The host's current state. Can be one of `UNREACHABLE`, `UP` and `DOWN`. + host.state_id | The host's current state. Can be one of `0` (up), `1` (down) and `2` (unreachable). + host.state_type | The host's current state type. Can be one of `SOFT` and `HARD`. + host.check_attempt | The current check attempt number. + host.max_check_attempts | The maximum number of checks which are executed before changing to a hard state. + host.last_state | The host's previous state. Can be one of `UNREACHABLE`, `UP` and `DOWN`. + host.last_state_id | The host's previous state. Can be one of `0` (up), `1` (down) and `2` (unreachable). + host.last_state_type | The host's previous state type. Can be one of `SOFT` and `HARD`. + host.last_state_change | The last state change's timestamp. + host.downtime_depth | The number of active downtimes. + host.duration_sec | The time since the last state change. + host.latency | The host's check latency. + host.execution_time | The host's check execution time. + host.output | The last check's output. + host.perfdata | The last check's performance data. + host.last_check | The timestamp when the last check was executed. + host.check_source | The monitoring instance that performed the last check. + host.num_services | Number of services associated with the host. + host.num_services_ok | Number of services associated with the host which are in an `OK` state. + host.num_services_warning | Number of services associated with the host which are in a `WARNING` state. + host.num_services_unknown | Number of services associated with the host which are in an `UNKNOWN` state. + host.num_services_critical | Number of services associated with the host which are in a `CRITICAL` state. + +### Service Runtime Macros + +The following service macros are available in all commands that are executed for +services: + + Name | Description + ---------------------------|-------------- + service.name | The short name of the service object. + service.display_name | The value of the `display_name` attribute. + service.check_command | The short name of the command along with any arguments to be used for the check. + service.state | The service's current state. Can be one of `OK`, `WARNING`, `CRITICAL` and `UNKNOWN`. + service.state_id | The service's current state. Can be one of `0` (ok), `1` (warning), `2` (critical) and `3` (unknown). + service.state_type | The service's current state type. Can be one of `SOFT` and `HARD`. + service.check_attempt | The current check attempt number. + service.max_check_attempts | The maximum number of checks which are executed before changing to a hard state. + service.last_state | The service's previous state. Can be one of `OK`, `WARNING`, `CRITICAL` and `UNKNOWN`. + service.last_state_id | The service's previous state. Can be one of `0` (ok), `1` (warning), `2` (critical) and `3` (unknown). + service.last_state_type | The service's previous state type. Can be one of `SOFT` and `HARD`. + service.last_state_change | The last state change's timestamp. + service.downtime_depth | The number of active downtimes. + service.duration_sec | The time since the last state change. + service.latency | The service's check latency. + service.execution_time | The service's check execution time. + service.output | The last check's output. + service.perfdata | The last check's performance data. + service.last_check | The timestamp when the last check was executed. + service.check_source | The monitoring instance that performed the last check. + +### Command Runtime Macros + +The following custom attributes are available in all commands: + + Name | Description + -----------------------|-------------- + command.name | The name of the command object. + +### User Runtime Macros + +The following custom attributes are available in all commands that are executed for +users: + + Name | Description + -----------------------|-------------- + user.name | The name of the user object. + user.display_name | The value of the display_name attribute. + +### Notification Runtime Macros + + Name | Description + -----------------------|-------------- + notification.type | The type of the notification. + notification.author | The author of the notification comment if existing. + notification.comment | The comment of the notification if existing. + +### Global Runtime Macros + +The following macros are available in all executed commands: + + Name | Description + -----------------------|-------------- + icinga.timet | Current UNIX timestamp. + icinga.long_date_time | Current date and time including timezone information. Example: `2014-01-03 11:23:08 +0000` + icinga.short_date_time | Current date and time. Example: `2014-01-03 11:23:08` + icinga.date | Current date. Example: `2014-01-03` + icinga.time | Current time including timezone information. Example: `11:23:08 +0000` + icinga.uptime | Current uptime of the Icinga 2 process. + +The following macros provide global statistics: + + Name | Description + ----------------------------------|-------------- + icinga.num_services_ok | Current number of services in state 'OK'. + icinga.num_services_warning | Current number of services in state 'Warning'. + icinga.num_services_critical | Current number of services in state 'Critical'. + icinga.num_services_unknown | Current number of services in state 'Unknown'. + icinga.num_services_pending | Current number of pending services. + icinga.num_services_unreachable | Current number of unreachable services. + icinga.num_services_flapping | Current number of flapping services. + icinga.num_services_in_downtime | Current number of services in downtime. + icinga.num_services_acknowledged | Current number of acknowledged service problems. + icinga.num_hosts_up | Current number of hosts in state 'Up'. + icinga.num_hosts_down | Current number of hosts in state 'Down'. + icinga.num_hosts_unreachable | Current number of unreachable hosts. + icinga.num_hosts_pending | Current number of pending hosts. + icinga.num_hosts_flapping | Current number of flapping hosts. + icinga.num_hosts_in_downtime | Current number of hosts in downtime. + icinga.num_hosts_acknowledged | Current number of acknowledged host problems. + + +## Apply Rules + +Instead of assigning each object ([Service](9-object-types.md#objecttype-service), +[Notification](9-object-types.md#objecttype-notification), [Dependency](9-object-types.md#objecttype-dependency), +[ScheduledDowntime](9-object-types.md#objecttype-scheduleddowntime)) +based on attribute identifiers for example `host_name` objects can be [applied](17-language-reference.md#apply). + +Before you start using the apply rules keep the following in mind: + +* Define the best match. + * A set of unique [custom attributes](3-monitoring-basics.md#custom-attributes) for these hosts/services? + * Or [group](3-monitoring-basics.md#groups) memberships, e.g. a host being a member of a hostgroup, applying services to it? + * A generic pattern [match](17-language-reference.md#function-calls) on the host/service name? + * [Multiple expressions combined](3-monitoring-basics.md#using-apply-expressions) with `&&` or `||` [operators](17-language-reference.md#expression-operators) +* All expressions must return a boolean value (an empty string is equal to `false` e.g.) + +> **Note** +> +> You can set/override object attributes in apply rules using the respectively available +> objects in that scope (host and/or service objects). + +[Custom attributes](3-monitoring-basics.md#custom-attributes) can also store nested dictionaries and arrays. That way you can use them +for not only matching for their existance or values in apply expressions, but also assign +("inherit") their values into the generated objected from apply rules. + +* [Apply services to hosts](3-monitoring-basics.md#using-apply-services) +* [Apply notifications to hosts and services](3-monitoring-basics.md#using-apply-notifications) +* [Apply dependencies to hosts and services](3-monitoring-basics.md#using-apply-dependencies) +* [Apply scheduled downtimes to hosts and services](3-monitoring-basics.md#using-apply-scheduledowntimes) + +A more advanced example is using [apply with for loops on arrays or +dictionaries](3-monitoring-basics.md#using-apply-for) for example provided by +[custom atttributes](3-monitoring-basics.md#custom-attributes) or groups. + +> **Tip** +> +> Building configuration in that dynamic way requires detailed information +> of the generated objects. Use the `object list` [CLI command](11-cli-commands.md#cli-command-object) +> after successful [configuration validation](11-cli-commands.md#config-validation). + + +### Apply Rules Expressions + +You can use simple or advanced combinations of apply rule expressions. Each +expression must evaluate into the boolean `true` value. An empty string +will be for instance interpreted as `false`. In a similar fashion undefined +attributes will return `false`. + +Returns `false`: + + assign where host.vars.attribute_does_not_exist + +Multiple `assign where` condition rows are evaluated as `OR` condition. + +You can combine multiple expressions for matching only a subset of objects. In some cases, +you want to be able to add more than one assign/ignore where expression which matches +a specific condition. To achieve this you can use the logical `and` and `or` operators. + + +Match all `*mysql*` patterns in the host name and (`&&`) custom attribute `prod_mysql_db` +matches the `db-*` pattern. All hosts with the custom attribute `test_server` set to `true` +should be ignored, or any host name ending with `*internal` pattern. + + object HostGroup "mysql-server" { + display_name = "MySQL Server" + + assign where match("*mysql*", host.name) && match("db-*", host.vars.prod_mysql_db) + ignore where host.vars.test_server == true + ignore where match("*internal", host.name) + } + +Similar example for advanced notification apply rule filters: If the service +attribute `notes` contains the `has gold support 24x7` string `AND` one of the +two condition passes, either the `customer` host custom attribute is set to `customer-xy` +`OR` the host custom attribute `always_notify` is set to `true`. + +The notification is ignored for services whose host name ends with `*internal` +`OR` the `priority` custom attribute is [less than](17-language-reference.md#expression-operators) `2`. + + template Notification "cust-xy-notification" { + users = [ "noc-xy", "mgmt-xy" ] + command = "mail-service-notification" + } + + apply Notification "notify-cust-xy-mysql" to Service { + import "cust-xy-notification" + + assign where match("*has gold support 24x7*", service.notes) && (host.vars.customer == "customer-xy" || host.vars.always_notify == true) + ignore where match("*internal", host.name) || (service.vars.priority < 2 && host.vars.is_clustered == true) + } + +More advanced examples are covered [here](8-advanced-topics.md#use-functions-assign-where). + +### Apply Services to Hosts + +The sample configuration already includes a detailed example in [hosts.conf](4-configuring-icinga-2.md#hosts-conf) +and [services.conf](4-configuring-icinga-2.md#services-conf) for this use case. + +The example for `ssh` applies a service object to all hosts with the `address` +attribute being defined and the custom attribute `os` set to the string `Linux` in `vars`. + + apply Service "ssh" { + import "generic-service" + + check_command = "ssh" + + assign where host.address && host.vars.os == "Linux" + } + + +Other detailed examples are used in their respective chapters, for example +[apply services with custom command arguments](3-monitoring-basics.md#command-passing-parameters). + +### Apply Notifications to Hosts and Services + +Notifications are applied to specific targets (`Host` or `Service`) and work in a similar +manner: + + + apply Notification "mail-noc" to Service { + import "mail-service-notification" + + user_groups = [ "noc" ] + + assign where host.vars.notification.mail + } + + +In this example the `mail-noc` notification will be created as object for all services having the +`notification.mail` custom attribute defined. The notification command is set to `mail-service-notification` +and all members of the user group `noc` will get notified. + +It is also possible to generally apply a notification template and dynamically overwrite values from +the template by checking for custom attributes. This can be achieved by using [conditional statements](17-language-reference.md#conditional-statements): + + apply Notification "host-mail-noc" to Host { + import "mail-host-notification" + + // replace interval inherited from `mail-host-notification` template with new notfication interval set by a host custom attribute + if (host.vars.notification_interval) { + interval = host.vars.notification_interval + } + + // same with notification period + if (host.vars.notification_period) { + period = host.vars.notification_period + } + + // Send SMS instead of email if the host's custom attribute `notification_type` is set to `sms` + if (host.vars.notification_type == "sms") { + command = "sms-host-notification" + } else { + command = "mail-host-notification" + } + + user_groups = [ "noc" ] + + assign where host.address + } + +In the example above, the notification template `mail-host-notification`, which contains all relevant +notification settings, is applied on all host objects where the `host.address` is defined. +Each host object is then checked for custom attributes (`host.vars.notification_interval`, +`host.vars.notification_period` and `host.vars.notification_type`). Depending if the custom +attibute is set or which value it has, the value from the notification template is dynamically +overwritten. + +The corresponding host object could look like this: + + object Host "host1" { + import "host-linux-prod" + display_name = "host1" + address = "192.168.1.50" + vars.notification_interval = 1h + vars.notification_period = "24x7" + vars.notification_type = "sms" + } + +### Apply Dependencies to Hosts and Services + +Detailed examples can be found in the [dependencies](3-monitoring-basics.md#dependencies) chapter. + +### Apply Recurring Downtimes to Hosts and Services + +The sample configuration includes an example in [downtimes.conf](4-configuring-icinga-2.md#downtimes-conf). + +Detailed examples can be found in the [recurring downtimes](8-advanced-topics.md#recurring-downtimes) chapter. + + +### Using Apply For Rules + +Next to the standard way of using [apply rules](3-monitoring-basics.md#using-apply) +there is the requirement of applying objects based on a set (array or +dictionary) using [apply for](17-language-reference.md#apply-for) expressions. + +The sample configuration already includes a detailed example in [hosts.conf](4-configuring-icinga-2.md#hosts-conf) +and [services.conf](4-configuring-icinga-2.md#services-conf) for this use case. + +Take the following example: A host provides the snmp oids for different service check +types. This could look like the following example: + + object Host "router-v6" { + check_command = "hostalive" + address6 = "::1" + + vars.oids["if01"] = "1.1.1.1.1" + vars.oids["temp"] = "1.1.1.1.2" + vars.oids["bgp"] = "1.1.1.1.5" + } + +Now we want to create service checks for `if01` and `temp`, but not `bgp`. +Furthermore we want to pass the snmp oid stored as dictionary value to the +custom attribute called `vars.snmp_oid` -- this is the command argument required +by the [snmp](10-icinga-template-library.md#plugin-check-command-snmp) check command. +The service's `display_name` should be set to the identifier inside the dictionary. + + apply Service for (identifier => oid in host.vars.oids) { + check_command = "snmp" + display_name = identifier + vars.snmp_oid = oid + + ignore where identifier == "bgp" //don't generate service for bgp checks + } + +Icinga 2 evaluates the `apply for` rule for all objects with the custom attribute +`oids` set. It then iterates over all list items inside the `for` loop and evaluates the +`assign/ignore where` expressions. You can access the loop variable +in these expressions, e.g. for ignoring certain values. +In this example we'd ignore the `bgp` identifier and avoid generating an unwanted service. +We could extend the configuration by also matching the `oid` value on certain regex/wildcard +patterns for example. + +> **Note** +> +> You don't need an `assign where` expression only checking for existance +> of the custom attribute. + +That way you'll save duplicated apply rules by combining them into one +generic `apply for` rule generating the object name with or without a prefix. + + +#### Apply For and Custom Attribute Override + +Imagine a different more advanced example: You are monitoring your network device (host) +with many interfaces (services). The following requirements/problems apply: + +* Each interface service check should be named with a prefix and a name defined in your host object (which could be generated from your CMDB, etc.) +* Each interface has its own vlan tag +* Some interfaces have QoS enabled +* Additional attributes such as `display_name` or `notes`, `notes_url` and `action_url` must be +dynamically generated + + +Tip: Define the snmp community as global constant in your [constants.conf](4-configuring-icinga-2.md#constants-conf) file. + + const IftrafficSnmpCommunity = "public" + +By defining the `interfaces` dictionary with three example interfaces on the `cisco-catalyst-6509-34` +host object, you'll make sure to pass the [custom attribute](3-monitoring-basics.md#custom-attributes) +storage required by the for loop in the service apply rule. + + object Host "cisco-catalyst-6509-34" { + import "generic-host" + display_name = "Catalyst 6509 #34 VIE21" + address = "127.0.1.4" + + /* "GigabitEthernet0/2" is the interface name, + * and key name in service apply for later on + */ + vars.interfaces["GigabitEthernet0/2"] = { + /* define all custom attributes with the + * same name required for command parameters/arguments + * in service apply (look into your CheckCommand definition) + */ + iftraffic_units = "g" + iftraffic_community = IftrafficSnmpCommunity + iftraffic_bandwidth = 1 + vlan = "internal" + qos = "disabled" + } + vars.interfaces["GigabitEthernet0/4"] = { + iftraffic_units = "g" + //iftraffic_community = IftrafficSnmpCommunity + iftraffic_bandwidth = 1 + vlan = "renote" + qos = "enabled" + } + vars.interfaces["MgmtInterface1"] = { + iftraffic_community = IftrafficSnmpCommunity + vlan = "mgmt" + interface_address = "127.99.0.100" #special management ip + } + } + +You can also omit the `"if-"` string, then all generated service names are directly +taken from the `if_name` variable value. + +The config dictionary contains all key-value pairs for the specific interface in one +loop cycle, like `iftraffic_units`, `vlan`, and `qos` for the specified interface. + +You can either map the custom attributes from the `interface_config` dictionary to +local custom attributes stashed into `vars`. If the names match the required command +argument parameters already (for example `iftraffic_units`), you could also add the +`interface_config` dictionary to the `vars` dictionary using the `+=` operator. + +After `vars` is fully populated, all object attributes can be set calculated from +provided host attributes. For strings, you can use string concatention with the `+` operator. + +You can also specifiy the display_name, check command, interval, notes, notes_url, action_url, etc. +attributes that way. Attribute strings can be [concatenated](17-language-reference.md#expression-operators), +for example for adding a more detailed service `display_name`. + +This example also uses [if conditions](17-language-reference.md#conditional-statements) +if specific values are not set, adding a local default value. +The other way around you can override specific custom attributes inherited from a service template if set. + + /* loop over the host.vars.interfaces dictionary + * for (key => value in dict) means `interface_name` as key + * and `interface_config` as value. Access config attributes + * with the indexer (`.`) character. + */ + apply Service "if-" for (interface_name => interface_config in host.vars.interfaces) { + import "generic-service" + check_command = "iftraffic" + display_name = "IF-" + interface_name + + /* use the key as command argument (no duplication of values in host.vars.interfaces) */ + vars.iftraffic_interface = interface_name + + /* map the custom attributes as command arguments */ + vars.iftraffic_units = interface_config.iftraffic_units + vars.iftraffic_community = interface_config.iftraffic_community + + /* the above can be achieved in a shorter fashion if the names inside host.vars.interfaces + * are the _exact_ same as required as command parameter by the check command + * definition. + */ + vars += interface_config + + /* set a default value for units and bandwidth */ + if (interface_config.iftraffic_units == "") { + vars.iftraffic_units = "m" + } + if (interface_config.iftraffic_bandwidth == "") { + vars.iftraffic_bandwidth = 1 + } + if (interface_config.vlan == "") { + vars.vlan = "not set" + } + if (interface_config.qos == "") { + vars.qos = "not set" + } + + /* set the global constant if not explicitely + * not provided by the `interfaces` dictionary on the host + */ + if (len(interface_config.iftraffic_community) == 0 || len(vars.iftraffic_community) == 0) { + vars.iftraffic_community = IftrafficSnmpCommunity + } + + /* Calculate some additional object attributes after populating the `vars` dictionary */ + notes = "Interface check for " + interface_name + " (units: '" + interface_config.iftraffic_units + "') in VLAN '" + vars.vlan + "' with ' QoS '" + vars.qos + "'" + notes_url = "http://foreman.company.com/hosts/" + host.name + action_url = "http://snmp.checker.company.com/" + host.name + "/if-" + interface_name + } + + + +This example makes use of the [check_iftraffic](https://exchange.icinga.org/exchange/iftraffic) plugin. +The `CheckCommand` definition can be found in the +[contributed plugin check commands](10-icinga-template-library.md#plugin-contrib-command-iftraffic) +-- make sure to include them in your [icinga2 configuration file](4-configuring-icinga-2.md#icinga2-conf). + + +> **Tip** +> +> Building configuration in that dynamic way requires detailed information +> of the generated objects. Use the `object list` [CLI command](11-cli-commands.md#cli-command-object) +> after successful [configuration validation](11-cli-commands.md#config-validation). + +Verify that the apply-for-rule successfully created the service objects with the +inherited custom attributes: + + # icinga2 daemon -C + # icinga2 object list --type Service --name *catalyst* + + Object 'cisco-catalyst-6509-34!if-GigabitEthernet0/2' of type 'Service': + ...... + * vars + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 59:3-59:26 + * iftraffic_bandwidth = 1 + * iftraffic_community = "public" + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 53:3-53:65 + * iftraffic_interface = "GigabitEthernet0/2" + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 49:3-49:43 + * iftraffic_units = "g" + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 52:3-52:57 + * qos = "disabled" + * vlan = "internal" + + + Object 'cisco-catalyst-6509-34!if-GigabitEthernet0/4' of type 'Service': + ... + * vars + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 59:3-59:26 + * iftraffic_bandwidth = 1 + * iftraffic_community = "public" + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 53:3-53:65 + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 79:5-79:53 + * iftraffic_interface = "GigabitEthernet0/4" + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 49:3-49:43 + * iftraffic_units = "g" + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 52:3-52:57 + * qos = "enabled" + * vlan = "renote" + + Object 'cisco-catalyst-6509-34!if-MgmtInterface1' of type 'Service': + ... + * vars + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 59:3-59:26 + * iftraffic_bandwidth = 1 + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 66:5-66:32 + * iftraffic_community = "public" + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 53:3-53:65 + * iftraffic_interface = "MgmtInterface1" + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 49:3-49:43 + * iftraffic_units = "m" + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 52:3-52:57 + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 63:5-63:30 + * interface_address = "127.99.0.100" + * qos = "not set" + % = modified in '/etc/icinga2/conf.d/iftraffic.conf', lines 72:5-72:24 + * vlan = "mgmt" + + +### Use Object Attributes in Apply Rules + +Since apply rules are evaluated after the generic objects, you +can reference existing host and/or service object attributes as +values for any object attribute specified in that apply rule. + + object Host "opennebula-host" { + import "generic-host" + address = "10.1.1.2" + + vars.hosting["xyz"] = { + http_uri = "/shop" + customer_name = "Customer xyz" + customer_id = "7568" + support_contract = "gold" + } + vars.hosting["abc"] = { + http_uri = "/shop" + customer_name = "Customer xyz" + customer_id = "7568" + support_contract = "silver" + } + } + + apply Service for (customer => config in host.vars.hosting) { + import "generic-service" + check_command = "ping4" + + vars.qos = "disabled" + + vars += config + + vars.http_uri = "/" + vars.customer + "/" + config.http_uri + + display_name = "Shop Check for " + vars.customer_name + "-" + vars.customer_id + + notes = "Support contract: " + vars.support_contract + " for Customer " + vars.customer_name + " (" + vars.customer_id + ")." + + notes_url = "http://foreman.company.com/hosts/" + host.name + action_url = "http://snmp.checker.company.com/" + host.name + "/" + vars.customer_id + } + +## Groups + +A group is a collection of similar objects. Groups are primarily used as a +visualization aid in web interfaces. + +Group membership is defined at the respective object itself. If +you have a hostgroup name `windows` for example, and want to assign +specific hosts to this group for later viewing the group on your +alert dashboard, first create a HostGroup object: + + object HostGroup "windows" { + display_name = "Windows Servers" + } + +Then add your hosts to this group: + + template Host "windows-server" { + groups += [ "windows" ] + } + + object Host "mssql-srv1" { + import "windows-server" + + vars.mssql_port = 1433 + } + + object Host "mssql-srv2" { + import "windows-server" + + vars.mssql_port = 1433 + } + +This can be done for service and user groups the same way: + + object UserGroup "windows-mssql-admins" { + display_name = "Windows MSSQL Admins" + } + + template User "generic-windows-mssql-users" { + groups += [ "windows-mssql-admins" ] + } + + object User "win-mssql-noc" { + import "generic-windows-mssql-users" + + email = "noc@example.com" + } + + object User "win-mssql-ops" { + import "generic-windows-mssql-users" + + email = "ops@example.com" + } + +### Group Membership Assign + +Instead of manually assigning each object to a group you can also assign objects +to a group based on their attributes: + + object HostGroup "prod-mssql" { + display_name = "Production MSSQL Servers" + + assign where host.vars.mssql_port && host.vars.prod_mysql_db + ignore where host.vars.test_server == true + ignore where match("*internal", host.name) + } + +In this example all hosts with the `vars` attribute `mssql_port` +will be added as members to the host group `mssql`. However, all `\*internal` +hosts or with the `test_server` attribute set to `true` are not added to this +group. + +Details on the `assign where` syntax can be found in the +[Language Reference](17-language-reference.md#apply). + +## Notifications + +Notifications for service and host problems are an integral part of your +monitoring setup. + +When a host or service is in a downtime, a problem has been acknowledged or +the dependency logic determined that the host/service is unreachable, no +notifications are sent. You can configure additional type and state filters +refining the notifications being actually sent. + +There are many ways of sending notifications, e.g. by email, XMPP, +IRC, Twitter, etc. On its own Icinga 2 does not know how to send notifications. +Instead it relies on external mechanisms such as shell scripts to notify users. +More notification methods are listed in the [addons and plugins](13-addons.md#notification-scripts-interfaces) +chapter. + +A notification specification requires one or more users (and/or user groups) +who will be notified in case of problems. These users must have all custom +attributes defined which will be used in the `NotificationCommand` on execution. + +The user `icingaadmin` in the example below will get notified only on `WARNING` and +`CRITICAL` states and `problem` and `recovery` notification types. + + object User "icingaadmin" { + display_name = "Icinga 2 Admin" + enable_notifications = true + states = [ OK, Warning, Critical ] + types = [ Problem, Recovery ] + email = "icinga@localhost" + } + +If you don't set the `states` and `types` configuration attributes for the `User` +object, notifications for all states and types will be sent. + +Details on troubleshooting notification problems can be found [here](15-troubleshooting.md#troubleshooting). + +> **Note** +> +> Make sure that the [notification](11-cli-commands.md#enable-features) feature is enabled +> in order to execute notification commands. + +You should choose which information you (and your notified users) are interested in +case of emergency, and also which information does not provide any value to you and +your environment. + +An example notification command is explained [here](3-monitoring-basics.md#notification-commands). + +You can add all shared attributes to a `Notification` template which is inherited +to the defined notifications. That way you'll save duplicated attributes in each +`Notification` object. Attributes can be overridden locally. + + template Notification "generic-notification" { + interval = 15m + + command = "mail-service-notification" + + states = [ Warning, Critical, Unknown ] + types = [ Problem, Acknowledgement, Recovery, Custom, FlappingStart, + FlappingEnd, DowntimeStart, DowntimeEnd, DowntimeRemoved ] + + period = "24x7" + } + +The time period `24x7` is included as example configuration with Icinga 2. + +Use the `apply` keyword to create `Notification` objects for your services: + + apply Notification "notify-cust-xy-mysql" to Service { + import "generic-notification" + + users = [ "noc-xy", "mgmt-xy" ] + + assign where match("*has gold support 24x7*", service.notes) && (host.vars.customer == "customer-xy" || host.vars.always_notify == true + ignore where match("*internal", host.name) || (service.vars.priority < 2 && host.vars.is_clustered == true) + } + + +Instead of assigning users to notifications, you can also add the `user_groups` +attribute with a list of user groups to the `Notification` object. Icinga 2 will +send notifications to all group members. + +> **Note** +> +> Only users who have been notified of a problem before (`Warning`, `Critical`, `Unknown` +> states for services, `Down` for hosts) will receive `Recovery` notifications. + +### Notification Escalations + +When a problem notification is sent and a problem still exists at the time of re-notification +you may want to escalate the problem to the next support level. A different approach +is to configure the default notification by email, and escalate the problem via SMS +if not already solved. + +You can define notification start and end times as additional configuration +attributes making the `Notification` object a so-called `notification escalation`. +Using templates you can share the basic notification attributes such as users or the +`interval` (and override them for the escalation then). + +Using the example from above, you can define additional users being escalated for SMS +notifications between start and end time. + + object User "icinga-oncall-2nd-level" { + display_name = "Icinga 2nd Level" + + vars.mobile = "+1 555 424642" + } + + object User "icinga-oncall-1st-level" { + display_name = "Icinga 1st Level" + + vars.mobile = "+1 555 424642" + } + +Define an additional [NotificationCommand](3-monitoring-basics.md#notification-commands) for SMS notifications. + +> **Note** +> +> The example is not complete as there are many different SMS providers. +> Please note that sending SMS notifications will require an SMS provider +> or local hardware with an active SIM card. + + object NotificationCommand "sms-notification" { + command = [ + PluginDir + "/send_sms_notification", + "$mobile$", + "..." + } + +The two new notification escalations are added onto the local host +and its service `ping4` using the `generic-notification` template. +The user `icinga-oncall-2nd-level` will get notified by SMS (`sms-notification` +command) after `30m` until `1h`. + +> **Note** +> +> The `interval` was set to 15m in the `generic-notification` +> template example. Lower that value in your escalations by using a secondary +> template or by overriding the attribute directly in the `notifications` array +> position for `escalation-sms-2nd-level`. + +If the problem does not get resolved nor acknowledged preventing further notifications, +the `escalation-sms-1st-level` user will be escalated `1h` after the initial problem was +notified, but only for one hour (`2h` as `end` key for the `times` dictionary). + + apply Notification "mail" to Service { + import "generic-notification" + + command = "mail-notification" + users = [ "icingaadmin" ] + + assign where service.name == "ping4" + } + + apply Notification "escalation-sms-2nd-level" to Service { + import "generic-notification" + + command = "sms-notification" + users = [ "icinga-oncall-2nd-level" ] + + times = { + begin = 30m + end = 1h + } + + assign where service.name == "ping4" + } + + apply Notification "escalation-sms-1st-level" to Service { + import "generic-notification" + + command = "sms-notification" + users = [ "icinga-oncall-1st-level" ] + + times = { + begin = 1h + end = 2h + } + + assign where service.name == "ping4" + } + +### Notification Delay + +Sometimes the problem in question should not be announced when the notification is due +(the object reaching the `HARD` state), but after a certain period. In Icinga 2 +you can use the `times` dictionary and set `begin = 15m` as key and value if you want to +postpone the notification window for 15 minutes. Leave out the `end` key -- if not set, +Icinga 2 will not check against any end time for this notification. Make sure to +specify a relatively low notification `interval` to get notified soon enough again. + + apply Notification "mail" to Service { + import "generic-notification" + + command = "mail-notification" + users = [ "icingaadmin" ] + + interval = 5m + + times.begin = 15m // delay notification window + + assign where service.name == "ping4" + } + +### Disable Re-notifications + +If you prefer to be notified only once, you can disable re-notifications by setting the +`interval` attribute to `0`. + + apply Notification "notify-once" to Service { + import "generic-notification" + + command = "mail-notification" + users = [ "icingaadmin" ] + + interval = 0 // disable re-notification + + assign where service.name == "ping4" + } + +### Notification Filters by State and Type + +If there are no notification state and type filter attributes defined at the `Notification` +or `User` object, Icinga 2 assumes that all states and types are being notified. + +Available state and type filters for notifications are: + + template Notification "generic-notification" { + + states = [ Warning, Critical, Unknown ] + types = [ Problem, Acknowledgement, Recovery, Custom, FlappingStart, + FlappingEnd, DowntimeStart, DowntimeEnd, DowntimeRemoved ] + } + +If you are familiar with Icinga 1.x `notification_options`, please note that they have been split +into type and state to allow more fine granular filtering for example on downtimes and flapping. +You can filter for acknowledgements and custom notifications too. + + +## Commands + +Icinga 2 uses three different command object types to specify how +checks should be performed, notifications should be sent, and +events should be handled. + +### Check Commands + +[CheckCommand](9-object-types.md#objecttype-checkcommand) objects define the command line how +a check is called. + +[CheckCommand](9-object-types.md#objecttype-checkcommand) objects are referenced by +[Host](9-object-types.md#objecttype-host) and [Service](9-object-types.md#objecttype-service) objects +using the `check_command` attribute. + +> **Note** +> +> Make sure that the [checker](11-cli-commands.md#enable-features) feature is enabled in order to +> execute checks. + +#### Integrate the Plugin with a CheckCommand Definition + +Unless you have done so already, download your check plugin and put it +into the [PluginDir](4-configuring-icinga-2.md#constants-conf) directory. The following example uses the +`check_mysql` plugin contained in the Monitoring Plugins package. + +The plugin path and all command arguments are made a list of +double-quoted string arguments for proper shell escaping. + +Call the `check_disk` plugin with the `--help` parameter to see +all available options. Our example defines warning (`-w`) and +critical (`-c`) thresholds for the disk usage. Without any +partition defined (`-p`) it will check all local partitions. + + icinga@icinga2 $ /usr/lib64/nagios/plugins/check_mysql --help + ... + This program tests connections to a MySQL server + + Usage: + check_mysql [-d database] [-H host] [-P port] [-s socket] + [-u user] [-p password] [-S] [-l] [-a cert] [-k key] + [-C ca-cert] [-D ca-dir] [-L ciphers] [-f optfile] [-g group] + +Next step is to understand how [command parameters](3-monitoring-basics.md#command-passing-parameters) +are being passed from a host or service object, and add a [CheckCommand](9-object-types.md#objecttype-checkcommand) +definition based on these required parameters and/or default values. + +Please continue reading in the [plugins section](5-service-monitoring.md#service-monitoring-plugins) for additional integration examples. + +#### Passing Check Command Parameters from Host or Service + +Check command parameters are defined as custom attributes which can be accessed as runtime macros +by the executed check command. + +The check command parameters for ITL provided plugin check command definitions are documented +[here](10-icinga-template-library.md#plugin-check-commands), for example +[disk](10-icinga-template-library.md#plugin-check-command-disk). + +In order to practice passing command parameters you should [integrate your own plugin](3-monitoring-basics.md#command-plugin-integration). + +The following example will use `check_mysql` provided by the [Monitoring Plugins installation](2-getting-started.md#setting-up-check-plugins). + +Define the default check command custom attributes, for example `mysql_user` and `mysql_password` +(freely definable naming schema) and optional their default threshold values. You can +then use these custom attributes as runtime macros for [command arguments](3-monitoring-basics.md#command-arguments) +on the command line. + +> **Tip** +> +> Use a common command type as prefix for your command arguments to increase +> readability. `mysql_user` helps understanding the context better than just +> `user` as argument. + +The default custom attributes can be overridden by the custom attributes +defined in the host or service using the check command `my-mysql`. The custom attributes +can also be inherited from a parent template using additive inheritance (`+=`). + + # vim /etc/icinga2/conf.d/commands.conf + + object CheckCommand "my-mysql" { + command = [ PluginDir + "/check_mysql" ] //constants.conf -> const PluginDir + + arguments = { + "-H" = "$mysql_host$" + "-u" = { + required = true + value = "$mysql_user$" + } + "-p" = "$mysql_password$" + "-P" = "$mysql_port$" + "-s" = "$mysql_socket$" + "-a" = "$mysql_cert$" + "-d" = "$mysql_database$" + "-k" = "$mysql_key$" + "-C" = "$mysql_ca_cert$" + "-D" = "$mysql_ca_dir$" + "-L" = "$mysql_ciphers$" + "-f" = "$mysql_optfile$" + "-g" = "$mysql_group$" + "-S" = { + set_if = "$mysql_check_slave$" + description = "Check if the slave thread is running properly." + } + "-l" = { + set_if = "$mysql_ssl$" + description = "Use ssl encryption" + } + } + + vars.mysql_check_slave = false + vars.mysql_ssl = false + vars.mysql_host = "$address$" + } + +The check command definition also sets `mysql_host` to the `$address$` default value. You can override +this command parameter if for example your MySQL host is not running on the same server's ip address. + +Make sure pass all required command parameters, such as `mysql_user`, `mysql_password` and `mysql_database`. +`MysqlUsername` and `MysqlPassword` are specified as [global constants](4-configuring-icinga-2.md#constants-conf) +in this example. + + # vim /etc/icinga2/conf.d/services.conf + + apply Service "mysql-icinga-db-health" { + import "generic-service" + + check_command = "my-mysql" + + vars.mysql_user = MysqlUsername + vars.mysql_password = MysqlPassword + + vars.mysql_database = "icinga" + vars.mysql_host = "192.168.33.11" + + assign where match("icinga2*", host.name) + ignore where host.vars.no_health_check == true + } + + +Take a different example: The example host configuration in [hosts.conf](4-configuring-icinga-2.md#hosts-conf) +also applies an `ssh` service check. Your host's ssh port is not the default `22`, but set to `2022`. +You can pass the command parameter as custom attribute `ssh_port` directly inside the service apply rule +inside [services.conf](4-configuring-icinga-2.md#services-conf): + + apply Service "ssh" { + import "generic-service" + + check_command = "ssh" + vars.ssh_port = 2022 //custom command parameter + + assign where (host.address || host.address6) && host.vars.os == "Linux" + } + +If you prefer this being configured at the host instead of the service, modify the host configuration +object instead. The runtime macro resolving order is described [here](3-monitoring-basics.md#macro-evaluation-order). + + object Host NodeName { + ... + vars.ssh_port = 2022 + } + +#### Passing Check Command Parameters Using Apply For + +The host `localhost` with the generated services from the `basic-partitions` dictionary (see +[apply for](3-monitoring-basics.md#using-apply-for) for details) checks a basic set of disk partitions +with modified custom attributes (warning thresholds at `10%`, critical thresholds at `5%` +free disk space). + +The custom attribute `disk_partition` can either hold a single string or an array of +string values for passing multiple partitions to the `check_disk` check plugin. + + object Host "my-server" { + import "generic-host" + address = "127.0.0.1" + address6 = "::1" + + vars.local_disks["basic-partitions"] = { + disk_partitions = [ "/", "/tmp", "/var", "/home" ] + } + } + + apply Service for (disk => config in host.vars.local_disks) { + import "generic-service" + check_command = "my-disk" + + vars += config + + vars.disk_wfree = "10%" + vars.disk_cfree = "5%" + } + + +More details on using arrays in custom attributes can be found in +[this chapter](3-monitoring-basics.md#custom-attributes). + + +#### Command Arguments + +By defining a check command line using the `command` attribute Icinga 2 +will resolve all macros in the static string or array. Sometimes it is +required to extend the arguments list based on a met condition evaluated +at command execution. Or making arguments optional -- only set if the +macro value can be resolved by Icinga 2. + + object CheckCommand "check_http" { + command = [ PluginDir + "/check_http" ] + + arguments = { + "-H" = "$http_vhost$" + "-I" = "$http_address$" + "-u" = "$http_uri$" + "-p" = "$http_port$" + "-S" = { + set_if = "$http_ssl$" + } + "--sni" = { + set_if = "$http_sni$" + } + "-a" = { + value = "$http_auth_pair$" + description = "Username:password on sites with basic authentication" + } + "--no-body" = { + set_if = "$http_ignore_body$" + } + "-r" = "$http_expect_body_regex$" + "-w" = "$http_warn_time$" + "-c" = "$http_critical_time$" + "-e" = "$http_expect$" + } + + vars.http_address = "$address$" + vars.http_ssl = false + vars.http_sni = false + } + +The example shows the `check_http` check command defining the most common +arguments. Each of them is optional by default and will be omitted if +the value is not set. For example, if the service calling the check command +does not have `vars.http_port` set, it won't get added to the command +line. + +If the `vars.http_ssl` custom attribute is set in the service, host or command +object definition, Icinga 2 will add the `-S` argument based on the `set_if` +numeric value to the command line. String values are not supported. + +If the macro value cannot be resolved, Icinga 2 will not add the defined argument +to the final command argument array. Empty strings for macro values won't omit +the argument. + +That way you can use the `check_http` command definition for both, with and +without SSL enabled checks saving you duplicated command definitions. + +Details on all available options can be found in the +[CheckCommand object definition](9-object-types.md#objecttype-checkcommand). + + +#### Environment Variables + +The `env` command object attribute specifies a list of environment variables with values calculated +from either runtime macros or custom attributes which should be exported as environment variables +prior to executing the command. + +This is useful for example for hiding sensitive information on the command line output +when passing credentials to database checks: + + object CheckCommand "mysql-health" { + command = [ + PluginDir + "/check_mysql" + ] + + arguments = { + "-H" = "$mysql_address$" + "-d" = "$mysql_database$" + } + + vars.mysql_address = "$address$" + vars.mysql_database = "icinga" + vars.mysql_user = "icinga_check" + vars.mysql_pass = "password" + + env.MYSQLUSER = "$mysql_user$" + env.MYSQLPASS = "$mysql_pass$" + } + + + +### Notification Commands + +[NotificationCommand](9-object-types.md#objecttype-notificationcommand) objects define how notifications are delivered to external +interfaces (email, XMPP, IRC, Twitter, etc.). + +[NotificationCommand](9-object-types.md#objecttype-notificationcommand) objects are referenced by +[Notification](9-object-types.md#objecttype-notification) objects using the `command` attribute. + +> **Note** +> +> Make sure that the [notification](11-cli-commands.md#enable-features) feature is enabled +> in order to execute notification commands. + +Below is an example using runtime macros from Icinga 2 (such as `$service.output$` for +the current check output) sending an email to the user(s) associated with the +notification itself (`$user.email$`). + +If you want to specify default values for some of the custom attribute definitions, +you can add a `vars` dictionary as shown for the `CheckCommand` object. + + object NotificationCommand "mail-service-notification" { + command = [ SysconfDir + "/icinga2/scripts/mail-notification.sh" ] + + env = { + NOTIFICATIONTYPE = "$notification.type$" + SERVICEDESC = "$service.name$" + HOSTALIAS = "$host.display_name$" + HOSTADDRESS = "$address$" + SERVICESTATE = "$service.state$" + LONGDATETIME = "$icinga.long_date_time$" + SERVICEOUTPUT = "$service.output$" + NOTIFICATIONAUTHORNAME = "$notification.author$" + NOTIFICATIONCOMMENT = "$notification.comment$" + HOSTDISPLAYNAME = "$host.display_name$" + SERVICEDISPLAYNAME = "$service.display_name$" + USEREMAIL = "$user.email$" + } + } + +The command attribute in the `mail-service-notification` command refers to the following +shell script. The macros specified in the `env` array are exported +as environment variables and can be used in the notification script: + + #!/usr/bin/env bash + template=$(cat <