Host stats
Project description
hoststats
hoststats
captures resource usage (CPU, memory, network, disk) on a set of
remote hosts over a period of time.
Collection can be started and stopped from a client host via HTTP or the included Python API. Results are written to a CSV file on the client machine.
Usage
Install:
pip3 install hoststats
Start the hoststats server (must be done on each host on which you wish to collect stats). Note that this runs in the foreground, so you can put it to the background however you see fit, e.g.
nohup hoststats start > /var/log/hoststats.log 2>&1 &
Check it's up with:
curl <hostname>:5000/ping
Create a client on another host with:
from hostats.client import HostStats
# Get list of IPs/ hostnames for hosts to be monitored
ip_list = ["1.2.3.4", "5.6.7.8"]
# Set up the client
hs = HostStats(ip_list)
# Start collection
hs.start_collection()
# Wait some time
# Write stats to CSV
hs.stop_and_write_to_csv("hoststats.csv")
Development
Ensure pip
and setuptools
are up to date and install requirements.
To develop:
pip3 install -e .
Run tests:
./bin/tests.sh
Releasing
To push to PyPI, make sure you have set up Twine keyring
support, or a
pypirc
.
Then increment the version in VERSION
.
Then:
# Tag the code
./bin/tag.sh
# Build the Docker image
./bin/build.sh
# Check the distributed tests passs
./bin/dist_test.sh
# Push the package
./bin/release.sh
Once everything looks good, create a release manually on Github.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for hoststats-0.0.5-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c943617b4d6984251ad93efddb767d5862080e7561bca48687d56d3c37e8007c |
|
MD5 | ede21c1d9ec0a95dc12dba96f2b6087f |
|
BLAKE2b-256 | e2b18d95b37f78d5b255c8885e933f50d1a05cd87b4a12e9744f61bea816d09b |