Skip to content
Snippets Groups Projects
Commit 1bdd4c82 authored by Sven Mäder's avatar Sven Mäder :speech_balloon:
Browse files

Add icons

parent a42af6a9
No related branches found
No related tags found
No related merge requests found
......@@ -28,22 +28,28 @@ def red(xymon):
def run_check(xymon):
title = 'CPU'
content = []
for vuln in cpu_vulnerabilities:
title = ''.join([vuln, ': '])
icon = '&green'
vuln_file = Path(''.join([cpu_vulnerabilities_base, vuln]))
if vuln_file.is_file():
with open(str(vuln_file)) as f:
content = '<br/>'.join(f.readlines())
if content.startswith('Vulnerable'):
title += 'Vulnerable'
lines = '<br>'.join(f.readlines()).rstrip()
if lines.startswith('Vulnerable'):
icon = '&red'
red(xymon)
else:
title += content.split(':')[0]
else:
title += 'Potentially Vulnerable'
content = 'Kernel needs update and host reboot'
lines = 'Kernel needs update and host reboot'
icon = '&yellow'
yellow(xymon)
xymon.section(title, content)
content.append(''.join([icon, ' ', vuln, ': ', lines]))
xymon.section(title, '<br>'.join(content))
def main():
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment