amidaware / community-scripts

A curated list of powershell, python, and batch scripts for use in TacticalRMM or anywhere!
MIT License
119 stars 82 forks source link

Update linux_disk_usage.sh #159

Closed SpookOz closed 1 year ago

SpookOz commented 1 year ago

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.

CLAassistant commented 1 year ago

CLA assistant check
All committers have signed the CLA.

SpookOz commented 1 year ago

I've added two more scripts. One to check a number of specified services, and another to check a number of specified processes.

SpookOz commented 1 year ago

Sorry - added a couple more scripts!

silversword411 commented 1 year ago

You've got 2 files in the root, they should be in the wip folder :)

silversword411 commented 1 year ago

Persistence is an attribute of the successful!

Thank you for the PR!