Some useful bash scripts.
This repository has been archived on 2023-09-23. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2023-08-08 18:24:38 +00:00
node_exporter added 2021-06-12 03:00:17 +02:00
.gitignore added scripts and 2020-05-21 01:57:45 +02:00 Update '' 2023-08-08 18:24:38 +00:00 added scripts and 2020-05-21 01:57:45 +02:00
LICENSE Initial commit 2020-05-20 23:46:30 +00:00 updated node_exporter scripts 2021-05-16 00:27:56 +02:00 added 2021-06-12 03:00:17 +02:00 updated and 2020-06-15 18:00:27 +02:00 extended to send a notification if a reboot is needed 2021-01-12 20:38:21 +01:00 added scripts and 2020-05-21 01:57:45 +02:00


Some useful bash scripts.


Script Description Script to use as cron wrap to monitor the job with Script to send an alert on ssh login Script to validate server side rsync command to use ssh force command Script to call docker-compose up -d on all subdirectories Script to call du on a given directory to export the size to prometheus Script to call apt to check the host for new updates and notify in gotify


Script Description Script to export all active sessions to prometheus Script to export directory sizes to prometheus Script to export pending apt updates to prometheus


To set up all scripts in the current directory run this:

curl | bash -s


Just use it like this in a cronjob:

0 0 * * * /root/ 333a77a4-a63e-4885-a045-d52a4f6a3d2f /root/ > /root/log/last-backup.log 2>&1

The first parameter is the healthcheck uuid instead of the script file you can als pass the command to execute directly after the uuid. The pipe to put all output to a log file is also optional.

Place a .gotify file in the same direction as the script and put the application token in. Append the following line to /etc/pam.d/sshd:

session optional seteuid /path/to/


Add the following in crontab:

*/5 * * * * /root/exporter/ "<your_dir_pattern>" "<your_key>" | sponge /path/to/textfiles/directory-size.prom
* * * * * /root/exporter/ | sponge /path/to/textfiles/active-sessions.prom

Add the textfiles dir as param to node_exporter:

node_exporter /path/to/textfiles ...