Linux Host
Description
This Ansible playbook automates the configuration of Nagios monitoring for Linux hosts. It sets hostgroup facts based on the OS distribution.
The playbook uses the Nagios XI REST API to create a host object and multiple service objects (e.g., CPU, memory, disk usage, network, and processes) for monitoring. Each service is configured with specific parameters like check periods, notification settings, and hostgroups. Debugging messages provide visibility into the process, including API URIs and hostgroup assignments.
Credentials
- sys_ansible_local
- mon-nagios-credential-sys_daf_nagios_write
Input
| Variable | Description |
|---|---|
target |
Target Linux host to add to Nagios |
nagios_server |
Nagios server hostname |
nagios_host_prio |
Piority of the Host, prio 1 hosts also send messages to person on-call (e.g., 1, 2) |
Output
None