Comments (13)
what does this command tell, in a shell ?
/bin/netstat -ntu | awk 'NR>2{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr
from linux-dash.
Load the dashboard, get the error message and this:
root@pbx2:/ $ /bin/netstat -ntu | awk 'NR>2{print $5}' | cut -d: -f1 | sort | uniq -c | sort -nr
18
2 127.0.0.1
2 10.41.2.126
1 208.113.219.101
1 146.255.36.1
1 10.41.2.6
from linux-dash.
i suspect that address to begin with a ":" or something wrong with the cut
could you try without the cut ?
/bin/netstat -ntu | awk 'NR>2{print $5}' | sort | uniq -c | sort -rk 1
by the way, this command should be the one used (if it fixes your pb obviously), cause it may the result more precise, keeping port distinction beetween connections.
from linux-dash.
Confirmed.
root@pbx2:/ $ /bin/netstat -ntu | awk 'NR>2{print $5}' | sort | uniq -c | sort -rk 1
1 ::ffff:10.41.2.6:38329
1 ::ffff:10.41.2.126:62136
1 ::ffff:10.41.2.126:62135
1 ::ffff:10.41.2.126:62134
1 ::ffff:10.41.2.126:62133
1 ::ffff:10.41.2.126:62132
1 ::ffff:10.41.2.126:62131
1 ::ffff:10.41.2.126:62130
1 ::ffff:10.41.2.126:62129
1 ::ffff:10.41.2.126:62128
1 ::ffff:10.41.2.126:62127
1 ::ffff:10.41.2.126:62126
1 ::ffff:10.41.2.126:62125
1 ::ffff:10.41.2.126:62124
1 ::ffff:10.41.2.126:62123
1 ::ffff:10.41.2.126:62122
1 ::ffff:10.41.2.126:62121
1 ::ffff:10.41.2.126:62120
1 ::ffff:10.41.2.126:62119
1 208.113.219.101:80
1 127.0.0.1:56565
1 127.0.0.1:5038
1 10.41.2.126:61511
1 10.41.2.126:60640
1 10.10.0.17:53
from linux-dash.
And how about this one ?
/bin/netstat -ntu | awk 'NR>2 {sub(/:[^:]+?$/, ""); print $5}' | sort | uniq -c | sort -rk 1
from linux-dash.
root@pbx2:/ $ /bin/netstat -ntu | awk 'NR>2 {sub(/:[^:]+?$/, ""); print $5}' | sort | uniq -c | sort -rk 1
2 127.0.0.1
2 10.41.2.126
20 ::ffff:10.41.2.126
1 208.113.219.101
1 146.255.36.1
1 10.41.2.6
from linux-dash.
hmm, it solves (partially) the problem. This one should be ok :
/bin/netstat -ntu | awk 'NR>2 {sub(/:[^:]+?$/, ""); print $5}' | sort | uniq -c | sort -nrk 1
from linux-dash.
root@pbx2:/ $ /bin/netstat -ntu | awk 'NR>2 {sub(/:[^:]+?$/, ""); print $5}' | sort | uniq -c | sort -nrk 1
31 ::ffff:10.41.2.126
2 127.0.0.1
2 10.41.2.126
1 208.113.219.101
1 146.255.36.1
from linux-dash.
The port will only be a number; sub(/:[^:]+?$/, "");
can be changed to sub(/:[0-9]+$/, "");
.
Is the first call to sort
necessary?
The k
argument to the second sort
call can be omitted.
from linux-dash.
yep, first sort is necessary. Removing it cause the uniq to not work completly. Dunbno exactkly why, i'm not a unix expert, not yet :)
And about regexp, it's not a bug, it's a feature 💃
I just wanted to be more generic, that's why I also make the quantifior less greedy (to handle weird client address)
And I agree about the k argument.
from linux-dash.
second sort is even fully useless since it's javascript sorted
from linux-dash.
I figured that was the cause for the pattern. I personally prefer explicitness when possible and I'd rather tackle specific issues as they arise, but I'm not going to insist either way.
I do think we should probably drop the second call to sort
, though.
from linux-dash.
I'm ok with that too, i'll change it in that way !
from linux-dash.
Related Issues (20)
- Docker container with linux dash HOT 2
- Limited data is shown when used on photonos HOT 4
- Dash displays same information as the demo HOT 1
- Incorporate APCups
- Json parse error HOT 1
- Python 3 support HOT 2
- Pi Raspbian issue linux_json_api-sh HOT 2
- injection vulnerabilities HOT 2
- Data loading for even in first starting server in node, but in the second starting server,Data display ( Delay display data in dash board) HOT 2
- any way to remove certain widgets? HOT 1
- module not found error HOT 1
- Total RAM capacity & usage incorrect HOT 1
- Recent Logins section and empty strings
- Literally nothing works except cpu usage HOT 5
- Getting JSON error in node enviroment HOT 7
- Is this project active?
- cpu temp displayed but graph blank HOT 1
- OpenBSD 7.2 issue HOT 1
- linux_json_api.sh no such file or directory with go HOT 1
- Remove Linux-Dash HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from linux-dash.