Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
FFS Gluon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
firmware
FFS Gluon
Commits
4b610626
Commit
4b610626
authored
Jan 16, 2014
by
Jan-Philipp Litza
Browse files
Options
Downloads
Patches
Plain Diff
alfred: add more traffic statistics
+ mgmt and forward counters + packet in addition to byte counters for everything
parent
7fdd0300
No related branches found
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
package/gluon-alfred/Makefile
+1
-1
1 addition, 1 deletion
package/gluon-alfred/Makefile
package/gluon-alfred/files/lib/gluon/alfred/announce.sh
+10
-2
10 additions, 2 deletions
package/gluon-alfred/files/lib/gluon/alfred/announce.sh
with
11 additions
and
3 deletions
package/gluon-alfred/Makefile
+
1
−
1
View file @
4b610626
...
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk
...
@@ -11,7 +11,7 @@ include $(INCLUDE_DIR)/package.mk
define
Package/gluon-alfred
define
Package/gluon-alfred
SECTION
:=
gluon
SECTION
:=
gluon
CATEGORY
:=
Gluon
CATEGORY
:=
Gluon
DEPENDS
:=
+gluon-core +gluon-location +gluon-cron +alfred
DEPENDS
:=
+gluon-core +gluon-location +gluon-cron +alfred
+ethtool
TITLE
:=
Configure alfred
TITLE
:=
Configure alfred
endef
endef
...
...
This diff is collapsed.
Click to expand it.
package/gluon-alfred/files/lib/gluon/alfred/announce.sh
+
10
−
2
View file @
4b610626
...
@@ -75,8 +75,16 @@ json_close_object # network
...
@@ -75,8 +75,16 @@ json_close_object # network
json_add_object
"statistics"
json_add_object
"statistics"
json_add_int
"uptime"
"
$(
cut
-d
' '
-f1
/proc/uptime
)
"
json_add_int
"uptime"
"
$(
cut
-d
' '
-f1
/proc/uptime
)
"
json_add_object
"traffic"
json_add_object
"traffic"
json_add_double
"rx"
"
$(
cat
/sys/class/net/bat0/statistics/rx_bytes
)
"
TRAFFIC
=
"
$(
ethtool
-S
bat0 |
sed
-e
's/^ *//'
)
"
json_add_double
"tx"
"
$(
cat
/sys/class/net/bat0/statistics/tx_bytes
)
"
for
class
in
rx tx forward mgmt_rx mgmt_tx
;
do
json_add_object
"
$class
"
json_add_int
"bytes"
"
$(
echo
"
$TRAFFIC
"
|
awk
-F
': '
"/^
${
class
}
_bytes:/ { print
\$
2 }"
)
"
json_add_int
"packets"
"
$(
echo
"
$TRAFFIC
"
|
awk
-F
': '
"/^
${
class
}
:/ { print
\$
2 }"
)
"
if
[
"
$class
"
=
"tx"
]
;
then
json_add_int
"dropped"
"
$(
echo
"
$TRAFFIC
"
|
awk
-F
': '
"/^
${
class
}
_dropped:/ { print
\$
2 }"
)
"
fi
json_close_object
# $class
done
json_close_object
# traffic
json_close_object
# traffic
json_close_object
# statistics
json_close_object
# statistics
...
...
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
sign in
to comment