cloud66_agent 1.4.2 → 1.4.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cloud66_agent/utils/version.rb +1 -1
- data/lib/cloud66_agent/utils/vital_signs.rb +6 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 602e5d7b7ef1bff2dfb6b2bb5859c9c5ded474956495762ed7f7ce466f853fa2
|
4
|
+
data.tar.gz: b3debd77d32cc3563efe69a46f9b9230ad01f746015adbe4696d7864e7ecae94
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9851b91161ee5cf3925d835abb753d42bb3f64252df70fa41c6922b77c4107388a451375915b8491f8d2b72a0eab5310beba5ce548c2992c6d05a3f5f6c35d71
|
7
|
+
data.tar.gz: 27875862679ac52871d0cefb1e30a75f5864a7ddf3323dfa4b1b5d729dc4292b5f0c174a6978a761edb38ccbbccae5f3394d8ea6adbf4b1700af6f87063b9ce7
|
@@ -81,6 +81,10 @@ module Cloud66
|
|
81
81
|
end
|
82
82
|
|
83
83
|
def self.calculate_space_alerts(warning_threshold, critical_threshold)
|
84
|
+
$logger.info "Calculating Disk Alerts [warning_threshold:#{warning_threshold}] [critical_threshold:#{critical_threshold}]"
|
85
|
+
warning_threshold = warning_threshold.to_i
|
86
|
+
critical_threshold = critical_threshold.to_i
|
87
|
+
|
84
88
|
space_alerts = []
|
85
89
|
return space_alerts if warning_threshold == 0 || critical_threshold == 0
|
86
90
|
# get the df output (linux only)
|
@@ -91,9 +95,10 @@ module Cloud66
|
|
91
95
|
filesystem = parts[0].strip
|
92
96
|
mounted = parts[1].strip
|
93
97
|
percentage = parts[2].strip.gsub(/%/, '').to_i
|
98
|
+
next if percentage < 1
|
94
99
|
if percentage >= critical_threshold
|
95
100
|
space_alerts << {level: :critical, filesystem: filesystem, mounted: mounted, percentage: percentage}
|
96
|
-
elsif percentage
|
101
|
+
elsif percentage >= warning_threshold
|
97
102
|
space_alerts << {level: :warning, filesystem: filesystem, mounted: mounted, percentage: percentage}
|
98
103
|
end
|
99
104
|
end
|