srv-stage/nagios.yml
2025-01-19 20:23:14 +01:00

48 lines
966 B
YAML

---
- name: install nagios and nagios plugin
dnf:
name:
- nagios
- nagios-plugins-dns
- nagios-plugins-mysql
- nagios-plugins-smtp
- nagios-plugins-ldap
- nagios-plugins-tcp
- name: copy somes nagios-plugins
copy:
src: "nagios/{{ item }}"
dest: "/usr/lib64/nagios/plugins/{{ item }}"
mode: 0755
with_items:
- check_ftp.pl
- check_site.sh
- sgichk_imap_inboxcount
- name: copy nagios config file
copy:
src: "nagios/{{ item }}"
dest: "/etc/nagios/{{ item }}"
with_items:
- cgi.cfg
- nagios.cfg
- name: copy monitoring config files
copy:
src: "nagios/{{ item }}"
dest: "/etc/nagios/objects/{{ item }}"
with_items:
- commands.cfg
- contacts.cfg
- timeperiods.cfg
- templates.cfg
- hostsgroup.cfg
- srv-stage.cfg
- workstation.cfg
- name: start and enable service
systemd_service:
name: nagios
state: started
enabled: yes