Upgrade NSClient++ to 0.5.0 stable

This involves required changes in the nscp-local ITL CheckCommand
definitions. Upgrading NSClient++ therefore requires updating
the Icinga 2 Windows client as well.

fixes #12733
This commit is contained in:
Michael Friedrich 2016-09-21 14:04:20 +02:00
parent 0742301b1d
commit c81b4a82dd
5 changed files with 50 additions and 20 deletions

View File

@ -316,11 +316,11 @@ include(InstallRequiredSystemLibraries)
if(WIN32) if(WIN32)
if(CMAKE_VS_PLATFORM_NAME STREQUAL "x64") 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_URL "https://github.com/mickem/nscp/releases/download/0.5.0.62/NSCP-0.5.0.62-x64.msi")
set(NSCP_SHA256 "36c487777e9488cbf7a15db3a87f63ff6d6af46398d6f36b25734041e3e13900") set(NSCP_SHA256 "1854de86ad4fda3391f273de0f9985b702c014bdec01b26ad28a1343177f537f")
else() else()
set(NSCP_URL "https://github.com/mickem/nscp/releases/download/0.4.4.19/NSCP-0.4.4.19-Win32.msi") set(NSCP_URL "https://github.com/mickem/nscp/releases/download/0.5.0.62/NSCP-0.5.0.62-Win32.msi")
set(NSCP_SHA256 "f05bc00712966901531d5a9354c57e95c34eb65b4748cf3ebc305ccc8fa29cce") set(NSCP_SHA256 "2186b60d588fa0811344ce709332f9c63670019c62ae92eae49698bf76205a95")
endif() endif()
set(NSCP_SHA256SUM "") set(NSCP_SHA256SUM "")

View File

