PDA

توجه ! این یک نسخه آرشیو شده میباشد و در این حالت شما عکسی را مشاهده نمیکنید برای مشاهده کامل متن و عکسها بر روی لینک مقابل کلیک کنید : نمایش پهنای باند مصرفی سرور بصورت روزانه



P-CO
November 12th, 2009, 23:32
با سلام، شما با نصب VNSTAT میتونین میزان پهنای باند مصرفی سرورتون رو چک بکنین.

آموزش نصب :




1) be root
2) (change directory to /usr/src or whatever you want) root@host [~]# cd /usr/src
3) (download the file using wget) root@host [~]# wget http://humdi.net/vnstat/vnstat-1.4.tar.gz
4) (untar the compressed package) root@host [~]# tar zxvf vnstat-1.4.tar.gz
5) (change directory to Vnstat) root@host [~]# cd vnstat-1.4
6) (compile using gcc) root@host [~]# make && make install
7) (run vnstat for the first time) root@host [~/vnstat-1.4]# vnstat
8) Vnstat will prompt you to make a new database for the interface you wish to monitor. In my case, I want to monitor venet0 so I type: root@host [~/vnstat-1.4]# vnstat -u -i venet0
9) you should see the following: Error: Unable to read database "/var/lib/vnstat/venet0". New database generated.
10) You're ready to run vnstat. root@host [~]# vnstat


با آرزوی موفقیت برای تک تک عزیزان. :113:

P-CO
November 12th, 2009, 23:33
این هم خروجی برنامه :





Database updated: Thu Nov 12 23:00:01 2009

eth0

received: 14.26 MB (37.8%)
transmitted: 23.16 MB (62.2%)
total: 37.42 MB

rx | tx | total
-----------------------+------------+-----------
today 14.26 MB | 23.16 MB | 37.42 MB
-----------------------+------------+-----------
estimated 14 MB | 24 MB | 38 MB

Roka
November 12th, 2009, 23:34
با تشكر از دوست عزيزمون

توي debian ‌هم با دستور زير نصب ميشه :

apt-get install vnstat

همچنين امكان custom ‌هم داره كه از دستور زير همه option ‌هاشو بهتون ميگه :

man vnstat
موفق باشيد

Vahid
November 12th, 2009, 23:35
با این میتونید VPS های VMware که میدید ببینید چقدر میکشه

P-CO
November 13th, 2009, 00:19
ورژن جدیدتر این برنامه هم ظاهراً هست :

http://humdi.net/vnstat/vnstat-1.9.tar.gz

این رو هم میتونین استفاده کنین.

P-CO
November 13th, 2009, 00:26
این هم خروجی های مختلف این برنامه با دستورات متفاوت :





$ vnstat
Database updated: Sat Aug 1 22:50:01 2009

eth1 since 11/20/08

rx: 3.32 TiB tx: 2.81 TiB total: 6.13 TiB

monthly
rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
Jul '09 609.40 GiB | 282.21 GiB | 891.61 GiB | 2.79 Mbit/s
Aug '09 16.95 GiB | 10.46 GiB | 27.40 GiB | 2.80 Mbit/s
------------------------+-------------+-------------+---------------
estimated 552.14 GiB | 340.70 GiB | 892.83 GiB |

daily
rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
yesterday 19.19 GiB | 8.63 GiB | 27.82 GiB | 2.70 Mbit/s
today 16.95 GiB | 10.46 GiB | 27.40 GiB | 2.80 Mbit/s
------------------------+-------------+-------------+---------------
estimated 17.81 GiB | 10.99 GiB | 28.80 GiB |


(with 2 interfaces)


$ vnstat

rx / tx / total / estimated
Internet (eth1):
Jul '09 31.90 GiB / 28.05 GiB / 59.95 GiB
Aug '09 281.04 MiB / 99.45 MiB / 380.49 MiB / 12.05 GiB
yesterday 1.23 GiB / 473.23 MiB / 1.69 GiB
today 281.04 MiB / 99.45 MiB / 380.49 MiB / 397 MiB

