summaryrefslogtreecommitdiffstats
path: root/app
diff options
context:
space:
mode:
authoryayogev <yaronyogev@gmail.com>2017-09-04 15:07:33 +0300
committeryayogev <yaronyogev@gmail.com>2017-09-04 15:07:33 +0300
commit57ee48adb74c1e49fb34a446e8c6a591411ce574 (patch)
tree864d1ebe018cdeb249c573bd1caf3cba901a2240 /app
parent3b88c2537aa558db80579a3113245a14d3a3a2fd (diff)
vnic-vconnector status 1 on problem
Change-Id: I896666e81f0a656936b0e77ce14b9effc8b444cb Signed-off-by: yayogev <yaronyogev@gmail.com>
Diffstat (limited to 'app')
-rwxr-xr-xapp/monitoring/checks/check_vnic_vconnector.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/app/monitoring/checks/check_vnic_vconnector.py b/app/monitoring/checks/check_vnic_vconnector.py
index b0f96cd..76efd0b 100755
--- a/app/monitoring/checks/check_vnic_vconnector.py
+++ b/app/monitoring/checks/check_vnic_vconnector.py
@@ -28,8 +28,10 @@ mac_address = str(sys.argv[2])
rc = 0
+cmd = None
try:
- out = subprocess.check_output(["brctl showmacs " + bridge_name],
+ cmd = "brctl showmacs " + bridge_name
+ out = subprocess.check_output([cmd],
stderr=subprocess.STDOUT,
shell=True)
out = binary2str(out)
@@ -45,8 +47,8 @@ try:
line_number += 1
state_match = re.match('^\W+([A-Z]+)', line)
if not found:
- rc = 2
- print('Error: failed to find MAC {}:\n{}\n'
+ rc = 1
+ print('Warning: failed to find MAC {}:\n{}\n'
.format(mac_address, out))
else:
# grab "is local?" and "ageing timer" values
@@ -65,8 +67,8 @@ try:
ageing_timer, mac_address, bridge_name, out)
print(msg)
except subprocess.CalledProcessError as e:
- print("Error finding MAC {}: {}\n"
- .format(mac_address, binary2str(e.output)))
+ print("Error running CLI command {}: {}\n"
+ .format(cmd, binary2str(e.output)))
rc = 2
exit(rc)