Visit Our UNIX and Linux User Community

Top Forums Shell Programming and Scripting How to make a script that logs bandwidth on a specific port? Post 302853987 by nbsparks on Monday 16th of September 2013 01:17:50 PM
Old 09-16-2013
How to make a script that logs bandwidth on a specific port?

I have a script that runs right before a daily reboot that captures the amount of MB transmitted up and pulled down since last reboot.
echo `date +"%m-%d-%y"``grep eth0 /proc/net/dev | awk '{print ","$2/1024/1024","$10/1024/1024}'`>>/home/nick/bandwidth.log

In looking at the raw output of /proc/net/dev, I know that this particular script will only yield the info on a Ethernet device. Is there any way to write a script that does something like this per port? I'd like to know, how much bandwidth is being consumed by the web pages being hosted on port 80 vs. the Minecraft server being hosted on port 25565.

Thanks in advance!
Test Your Knowledge in Computers #228
Difficulty: Easy
According to NetMarketShare, in September 2019 Linux had a 5% global market share of the desktop / laptop computer market.
True or False?

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script to delete logs or take backups under specific user

I have to write a shell script like this-- 1) Utility will be run under the directory owner. 2) This utility will clean files in ABC/logs. And following logs will be backed up or deleted. Dispatcher Logs Middle tier Logs Sage log Sage monitor log Sage db clean up result log Core files ... (12 Replies)
Discussion started by: namishtiwari
12 Replies

2. Shell Programming and Scripting

how do i get current bandwidth usage via shell script?

hello unix-people. can u please tell me how i can get the current bandwidth usage of my machine on shell into variables? thanks a lot (2 Replies)
Discussion started by: scarfake
2 Replies

3. UNIX for Advanced & Expert Users

how to port a package to huge source code having its own make and compilers

In general for intalling a package like we do ./configure, make , make install But if we want to integrate the package with a huge source base what are the things to be taken care could some one have a light on purpose of ./configure , make and make install along with above question. I... (1 Reply)
Discussion started by: Gopi Krishna P
1 Replies

4. Shell Programming and Scripting

Get Data Between a specific Date Range from logs

I need to extract data from logs for a mentioned date range..Its quite urgent can anyone help me out with it..its to be written in unix..just thought its better to specify.. (4 Replies)
Discussion started by: sankasu
4 Replies

5. IP Networking

Bandwidth shaping on specific port

Hi, I've been looking for a few hours now, reading various docs and man pages, but the info I found so far is either not what I was looking for or I just don't get how to do the thing I need.... So, my "problems" is that I have a server running on a specific port and I need to shape traffic... (2 Replies)
Discussion started by: Zamba
2 Replies

6. UNIX for Dummies Questions & Answers

Find Audio Files With Specific Bandwidth?

Hi, I would like to write a shell script that will: -search the files of a specific user to find any audio files with a bandwidth iqual or greater than 192 kps - on the results i should see the file name along with all the whole file route and each file's size So I guess i should be using... (1 Reply)
Discussion started by: ubu-user
1 Replies

7. Shell Programming and Scripting

using awk to get specific section of lines in logs

i have a log file that has the date and time that looks like this: Wed Jun 28 15:46:21 2012 test failed tailed passed passed not error panic what we want to focus on is the first 5 columns because they contain the date and time. the date and time can be anywhere on the line. in this... (6 Replies)
Discussion started by: SkySmart
6 Replies

8. Red Hat

How to send specific logs to remote rsyslog?

Assuming i have /usr/local/psa/var/log/mail.log on client server. What are the configuration on rsyslog (server) and rsyslog (client)? on rsyslog (server) i would also want it to be put on a separate log file for example: /var/log/client-server-hostname01/mail.log ,... (2 Replies)
Discussion started by: timmywong
2 Replies

9. Shell Programming and Scripting

IP list specific port checker script

Hello again people, I currently searching for a code/script that will allow it to check if a specific port is open, lets say 123. Found a public script on a ftp but I dont know how and what to modify in it to suit my needs. (I think this is a evil code and I want to use it as an example). ... (3 Replies)
Discussion started by: galford
3 Replies

10. Shell Programming and Scripting

If I ran perl script again,old logs should move with today date and new logs should generate.

Appreciate help for the below issue. Im using below code.....I dont want to attach the logs when I ran the perl twice...I just want to take backup with today date and generate new logs...What I need to do for the below scirpt.............. 1)if logs exist it should move the logs with extention... (1 Reply)
Discussion started by: Sanjeev G
1 Replies
ib_read_bw(1)							   User Commands						     ib_read_bw(1)

ib_read_bw - RDMA read bandwidth test SYNOPSIS
ib_read_bw [ options ] [ server IP address ] DESCRIPTION
This program tests the bandwidth of RMDA read transactions. OPTIONS
-p, --port=<port> listen on/connect to port <port> (default: 18515) -m, --mtu=<mtu> mtu size (default: 1024) -d, --ib-dev=<dev> use IB device <dev> (default: first device found) -i, --ib-port=<port> use port <port> of IB device (default: 1) -s, --size=<size> size of message to exchange (default: 1) -a, --all run sizes from 2 till 2^23 -t, --tx-depth=<dep> size of tx queue (default: 50) -n, --iters=<iters> number of exchanges (at least 100, default: 1000) -C, --report-cycles report times in cpu cycle units (default: microseconds) -H, --report-histogram print out all results (default: print summary only) -U, --report-unsorted (implies -H) print out unsorted results (default: sorted) -V, --version display version number AUTHOR
Guy Coates < > perftest February 20, 2008 ib_read_bw(1)

Featured Tech Videos

All times are GMT -4. The time now is 10:26 PM.
Unix & Linux Forums Content Copyright 1993-2020. All Rights Reserved.
Privacy Policy