Skip to content

Latest commit

 

History

History

playbook

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Playbook

Playbook created to install rstatus in a host machine.

Requirements

You must install Ansible.

user:~$ mkvirtualenv ansibleve
(ansibleve) user:~$ pip install ansible

Creation of the experimental environment

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

Changing the inventory file

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.

Measuring other variables

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.

Usage

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
    

Check that everything works

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.