@ -1607,7 +1607,8 @@ Custom attributes passed as [command parameters](3-monitoring-basics.md#command-
Name | Description Name | Description
----------------|-------------- ----------------|--------------
nscp_log_level | **Optional.** The log level. Defaults to "critical". nscp_log_level | **Optional.** The log level. Defaults to "critical".
nscp_load_all | **Optional.** Whether to load all modules. Defaults to true. nscp_load_all | **Optional.** Whether to load all modules. Defaults to false.
nscp_modules | **Optional.** An array of NSClient++ modules to load. Defaults to `[ "CheckSystem" ]`.
nscp_boot | **Optional.** Whether to use the --boot option. 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_query | **Required.** The NSClient++ query. Try `nscp client -q x` for a list.
nscp_arguments | **Optional.** An array of query arguments. nscp_arguments | **Optional.** An array of query arguments.
@ -1685,6 +1686,7 @@ This command has the same custom attributes like the `nscp-local` check command.
Check command object for the `check_version` NSClient++ plugin. Check command object for the `check_version` NSClient++ plugin.
This command has the same custom attributes like the `nscp-local` check command. This command has the same custom attributes like the `nscp-local` check command.
In addition to that the default value for `nscp_modules` is set to `[ "CheckHelpers" ]`.
### <a id="nscp-check-local-disk"></a> nscp-local-disk ### <a id="nscp-check-local-disk"></a> nscp-local-disk
@ -1698,6 +1700,7 @@ nscp_disk_warning | **Optional.** Threshold for WARNING in percent or absol
nscp_disk_critical | **Optional.** Threshold for CRITICAL in percent or absolut (use MB, GB, ...), default to 90 (used) or 10 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_arguments | **Optional.** Additional arguments.
nscp_disk_showall | **Optional.** Shows more details in plugin output, default to true. nscp_disk_showall | **Optional.** Shows more details in plugin output, default to true.
nscp_modules | **Optional.** An array of NSClient++ modules to load. Defaults to `[ "CheckDisk" ]`.
### <a id="nscp-check-local-counter"></a> nscp-local-counter ### <a id="nscp-check-local-counter"></a> nscp-local-counter

View File

@ -1645,6 +1645,19 @@ add a dependency which prevents notifications for all other failing services:
ignore where service.name == "child-health" ignore where service.name == "child-health"
} }
### <a id="distributed-monitoring-windows-firewall"></a> Windows Firewall
By default ICMP requests are disabled in the Windows firewall. You can
change that by [adding a new rule](https://support.microsoft.com/en-us/kb/947709).
C:\WINDOWS\system32>netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request" protocol=icmpv4:8,any dir=in action=allow
If your master/satellite nodes should actively connect to the Windows client
you'll also need to ensure that port `5665` is enabled.
C:\WINDOWS\system32>netsh advfirewall firewall add rule name="Open port 5665 (Icinga 2)" dir=in action=allow protocol=TCP localport=5665
### <a id="distributed-monitoring-windows-plugins"></a> Windows Client and Plugins ### <a id="distributed-monitoring-windows-plugins"></a> Windows Client and Plugins
The Icinga 2 package on Windows already provides several plugins. The Icinga 2 package on Windows already provides several plugins.
@ -1729,6 +1742,7 @@ First, add the client node as host object:
check_command = "hostalive" check_command = "hostalive"
address = "192.168.56.111" address = "192.168.56.111"
vars.client_endpoint = name //follows the convention that host name == endpoint name vars.client_endpoint = name //follows the convention that host name == endpoint name
vars.os_type = "windows"
} }
Next, add a performance counter check using command endpoint checks (details in the Next, add a performance counter check using command endpoint checks (details in the
@ -1736,18 +1750,18 @@ Next, add a performance counter check using command endpoint checks (details in
[root@icinga2-master1.localdomain /etc/icinga2/zones.d/master]# vim services.conf [root@icinga2-master1.localdomain /etc/icinga2/zones.d/master]# vim services.conf
apply Service "perf-counter-cpu" { apply Service "nscp-local-counter-cpu" {
check_command = "nscp-local-counter" check_command = "nscp-local-counter"
vars.nscp_local_counter = "\\Processor(_total)\\% Processor Time"
vars.nscp_local_perfsyntax = "Total Processor Time"
vars.nscp_local_warning = 1
vars.nscp_local_critical = 5
//specify where the check is executed
command_endpoint = host.vars.client_endpoint command_endpoint = host.vars.client_endpoint
assign where host.vars.client_endpoint vars.nscp_counter_name = "\\Processor(_total)\\% Processor Time"
vars.nscp_counter_perfsyntax = "Total Processor Time"
vars.nscp_counter_warning = 1
vars.nscp_counter_critical = 5
vars.nscp_counter_showall = true
assign where host.vars.os_type == "windows" && host.vars.client_endpoint
} }
Validate the configuration and restart Icinga 2. Validate the configuration and restart Icinga 2.
@ -1755,6 +1769,11 @@ Validate the configuration and restart Icinga 2.
[root@icinga2-master1.localdomain /]# icinga2 daemon -C [root@icinga2-master1.localdomain /]# icinga2 daemon -C
[root@icinga2-master1.localdomain /]# systemctl restart icinga2 [root@icinga2-master1.localdomain /]# systemctl restart icinga2
Open Icinga Web 2 and check your newly added Windows NSClient++ check :)
![Icinga 2 Distributed Monitoring Windows Client with NSClient++](images/distributed-monitoring/icinga2_distributed_windows_nscp_counter_icingaweb2.png)
## <a id="distributed-monitoring-advanced-hints"></a> Advanced Hints ## <a id="distributed-monitoring-advanced-hints"></a> Advanced Hints
You can find additional hints in this section if you prefer to go your own route You can find additional hints in this section if you prefer to go your own route
@ -1848,7 +1867,7 @@ to the client node `icinga2-client1.localdomain`:
//... //...
object Endpoint "icinga2-client1.localdomain" { object Endpoint "icinga2-client1.localdomain" {
host = "192.168.33.111" //the master actively tries to connect to the client host = "192.168.56.111" //the master actively tries to connect to the client
log_duration = 0 log_duration = 0
} }
@ -1893,7 +1912,7 @@ Configuration on the master node `icinga2-master1.localdomain`:
//... //...
object Endpoint "icinga2-client1.localdomain" { object Endpoint "icinga2-client1.localdomain" {
host = "192.168.33.111" //the master actively tries to connect to the client host = "192.168.56.111" //the master actively tries to connect to the client
log_duration = 0 log_duration = 0
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 28 KiB

View File

@ -27,6 +27,11 @@ object CheckCommand "nscp-local" {
arguments = { arguments = {
"--log" = "$nscp_log_level$" "--log" = "$nscp_log_level$"
"--load-all" = { set_if ="$nscp_load_all$" } "--load-all" = { set_if ="$nscp_load_all$" }
"--module" = {
value = "$nscp_modules$"
description = "Specify which NSClient++ modules are required. 'nscp client' just needs 'CheckSystem' by default."
repeat_key = true
}
"-q" = { "-q" = {
value = "$nscp_query$" value = "$nscp_query$"
required = true required = true
@ -45,9 +50,10 @@ object CheckCommand "nscp-local" {
} }
vars.nscp_log_level = "critical" vars.nscp_log_level = "critical"
vars.nscp_load_all = true vars.nscp_load_all = false
vars.nscp_boot = true vars.nscp_boot = true
vars.nscp_showall = false vars.nscp_showall = false
vars.nscp_modules = [ "CheckSystem" ]
} }
object CheckCommand "nscp-local-cpu" { object CheckCommand "nscp-local-cpu" {
@ -193,6 +199,7 @@ object CheckCommand "nscp-local-version" {
import "nscp-local" import "nscp-local"
vars.nscp_query = "check_version" vars.nscp_query = "check_version"
vars.nscp_modules = [ "CheckHelpers" ]
} }
object CheckCommand "nscp-local-disk" { object CheckCommand "nscp-local-disk" {
@ -234,6 +241,8 @@ object CheckCommand "nscp-local-disk" {
vars.nscp_disk_critical = {{ vars.nscp_disk_critical = {{
if (!macro("$nscp_disk_free$")) { return 90 } else { return 10 } if (!macro("$nscp_disk_free$")) { return 90 } else { return 10 }
}} }}
vars.nscp_modules = [ "CheckDisk" ]
} }
object CheckCommand "nscp-local-counter" { object CheckCommand "nscp-local-counter" {
@ -250,9 +259,8 @@ object CheckCommand "nscp-local-counter" {
"--critical" = { "--critical" = {
value = "value $nscp_counter_op$ $nscp_counter_critical$" value = "value $nscp_counter_op$ $nscp_counter_critical$"
} }
"perf-syntax" = { "--perf-syntax" = {
value = "perf-syntax=$nscp_counter_perfsyntax$" value = "$nscp_counter_perfsyntax$"
skip_key = true
} }
"-a" = { "-a" = {
value = "$nscp_counter_arguments$" value = "$nscp_counter_arguments$"