diff --git a/manifests/commands/definition_rules.pp b/manifests/commands/definition_rules.pp index c63e6e6..f07f31b 100644 --- a/manifests/commands/definition_rules.pp +++ b/manifests/commands/definition_rules.pp @@ -67,8 +67,9 @@ class confdroid_nrpe::commands::definition_rules ( } confdroid_nrpe::commands::definitions { 'check_fail2ban': + ne_check_name => 'check_fail2ban', ne_check_cmd => 'check_procs', - ne_cmd_argstring => '-c $ARG1$ -C $ARG2$', + ne_cmd_argstring => '-c $ARG1$ -a $ARG2$', } } } diff --git a/manifests/commands/definitions.pp b/manifests/commands/definitions.pp index 6f54e6d..1ac78c0 100644 --- a/manifests/commands/definitions.pp +++ b/manifests/commands/definitions.pp @@ -12,13 +12,19 @@ # checks. # @param [String] ne_cmd_comment Specify an optional comment for your command # definition +# @param [String] ne_check_name Specify an optional name for the check, +# if you want to use a different name than the check_command. +# This is useful if you want to use the same check_command with +# different arguments, e.g. check_procs with different argument strings for +#different checks. ############################################################################### define confdroid_nrpe::commands::definitions ( + String $ne_check_name = 'check_procs', Optional[String] $ne_check_cmd = undef, String $ne_cmd_path = '/usr/lib64/nagios/plugins/', Optional[String] $ne_cmd_argstring = undef, - String $ne_cmd_comment = '', + Optional[String] $ne_cmd_comment = undef, ) { $ne_cmd_file = $confdroid_nrpe::params::ne_cmd_file diff --git a/templates/cmd_rule.erb b/templates/cmd_rule.erb index 0b7d5ea..76a327c 100644 --- a/templates/cmd_rule.erb +++ b/templates/cmd_rule.erb @@ -2,4 +2,4 @@ <% unless @ne_cmd_comment.empty? -%> # <%= @ne_cmd_comment %> <% end -%> -command[<%= @ne_check_cmd %>]=<%= @ne_cmd_path %><%= @ne_check_cmd %> <%= @ne_cmd_argstring %> +command[<%= @ne_check_name %>]=<%= @ne_cmd_path %><%= @ne_check_cmd %> <%= @ne_cmd_argstring %>