Local (eth0):
Jul '09 25.13 GiB / 116.94 GiB / 142.07 GiB
Aug '09 234.75 MiB / 5.03 GiB / 5.26 GiB / 170.76 GiB
yesterday 520.55 MiB / 2.21 GiB / 2.72 GiB
today 234.75 MiB / 5.03 GiB / 5.26 GiB / 5.51 GiB




$ vnstat -h
eth1 21:25
^ r
| r
| r r
| r r r
| t r r r t
| rt r r r r t t
| rt r r r r t t
| rt r r t r r r t t
| rt r rt t r r r rt rt t rt rt t
| rt rt rt rt rt r rt r r r r r rt rt rt rt rt rt rt t
-+--------------------------------------------------------------------------->
| 22 23 00 01 02 03 04 05 06 07 08 09 10 11 12 13 14 15 16 17 18 19 20 21

h rx (KiB) tx (KiB) h rx (KiB) tx (KiB) h rx (KiB) tx (KiB)
22 250,801 205,825 06 100,529 49,054 14 205,356 157,877
23 705,144 885,844 07 52,806 44,130 15 258,228 226,265
00 928,792 224,789 08 52,298 45,230 16 1,028,043 343,843
01 1,271,180 292,260 09 70,396 61,719 17 755,804 293,309
02 212,296 186,481 10 155,502 72,451 18 235,691 284,886
03 165,931 91,943 11 266,673 92,497 19 275,554 658,386
04 150,997 437,071 12 392,244 122,185 20 307,819 850,813
05 180,170 56,391 13 133,829 120,555 21 117,474 292,787




$ vnstat -d

eth1 / daily

day rx | tx | total | avg. rate
------------------------+-------------+-------------+---------------
07/03/09 10.90 GiB | 6.39 GiB | 17.29 GiB | 1.68 Mbit/s
07/04/09 21.21 GiB | 5.65 GiB | 26.87 GiB | 2.61 Mbit/s
07/05/09 10.58 GiB | 6.67 GiB | 17.25 GiB | 1.67 Mbit/s
07/06/09 49.90 GiB | 9.69 GiB | 59.59 GiB | 5.79 Mbit/s
07/07/09 28.09 GiB | 7.58 GiB | 35.68 GiB | 3.46 Mbit/s
07/08/09 17.60 GiB | 6.83 GiB | 24.43 GiB | 2.37 Mbit/s
07/09/09 20.80 GiB | 15.64 GiB | 36.44 GiB | 3.54 Mbit/s
07/10/09 16.10 GiB | 11.14 GiB | 27.24 GiB | 2.64 Mbit/s
07/11/09 9.79 GiB | 4.96 GiB | 14.76 GiB | 1.43 Mbit/s
07/12/09 9.36 GiB | 9.60 GiB | 18.97 GiB | 1.84 Mbit/s
07/13/09 11.26 GiB | 8.16 GiB | 19.42 GiB | 1.89 Mbit/s
07/14/09 32.65 GiB | 9.56 GiB | 42.21 GiB | 4.10 Mbit/s
07/15/09 35.32 GiB | 15.55 GiB | 50.88 GiB | 4.94 Mbit/s
07/16/09 20.71 GiB | 15.24 GiB | 35.95 GiB | 3.49 Mbit/s
07/17/09 15.10 GiB | 15.34 GiB | 30.44 GiB | 2.95 Mbit/s
07/18/09 14.23 GiB | 5.20 GiB | 19.44 GiB | 1.89 Mbit/s
07/19/09 23.59 GiB | 6.73 GiB | 30.32 GiB | 2.94 Mbit/s
07/20/09 36.36 GiB | 7.53 GiB | 43.90 GiB | 4.26 Mbit/s
07/21/09 28.11 GiB | 6.06 GiB | 34.16 GiB | 3.32 Mbit/s
07/22/09 20.80 GiB | 15.36 GiB | 36.16 GiB | 3.51 Mbit/s
07/23/09 18.20 GiB | 10.71 GiB | 28.91 GiB | 2.81 Mbit/s
07/24/09 13.07 GiB | 6.25 GiB | 19.33 GiB | 1.88 Mbit/s
07/25/09 9.74 GiB | 6.38 GiB | 16.11 GiB | 1.56 Mbit/s
07/26/09 11.51 GiB | 6.66 GiB | 18.17 GiB | 1.76 Mbit/s
07/27/09 16.68 GiB | 9.18 GiB | 25.86 GiB | 2.51 Mbit/s
07/28/09 17.06 GiB | 6.61 GiB | 23.67 GiB | 2.30 Mbit/s
07/29/09 23.19 GiB | 7.21 GiB | 30.41 GiB | 2.95 Mbit/s
07/30/09 9.34 GiB | 7.79 GiB | 17.13 GiB | 1.66 Mbit/s
07/31/09 19.19 GiB | 8.63 GiB | 27.82 GiB | 2.70 Mbit/s
08/01/09 17.13 GiB | 10.50 GiB | 27.63 GiB | 2.81 Mbit/s
------------------------+-------------+-------------+---------------
estimated 17.94 GiB | 11.00 GiB | 28.94 GiB |




