This repository has been archived by the owner on Jul 3, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
42 additions
and
17 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -44,46 +44,71 @@ But feel free to [add a new one](#development)! | |
Optional. Print binary version. | ||
|
||
|
||
## Example | ||
## Install | ||
|
||
- With [Go](https://golang.org/): | ||
``` | ||
go get qvl.io/promplot | ||
``` | ||
|
||
- With [Homebrew](http://brew.sh/): | ||
``` | ||
brew install qvl/tap/promplot | ||
``` | ||
|
||
- Download from https://github.com/qvl/promplot/releases | ||
|
||
|
||
## Examples | ||
|
||
It's simple to create a shell script for multiple plots: | ||
|
||
### Slack | ||
|
||
```sh | ||
common="-url $promurl -channel stats -slack $slacktoken" | ||
common="-url $promurl -channel stats -slack $slacktoken -range 24h" | ||
|
||
promplot $common \ | ||
-title "Free memory in MB" \ | ||
-query "node_memory_MemFree /1024 /1024" \ | ||
-range "24h" | ||
-query "node_memory_MemFree /1024 /1024" | ||
|
||
promplot $common \ | ||
-title "Free disk space in GB" \ | ||
-query "node_filesystem_free /1024 /1024 /1024" \ | ||
-query "node_filesystem_free /1024 /1024 /1024" | ||
-range "24h" | ||
|
||
promplot $common \ | ||
-title "Open file descriptors" \ | ||
-query "process_open_fds" \ | ||
-range "24h" | ||
-query "process_open_fds" | ||
``` | ||
|
||
And with a scheduler like [sleepto](https://qvl.io/sleepto) you can easily automate this script to run every day or once a week. | ||
|
||
|
||
## Install | ||
### Mailing results | ||
|
||
- With [Go](https://golang.org/): | ||
``` | ||
go get qvl.io/promplot | ||
``` | ||
There is no mail transport built into promplot but you can use the Linux `mail` utility instead: | ||
|
||
- With [Homebrew](http://brew.sh/): | ||
``` | ||
brew install qvl/tap/promplot | ||
``` | ||
```sh | ||
tmp="$(mktemp -d)" | ||
common="-url $promurl -range 24h" | ||
|
||
- Download from https://github.com/qvl/promplot/releases | ||
promplot $common \ | ||
-title "Free memory in MB" \ | ||
-query "node_memory_MemFree /1024 /1024" \ | ||
-file ${tmp}/memory.png | ||
|
||
promplot $common \ | ||
-title "Open file descriptors" \ | ||
-query "process_open_fds" \ | ||
-file ${tmp}/fds.png | ||
|
||
echo "Your daily report is here." | mail \ | ||
-s "Daily server stats" \ | ||
-a ${tmp}/memory.png \ | ||
-a ${tmp}/fds.png \ | ||
[email protected] | ||
``` | ||
|
||
|
||
## Development | ||
|