About GNU/Linux

The content of that blog comes from http://about-gnulinux.info, I translate all articles in english. The content deals with Free software (GNU/Linux).

Monitor your services with mon !

Mon is a tool for monitoring the services of a Linux system and that sends an alert via mail if a service doesn't work anymore.

Here is a possible configuration (/etc/mon/mon.cf) :

# We give the IP and the domain name (if existing, or the dns reverse) of the system to monitor :
hostgroup myWebSite.tld 11.22.33.44

## FTP :
watch myWebSite.tld
 service ftp
         interval 35m # monitoring of the service every 35minutes

         monitor ftp.monitor -p 21 -t 5 myWebSite.tld # which kind of service to monitor and the used port for the FTP

         period wd {Mon-Sun} # from monday to sunday, modify if you need

         alert mail.alert -S "The FTP server of "myWebSite.tld" is down !" EMAIL1@myWebSite.tld EMAIL2@myWebSite1.tld # alert's title + email getting the alert

         alert hb_takeover

         upalert mail.alert -S "The FTP server of "myWebSite.tld" is now up" EMAIL1@myWebSite.tld# content of the mail when the service is up

         alertafter 5s # alert after 5sec

         alertevery 10m # alert every 10minutes until the end of the alert

## ping :
    service ping
        interval 30m
        monitor ping.monitor
        period wd {Mon-Sun}
           alert mail.alert -S "The server monSiteWeb.tld" is down !" EMAIL1@myWebSite.tld
           upalert mail.alert -S "The server "monSiteWeb.tld" is now up !" EMAIL1@myWebSite.tld
           alert hb_standby
           alertafter 5s
           alertevery 10m

## Service postfix
    service postfix
        interval 35m
        monitor smtp.monitor -t 5 myWebSite.tld
        period wd {Mon-Sun}
        alert mail.alert -S "The mail (smtp) server of "myWebSite.tld" is down !" EMAIL1@myWebSite.tld
        alert hb_takeover
        upalert mail.alert -S "The mail server (smtp) of "myWebSite.tld" is now up" EMAIL1@myWebSite.tld
        alertafter 10s
        alertevery 10m

## Service http
    service HTTP
        interval 35m
        monitor http.monitor
        period wd {Mon-Sun}
        alert mail.alert -S "The HTTP server of "myWebSite.tld" is down !" EMAIL1@myWebSite.tld
        alert hb_takeover
        upalert mail.alert -S "The HTTP server of myWebSite.tld" is now up" EMAIL1@myWebSite.tld
        alertafter 10s
        alertevery 10m

Enjoy !

And...

Virtualbox : The character device /dev/vboxdrv does not exist or NS_ERROR_FAILURE

Errors :

When you install virtualbox, you can get this kind of error :

WARNING: The character device /dev/vboxdrv does not exist.
	 Please install the virtualbox-ose-dkms package and the appropriate
	 headers, most likely linux-headers-686.

	 You will not be able to start VMs until this problem is fixed.
**
GLib-GIO:ERROR:/build/buildd-glib2.0_2.28.6-1-i386-A3fp41/glib2.0-2.28.6/./gio/gdbusconnection.c:2279:initable_init: assertion failed: (con
nection->initialization_error == NULL)
Aborted

Reading this message means "install the virtualbox-ose-dkms package and the headers of your current kernel".

Or/and with the above message, you can get this one :

Failed to open a session for the virtual machine BLABLA

The virtual machine 'BLABLA' has terminated unexpectedly during starting with exit code 1.

Result code : NS_ERROR_FAILURE (0x80004005)

and

 
Kernel driver not installed

Please install the virtualbox-dkms package and execute 'modprobe vboxdrv' as root

To fix them :

Firstly, install the kernel's linux-headers package (find your courrent kernel with uname -r) :

aptitude install linux-headers-2.6.39-bpo.2-686-pae # aptitude search linux-headers will help you

Then if the package virtualbox-dkms is not installed (check with dpkg -l | grep virtualbox-dkms), install it :

aptitude install virtualbox-dkms

Then you should lunch m-a (module-assistant, this assistant manages the modules, thanks to debian!)

m-a prepare
m-a a-i virtualbox-source # module installation

If you want to get more details about m-a, just do "man m-a".

And the last thing to do is to restart the computer or to modprobe vboxdrv.

No module named wxaddons.sized_control - Itrade

If you get this error after the itrade installation (software for trading), at its starting :

ImportError: No module named wxaddons.sized_control

The error seems to come from a conflict of versions, between the current versions of some modules and the current stable version of the software.

You should install the last unstable version of itrade, the officiel website of the project will give you all the details you need on this page

Find and download any version of Iceweasel or Icedove

It is not always easy to find any version (such as the newest versions) of Iceweasel or Icedove in debian.

That's why the Debian Mozilla team created a webpage for searching any version of these two softwares. You will find this page at http://mozilla.debian.net/.

You'll find all the details about downloading and installing the version of Ice* you want in the page. ;)

Enjoy !

How to connect two Linux PCs together

We're going to see how to connect two Linux (debian) PCs together with a wire. The purpose is to share data !

I - Hardware :

  • A RJ45 wire ;
  • Plug in your ethernet wire to your computers ;

II - Conf :

Our case is : the PC "A" is the master and the PC "B" is the slave. (the B must connected to the A)

In the "interfaces" file (/etc/network/interfaces) of each computer :

PC A :

allow-hotplug eth0
iface eth0 inet static
address 192.168.3.3 # PC A's IP
netmask 255.255.255.0
brodcast 192.168.3.255

You can observe we don't use a gateway.

PC B :

allow-hotplug eth0
iface eth0 inet static
address 192.168.3.4 # PC B's IP
netmask 255.255.255.0
brodcast 192.168.3.255
gateway 192.168.3.3 # a gateway is necessary (PC A's IP)

Don't forget to modify "eth0" if it's needed (and the IPs).

And, you must mount eth0 on each computer (first on PCA and on PCB) :

ifup eth0

That's all ! This way to do is very easy to set up for sharing data, but can be sufficient. You only need, for example, to use Samba to share your data.