$ vnstat -m

eth1 / monthly

month rx | tx | total | avg. rate
------------------------+--------------+--------------+---------------
Nov '08 74.94 GiB | 96.48 GiB | 171.42 GiB | 554.76 kbit/s
Dec '08 279.32 GiB | 276.05 GiB | 555.37 GiB | 1.74 Mbit/s
Jan '09 324.34 GiB | 413.38 GiB | 737.72 GiB | 2.31 Mbit/s
Feb '09 273.73 GiB | 362.49 GiB | 636.22 GiB | 2.21 Mbit/s
Mar '09 353.50 GiB | 270.03 GiB | 623.53 GiB | 1.95 Mbit/s
Apr '09 361.74 GiB | 365.01 GiB | 726.74 GiB | 2.35 Mbit/s
May '09 345.62 GiB | 440.43 GiB | 786.05 GiB | 2.46 Mbit/s
Jun '09 758.45 GiB | 359.30 GiB | 1.09 TiB | 3.62 Mbit/s
Jul '09 609.40 GiB | 282.21 GiB | 891.61 GiB | 2.79 Mbit/s
Aug '09 17.13 GiB | 10.50 GiB | 27.63 GiB | 2.81 Mbit/s
------------------------+--------------+--------------+---------------
estimated 556.15 GiB | 340.85 GiB | 897.00 GiB |




$ vnstat -t

eth1 / top 10

# day rx | tx | total | avg. rate
-----------------------------+-------------+-------------+---------------
1 06/24/09 80.56 GiB | 10.47 GiB | 91.03 GiB | 8.84 Mbit/s
2 06/09/09 49.11 GiB | 21.65 GiB | 70.76 GiB | 6.87 Mbit/s
3 06/15/09 38.01 GiB | 28.77 GiB | 66.78 GiB | 6.48 Mbit/s
4 06/26/09 53.03 GiB | 10.57 GiB | 63.60 GiB | 6.17 Mbit/s
5 07/06/09 49.90 GiB | 9.69 GiB | 59.59 GiB | 5.79 Mbit/s
6 06/25/09 47.32 GiB | 10.11 GiB | 57.43 GiB | 5.58 Mbit/s
7 02/20/09 19.15 GiB | 37.55 GiB | 56.70 GiB | 5.50 Mbit/s
8 02/02/09 20.65 GiB | 34.03 GiB | 54.68 GiB | 5.31 Mbit/s
9 01/14/09 20.00 GiB | 32.99 GiB | 52.99 GiB | 5.14 Mbit/s
10 04/26/09 32.37 GiB | 19.22 GiB | 51.59 GiB | 5.01 Mbit/s
-----------------------------+-------------+-------------+---------------




