Escolar Documentos
Profissional Documentos
Cultura Documentos
setup a monitoring solution using Icinga. Icinga should monitor the Apache Web Server and the
Mysql Database server and send logs to Amazon S3 dynamically using Bash Scripting.
Prerequisites
Require root access to an Ubuntu 14.04 server with terraform and ansible
Install Icinga
Run the following command to add the Icinga PPA to your package manager:
sudo add-apt-repository ppa:formorer/icinga
Now you will be presented with a series of prompts regarding your Icinga installation.
Here is a list of the prompts, and how you should answer them:
Enable the ido2db daemon to start on boot up, which stores Icinga events and configurations in
the database. Edit Icinga default configuration:
sudo vi /etc/default/icinga
The top row shows that the single monitored host is "Up", and the bottom row shows
that there are seven "OK" monitored services.
Now add the following, replacing the values of host_name with your own hostname (in
both places),alias with a description of the host, and address with the value of your
host's public IP address:
define host {
use
generic-host
host_name
web-1
alias
A Web Server
address
203.143.xxx.xxx
}
define service {
use
generic-service
host_name
web-1
service_description
HTTP
check_command
check_http
Now save and quit. Reload your Icinga configuration to put any changes into effect:
sudo service icinga reload
Install Docker
Docker ps
Automations
You can write playbook in order to automate deployment task, all required files are
attached with the document
ansible-playbook -i hosts -vv run-ansible.yml