idiv-biodiversity.nrpe
Ansible 角色:Nagios 远程插件执行器 (NRPE)
一个安装和配置 NRPE 的 Ansible 角色。
目录
要求
- Ansible 2+
角色变量
以下是所有变量及其默认值:
nrpe_log_facility: 'daemon'
nrpe_pid_file: '/var/run/nrpe/nrpe.pid'
nrpe_server_port: '5666'
nrpe_user: 'nrpe'
nrpe_group: 'nrpe'
nrpe_allowed_hosts:
- '127.0.0.1'
- '::1'
nrpe_dont_blame: '0'
nrpe_allow_bash_command_substitution: '0'
nrpe_debug: '0'
nrpe_command_timeout: '60'
nrpe_connection_timeout: '300'
nrpe_commands:
- name: 'check_users'
line: '/usr/lib64/nagios/plugins/check_users -w 5 -c 10'
- name: 'check_load'
line: '/usr/lib64/nagios/plugins/check_load -r -w .15,.10,.05 -c .30,.25,.20'
- name: 'check_hda1'
line: '/usr/lib64/nagios/plugins/check_disk -w 20% -c 10% -p /dev/hda1'
- name: 'check_zombie_procs'
line: '/usr/lib64/nagios/plugins/check_procs -w 5 -c 10 -s Z'
- name: 'check_total_procs'
line: '/usr/lib64/nagios/plugins/check_procs -w 150 -c 200'
依赖项
该角色 有条件 依赖于 geerlingguy.repo-epel,适用于 RedHat 系列的发行版,以安装运行时和构建依赖项。这些依赖项并非全部包含在默认的仓库中。
示例剧本
添加到 requirements.yml
:
---
# 可选
# - src: geerlingguy.repo-epel
- src: idiv-biodiversity.nrpe
...
下载:
$ ansible-galaxy install -r requirements.yml
顶层剧本
编写顶层剧本:
---
- name: 头服务器
hosts: head
roles:
- role: idiv-biodiversity.nrpe
tags:
- icinga
- nagios
- nrpe
...
角色依赖
在 meta/main.yml
中定义角色依赖:
---
dependencies:
- role: idiv-biodiversity.nrpe
tags:
- icinga
- nagios
- nrpe
...
许可证
MIT
作者信息
该角色由 Christian Krause 创建于 2017 年,他是 德意志整合生物多样性研究中心 (iDiv) 的高性能计算集群系统管理员,基于 Ben Langenberg(即 sloan87 at GitHub)的草稿。