Update linux_disk_usage.sh#159
Merged
silversword411 merged 9 commits intoamidaware:mainfrom Jun 14, 2023
Merged
Conversation
This is a cool script! I just made a few changes that I think may improve it: 1. Added a $WARNINGVALUE (which can be lower than the $ERRORVALUE. If the disk is only at warning stage, it will exit with error code 2 instead of 1. In TRMM, you can set code 2 to be a warning (in automation) so you have time to fix the issue before it gets critical. 2. Added the option to change the warning and error value with ENV VARs so you don't need to change the code if they don't suit you, or you can customise it for different servers. 3. Rather than incrementing, I just set $ERROROUTCODE and $WARNINGOUTCODE to 1. I figure as long as there is at least one disk, it doesn't matter how many - it will still give an error or warning.
This script checks for a number of defined services to make sure they are running. If the service doesn't exist, it skips over it. I created this, because I wanted to be notified urgently if critical services that my servers depend on are down (rather than less important services).
This script will check if a number of defined Linux processes are running and give an error if they are not. The processes are defined by an ENV VAR using format PROCESSES=process1 process2 process3. I found this useful for monitoring critical processes on my Linux servers.
Contributor
Author
|
I've added two more scripts. One to check a number of specified services, and another to check a number of specified processes. |
This shell script gets the load average of a Linux machine and checks it against a specified threshold (default is 1, but the user can specify a different threshold in the ENV VAR). It checks 1m, 5m and 15m load averages and gives warnings if they are outside the threshold.
This shell script is only for Linux machines running docker. It downloads an image and runs a small Docker container that pulses the run commands of every container in Docker. I find this useful for keeping track of the containers I am running in case I need to run them again.
This script is an extension on the current Linux memory check script. I have modified it to include physical and swap. It also has 3 thresholds: OK, low and critically low. It checks the free physical mem first. If the physical memory is less than min, the script will check swap. If swap is more than ok amount, the script gives a warning. If swap is less than ok amount, the script gives a warning. If swap is also lower than min, the script gives an error. The script allows the user to specify the threshold using ENV VARs, but if they don't, it uses defaults.
Contributor
Author
|
Sorry - added a couple more scripts! |
Contributor
|
You've got 2 files in the root, they should be in the wip folder :) |
Contributor
|
Persistence is an attribute of the successful! Thank you for the PR! |
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a cool script! I just made a few changes that I think may improve it:
Added a $WARNINGVALUE (which can be lower than the $ERRORVALUE. If the disk is only at warning stage, it will exit with error code 2 instead of 1. In TRMM, you can set code 2 to be a warning (in automation) so you have time to fix the issue before it gets critical.
Added the option to change the warning and error value with ENV VARs so you don't need to change the code if they don't suit you, or you can customise it for different servers.
Rather than incrementing, I just set $ERROROUTCODE and $WARNINGOUTCODE to 1. I figure as long as there is at least one disk, it doesn't matter how many - it will still give an error or warning.