Metadata-Version: 2.1
Name: service-stats
Version: 1.0.2
Summary: Service serves savvy server stats.
Home-page: http://github.com/justintime50/service
Author: Justintime50
License: MIT
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.6
Description-Content-Type: text/markdown
Requires-Dist: psutil (>=5.7.0)
Requires-Dist: slackclient (>=2.7.0)
Requires-Dist: python-dotenv (>=0.13.0)
Provides-Extra: dev
Requires-Dist: pylint (>=2.5.0) ; extra == 'dev'

<div align="center">

# Service

Service serves savvy server stats.

[![Build Status](https://travis-ci.com/Justintime50/service.svg?branch=master)](https://travis-ci.com/Justintime50/service)
[![MIT Licence](https://badges.frapsoft.com/os/mit/mit.svg?v=103)](https://opensource.org/licenses/mit-license.php)

<img src="assets/showcase.png">

</div>

Service is completely configurable, allowing you to request data about boot time, CPU usage, disk usage, memory usage, network usage, and system information. You can send all this right to Slack. Great for a daily/weekly server snapshot of what's going on. Build custom logic to warn you about high CPU/memory usage or low available disk space.

## Install

```bash
# Install Service
pip3 install service-stats

# Setup Slack ENV variables (optional)
cp .env.example .env
```

## Usage

Grab all server data and send it to Slack.

```
Usage:
    service --boot --cpu --disk --memory --network --system --slack

Options:
    -b, --boot      Show boot stats
    -c, --cpu       Show CPU stats
    -d, --disk      Show disk stats
    -m, --memory    Show memory stats
    -n, --network   Show network stats
    -s, --system    Show system stats
    -sl, --slack    Send Service report to Slack (must configure ENV variables)
    -h, --help      Show package usage help
```

## Cron

```bash
crontab -e

0 9 * * 1 service --boot --cpu --disk --memory --network --system --slack
```

## Development

Install project with dev depencencies:

```bash
pip3 install -e ."[dev]"
```

Lint the project:

```bash
pylint service/*.py
```

## Attribution

Based on [this article](https://www.thepythoncode.com/article/get-hardware-system-information-python).


