From 303c624b0d79e79b163a3740078930c8a21e71e5 Mon Sep 17 00:00:00 2001 From: "Antonio J. Delgado" Date: Fri, 21 Oct 2022 10:02:45 +0300 Subject: [PATCH] Add .gitignore and readme --- .gitignore | 1 + README.md | 96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 97 insertions(+) create mode 100644 .gitignore create mode 100644 README.md diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..7ae557a --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +gitignoreme_* \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..46b2689 --- /dev/null +++ b/README.md @@ -0,0 +1,96 @@ +# Ansible Role Nagios server (version 4) + +This role install Apache2 and Nagios4 servers. + +## Supported distributions: + + - Ubuntu 20.04 focal + +## Requirements + +- Manually run httpwd to create the authentication file +- Check the template apache_vhost.j2 for the path to SSL certificates and update it. + +## To-Do + +- Option to generate SSL certificate with let's encrypt + +## Role Variables + +Check defaults/main.yml for a working example. + +### General variables + +nagios_user: System user to run nagios +nagios_group: System group of the nagios_user +auth_user_file: File to store user and password with access to the web interface. + +### Dictionary nagios4_config + +This dictionary will be read (using .items()) to generate the file /etc/nagios4/nagios.cfg so any supported Nagios4 configuration can be included + +### Dictionary cgi_config + +This dictionary will be read (using .items()) to generate the file /etc/nagios4/cgi.cfg so any supported Nagios4 configuration can be included + +### List monitored_hosts + +This is list of monitored hosts clients, optionally can include services specific for the host, but it's recommended to reduce this usage and include as many services as possible in the hostgroups list. + +Example: +```yaml + - host_name: localhost + use: linux-server + alias: Server0 + address: 127.0.0.1 + services: + - use: local-service + description: PING + check_command: check_ping!100.0,20%!500.0,60% +``` + + +### List hostgroups + +This is a list of groups and their members (you have to declare the same members as hosts in monitored_hosts). + +```yaml + - hostgroup_name: linux servers + alias: Linux Servers + members: + - localhost + - server1 + services: + - service_description: 'PING' + check_command: "check_ping!200.0,20%!500.0,60%" +``` + +### Other lists +There are similar list of objects supported by Nagios like: +- commands +- contacts +- templates +- timeperiods + + +### Apache specific virtual hosts list + +The list vhosts contains at least one virtual host to configure Apache2. +```yaml + - vhost_name: nagios4.example.org + serveradmin: webmaster@example.org + vhost_aliases: nagios.example.org + ssl_certificate_file: "/etc/letsencrypt/live/nagios4.example.org/fullchain.pem" + ssl_certificate_key_file: "/etc/letsencrypt/live/nagios4.example.org/privkey.pem" + ssl_certificate_chain_file: "/usr/local/apache2/conf/ssl/ca_bundle.crt" # optional +``` + +## Dependencies + +None + +## License +GPLv3 + +## Author Information +This role was created in 2022 by Antonio J. Delgado (ajdelgado).