Odd issues on Install: Ubuntu Server

So I’m playing with a new VPS that’s costing me a whopping $15USD a year, there’s a bank breaker!

But I’ve found a couple of odd issues as I’ve started installing things.
One I’d not tripped over before is Vnstat issuing the error “Zero database found, exiting”

philtann@epicbox:~$ sudo apt-get install vnstat
Reading package lists... Done
Building dependency tree
Reading state information... Done
Suggested packages:
  vnstati
The following NEW packages will be installed:
  vnstat
0 upgraded, 1 newly installed, 0 to remove and 0 not upgraded.
Need to get 82.2 kB of archives.
After this operation, 311 kB of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu/ natty/universe vnstat i386 1.10-1 [82.2 kB]
Fetched 82.2 kB in 0s (148 kB/s)
Selecting previously deselected package vnstat.
(Reading database ... 22001 files and directories currently installed.)
Unpacking vnstat (from .../vnstat_1.10-1_i386.deb) ...
Processing triggers for man-db ...
Setting up vnstat (1.10-1) ...
 * Starting vnStat daemon vnstatd                                                                             Zero database found, exiting.
                                                                                                       [fail]

Relatively easy to get around, just punch in

sudo vnstat -u -i **INTERFACE**

where **INTERFACE** is the network interface you want monitored, for a hardwired PC it’s almost certainly going to be eth0 and for my laptop it’s wlan0 (until about 2 weeks ago when franken-network bit me, I wasn’t even sure if the ethernet card on my laptop still worked!).

If you’re unsure of the interface tag that you want to monitor type

ifconfig

or some distro’s may require a

/sbin/ifconfig

in your terminal, it will show you all interfaces that are connected, or available to connect to a network like this.

philtann@epicbox:~$ ifconfig
lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

venet0    Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:127.0.0.2  P-t-P:127.0.0.2  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1
          RX packets:34483 errors:0 dropped:0 overruns:0 frame:0
          TX packets:16431 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:48396687 (48.3 MB)  TX bytes:1109386 (1.1 MB)

venet0:0  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:199.195.249.214  P-t-P:199.195.249.214  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

venet0:1  Link encap:UNSPEC  HWaddr 00-00-00-00-00-00-00-00-00-00-00-00-00-00-00-00
          inet addr:172.16.183.40  P-t-P:172.16.183.40  Bcast:0.0.0.0  Mask:255.255.255.255
          UP BROADCAST POINTOPOINT RUNNING NOARP  MTU:1500  Metric:1

Because I know that the 199.195.249.214 ip is the public facing IP for this server, it’s easy to see which one I need so I used

sudo vnstat -u -i venet0

Which created the database on the server specifically for vnstat to monitor the venet0 interface then started the daemon

sudo /etc/init.d/vnstat start

Over time this will give me a good data set on how much bandwidth my server is using which is a useful tool to have.

1 Comment

Comments are closed