sysstat_webhook : add some context
This commit is contained in:
parent
124eb748eb
commit
223d245d18
@ -1,18 +1,40 @@
|
|||||||
# Sysstat_Webhook
|
# Sysstat_Webhook
|
||||||
|
|
||||||
currently, WIP. But yeah, Discord sucks! They don't rendering SVG.
|
currently, WIP. But yeah, Discord sucks! They don't rendering SVG.
|
||||||
|
# Required Package
|
||||||
```
|
```
|
||||||
sudo apt install -y librsvg2-bin
|
sudo apt install -y librsvg2-bin
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Arguments
|
||||||
```
|
```
|
||||||
w) webhook_url=${OPTARG};; # Discord Webhook URL
|
w) webhook_url=${OPTARG};; # Discord Webhook URL
|
||||||
c) CPU="True";; # CPU
|
c) CPU="True";; # CPU
|
||||||
r) RAM="True";; # RAM
|
r) RAM="True";; # RAM
|
||||||
d) DISK_IO="True";; # DISK I/O
|
d) DISK_IO="True";; # DISK I/O
|
||||||
n) NETWORK="True";; # Network
|
n) NETWORK="True";; # Network
|
||||||
|
t) MESSAGE_TEXT=${OPTARG};; # Add some text to your webhook message!
|
||||||
f) datafile=${OPTARG};; # where your data belongs!
|
f) datafile=${OPTARG};; # where your data belongs!
|
||||||
|
o) SYSSTAT_OPTIONS=${OPTARG};; # Sysstat options
|
||||||
```
|
```
|
||||||
|
|
||||||
|
# Basic running
|
||||||
```
|
```
|
||||||
curl -sL https://github.com/minoplhy/scriptbox/raw/main/sysstat_webhook/stat_discord.sh | bash -s -- -w WEBHOOK_URL ARGUMENTS GOES HERE!
|
curl -sL https://github.com/minoplhy/scriptbox/raw/main/sysstat_webhook/stat_discord.sh | bash -s -- -w <WEBHOOK_URL> ARGUMENTS GOES HERE!
|
||||||
|
```
|
||||||
|
|
||||||
|
# Sample usage
|
||||||
|
|
||||||
|
This will get stats from previous day , and the webhook message will be yesterday date.
|
||||||
|
|
||||||
|
something like this :
|
||||||
|
|
||||||
|
![Yesterday date](assets/screenshot.png)
|
||||||
|
|
||||||
|
```
|
||||||
|
text=$(date -d '-1 day' '+%Y-%m-%d')
|
||||||
|
d1=$(date -d '-1 day' '+%d')
|
||||||
|
file=/var/log/sysstat/sa$d1
|
||||||
|
|
||||||
|
curl -sL https://github.com/minoplhy/scriptbox/raw/main/sysstat_webhook/stat_discord.sh | bash -s -- -w <WEBHOOK_URL> -c -f "$file" -t "$text
|
||||||
```
|
```
|
BIN
sysstat_webhook/assets/screenshot.png
Normal file
BIN
sysstat_webhook/assets/screenshot.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 41 KiB |
Loading…
Reference in New Issue
Block a user