2011-12-21 14:09:26 +01:00
< ? php
2019-03-04 13:12:01 +01:00
/**
2022-05-06 11:19:44 +02:00
* Setup view for Netflow
*
* @ category Setup
* @ package Pandora FMS
* @ subpackage Configuration
* @ version 1.0 . 0
* @ license See below
*
2019-03-04 13:12:01 +01:00
* ______ ___ _______ _______ ________
2023-06-08 12:42:10 +02:00
* | __ \ .-----.--.--.--| |.-----.----.-----. | ___ | | | __ |
* | __ /| _ | | _ || _ | _ | _ | | ___ | | __ |
2019-03-04 13:12:01 +01:00
* | ___ | | ___ . _ | __ | __ | _____ || _____ | __ | | ___ . _ | | ___ | | __ | _ | __ | _______ |
*
* ============================================================================
2023-06-08 11:53:13 +02:00
* Copyright ( c ) 2005 - 2023 Pandora FMS
2023-06-08 13:19:01 +02:00
* Please see https :// pandorafms . com / community / for full contribution list
2019-03-04 13:12:01 +01:00
* This program is free software ; you can redistribute it and / or
* modify it under the terms of the GNU General Public License
* as published by the Free Software Foundation for version 2.
* This program is distributed in the hope that it will be useful ,
* but WITHOUT ANY WARRANTY ; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE . See the
* GNU General Public License for more details .
* ============================================================================
*/
2011-12-21 14:09:26 +01:00
2022-05-06 11:19:44 +02:00
// Begin.
2011-12-21 14:09:26 +01:00
global $config ;
2019-01-30 16:18:44 +01:00
require_once 'include/functions_ui.php' ;
2011-12-21 14:09:26 +01:00
2019-01-30 16:18:44 +01:00
check_login ();
2011-12-21 14:09:26 +01:00
2019-01-30 16:18:44 +01:00
$update = ( bool ) get_parameter ( 'update' );
2011-12-21 14:09:26 +01:00
2022-05-06 11:19:44 +02:00
$table = new stdClass ();
2015-06-26 11:20:08 +02:00
$table -> width = '100%' ;
2023-03-16 13:11:11 +01:00
$table -> class = 'databox filter-table-adv' ;
2011-12-23 09:37:36 +01:00
$table -> border = 0 ;
2019-01-30 16:18:44 +01:00
$table -> data = [];
2013-02-27 15:25:24 +01:00
2023-03-16 13:11:11 +01:00
$table -> data [ 0 ][] = html_print_label_input_block (
__ ( 'Data storage path' ),
2023-03-21 09:38:56 +01:00
html_print_input_text ( 'netflow_name_dir' , $config [ 'netflow_name_dir' ], false , 50 , 200 , true )
2023-03-16 13:11:11 +01:00
);
2023-11-03 11:32:54 +01:00
$table -> data [ 0 ][] = html_print_label_input_block (
2023-03-16 13:11:11 +01:00
__ ( 'Daemon binary path' ),
html_print_input_text ( 'netflow_daemon' , $config [ 'netflow_daemon' ], false , 50 , 200 , true )
);
2023-11-03 11:32:54 +01:00
$table -> data [ 1 ][] = html_print_label_input_block (
2023-03-16 13:11:11 +01:00
__ ( 'Nfdump binary path' ),
html_print_input_text ( 'netflow_nfdump' , $config [ 'netflow_nfdump' ], false , 50 , 200 , true )
);
2023-11-03 11:32:54 +01:00
$table -> data [ 1 ][] = html_print_label_input_block (
2023-03-16 13:11:11 +01:00
__ ( 'Nfexpire binary path' ),
html_print_input_text ( 'netflow_nfexpire' , $config [ 'netflow_nfexpire' ], false , 50 , 200 , true )
);
2023-11-03 11:32:54 +01:00
$table -> data [ 2 ][] = html_print_label_input_block (
2023-03-16 13:11:11 +01:00
__ ( 'Maximum chart resolution' ),
html_print_input_text ( 'netflow_max_resolution' , $config [ 'netflow_max_resolution' ], false , 50 , 200 , true )
);
2023-11-03 11:32:54 +01:00
$table -> data [ 2 ][] = html_print_label_input_block (
2023-03-16 13:11:11 +01:00
__ ( 'Disable custom live view filters' ),
html_print_checkbox_switch ( 'netflow_disable_custom_lvfilters' , 1 , $config [ 'netflow_disable_custom_lvfilters' ], true )
);
2023-11-03 11:32:54 +01:00
$table -> data [ 3 ][] = html_print_label_input_block (
2023-03-16 13:11:11 +01:00
__ ( 'Netflow max lifetime' ),
html_print_input_text ( 'netflow_max_lifetime' , $config [ 'netflow_max_lifetime' ], false , 50 , 200 , true )
);
2014-04-23 11:34:00 +02:00
2019-01-30 16:18:44 +01:00
$onclick = " if (!confirm(' " . __ ( 'Warning' ) . '. ' . __ ( 'IP address resolution can take a lot of time' ) . " ')) return false; " ;
2023-11-03 11:32:54 +01:00
$table -> data [ 3 ][] = html_print_label_input_block (
2023-03-16 13:11:11 +01:00
__ ( 'Name resolution for IP address' ),
html_print_checkbox_switch_extended ( 'netflow_get_ip_hostname' , 1 , $config [ 'netflow_get_ip_hostname' ], false , $onclick , '' , true )
);
2013-02-27 15:25:24 +01:00
2024-01-02 12:57:02 +01:00
$table -> data [ 4 ][] = html_print_label_input_block (
__ ( 'Netflow interval' ) . ui_print_help_tip ( __ ( 'It is necessary to restart the server if the value is changed.' ), true ),
html_print_select (
[
'600' => __ ( '10 min' ),
'1800' => __ ( '30 min' ),
'3600' => __ ( '60 min' ),
],
'netflow_interval' ,
$config [ 'netflow_interval' ],
'' ,
'' ,
0 ,
true
)
);
2023-11-03 11:35:22 +01:00
$table -> data [ 4 ][] = html_print_label_input_block (
2024-02-19 12:07:31 +01:00
__ ( 'Enable Sflow' ) . ui_print_help_tip ( __ ( 'SFLow uses a different protocol and needs an alternative collector that must be activated with this switch' ), true ),
2023-11-03 11:35:22 +01:00
html_print_checkbox_switch_extended (
'activate_sflow' ,
1 ,
$config [ 'activate_sflow' ],
$rbt_disabled ,
'' ,
'' ,
true
),
);
2023-03-16 13:11:11 +01:00
echo '<form class="max_floating_element_size" id="netflow_setup" method="post">' ;
2019-01-30 16:18:44 +01:00
html_print_table ( $table );
2023-03-16 13:11:11 +01:00
html_print_input_hidden ( 'update_config' , 1 );
html_print_action_buttons (
html_print_submit_button (
__ ( 'Update' ),
'upd_button' ,
false ,
[ 'icon' => 'update' ],
true
)
);
echo '</form>' ;
2023-03-21 10:30:35 +01:00
?>
< script >
$ ( " input[name=netflow_name_dir] " ) . on ( " input " , function () {
$ ( this ) . val ( $ ( this ) . val () . replace ( / [ ^ a - z0 - 9 ] / gi , " " ));
});
</ script >