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
783a9010
Commit
783a9010
authored
Sep 25, 2015
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(SystemHealth) work in progress
parent
ecf9eb5f
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
14 additions
and
20 deletions
+14
-20
SystemhealthController.php
...llers/OPNsense/Diagnostics/Api/SystemhealthController.php
+4
-16
SystemhealthController.php
...ntrollers/OPNsense/Diagnostics/SystemhealthController.php
+1
-1
actions_systemhealth.conf
...opnsense/service/conf/actions.d/actions_systemhealth.conf
+9
-3
No files found.
src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/System
H
ealthController.php
→
src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/System
h
ealthController.php
View file @
783a9010
...
...
@@ -36,7 +36,7 @@ use \OPNsense\Core\Backend;
* Class ServiceController
* @package OPNsense\SystemHealth
*/
class
System
H
ealthController
extends
ApiControllerBase
class
System
h
ealthController
extends
ApiControllerBase
{
/**
...
...
@@ -242,18 +242,7 @@ class SystemHealthController extends ApiControllerBase
$timestamp
=
$rowValues
[
'timestamp'
]
*
1000
;
// javascript works with milliseconds
foreach
(
$data
[
'columns'
]
as
$key
=>
$value
)
{
$name
=
$value
[
'name'
];
if
(
$value
[
'type'
]
==
"GAUGE"
)
{
// return values as float
$value
=
$rowValues
[
'condensed_values'
][
$key
];
}
else
{
// return values as int
if
((
string
)
$rowValues
[
'condensed_values'
][
$key
]
!=
"NaN"
)
{
$value
=
(
int
)
$rowValues
[
'condensed_values'
][
$key
];
}
else
{
$value
=
$rowValues
[
'condensed_values'
][
$key
];
}
}
$value
=
$rowValues
[
'condensed_values'
][
$key
];
if
(
!
isset
(
$d3_data
[
$key
]))
{
$d3_data
[
$key
]
=
[];
$d3_data
[
$key
][
"area"
]
=
true
;
...
...
@@ -263,7 +252,6 @@ class SystemHealthController extends ApiControllerBase
$d3_data
[
$key
][
"key"
]
=
$name
;
}
$d3_data
[
$key
][
"values"
]
=
[];
}
if
(
$value
==
"NaN"
)
{
...
...
@@ -311,7 +299,7 @@ class SystemHealthController extends ApiControllerBase
"stepSize"
=>
$data
[
'condensed_step'
],
"from_timestamp"
=>
$from_timestamp
,
"to_timestamp"
=>
$to_timestamp
,
"count"
=>
count
(
$d3_data
[
0
][
'values'
])
,
"count"
=>
isset
(
$d3_data
[
0
])
?
count
(
$d3_data
[
0
][
'values'
])
:
0
,
"data"
=>
$d3_data
];
}
...
...
@@ -555,7 +543,7 @@ class SystemHealthController extends ApiControllerBase
if
(
$xml
!==
false
)
{
// we only use the average databases in any RRD, remove the rest to avoid strange behaviour.
for
(
$count
=
count
(
$xml
->
rra
)
-
1
;
$count
>=
0
;
$count
--
)
{
if
(
(
string
)
$xml
->
rra
[
$count
]
->
cf
!=
"AVERAGE"
)
{
if
(
trim
((
string
)
$xml
->
rra
[
$count
]
->
cf
)
!=
"AVERAGE"
)
{
unset
(
$xml
->
rra
[
$count
]);
}
...
...
src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/System
H
ealthController.php
→
src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/System
h
ealthController.php
View file @
783a9010
...
...
@@ -32,7 +32,7 @@ namespace OPNsense\Diagnostics;
* Class IndexController
* @package OPNsense\Proxy
*/
class
System
H
ealthController
extends
\OPNsense\Base\IndexController
class
System
h
ealthController
extends
\OPNsense\Base\IndexController
{
public
function
indexAction
()
{
...
...
src/opnsense/service/conf/actions.d/actions_systemhealth.conf
View file @
783a9010
[
query
.
details
]
command
:/
Users
/
josschellevis
/
Development
/
opnsense
/
scripts
/
systemhealth
/
queryDetail
s
.
py
[
list
]
command
:/
usr
/
local
/
opnsense
/
scripts
/
systemhealth
/
listReport
s
.
py
parameters
:
type
:
script_output
message
:
request
rrd
graph
details
message
:
list
systemhealth
items
[
fetch
]
command
:/
usr
/
local
/
opnsense
/
scripts
/
systemhealth
/
fetchData
.
py
parameters
: %
s
type
:
script_output
message
:
fetch
systemhealth
report
data
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