Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion weka_upgrade_checker/version.txt
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.12.1
1.12.2
Binary file modified weka_upgrade_checker/weka_upgrade_checker
Binary file not shown.
51 changes: 50 additions & 1 deletion weka_upgrade_checker/weka_upgrade_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ def _clean_subprocess_env():
return env


pg_version = "1.12.1"
pg_version = "1.12.2"
known_issues_file = "known_issues.json"

log_file_path = os.path.abspath("./weka_upgrade_checker.log")
Expand Down Expand Up @@ -1888,6 +1888,29 @@ def free_space_check_logs(results):
GOOD(f"Host: {hname} has {percent_free}% free — OK.")


def free_space_check_path(results, path):
for hname, output in results:
if output is None:
continue
try:
used_str, avail_str = output.split()
used = int(used_str)
avail = int(avail_str)
except (ValueError, AttributeError):
WARN(f"Host: {hname} could not parse free space for {path}")
continue

percent_free = int((avail / (used + avail)) * 100)

if percent_free < 20:
WARN(
f"Host: {hname} {path} partition is only {percent_free}% free. "
"Consider freeing space."
)
else:
GOOD(f"Host: {hname} {path} has {percent_free}% free — OK.")


def weka_container_status(results, weka_version):
containers_by_host = {
host: [
Expand Down Expand Up @@ -2692,6 +2715,32 @@ def backend_host_checks(

free_space_check_logs(results)

INFO("CHECKING /var DIRECTORY SPACE USAGE ON BACKENDS")
results = parallel_execution(
ssh_bk_hosts,
["df -m /var | awk 'NR==2 {print $3, $4}'"],
use_check_output=True,
ssh_identity=ssh_identity,
)
for host_name, result in results:
if result is None:
WARN(f"Unable to determine Host: {host_name} /var available space")

free_space_check_path(results, "/var")

INFO("CHECKING /root DIRECTORY SPACE USAGE ON BACKENDS")
results = parallel_execution(
ssh_bk_hosts,
["df -m /root | awk 'NR==2 {print $3, $4}'"],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think you want to check the actual root, no? df -m /

use_check_output=True,
ssh_identity=ssh_identity,
)
for host_name, result in results:
if result is None:
WARN(f"Unable to determine Host: {host_name} /root available space")

free_space_check_path(results, "/root")

INFO("CHECKING BACKEND WEKA CONTAINER STATUS ON BACKENDS")
results = parallel_execution(
ssh_bk_hosts,
Expand Down