-
-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
UnixPB: Add Docker Overlay Check Plugin Script For Nagios #3825
Conversation
...DK_Unix_Playbook/roles/Nagios_Plugins/tasks/additional_plugins/check_docker_overlay2_size.sh
Outdated
Show resolved
Hide resolved
…ins/tasks/additional_plugins/check_docker_overlay2_size.sh Co-authored-by: Stewart X Addison <[email protected]>
Done, once this is merged and rolled out via the weekly updates, I'll add the monitoring into nagios. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Approving on the assumption you check whether you agree with my symlink comment before merging :-)
...DK_Unix_Playbook/roles/Nagios_Plugins/tasks/additional_plugins/check_docker_overlay2_size.sh
Outdated
Show resolved
Hide resolved
fi | ||
|
||
# Convert size to GB for display | ||
FOLDER_SIZE_GB=$(echo "scale=2; $FOLDER_SIZE_BYTES / (1024 * 1024 * 1024)" | bc) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You don't see bc
used often enough these days ;-)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I based it on an existing script, but I wanted the parameters to be simple, rather than in bytes/kilobytes/megabytes :)
FOLDER_SIZE_GB=$(echo "scale=2; $FOLDER_SIZE_BYTES / (1024 * 1024 * 1024)" | bc) | ||
|
||
# Determine Nagios status | ||
if (( FOLDER_SIZE_BYTES > CRIT_THRESHOLD_BYTES )); then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was thinking that this needed $
prefxes but apparently not.
Also noting that while these two numbers are calculated within the script, this syntax prevents the issues described in https://yossarian.net/til/post/some-surprising-code-execution-sources-in-bash/ with using -gt
and similar constructs, which is giong to take a bit of getting used to
…ins/tasks/additional_plugins/check_docker_overlay2_size.sh Co-authored-by: Stewart X Addison <[email protected]>
) * UnixPB: Add Docker Overlay Check Script For Nagios * Update ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Nagios_Plugins/tasks/additional_plugins/check_docker_overlay2_size.sh Co-authored-by: Stewart X Addison <[email protected]> * Update ansible/playbooks/AdoptOpenJDK_Unix_Playbook/roles/Nagios_Plugins/tasks/additional_plugins/check_docker_overlay2_size.sh Co-authored-by: Stewart X Addison <[email protected]> --------- Co-authored-by: Stewart X Addison <[email protected]>
Ref: #3797
Add a new script to be used by nagios for monitoring the size of the /var/lib/docker/overlay2 folder, and ensure it is installed alongside the other nagios plugins.
Checklist
VPC OK : https://ci.adoptium.net/job/VagrantPlaybookCheck/2008/