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
6ab92467
Commit
6ab92467
authored
Mar 24, 2016
by
Ad Schellevis
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
(netflow) finish rc scripting
parent
b706112a
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
2 deletions
+24
-2
netflow.conf.sample
src/etc/netflow.conf.sample
+5
-0
netflow
src/etc/rc.d/netflow
+19
-2
No files found.
src/etc/netflow.conf.sample
View file @
6ab92467
# Sample configuration for netflow daemon (/usr/local/etc/netflow.conf)
# The configuration below sends flows captured from em0 and em1 to multiple locations
# define interfaces to configure
netflow_interfaces="em0 em1"
# per interface settings
# netflow_<interface>_int_destination -> address:port
netflow_em0_int_destination="127.0.0.1:3001"
netflow_em1_int_destination="127.0.0.1:3002"
# netflow_<interface>_destinations -> address:port address:port ...
netflow_em0_destinations="10.211.55.101:2055 10.211.55.100:4444"
netflow_em1_destinations="10.211.55.101:2056"
src/etc/rc.d/netflow
View file @
6ab92467
...
...
@@ -62,12 +62,17 @@ setup_interface()
SEQ
# forward netflow packets, make sure $netflow_int_destination forwards to localhost (127.0.0.1)
if
[
"
$destinations
"
!=
""
]
;
then
/usr/
local/bin/samplicate
-s
127.0.0.1
-f
-p
$netflow_port
$destinations
/usr/
sbin/daemon
-p
/var/run/netflow_samplicate_
$interface
-u
nobody /usr/local/bin/samplicate
-s
127.0.0.1
-p
$netflow_port
$destinations
fi
}
netflow_start
()
{
is_running
=
`
ngctl list |
grep
netflow_ |
wc
-l
`
if
[
$is_running
-ne
0
]
;
then
echo
"already running"
return
fi
for
interface
in
$netflow_interfaces
do
int_destination
=
"netflow_"
$interface
"_int_destination"
...
...
@@ -80,9 +85,21 @@ netflow_start()
done
}
# stop netflow collect and distribution
netflow_stop
()
{
#todo
# kill all samplicate processes
for
samplicate_pid
in
`
ls
/var/run/netflow_samplicate_
*
2>/dev/null
`
do
kill
-9
`
cat
$samplicate_pid
`
done
# cleanup netflow processes
for
netflow_node
in
`
ngctl list |
grep
netflow_ |
awk
'{print $2;}'
`
do
/usr/sbin/ngctl shutdown
$netflow_node
:
done
}
load_rc_config
$name
...
...
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