mirror of
https://github.com/lucaspalomodevelop/core.git
synced 2026-03-14 16:44:39 +00:00
(netflow) enable local data collection, ui part
This commit is contained in:
parent
dcc4431671
commit
bec30ed225
@ -67,6 +67,18 @@ class NetflowController extends ApiControllerBase
|
||||
// load model and update with provided data
|
||||
$mdlNetflow = new 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
|
||||
$validations = $mdlNetflow->validate();
|
||||
|
||||
@ -7,6 +7,12 @@
|
||||
<help><![CDATA[Select interface(s) to enable netflow on.]]></help>
|
||||
<hint>Type or select interface.</hint>
|
||||
</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>
|
||||
<id>netflow.capture.version</id>
|
||||
<label>Version</label>
|
||||
|
||||
@ -27,5 +27,11 @@
|
||||
<ValidationMessage>Please enter valid targets (e.g. 192.168.0.1:2055)</ValidationMessage>
|
||||
</targets>
|
||||
</capture>
|
||||
<collect>
|
||||
<enable type="BooleanField">
|
||||
<default>1</default>
|
||||
<Required>Y</Required>
|
||||
</enable>
|
||||
</collect>
|
||||
</items>
|
||||
</model>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user