Add a new server
Please note that for now only debian servers are supported. To add a new server to the icinga monitoring system, follow these steps:
Add the server in the Ansible playbook
Clone the repository and put the server address in the icinga2_clients section of thehosts file. This will:
- Create a "icinga" user
Add the SSH public key to the authorized_keys file of the new "icinga" user
- Install the monitoring plugin packages (monitoring-plugins)
Install custom plugins
Add the server in the icinga configuration
Add the server in the conf.d/hosts.conf file. Here is an example:
object Host "host1" { import "ssh-agent" address = "host1.example.org" address6 = "host1.example.org" # Ensure apache2 is running vars.service["apache2"] = { service_to_check = "apache2" } # Check disk space vars.disks["/"] = { disk_partition = "/" } # Check website vars.http_vhosts["examplepage"] = { http_uri = "/" http_vhost = "url.example.org" http_ssl = true } }
Please see the file conf.d/commands.conf for a list of already existing monitoring commands meant to be used via SSH. Please follow the steps in the page ../AddNewPlugin, for details about how to create new ones.
Deploy
To deploy the changed configuration, add your changes to the git repository and run the ansible playbook by following the intructions in the README.