Showing posts with label debian. Show all posts
Showing posts with label debian. Show all posts

Saturday, February 14, 2009

Link: Introduction to Xen Virtualization

I've played around with VMware for years. Not on servers, but on my desktop. I was really familiar with the way it worked when I found VirtualBox, which became my desktop emulator of choice. They both worked in very similar ways, where they would completely emulate an entire machine. Then Xen came out, and I was pretty lost.

I've never taken the time to do the hard work in acquiring a mastery of Xen. I didn't really see the need for it, and I didn't understand it well. I still don't understand it all, but yesterday Joe Topjian posted a link on Adminspotting to an outstanding Introduction to Xen on Debian. A very small bit of the instructions are Debian specific, but it functions well as a general introduction to Xen. There are some questions unanswered, but it seems like a great starting point.

If you are similarly unfamiliar but curious, definitely check it out.

Wednesday, January 28, 2009

vnstat Console Network Traffic Monitor

Many thanks to Nick Anderson for this blog entry!


Matt was kind enough to ask me to spice things up a bit while he is gone on vacation.(well kind to me, perhaps not so kind to his readers).

If you have ever wanted to monitor network bandwidth I'm sure your familiar with mrtg. I find it useful to be able to do things from the console whenever possible. vnstat fills the void for simple bandwidth monitoring. Since vnstat pulls its information from the /proc filesystem it can be used without root permissions.

To install vnstat on debian just do

[code=bash]
sudo aptitude install vnstat
[/code]

Now you need to create the databases for it to log to. For each interface you want to monitor do the following.

[code=bash]
sudo vnstat -u -i iface
[/code]

After you have created the databases for each interface you want to monitor check to ensure the cron entry was setup correctly. You should have a file in /etc/cron.d called vnstat and its contents should be similar to the following.

[code=bash]
# /etc/cron.d/vnstat: crontab entries for the vnstat package

0-55/5 * * * * root if [ -x /usr/bin/vnstat ] && [ `ls /var/lib/vnstat/ | wc -l` -ge 1 ]; then /usr/bin/vnstat -u; fi
[/code]

Now all you have to do is wait. After some time you can get interesting output like this.


[code=bash]
vnstat --days -i wlan0

wlan0 / daily

day rx | tx | total
------------------------+-------------+----------------------------------------
05.01. 9.69 MB | 1.84 MB | 11.53 MB
06.01. 410.54 MB | 23.72 MB | 434.26 MB %
07.01. 409.89 MB | 25.83 MB | 435.71 MB %
08.01. 68.63 MB | 12.91 MB | 81.54 MB
09.01. 9.75 MB | 3.73 MB | 13.49 MB
10.01. 292.16 MB | 39.78 MB | 331.94 MB %
11.01. 178.23 MB | 1.57 GB | 1.74 GB %:::::
12.01. 350.97 MB | 1.60 GB | 1.94 GB %:::::
13.01. 23.65 MB | 5.89 MB | 29.54 MB
14.01. 410.56 MB | 1.61 GB | 2.01 GB %::::::
15.01. 440.17 MB | 1.62 GB | 2.05 GB %::::::
16.01. 241.75 MB | 26.32 MB | 268.07 MB
17.01. 713.33 MB | 79.22 MB | 792.56 MB %%
18.01. 5.40 GB | 1.64 GB | 7.05 GB %%%%%%%%%%%%%%%%%%%::::::
19.01. 168.10 MB | 1.45 GB | 1.61 GB %::::
20.01. 19.27 MB | 9.64 MB | 28.91 MB
------------------------+-------------+----------------------------------------
estimated 21 MB | 10 MB | 31 MB

vnstat --months -i wlan0

wlan0 / monthly

month rx | tx | total
-------------------------+--------------+--------------------------------------
Jan '09 9.06 GB | 9.72 GB | 18.78 GB %%%%%%%%%%%:::::::::::
-------------------------+--------------+--------------------------------------
estimated 14.13 GB | 15.16 GB | 29.30 GB
[/code]

Hopefully its something you can add to your command line toolbox.