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): ...@@ -28,22 +28,28 @@ def red(xymon):
def run_check(xymon): def run_check(xymon):
title = 'CPU'
content = []
for vuln in cpu_vulnerabilities: for vuln in cpu_vulnerabilities:
title = ''.join([vuln, ': ']) icon = '&green'
vuln_file = Path(''.join([cpu_vulnerabilities_base, vuln])) vuln_file = Path(''.join([cpu_vulnerabilities_base, vuln]))
if vuln_file.is_file(): if vuln_file.is_file():
with open(str(vuln_file)) as f: with open(str(vuln_file)) as f:
content = '<br/>'.join(f.readlines()) lines = '<br>'.join(f.readlines()).rstrip()
if content.startswith('Vulnerable'):
title += 'Vulnerable' if lines.startswith('Vulnerable'):
icon = '&red'
red(xymon) red(xymon)
else:
title += content.split(':')[0]
else: else:
title += 'Potentially Vulnerable' lines = 'Kernel needs update and host reboot'
content = 'Kernel needs update and host reboot' icon = '&yellow'
yellow(xymon) yellow(xymon)
xymon.section(title, content)
content.append(''.join([icon, ' ', vuln, ': ', lines]))
xymon.section(title, '<br>'.join(content))
def main(): 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