Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
O
OpnSense
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
OpnSense
Commits
9d81789c
Commit
9d81789c
authored
Sep 29, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(systemhealth) python style fixes
parent
24bd9724
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
3 additions
and
3 deletions
+3
-3
fetchData.py
src/opnsense/scripts/systemhealth/fetchData.py
+1
-1
listReports.py
src/opnsense/scripts/systemhealth/listReports.py
+2
-2
No files found.
src/opnsense/scripts/systemhealth/fetchData.py
View file @
9d81789c
...
...
@@ -47,7 +47,7 @@ if len(sys.argv) > 1:
if
os
.
path
.
basename
(
rrdFilename
)
==
filename
:
with
tempfile
.
NamedTemporaryFile
()
as
output_stream
:
subprocess
.
check_call
([
'/usr/local/bin/rrdtool'
,
'dump'
,
rrdFilename
],
stdout
=
output_stream
,
stderr
=
subprocess
.
STDOUT
)
stdout
=
output_stream
,
stderr
=
subprocess
.
STDOUT
)
output_stream
.
seek
(
0
)
print
(
output_stream
.
read
())
break
src/opnsense/scripts/systemhealth/listReports.py
View file @
9d81789c
...
...
@@ -43,7 +43,7 @@ result = {}
for
filename
in
glob
.
glob
(
'
%
s/*.rrd'
%
rrd_reports_dir
):
rrdFilename
=
os
.
path
.
basename
(
filename
)
.
split
(
'.'
)[
0
]
# determine topic and item name, fixes naming issues
if
rrdFilename
.
split
(
'-'
)[
0
]
in
(
'system'
)
and
rrdFilename
.
find
(
'-'
)
>
-
1
:
if
rrdFilename
.
split
(
'-'
)[
0
]
==
'system'
and
rrdFilename
.
find
(
'-'
)
>
-
1
:
topic
=
rrdFilename
.
split
(
'-'
)[
0
]
itemName
=
'-'
.
join
(
rrdFilename
.
split
(
'-'
)[
1
:])
else
:
...
...
@@ -55,7 +55,7 @@ for filename in glob.glob('%s/*.rrd' % rrd_reports_dir):
for
filename
in
glob
.
glob
(
'
%
s/*.xml'
%
rrd_definition_dir
):
rrdFilename
=
os
.
path
.
basename
(
filename
)
.
split
(
'.'
)[
0
]
try
:
ruleXML
=
xml
.
etree
.
ElementTree
.
fromstring
(
open
(
filename
)
.
read
())
ruleXML
=
xml
.
etree
.
ElementTree
.
fromstring
(
open
(
filename
)
.
read
())
rrdDef
=
{}
if
ruleXML
.
tag
==
'systemhealth'
:
# only parse systemhealth items
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment