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
bec30ed2
Commit
bec30ed2
authored
Apr 04, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(netflow) enable local data collection, ui part
parent
dcc44316
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
24 additions
and
0 deletions
+24
-0
NetflowController.php
...ontrollers/OPNsense/Diagnostics/Api/NetflowController.php
+12
-0
netflow_capture.xml
...ontrollers/OPNsense/Diagnostics/forms/netflow_capture.xml
+6
-0
Netflow.xml
src/opnsense/mvc/app/models/OPNsense/Diagnostics/Netflow.xml
+6
-0
No files found.
src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/Api/NetflowController.php
View file @
bec30ed2
...
@@ -67,6 +67,18 @@ class NetflowController extends ApiControllerBase
...
@@ -67,6 +67,18 @@ class NetflowController extends ApiControllerBase
// load model and update with provided data
// load model and update with provided data
$mdlNetflow
=
new
Netflow
();
$mdlNetflow
=
new
Netflow
();
$mdlNetflow
->
setNodes
(
$this
->
request
->
getPost
(
"netflow"
));
$mdlNetflow
->
setNodes
(
$this
->
request
->
getPost
(
"netflow"
));
if
((
string
)
$mdlNetflow
->
collect
->
enable
==
1
)
{
// add localhost (127.0.0.1:2056) as target if local capture is configured
if
(
strpos
((
string
)
$mdlNetflow
->
capture
->
targets
,
"127.0.0.1:2056"
)
===
false
)
{
if
((
string
)
$mdlNetflow
->
capture
->
targets
!=
""
)
{
$targets
=
explode
(
","
,
(
string
)
$mdlNetflow
->
capture
->
targets
);
}
else
{
$targets
=
array
();
}
$targets
[]
=
"127.0.0.1:2056"
;
$mdlNetflow
->
capture
->
targets
=
implode
(
','
,
$targets
);
}
}
// perform validation
// perform validation
$validations
=
$mdlNetflow
->
validate
();
$validations
=
$mdlNetflow
->
validate
();
...
...
src/opnsense/mvc/app/controllers/OPNsense/Diagnostics/forms/netflow_capture.xml
View file @
bec30ed2
...
@@ -7,6 +7,12 @@
...
@@ -7,6 +7,12 @@
<help>
<![CDATA[Select interface(s) to enable netflow on.]]>
</help>
<help>
<![CDATA[Select interface(s) to enable netflow on.]]>
</help>
<hint>
Type or select interface.
</hint>
<hint>
Type or select interface.
</hint>
</field>
</field>
<field>
<id>
netflow.collect.enable
</id>
<label>
Capture local
</label>
<type>
checkbox
</type>
<help>
Collect netflow data on this firewall, this will automatically append localhost as netflow target
</help>
</field>
<field>
<field>
<id>
netflow.capture.version
</id>
<id>
netflow.capture.version
</id>
<label>
Version
</label>
<label>
Version
</label>
...
...
src/opnsense/mvc/app/models/OPNsense/Diagnostics/Netflow.xml
View file @
bec30ed2
...
@@ -27,5 +27,11 @@
...
@@ -27,5 +27,11 @@
<ValidationMessage>
Please enter valid targets (e.g. 192.168.0.1:2055)
</ValidationMessage>
<ValidationMessage>
Please enter valid targets (e.g. 192.168.0.1:2055)
</ValidationMessage>
</targets>
</targets>
</capture>
</capture>
<collect>
<enable
type=
"BooleanField"
>
<default>
1
</default>
<Required>
Y
</Required>
</enable>
</collect>
</items>
</items>
</model>
</model>
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