Created
January 6, 2024 04:04
-
-
Save jhowbhz/8287559f1dcb30b746fd18d95869e598 to your computer and use it in GitHub Desktop.
Monitoring script for apibrasil
This file contains hidden or 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
#! /bin/bash | |
MEMORY=$(free -m | awk 'NR==2{printf "%6.2f%%", $3*100/$2 }') | |
DISK=$(df -h | awk '$NF=="/"{printf "%6s", $5}') | |
CPU=$(top -bn1 | grep load | awk '{printf "%6.2f%%", $(NF-2)}') | |
MESSAGE="*Servidor*\n-----\n*Servidor:* APIS\n*Memória*: $MEMORY\n*Disco*:$DISK\n*CPU:*$CPU" | |
curl --location 'https://gateway.apibrasil.io/api/v2/whatsapp/sendText' \ | |
--header 'Content-Type: application/json' \ | |
--header 'DeviceToken: YOUR_DEVICE_TOKEN' \ | |
--header 'Authorization: Bearer YOUR_AUTH_TOKEN' \ | |
--data '{ | |
"number": "YOUR_PHONE_NUMBER", | |
"text": "'"$MESSAGE"'", | |
"time_typing": 1 | |
}' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment