Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
python
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
isgphys
python
Commits
1bdd4c82
Commit
1bdd4c82
authored
5 years ago
by
Sven Mäder
Browse files
Options
Downloads
Patches
Plain Diff
Add icons
parent
a42af6a9
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
bin/xymon-vulnerabilities.py
+15
-9
15 additions, 9 deletions
bin/xymon-vulnerabilities.py
with
15 additions
and
9 deletions
bin/xymon-vulnerabilities.py
+
15
−
9
View file @
1bdd4c82
...
...
@@ -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
'
con
tent
=
'
Kernel needs update and host reboot
'
lines
=
'
Kernel needs update and host reboot
'
i
con
=
'
&yellow
'
yellow
(
xymon
)
xymon
.
section
(
title
,
content
)
content
.
append
(
''
.
join
([
icon
,
'
'
,
vuln
,
'
:
'
,
lines
]))
xymon
.
section
(
title
,
'
<br>
'
.
join
(
content
))
def
main
():
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment