]> granicus.if.org Git - icinga2/commitdiff
Upgrade NSClient++ to 0.5.0 stable
authorMichael Friedrich <michael.friedrich@netways.de>
Wed, 21 Sep 2016 12:04:20 +0000 (14:04 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Wed, 21 Sep 2016 13:28:20 +0000 (15:28 +0200)
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

CMakeLists.txt
doc/10-icinga-template-library.md
doc/6-distributed-monitoring.md
doc/images/distributed-monitoring/icinga2_distributed_windows_nscp_counter_icingaweb2.png [new file with mode: 0644]
itl/command-nscp-local.conf

index 7282d17da1b29aef388cba8d351ee46e59f5106a..20f112c9a23259d58c13241b43c0f6fcf32ccbe4 100644 (file)
@@ -316,11 +316,11 @@ 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")
+    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 "")
index 480b5a05357683c0a35c6517ebb2bd9980eb890e..45c07d38c8666f8faea0c3b7d67a677b5080f45d 100644 (file)
@@ -1607,7 +1607,8 @@ Custom attributes passed as [command parameters](3-monitoring-basics.md#command-
 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.
@@ -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.
 
 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
 
@@ -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_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
 
index 2a0c91c197d0a61d39560f37de78e017bdbfe7c2..991812da5926edd829f35a7e34da3bbb3ae4f3ba 100644 (file)
@@ -1645,6 +1645,19 @@ add a dependency which prevents notifications for all other failing services:
       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.
@@ -1729,6 +1742,7 @@ First, add the client node as host object:
       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
@@ -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
 
-    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.
@@ -1755,6 +1769,11 @@ 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 :)
+
+![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
 
 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" {
-      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
     }
 
@@ -1893,7 +1912,7 @@ Configuration on the master node `icinga2-master1.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
     }
 
diff --git a/doc/images/distributed-monitoring/icinga2_distributed_windows_nscp_counter_icingaweb2.png b/doc/images/distributed-monitoring/icinga2_distributed_windows_nscp_counter_icingaweb2.png
new file mode 100644 (file)
index 0000000..a7383e2
Binary files /dev/null and b/doc/images/distributed-monitoring/icinga2_distributed_windows_nscp_counter_icingaweb2.png differ
index fa413085b5c5424fb9da387915390f1b1411a29f..4d0be6e1111e8930108624e9e24e9edab5ad71e3 100644 (file)
@@ -27,6 +27,11 @@ object CheckCommand "nscp-local" {
        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
@@ -45,9 +50,10 @@ object CheckCommand "nscp-local" {
        }
 
        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" {
@@ -193,6 +199,7 @@ object CheckCommand "nscp-local-version" {
        import  "nscp-local"
 
        vars.nscp_query = "check_version"
+       vars.nscp_modules = [ "CheckHelpers" ]
 }
 
 object CheckCommand "nscp-local-disk" {
@@ -234,6 +241,8 @@ 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" {
@@ -250,9 +259,8 @@ 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$"