$ vnstat -w

eth1 / weekly

rx | tx | total | avg. rate
---------------------------+-------------+-------------+---------------
last 7 days 114.11 GiB | 56.58 GiB | 170.69 GiB | 2.38 Mbit/s
last week 137.79 GiB | 58.96 GiB | 196.75 GiB | 2.73 Mbit/s
current week 102.60 GiB | 49.92 GiB | 152.52 GiB | 2.49 Mbit/s
---------------------------+-------------+-------------+---------------
estimated 121.38 GiB | 59.06 GiB | 180.44 GiB |



$ vnstat -tr
3103 packets sampled in 5 seconds
Traffic average for eth1

rx 50.41 KiB/s 289 packets/s
tx 82.11 KiB/s 331 packets/s



$ vnstat -l
Monitoring eth1... (press CTRL-C to stop)

rx: 63.06 KiB/s 365 p/s tx: 112.84 KiB/s 436 p/s


eth1 / traffic statistics

rx | tx
--------------------------------------+----------------------------------------
bytes 3.83 MiB | 5.63 MiB
--------------------------------------+----------------------------------------
max 206.55 KiB/s | 273.35 KiB/s
average 63.21 KiB/s | 93.01 KiB/s
min 36.86 KiB/s | 24.02 KiB/s
--------------------------------------+----------------------------------------
packets 17251 | 20214
--------------------------------------+----------------------------------------
max 376 p/s | 473 p/s
average 278 p/s | 326 p/s
min 183 p/s | 215 p/s
--------------------------------------+----------------------------------------
time 1.03 minutes



موفق باشید.

takweb.ir
November 13th, 2009, 00:38
با این میتونید VPS های VMware که میدید ببینید چقدر میکشه

چه طوری؟

1eng.ir
November 13th, 2009, 00:40
کاربردی و عالی بود.
بسی شادمان گشتیم :)

1eng.ir
November 13th, 2009, 00:50
واسه وی پی اس ویندوز فکر نکنم بشه.

اینم Helpش:


-q, --query query database
-h, --hours show hours
-d, --days show days
-m, --months show months
-w, --weeks show weeks
-t, --top10 show top10
-s, --short use short output
-u, --update update database
-i, --iface select interface (default: eth0)
-?, --help short help
-v, --version show version
-tr, --traffic calculate traffic
-ru, --rateunit swap configured rate unit
-l, --live show transfer rate in real time

iranihost
November 13th, 2009, 01:15
چه طوری؟

فکر کنم وحید سوالی پرسید !

درسته وحید ؟

FireMan
November 30th, 2009, 10:46
سلام

دوست عزیز چطوری میشه این vnstat رو از روی سرور پاک کرد ؟

Arashdn
November 30th, 2009, 15:07
میشه با این برنامه دید هر ایپی چقدر مصرف داشته؟

Vahid
November 30th, 2009, 15:07
اره
لازمه هر ایپی رو تو یه اینتر فیس بزاری

Arashdn
November 30th, 2009, 16:06
دقیقا چطوری؟

Vahid
November 30th, 2009, 16:09
ببین تو توی eth0 مثلا یه دونه ایگی ادد میکنی
حالا برو یه eth0:1 بساز و ایپی رو بدده توش این شکلی مانیتور میکنه

Arashdn
November 30th, 2009, 16:17
من با وی ام ور کار میکنم
که این کار رو نمیشه کرد

Roka
December 2nd, 2009, 14:13
سلام

دوست عزیز چطوری میشه این vnstat رو از روی سرور پاک کرد ؟

اگه Centos یا fedora استفاده میکنی



yum remove vnstat

اگه debian یا ubuntu استفاده میکنی


apt-get remove vnstat

موفق باشید