Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
datasid
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Harbor Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
simmctic
datasid
Commits
c9759e1d
Commit
c9759e1d
authored
11 years ago
by
edileuton
Browse files
Options
Downloads
Patches
Plain Diff
agent: Fix possible conflict with proinfodata agent
Signed-off-by:
edileuton
<
edileuton@gmail.com
>
parent
e6fd5dac
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
agent/bin/datasid-netmon.sh
+6
-6
6 additions, 6 deletions
agent/bin/datasid-netmon.sh
with
6 additions
and
6 deletions
agent/bin/datasid-netmon.sh
+
6
−
6
View file @
c9759e1d
...
@@ -113,12 +113,12 @@ if test $? -ne 0; then exit 2; fi
...
@@ -113,12 +113,12 @@ if test $? -ne 0; then exit 2; fi
check_traffic_date
check_traffic_date
if
test
$?
-ne
0
;
then
exit
3
;
fi
if
test
$?
-ne
0
;
then
exit
3
;
fi
INPUT_COUNT
=
$(
sudo
$IPTABLES
-nvxL
INPUT |
grep
INPUT_COUNTS |
\
INPUT_COUNT
=
$(
sudo
$IPTABLES
-nvxL
INPUT |
grep
DS_
INPUT_COUNTS |
\
awk
'BEGIN{pkts=0; bytes=0} \
awk
'BEGIN{pkts=0; bytes=0} \
{pkts+=$1; bytes+=$2} \
{pkts+=$1; bytes+=$2} \
END{print pkts,bytes}'
)
END{print pkts,bytes}'
)
OUTPUT_COUNT
=
$(
sudo
$IPTABLES
-nvxL
OUTPUT |
grep
OUTPUT_COUNTS |
\
OUTPUT_COUNT
=
$(
sudo
$IPTABLES
-nvxL
OUTPUT |
grep
DS_
OUTPUT_COUNTS |
\
awk
'BEGIN{pkts=0; bytes=0} \
awk
'BEGIN{pkts=0; bytes=0} \
{pkts+=$1; bytes+=$2} \
{pkts+=$1; bytes+=$2} \
END{print pkts,bytes}'
)
END{print pkts,bytes}'
)
...
@@ -133,9 +133,9 @@ echo "$INTERVALID $INPUT_COUNT $OUTPUT_COUNT" >> $TRAFFIC
...
@@ -133,9 +133,9 @@ echo "$INTERVALID $INPUT_COUNT $OUTPUT_COUNT" >> $TRAFFIC
if
test
-f
"
$INTERFACES
"
;
then
if
test
-f
"
$INTERFACES
"
;
then
while
IFS
=
$' '
read
-a
net
;
do
while
IFS
=
$' '
read
-a
net
;
do
sudo
$IPTABLES
-D
INPUT
-i
${
net
[0]
}
!
-s
${
net
[1]
}
-m
comment
\
sudo
$IPTABLES
-D
INPUT
-i
${
net
[0]
}
!
-s
${
net
[1]
}
-m
comment
\
--comment
INPUT_COUNTS 2>/dev/null
--comment
DS_
INPUT_COUNTS 2>/dev/null
sudo
$IPTABLES
-D
OUTPUT
-o
${
net
[0]
}
!
-d
${
net
[1]
}
-m
comment
\
sudo
$IPTABLES
-D
OUTPUT
-o
${
net
[0]
}
!
-d
${
net
[1]
}
-m
comment
\
--comment
OUTPUT_COUNTS 2>/dev/null
--comment
DS_
OUTPUT_COUNTS 2>/dev/null
done
<
$INTERFACES
done
<
$INTERFACES
fi
fi
...
@@ -154,7 +154,7 @@ done
...
@@ -154,7 +154,7 @@ done
# Insert new rules
# Insert new rules
while
IFS
=
$' '
read
-a
net
;
do
while
IFS
=
$' '
read
-a
net
;
do
sudo
$IPTABLES
-I
INPUT
-i
${
net
[0]
}
!
-s
${
net
[1]
}
-m
comment
\
sudo
$IPTABLES
-I
INPUT
-i
${
net
[0]
}
!
-s
${
net
[1]
}
-m
comment
\
--comment
INPUT_COUNTS
--comment
DS_
INPUT_COUNTS
sudo
$IPTABLES
-I
OUTPUT
-o
${
net
[0]
}
!
-d
${
net
[1]
}
-m
comment
\
sudo
$IPTABLES
-I
OUTPUT
-o
${
net
[0]
}
!
-d
${
net
[1]
}
-m
comment
\
--comment
OUTPUT_COUNTS
--comment
DS_
OUTPUT_COUNTS
done
<
$INTERFACES
done
<
$INTERFACES
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment