]> granicus.if.org Git - icinga2/commitdiff
ITL: Add logstash CheckCommand
authorThomas Widhalm <thomas.widhalm@icinga.com>
Mon, 31 Oct 2016 15:51:58 +0000 (16:51 +0100)
committerMichael Friedrich <michael.friedrich@icinga.com>
Thu, 17 Nov 2016 15:39:57 +0000 (16:39 +0100)
fixes #12755

Signed-off-by: Michael Friedrich <michael.friedrich@icinga.com>
doc/10-icinga-template-library.md
itl/plugins-contrib.d/CMakeLists.txt
itl/plugins-contrib.d/logmanagement.conf [new file with mode: 0644]

index a49b6aa5a2429ee18a81eecd850cf22a4dfd313e..79e7bd8f3e407626edd5bd72216aadea5fef0305 100644 (file)
@@ -4741,3 +4741,24 @@ glusterfs_disk_warning     | **Optional.** Warn if disk usage is above *DISKWARN
 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).
+
+### <a id="plugins-contrib-logmanagement"></a> Logmanagement
+
+This category includes all plugins for services dealing with logfiles and logevents
+
+#### <a id="plugins-contrib-command-logstash"></a> logstash
+
+The [logstash](https://github.com/widhalmt/check_logstash) plugin connects to the Node API of Logstash. This feature was introduced with Logstash version 5.0 so the plugin won't work with prior versions of Logstash. The Node API is not activated by default, you will have to reconfigure your Logstash installation for the plugin to connect.
+
+Name                       | Description
+---------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
+logstash_hostname          | **Optional.** Hostname where Logstash is running. Defaults to `check_address`
+logstash_port              | **Optional.** Port where Logstash is listening for API requests. Defaults to 9600
+logstash_filedesc_warn     | **Optional.** Warning threshold of file descriptor usage in percent. Defaults to 85 (percent).
+logstash_filedesc_crit     | **Optional.** Critical threshold of file descriptor usage in percent. Defaults to 95 (percent).
+logstash_heap_warn         | **Optional.** Warning threshold of heap usage in percent. Defaults to 70 (percent).
+logstash_heap_crit         | **Optional.** Critical threshold of heap usage in percent Defaults to 80 (percent).
+logstash_inflight_warn     | **Optional.** Warning threshold of inflight events.
+logstash_inflight_crit     | **Optional.** Critical threshold of inflight events.
+logstash_cpu_warn          | **Optional.** Warning threshold for cpu usage in percent.
+logstash_cpu_crit          | **Optional.** Critical threshold for cpu usage in percent.
index 2358b4b1f932f7f1d081ca95a806d92c4de712ce..1b74b5abbe0d83be442c828510a786d53e72b187 100644 (file)
@@ -16,6 +16,6 @@
 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA.
 
 install(
-  FILES databases.conf icingacli.conf ipmi.conf network-components.conf operating-system.conf virtualization.conf vmware.conf storage.conf web.conf hardware.conf network-services.conf metrics.conf
+  FILES databases.conf icingacli.conf ipmi.conf logmanagement.conf network-components.conf operating-system.conf virtualization.conf vmware.conf storage.conf web.conf hardware.conf network-services.conf metrics.conf
   DESTINATION ${CMAKE_INSTALL_DATADIR}/icinga2/include/plugins-contrib.d
 )
diff --git a/itl/plugins-contrib.d/logmanagement.conf b/itl/plugins-contrib.d/logmanagement.conf
new file mode 100644 (file)
index 0000000..a85f943
--- /dev/null
@@ -0,0 +1,72 @@
+/******************************************************************************
+ * 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.             *
+ ******************************************************************************/
+
+object CheckCommand "logstash" {
+       import "plugin-check-command"
+       command = [ PluginContribDir + "/check_logstash" ]
+       arguments = {
+               "-H" = {
+                       value = "$logstash_hostname$"
+                       description = "Hostname where Logstash is running"
+               }
+               "-p" = {
+                       value = "$logstash_port$"
+                       description = "Port where Logstash is listening for API requests"
+               }
+               "--file-descriptor-threshold-warn" = {
+                       value = "$logstash_filedesc_warn$"
+                       description = "Warning threshold of file descriptor usage in percent"
+               }
+               "--file-descriptor-threshold-crit" = {
+                       value = "$logstash_filedesc_crit$"
+                       description = "Critical threshold of file descriptor usage in percent"
+               }
+               "--heap-usage-threshold-warn" = {
+                       value = "$logstash_heap_warn$"
+                       description = "Warning threshold of heap usage in percent"
+               }
+               "--heap-usage-threshold-crit" = {
+                       value = "$logstash_heap_crit$"
+                       description = "Critical threshold of heap usage in percent"
+               }
+               "--inflight-events-warn" = {
+                       value = "$logstash_inflight_warn$"
+                       description = "Warning threshold of inflight events"
+               }
+               "--inflight-events-crit" = {
+                       value = "$logstash_inflight_crit$"
+                       description = "Critical threshold of inflight events"
+               }
+               "--cpu-usage-threshold-warn" = {
+                       value = "$logstash_cpu_warn$"
+                       description = "Warning threshold for cpu usage in percent"
+               }
+               "--cpu-usage-threshold-crit" = {
+                       value = "$logstash_cpu_crit$"
+                       description = "Critical threshold for cpu usage in percent"
+               }
+
+       }
+       vars.logstash_hostname = "$check_address$"
+       vars.logstash_port = 9600
+       vars.logstash_filedesc_warn = 85
+       vars.logstash_filedesc_crit = 95
+       vars.logstash_heap_warn = 70
+       vars.logstash_heap_crit = 80
+}