]> granicus.if.org Git - icinga2/commitdiff
Add 'disk_smb' Plugin CheckCommand definition
authorMichael Friedrich <michael.friedrich@netways.de>
Tue, 12 May 2015 12:45:10 +0000 (14:45 +0200)
committerMichael Friedrich <michael.friedrich@netways.de>
Wed, 13 May 2015 08:33:51 +0000 (10:33 +0200)
fixes #9254

doc/7-icinga-template-library.md
itl/command-plugins.conf

index 77b4197a04e39723aafcca5d026ad077ce897a22..19399a110c9efd2d77d8b609c97a6ea9bdc29e07 100644 (file)
@@ -172,6 +172,27 @@ disk_timeout           | **Optional.** Seconds before connection times out (defa
 disk_units             | **Optional.** Choose bytes, kB, MB, GB, TB (default: MB).
 disk_exclude_type      | **Optional.** Ignore all filesystems of indicated type (may be repeated).
 
+## <a id="plugin-check-command-disk-smb"></a> disk_smb
+
+Check command object for the `check_disk_smb` plugin.
+
+> **Note**
+>
+> `disk_smb_wused` and `disk_smb_cused` require the percent sign. If omitted, disk units can be used.
+
+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.
 
 ## <a id="plugin-check-command-dns"></a> dns
 
@@ -813,7 +834,7 @@ users_cgreater  | **Optional.** The user count critical threshold. Defaults to 5
 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 <windows-plugins>
 
 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.
@@ -833,7 +854,7 @@ Threshold    | Meaning
 
 ## <a id="windows-plugins-disk-windows"></a>disk-windows
 
-Check command object for the `check_disk.exe` plugin.  
+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:
@@ -848,7 +869,7 @@ disk\_win\_unit | **Optional**. Use this unit to display disk space, thresholds
 
 ## <a id="windows-plugins-load-windows"></a>load-windows
 
-Check command object for the `check_load.exe` plugin.  
+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`](7-icinga-template-library.md#windows-plugins-load-windows).
 
 Custom attributes:
@@ -861,7 +882,7 @@ load\_win\_crit | **Optional**. The critical threshold.
 
 ## <a id="windows-plugins-memory-windows"></a>memory-windows
 
-Check command object for the `check_memory.exe` plugin.  
+Check command object for the `check_memory.exe` plugin.
 The memory collection is instant.
 
 Custom attributes:
@@ -875,7 +896,7 @@ memory\_win\_unit | **Optional**. The unit to display the received value in, thr
 
 ## <a id="windows-plugins-network-windows"></a>network-windows
 
-Check command object for the `check_network.exe` plugin.  
+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`](7-icinga-template-library.md#windows-plugins-load-windows).
 
 Custom attributes:
@@ -888,7 +909,7 @@ network\_win\_crit | **Optional**. The critical threshold.
 
 ## <a id="windows-plugins-permon-windows"></a>perfmon-windows
 
-Check command object for the `check_perfmon.exe` plugin.  
+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"`
@@ -906,7 +927,7 @@ perfmon\_win\_type    | **Optional**. Format in which to expect perfomance value
 
 ## <a id="windows-plugins-ping-windows"></a>ping-windows
 
-Check command object for the `check_ping.exe` plugin.  
+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:
@@ -922,7 +943,7 @@ ping\_win\_timeout | **Optional**. The timeout in milliseconds. Default: 1000
 
 ## <a id="windows-plugins-procs-windows"></a>procs-windows
 
-Check command object for `check_procs.exe` plugin.  
+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:
@@ -936,7 +957,7 @@ procs\_win\_user | **Optional**. Count this useres processes.
 
 ## <a id="windows-plugins-service-windows"></a>service-windows
 
-Check command object for `check_service.exe` plugin.  
+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:
@@ -949,7 +970,7 @@ service\_win\_service | **Required**. The critical threshold.
 
 ## <a id="windows-plugins-swap-windows"></a>swap-windows
 
-Check command object for `check_swap.exe` plugin.  
+Check command object for `check_swap.exe` plugin.
 The data collection is instant.
 
 Custom attributes:
@@ -963,8 +984,8 @@ swap\_win\_unit | **Optional**. The unit to display the received value in, thres
 
 ## <a id="windows-plugins-update-windows"></a>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. 
+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.
 
 Custom attributes:
 
@@ -977,7 +998,7 @@ update\_win\_reboot | Set to treat 'may need update' as 'definitely needs update
 
 ## <a id="windows-plugins-uptime-windows"></a>uptime-windows
 
-Check command opject for `check_uptime.exe` plugin.  
+Check command opject for `check_uptime.exe` plugin.
 Uses GetTickCount64 to get the uptime, so boot time is not included.
 
 Custom attributes:
@@ -991,7 +1012,7 @@ uptime\_win\_unit | **Optional**. The unit to display the received value in, thr
 
 ## <a id="windows-plugins-users-windows"></a>users-windows
 
-Check command object for `check_users.exe` plugin.  
+Check command object for `check_users.exe` plugin.
 
 Custom attributes:
 
@@ -1009,7 +1030,7 @@ You can enable these check commands by adding the following the include directiv
 [icinga2.conf](5-configuring-icinga-2.md#icinga2-conf) configuration file:
 
     include <nscp>
-    
+
 You can also optionally specify an alternative installation directory for NSClient++ by adding
 the NscpPath constant in your [constants.conf](5-configuring-icinga-2.md#constants-conf) configuration
 file:
@@ -3478,4 +3499,3 @@ vmware_username         | **Optional.** The username to connect to Host or vCent
 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 <br> **Autentication file content:** <br>  username=vmuser <br> password=p@ssw0rd
 vmware_multiline        | **Optional.** Multiline output in overview. This mean technically that a multiline output uses a HTML **\<br\>** for the GUI. No value defined as default.
-
index 2b286494d0556fe3c70bd4932789aa059e7f1763..94aab7dbcc773b3fb5dd5c7b2860af405a434a85 100644 (file)
@@ -775,6 +775,54 @@ object CheckCommand "disk" {
        vars.disk_exclude_type = ["none", "tmpfs", "sysfs", "proc", "devtmpfs", "devfs", "mtmfs"]
 }
 
+object CheckCommand "disk_smb" {
+        import "plugin-check-command"
+
+        command = [ PluginDir + "/check_disk_smb" ]
+
+        arguments = {
+                "-H" = {
+                        value = "$disk_smb_hostname$"
+                        description = "NetBIOS name of the server."
+                }
+                "-s" = {
+                        value = "$disk_smb_share$"
+                        description = "Share name to be tested."
+                }
+                "-W" = {
+                        value = "$disk_smb_workgroup$"
+                        description = "Workgroup or Domain used (Defaults to 'WORKGROUP' if omitted)."
+                }
+                "-a" = {
+                        value = "$disk_smb_address$"
+                        description = "IP-address of HOST (only necessary if HOST is in another network)."
+                }
+                "-u" = {
+                        value = "$disk_smb_username$"
+                        description = "Username to log in to server. (Defaults to 'guest' if omitted)."
+                }
+                "-p" = {
+                        value = "$disk_smb_password$"
+                        description = "Password to log in to server. (Defaults to an empty password if omitted)."
+                }
+                "-w" = {
+                        value = "$disk_smb_wused$"
+                        description = "Percent of used space at which a warning will be generated (Default: 85%)."
+                }
+                "-c" = {
+                        value = "$disk_smb_cused$"
+                        description = "Percent of used space at which a critical will be generated (Defaults: 95%)"
+                }
+                "-P" = {
+                        value = "$disk_smb_port$"
+                        description = "Port to be used to connect to. Some Windows boxes use 139, others 445 (Defaults to smbclient default if omitted)."
+                }
+        }
+
+       vars.disk_smb_wused = "85%"
+       vars.disk_smb_cused = "95%"
+}
+
 object CheckCommand "users" {
        import "plugin-check-command"