]> granicus.if.org Git - icinga2/commitdiff
ITL: Fix check_logfiles definition and documentation 7223/head
authorMichael Insel <michael@insel.email>
Thu, 11 Jul 2019 17:14:38 +0000 (19:14 +0200)
committerMichael Insel <michael@insel.email>
Thu, 11 Jul 2019 17:31:37 +0000 (19:31 +0200)
This fixes several issues with the ITL definition for the check plugin
check_logfiles.

* Moved the documentation parts into the Log Management section.

* Moved the CheckCommand parts into logmanagement.conf and dropped
logfiles.conf

* Renamed the CheckCommand to logfiles

* Removed the .pl suffix in the command attribute

* Removed the -H argument since its unknown to the plugin

* Fixed typo in documentation parts

doc/10-icinga-template-library.md
itl/plugins-contrib.d/logfiles.conf [deleted file]
itl/plugins-contrib.d/logmanagement.conf

index 0a99e531dad3d707578f8f9d81e85e65c7a1b42c..e96ae5e35ac4f140ae2efb6a11bca39f00c3d9d9 100644 (file)
@@ -2861,9 +2861,30 @@ ping_packets                     | **Optional.** The number of packets to send.
 ping_timeout                     | **Optional.** The plugin timeout in seconds. Defaults to 0 (no timeout).
 
 
