Claire is an open source CLI cluster management tool that works over SSH. It provides a fast and clear interface to the state of your servers.
To install Claire clone this repository in your personal folder and type:
$ cd claire && python setup.py install
To use Claire simply type in your shell:
$ claire stats
To run Claire as a daemon, you need to have super user privileges:
$ sudo claire stats --daemon
To stop the daemon:
$ sudo claire stats --stop-daemon
Claire uses by default the config file in /etc/claire/config. To use another file as config, type:
$ claire stats --conf <path of the config file>
The config file is an ini file structured in this way:
[default]
pidfile=<pid file location> DEFAULT=/etc/claire/claire.pid
interval=<check interval (only for daemon mode)> DEFAULT=300
[reporter]
name=<reporter name>
<reporter configuration key>=<reporter configuration value>
[loggers]
...
[handlers]
...
[formatters]
...
The config file contains also the logging configuration, in the standard python logging config format.
An example of the config file can be found in the config_example
folder.
The reporter is the object in charge of reporting the errors.
It inherits from the class Reporter, defined in reporter.py
,
which methods report_server and report_process are called
when an error occours reaching a server or checking for a process.
Claire uses by default the hosts file in /etc/claire/hosts. To use another file as hosts, type:
$ claire stats --hosts <path of the hosts file>
The hosts file is an ini file structured in this way:
[group_name]
host_name
check=<check if process with this name is active>
instances=<desired number of running instances of the process>
failure=<run this command in case of failure and retry>
An example of the hosts file can be found in the config_example
folder.
To only make Claire check for a single hosts group:
$ claire stats --group <group name>
- Make server checks parallel
- Check service status