Add .gitignore and readme
This commit is contained in:
parent
2741594c4d
commit
303c624b0d
2 changed files with 97 additions and 0 deletions
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
|
@ -0,0 +1 @@
|
|||
gitignoreme_*
|
96
README.md
Normal file
96
README.md
Normal file
|
@ -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).
|
Loading…
Reference in a new issue