-### Log Files <a id="plugins-contrib-log-files"></a>
+### Log Management <a id="plugins-contrib-log-management"></a>
+
+This category includes all plugins for log management, for example [Logstash](https://www.elastic.co/products/logstash).
 
-This category includes all plugins for matching log files.
+#### logstash <a id="plugins-contrib-command-logstash"></a>
+
+The [logstash](https://github.com/widhalmt/check_logstash) plugin connects to
+the Node API of Logstash. This plugin requires at least Logstash version 5.0.x.
+
+The Node API is not activated by default. You have to configure your Logstash
+installation in order to allow plugin connections.
+
+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.
 
 #### logfiles <a id="plugins-contrib-command-logfiles"></a>
 
@@ -2872,9 +2893,8 @@ specified patterns in log files.
 
 Name                        | Description
 ----------------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-logfiles_hostname           | **Optional.** Hostname where log files are
 logfiles_tag                | **Optional.** A short unique descriptor for this search. It will appear in the output of the plugin and is used to separare the different services.
-logfiles_tag                | **Optional.** This is the name of the log file you want to scan.
+logfiles_logfile            | **Optional.** This is the name of the log file you want to scan.
 logfiles_rotation           | **Optional.** This is the method how log files are rotated. One of the predefined methods or a regular expression, which helps identify the rotated archives. If this key is missing, check_logfiles assumes that the log file will be simply overwritten instead of rotated.
 logfiles_critical_pattern   | **Optional.** A regular expression which will trigger a critical error.
 logfiles_warning_pattern    | **Optional.** A regular expression which will trigger a warning error.
@@ -2886,7 +2906,7 @@ logfiles_syslog_server      | **Optional.** With this option you limit the patte
 logfiles_syslog_client      | **Optional.** With this option you limit the pattern matching to lines originating from the host named in this option.
 logfiles_sticky             | **Optional.** Errors are propagated through successive runs.
 logfiles_unstick            | **Optional.** Resets sticky errors.
-logfiles_config             | **Optional.** Te name of a configuration file.
+logfiles_config             | **Optional.** The name of a configuration file.
 logfiles_configdir          | **Optional.** The name of a configuration directory. Configfiles ending in .cfg or .conf are (recursively) imported.
 logfiles_searches           | **Optional.** A list of tags of those searches which are to be run. Using this parameter, not all searches listed in the config file are run, but only those selected.
 logfiles_selectedsearches   | **Optional.** A list of tags of those searches which are to be run. Using this parameter, not all searches listed in the config file are run, but only those selected.
@@ -2899,32 +2919,6 @@ logfiles_warning            | **Optional.** Complex handler-scripts can be provi
 logfiles_critical           | **Optional.** Complex handler-scripts can be provided with a critical-parameter this way. Inside the scripts the value is accessible as the macro CL_CRITICAL.
 
 
-### Log Management <a id="plugins-contrib-log-management"></a>
-
-This category includes all plugins for log management, for example [Logstash](https://www.elastic.co/products/logstash).
-
-#### logstash <a id="plugins-contrib-command-logstash"></a>
-
-The [logstash](https://github.com/widhalmt/check_logstash) plugin connects to
-the Node API of Logstash. This plugin requires at least Logstash version 5.0.x.
-
-The Node API is not activated by default. You have to configure your Logstash
-installation in order to allow plugin connections.
-
-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.
-
-
 ### Metrics <a id="plugin-contrib-metrics"></a>
 
 This category includes all plugins for metric-based checks.
diff --git a/itl/plugins-contrib.d/logfiles.conf b/itl/plugins-contrib.d/logfiles.conf
deleted file mode 100644 (file)
index dd13c7c..0000000
+++ /dev/null
@@ -1,115 +0,0 @@
-/*
- * Icinga2 CheckCommand definitions to monitor log files using check_logfiles.
- * The check_logfiles is a Plugin for Icinga which scans log files for specific patterns.
- * Available from here: https://labs.consol.de/nagios/check_logfiles/
- */
-
-object CheckCommand "log" {
-       import "ipv4-or-ipv6"
-
-       command = [ PluginContribDir + "/check_logfiles.pl" ]
-
-       arguments = {
-               "-H" = {
-                       value = "$logfiles_hostname$"
-                       description = "Hostname where log files are."
-               }
-               "--tag" = {
-                       value = "$logfiles_tag$"
-                       description = "A short unique descriptor for this search. It will appear in the output of the plugin and is used to separare the different services."
-               }
-               "--logfile" = {
-                       value = "$logfiles_logfile$"
-                       description = "This is the name of the log file you want to scan."
-               }
-               "--rotation" = {
-                       value = "$logfiles_rotation$"
-                       description = "This is the method how log files are rotated. One of the predefined methods or a regular expression, which helps identify the rotated archives. If this key is missing, check_logfiles assumes that the log file will be simply overwritten instead of rotated."
-               }
-               "--criticalpattern" = {
-                       value = "$logfiles_critical_pattern$"
-                       description = "A regular expression which will trigger a critical error."
-               }
-               "--warningpattern" = {
-                       value = "$logfiles_warning_pattern$"
-                       description = "A regular expression which will trigger a warning error."
-               }
-               "--criticalexception" = {
-                       value = "$logfiles_critical_exception$"
-                       description = "A regular expression, the exceptions which are not counted as critical errors."
-               }
-               "--warningexception" = {
-                       value = "$logfiles_warning_exception$"
-                       description = "A regular expression, the exceptions which are not counted as warning errors."
-               }
-               "--okpattern" = {
-                       value = "$logfiles_ok_pattern$"
-                       description = "A regular expression which resets the error counters."
-               }
-               "--noprotocol" = {
-                       set_if = "$logfiles_no_protocol$"
-                       description = "Normally all the matched lines are written into a protocol file with this file’s name appearing in the plugin’s output. This option switches this off."
-               }
-               "--syslogserver" = {
-                       set_if = "$logfiles_syslog_server$"
-                       description = "With this option you limit the pattern matching to lines originating from the host check_logfiles is running on."
-               }
-               "--syslogclient" = {
-                       value = "$logfiles_syslog_client$"
-                       description = "With this option you limit the pattern matching to lines originating from the host named in this option."
-               }
-               "--sticky" = {
-                       value = "$logfiles_sticky$"
-                       description = "Errors are propagated through successive runs."
-               }
-               "--unstick" = {
-                       set_if = "$logfiles_unstick$"
-                       description = "Resets sticky errors."
-               }
-               "--config" = {
-                       value = "$logfiles_config$"
-                       description = "Te name of a configuration file."
-               }
-               "--configdir" = {
-                       value = "$logfiles_configdir$"
-                       description = "The name of a configuration directory. Configfiles ending in .cfg or .conf are (recursively) imported."
-               }
-               "--searches" = {
-                       value = "$logfiles_searches$"
-                       description = "A list of tags of those searches which are to be run. Using this parameter, not all searches listed in the config file are run, but only those selected."
-               }
-               "--selectedsearches" = {
-                       value = "$logfiles_selectedsearches$"
-                       description = "A list of tags of those searches which are to be run. Using this parameter, not all searches listed in the config file are run, but only those selected."
-               }
-               "--report" = {
-                       value = "$logfiles_report$"
-                       description = "This option turns on multiline output (Default: off). The setting html generates a table which display the last hits in the service details view. Possible values are: short, long, html or off"
-               }
-               "--maxlength" = {
-                       value = "$logfiles_max_length$"
-                       description = "With this parameter long lines are truncated (Default: off). Some programs (e.g. TrueScan) generate entries in the eventlog of such a length, that the output of the plugin becomes longer than 1024 characters. NSClient++ discards these."
-               }
-               "--winwarncrit" = {
-                       value = "$logfiles_winwarncrit$"
-                       description = "With this parameter messages in the eventlog are classified by the type WARNING/ERROR (Default: off). Replaces or complements warning/criticalpattern."
-               }
-               "--rununique" = {
-                       set_if = "$logfiles_run_unique$"
-                       description = "This parameter prevents check_logfiles from starting when there’s already another instance using the same config file. (exits with UNKNOWN)"
-               }
-               "--timeout" = {
-                       value = "$logfiles_timeout$"
-                       description = "This parameter causes an abort of a running search after a defined number of seconds. It is an aborted in a controlled manner, so that the lines which have been read so far, are used for the computation of the final result."
-               }
-               "--warning" = {
-                       value = "$logfiles_warning$"
-                       description = "Complex handler-scripts can be provided with a warning-parameter this way. Inside the scripts the value is accessible as the macro CL_WARNING."
-               }
-               "--critical" = {
-                       value = "$logfiles_critical$"
-                       description = "Complex handler-scripts can be provided with a critical-parameter this way. Inside the scripts the value is accessible as the macro CL_CRITICAL."
-               }
-       }
-       vars.logfiles_hostname = "$check_address$"
-}
index fbfa0445ad14131428ed628478e60896ef71c611..16cafe0441fe0864da24715b88464d08007918a8 100644 (file)
@@ -55,3 +55,106 @@ object CheckCommand "logstash" {
        vars.logstash_heap_warn = 70
        vars.logstash_heap_crit = 80
 }
+
+object CheckCommand "logfiles" {
+       command = [ PluginContribDir + "/check_logfiles" ]
+
+       arguments = {
+               "--tag" = {
+                       value = "$logfiles_tag$"
+                       description = "A short unique descriptor for this search. It will appear in the output of the plugin and is used to separare the different services."
+               }
+               "--logfile" = {
+                       value = "$logfiles_logfile$"
+                       description = "This is the name of the log file you want to scan."
+               }
+               "--rotation" = {
+                       value = "$logfiles_rotation$"
+                       description = "This is the method how log files are rotated. One of the predefined methods or a regular expression, which helps identify the rotated archives. If this key is missing, check_logfiles assumes that the log file will be simply overwritten instead of rotated."
+               }
+               "--criticalpattern" = {
+                       value = "$logfiles_critical_pattern$"
+                       description = "A regular expression which will trigger a critical error."
+               }
+               "--warningpattern" = {
+                       value = "$logfiles_warning_pattern$"
+                       description = "A regular expression which will trigger a warning error."
+               }
+               "--criticalexception" = {
+                       value = "$logfiles_critical_exception$"
+                       description = "A regular expression, the exceptions which are not counted as critical errors."
+               }
+               "--warningexception" = {
+                       value = "$logfiles_warning_exception$"
+                       description = "A regular expression, the exceptions which are not counted as warning errors."
+               }
+               "--okpattern" = {
+                       value = "$logfiles_ok_pattern$"
+                       description = "A regular expression which resets the error counters."
+               }
+               "--noprotocol" = {
+                       set_if = "$logfiles_no_protocol$"
+                       description = "Normally all the matched lines are written into a protocol file with this file’s name appearing in the plugin’s output. This option switches this off."
+               }
+               "--syslogserver" = {
+                       set_if = "$logfiles_syslog_server$"
+                       description = "With this option you limit the pattern matching to lines originating from the host check_logfiles is running on."
+               }
+               "--syslogclient" = {
+                       value = "$logfiles_syslog_client$"
+                       description = "With this option you limit the pattern matching to lines originating from the host named in this option."
+               }
+               "--sticky" = {
+                       value = "$logfiles_sticky$"
+                       description = "Errors are propagated through successive runs."
+               }
+               "--unstick" = {
+                       set_if = "$logfiles_unstick$"
+                       description = "Resets sticky errors."
+               }
+               "--config" = {
+                       value = "$logfiles_config$"
+                       description = "The name of a configuration file."
+               }
+               "--configdir" = {
+                       value = "$logfiles_configdir$"
+                       description = "The name of a configuration directory. Configfiles ending in .cfg or .conf are (recursively) imported."
+               }
+               "--searches" = {
+                       value = "$logfiles_searches$"
+                       description = "A list of tags of those searches which are to be run. Using this parameter, not all searches listed in the config file are run, but only those selected."
+               }
+               "--selectedsearches" = {
+                       value = "$logfiles_selectedsearches$"
+                       description = "A list of tags of those searches which are to be run. Using this parameter, not all searches listed in the config file are run, but only those selected."
+               }
+               "--report" = {
+                       value = "$logfiles_report$"
+                       description = "This option turns on multiline output (Default: off). The setting html generates a table which display the last hits in the service details view. Possible values are: short, long, html or off"
+               }
+               "--maxlength" = {
+                       value = "$logfiles_max_length$"
+                       description = "With this parameter long lines are truncated (Default: off). Some programs (e.g. TrueScan) generate entries in the eventlog of such a length, that the output of the plugin becomes longer than 1024 characters. NSClient++ discards these."
+               }
+               "--winwarncrit" = {
+                       value = "$logfiles_winwarncrit$"
+                       description = "With this parameter messages in the eventlog are classified by the type WARNING/ERROR (Default: off). Replaces or complements warning/criticalpattern."
+               }
+               "--rununique" = {
+                       set_if = "$logfiles_run_unique$"
+                       description = "This parameter prevents check_logfiles from starting when there’s already another instance using the same config file. (exits with UNKNOWN)"
+               }
+               "--timeout" = {
+                       value = "$logfiles_timeout$"
+                       description = "This parameter causes an abort of a running search after a defined number of seconds. It is an aborted in a controlled manner, so that the lines which have been read so far, are used for the computation of the final result."
+               }
+               "--warning" = {
+                       value = "$logfiles_warning$"
+                       description = "Complex handler-scripts can be provided with a warning-parameter this way. Inside the scripts the value is accessible as the macro CL_WARNING."
+               }
+               "--critical" = {
+                       value = "$logfiles_critical$"
+                       description = "Complex handler-scripts can be provided with a critical-parameter this way. Inside the scripts the value is accessible as the macro CL_CRITICAL."
+               }
+       }
+}