LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 01-02-2009, 01:36 AM   #1
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Rep: Reputation: Disabled
performance monitoring tool for network..something like perfmon


Hello all,

I am in need of some tool that can monitor my network interfaces and put the output into some file in format that is human readable so that it can be used later on. I am trying ntop but I still need suggestions for better performance management. I need it to find the speed of my internet connection. It should possibly run as daemon so that no human interaction is needed. It will run on a server running squid. Something similar to perfmon that is built in windows.
 
Old 01-02-2009, 02:58 AM   #2
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
I have got ifstat and I guess it is a good tool to use. I collect the data in a log file and I think it is ok. I put the process in the background and it is working. But I want to know how to append the file instead of getting it over written everytime I call ifstat.
Suppose I am using command like

ifstat > /ifstat/log &

This will put the process in background and log all the entries in the file. But everytime I start the process it will over write the file. I need to append. How do I tell ifstat to append the file rather than to overwrite it?
 
Old 01-02-2009, 03:37 AM   #3
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Well......
ifstat shows the bandwidth consumes or the internet speed I get at the particular moment. And it will show the bandwidth only if someone is downloading or using the internet.
My aim was to have some tool that will keep the track of bandwidth my isp provides no matter if someone is using it or not.
I thought a script could do so. I will download something using wget and run ifstat and collect the output in some file and this script will run every hour so that I know average bandwidth I get from ISP.
Here I have got a small issue. I write the bash script and run it and download it and everything. But how do I tell ifstat to stop or kill itself once the download is complete? And that too in this script.
I know there is an option available with ifstat called count after which it will stop but how do I know after how many counts is downloading going to complete? I do not know the time required for the download. I want that once the download is complete ifstat should kill itself.

Any inputs will be highly appreciated.

Last edited by linuxlover.chaitanya; 01-02-2009 at 03:42 AM.
 
Old 01-02-2009, 06:26 AM   #4
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Another problem. I am not good at shell scripting and I tried to do that exactly.
I wrote a script that downloads a file using wget and logs network statistics using ifstat.
What I needed was to monitor the network activity while downloading was in progress. But what happened was that once downloading completed i.e. wget finished ifstat was executed.
I want both, wget and ifstat to execute simultaneously. Can anyone help?

Putting my script here for reference. If anyone can tell me what modifications are to be made it will be very helpful.
Code:
#!/bin/bash

cd /downloads
wget http://xxxxxxxxxxxx  
 ifstat -T 1 60 > /ifstat/log
Also the file log in ifstat directory is not getting appended. Its getting overwritten.

Ok. Just edited the line to ifstat -T 1 60 >> /ifstat/log to append the results. Still the basic problem remains

Last edited by linuxlover.chaitanya; 01-02-2009 at 06:44 AM.
 
Old 01-04-2009, 08:09 AM   #5
markseger
Member
 
Registered: Jul 2003
Posts: 244

Rep: Reputation: 26
use collectl

I wrote this tool a number of years ago, the focus on collecting virtually anything you might want to look at, one of which is network data. The neat thing is you can run collectl as a service and play back the data later either as text such as:

# <----------Network---------->
#Time KBIn PktIn KBOut PktOut
04:23:50 15 47 3 30
04:23:51 0 7 0 4

or if you're interested in individual network interfaces you can do that too as:

# NETWORK STATISTICS (/sec)
# Num Name KBIn PktIn SizeIn MultI CmpI ErrIn KBOut PktOut SizeO CmpO ErrOut
04:24:23 0 lo: 0 6 92 0 0 0 0 6 92 0 0
04:24:23 1 eth0: 0 3 64 0 0 0 0 0 0 0 0
04:24:23 2 eth1: 0 2 67 0 0 0 0 1 150 0 0
04:24:23 3 sit0: 0 0 0 0 0 0 0 0 0 0 0
04:24:24 0 lo: 0 0 0 0 0 0 0 0 0 0 0
04:24:24 1 eth0: 0 4 134 0 0 0 0 0 0 0 0
04:24:24 2 eth1: 0 6 70 0 0 0 1 6 203 0 0
04:24:24 3 sit0: 0 0 0 0 0 0 0 0 0 0 0

Alternatively you can also generate the output in space-separated format like this (there is also a for that shows individual interfaces):

#Date Time [NET]RxPktTot [NET]TxPktTot [NET]RxKBTot [NET]TxKBTot [NET]RxCmpTot [NET]RxMltTot [NET]TxCmpTot [NET]RxErrsTot [NET]TxErrsTot
20090104 04:25:21 10 4 1 0 0 0 0 0 0
20090104 04:25:22 3 5 0 1 0 0 0 0 0

which means you can directly load it other tools such as excel or open office to examine/plot it OR use tools like gnuplot directly.

These examples show it taking samples every second - the default when run as a daemon is once every 10 seconds. You can set that interval to anything you want including fractional times.

Far too many options to go into them here, but check out http://collectl.sourceforge.net/ to learn more

-mark
 
Old 01-04-2009, 11:17 PM   #6
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Thanks Mark for that very much. Will look into it give you feedback surely.
 
Old 01-05-2009, 01:18 AM   #7
linuxlover.chaitanya
Senior Member
 
Registered: Apr 2008
Location: Gurgaon, India
Distribution: Cent OS 6/7
Posts: 4,631

Original Poster
Rep: Reputation: Disabled
Hi Mark,
Its a nice tool to have but my original problem still remains. How do I use this tool in the script so that two commands run simultaneously. Not that first completes and then second starts.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
network monitoring tool staubsaugen Linux - Networking 2 03-27-2008 06:06 PM
Collectl - a new performance monitoring tool markseger LinuxQuestions.org Member Intro 3 01-10-2008 12:50 PM
Perfmon tool kjsubbu Linux - Server 2 03-30-2007 06:19 AM
Performance Monitoring Tool kaplan71 Linux - Software 1 09-21-2006 02:40 PM
Monitoring Windows Servers from Linux (CPU, Perfmon, Event log) big_linux_geek Linux - Enterprise 5 02-16-2005 01:20 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 05:16 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration