monitoring-plugins-sar-perf/monitoring-plugins-sar-perf-output.patch
Dominique Leuenberger caf477d719 - Fix version number, we don't want to downgrade this package.
- Conversion to _service pulled source from upstream
- Add no-python2.patch to make script python3 compatible

OBS-URL: https://build.opensuse.org/package/show/server:monitoring/monitoring-plugins-sar-perf?expand=0&rev=42
2025-01-27 11:55:31 +00:00

29 lines
1.2 KiB
Diff

---
check_sar_perf.py | 15 ++++++++-------
1 file changed, 8 insertions(+), 7 deletions(-)
--- a/check_sar_perf.py
+++ b/check_sar_perf.py
@@ -99,13 +99,14 @@ class SarNRPE:
# Create dictionary
for i in range(len(columns)):
# Remove first column if data contains only letters
- if i != 0 or not search.match(data[i]):
- # Remove characters that cause issues (%/)
- badchars=['%','/']
- columns[i] = ''.join(j for j in columns[i] if j not in badchars)
- string = "%s=%s" %(columns[i].strip('%/'), data[i].strip())
- self.stats.append(string)
- #print "Appended data: ", data[i]
+ #if i != 0 or not search.match(data[i]):
+ if (i != 0 or not search.match(data[i])) and (columns[i] != "DEV"):
+ # Remove characters that cause issues (%/)
+ badchars=['%','/']
+ columns[i] = ''.join(j for j in columns[i] if j not in badchars)
+ string = "%s=%s" %(columns[i].strip('%/'), data[i].strip())
+ self.stats.append(string)
+ #print "Appended data: ", data[i]
def CheckBin(program):
'''Ensure the program exists in the PATH'''