Files
confdroid_nrpe/manifests/commands/definitions.pp

54 lines
2.1 KiB
ObjectPascal
Raw Normal View History

2017-07-28 16:52:39 +01:00
## cd_nrpe::commands::definitions.pp
# Module name: cd_nrpe
# Author: Arne Teuke (arne_teuke@ConfDroid.com)
# # License:
# This file is part of cd_nrpe.
#
# cd_nrpe is used for providing automatic configuration of NRPE.
# Copyright (C) 2016 ConfDroid (copyright@ConfDroid.com)
# 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 3 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, see <http://www.gnu.org/licenses/>.
2017-07-30 12:32:29 +01:00
# @summary Populate command definitions through external puppet rules, i.e.
# from other modules.
# @param [string] ne_check_cmd Specify the check_command to use.
# @param [string] ne_cmd_path The path to the command scripts, usually
# where the nagis_plugins are located. If you use your own scripts, specify
# the custom location **__including the trailing slash__**
# @param ne_cmd_argstring Specify the string of valid argument for the command
# , i.e. -w $ARG1$ -c $ARG2$. See the arguments in th eman pages for the
# checks.
2017-07-30 13:17:19 +01:00
# @param [string] ne_cmd_comment Specify an optional comment for your command
# definition
2017-07-28 16:52:39 +01:00
###############################################################################
define cd_nrpe::commands::definitions (
2017-07-30 12:32:29 +01:00
$ne_check_cmd = undef,
$ne_cmd_path = '/usr/lib64/nagios/plugins/',
$ne_cmd_argstring = undef,
2017-07-30 13:17:19 +01:00
$ne_cmd_comment = undef,
2017-07-28 16:56:18 +01:00
2017-07-28 16:52:39 +01:00
) {
2017-07-28 16:56:18 +01:00
2017-07-30 12:32:29 +01:00
$ne_cmd_file = $::cd_nrpe::params::ne_cmd_file
$ne_cmd_rule_erb = $::cd_nrpe::params::ne_cmd_rule_erb
$ne_manage_cmds = $::cd_nrpe::params::ne_manage_cmds
2017-07-28 17:31:53 +01:00
if $ne_manage_cmds == true {
2017-07-28 16:56:18 +01:00
concat::fragment { $name:
target => $ne_cmd_file,
content => template($ne_cmd_rule_erb),
}
2017-07-30 12:32:29 +01:00
}
2017-07-28 16:52:39 +01:00
}