Playbook created to install rstatus in a host machine.
You must install Ansible.
user:~$ mkvirtualenv ansibleve
(ansibleve) user:~$ pip install ansible
This Ansible playbook is intended to be used as a base to install rstatus in any hosts to be monitored.
However, if you use it as it is it will expect the following environment:
- One redis server.
- Two sample hosts whose performance will be measured.
To simply create these machines using Vagrant go to this directory (playbook/) and run:
vagrant up
The inventory file describes the hosts which will be instrumented with rstatus.
By default, it refers to the hosts from the experimental environment.
If you want to instrument other hosts, simply update hosts file.
This playbook copies config.yml to each host and uses it as a base to define which features must be measured and sent to the database.
Therefore, if you want to measure other aspects, please change the file to refer to other psutil methods. To check that you have changed it properly, run:
# Cd to the root of this project
python rstatus/config.py -config config.yml
This will print the psutil methods that will be called.
Depending on you needs, you will need to follow one of the following instructions:
-
Do nothing. If you ran vagrant up and everything went smoothly, then everything should be installed and working.
-
Do all the magic. This option installs redis in the server and installs rstatus in all the machines whose performance wants to be measured.
ansible-playbook -vvvv -u vagrant --private-key=[private-key-location] -l 'local' -i hosts main.yml
-
Just instrument the hosts to be measured.
ansible-playbook -vvvv -u vagrant --private-key=[private-key-location] -l 'local' -i hosts measuredhosts.yml
To check that hosts are sending their measures to the Redis server, try the following:
$ redis-cli -h [host] -p [port]
> select [db_number]
> keys "*/*"
This will return the hosts that have send their measures and the types of measures. If any of the hosts where you have installed rstatus is not listed, something went wrong. A return sample could be:
1) "host1/cpu_percent"
2) "host2/cpu_percent"
3) "host1/disk_partitions"
Note that if you have deployed the experimental environment mentioned above, host will correspond to localhost and port to 16379.