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")
+ set(NSCP_URL "https://github.com/mickem/nscp/releases/download/0.5.0.62/NSCP-0.5.0.62-x64.msi")
+ set(NSCP_SHA256 "1854de86ad4fda3391f273de0f9985b702c014bdec01b26ad28a1343177f537f")
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")
+ set(NSCP_URL "https://github.com/mickem/nscp/releases/download/0.5.0.62/NSCP-0.5.0.62-Win32.msi")
+ set(NSCP_SHA256 "2186b60d588fa0811344ce709332f9c63670019c62ae92eae49698bf76205a95")
endif()
set(NSCP_SHA256SUM "")
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_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_query | **Required.** The NSClient++ query. Try `nscp client -q x` for a list.
nscp_arguments | **Optional.** An array of query arguments.
Check command object for the `check_version` NSClient++ plugin.
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
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_modules | **Optional.** An array of NSClient++ modules to load. Defaults to `[ "CheckDisk" ]`.
### <a id="nscp-check-local-counter"></a> nscp-local-counter
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
The Icinga 2 package on Windows already provides several plugins.
check_command = "hostalive"
address = "192.168.56.111"
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
[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"
+ command_endpoint = host.vars.client_endpoint
- 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
+ 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
- //specify where the check is executed
- command_endpoint = host.vars.client_endpoint
+ vars.nscp_counter_showall = true
- assign where host.vars.client_endpoint
+ assign where host.vars.os_type == "windows" && host.vars.client_endpoint
}
Validate the configuration and restart Icinga 2.
[root@icinga2-master1.localdomain /]# icinga2 daemon -C
[root@icinga2-master1.localdomain /]# systemctl restart icinga2
+Open Icinga Web 2 and check your newly added Windows NSClient++ check :)
+
+
+
+
## <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
//...
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
}
//...
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
}
arguments = {
"--log" = "$nscp_log_level$"
"--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" = {
value = "$nscp_query$"
required = true
}
vars.nscp_log_level = "critical"
- vars.nscp_load_all = true
+ vars.nscp_load_all = false
vars.nscp_boot = true
vars.nscp_showall = false
+ vars.nscp_modules = [ "CheckSystem" ]
}
object CheckCommand "nscp-local-cpu" {
import "nscp-local"
vars.nscp_query = "check_version"
+ vars.nscp_modules = [ "CheckHelpers" ]
}
object CheckCommand "nscp-local-disk" {
vars.nscp_disk_critical = {{
if (!macro("$nscp_disk_free$")) { return 90 } else { return 10 }
}}
+
+ vars.nscp_modules = [ "CheckDisk" ]
}
object CheckCommand "nscp-local-counter" {
"--critical" = {
value = "value $nscp_counter_op$ $nscp_counter_critical$"
}
- "perf-syntax" = {
- value = "perf-syntax=$nscp_counter_perfsyntax$"
- skip_key = true
+ "--perf-syntax" = {
+ value = "$nscp_counter_perfsyntax$"
}
"-a" = {
value = "$nscp_counter_arguments$"