Unetlab: create a QEMU image

So you have your Unified Networking Lab (UNL) server running and you want to use arbitrary QEMU images with it. Here is how to create one. All UNL data is stored under /opt/unetlab , images are stored under /opt/unetlab/addons and QEMU images are a folder deeper under /opt/unetlab/addons/qemu . UNL expects to find images within directories named according to some scheme. The directory names must start with some keywords followed by anything you want....

March 18, 2016

Ubuntu 14.04 and USB to Serial ch341 (chinese device from Ebay)

You can find pretty cheap USB to Serial devices on Ebay. I bought one and received a device using a chip ch341. Unfortunately, the drive is bugged in Ubuntu 12.04 and 14.04. Fortunately, there is patch to fix it. Here is how to recompile the module to enjoy these devices. $ sudo apt-get source linux-source-3.13.0 linux-headers-$(uname -r) $ cd /tmp $ tar -xjf /usr/src/linux-source-3.13.0.tar.bz2 $ cd linux-source-3.13.0/ $ make oldconfig $ make prepare $ make scripts $ cp -v /usr/src/linux-headers-$(uname -r)/Module....

December 31, 2015

Update GNS3 server on GNS3 IOU VM

GNS3 Sourceforge account provides an OVA image ready to run gns3-server for those who want to use Cisco IOS on Unix images . However, at the time of this writing, the gns3-server version is outdated (1.3.3). The client must have the same version as the server to be able to connect to it. Here is how you can update the gns3-server inside the image. Note that you need Internet access for the update....

September 29, 2015

Migrate Debian 6+ to another server with minimal downtime

Recently I had to migrate services from a running Debian server to another one, with minimal downtime of services. I usually do this to P2V or V2V Linux systems, as this allows me to resize the new virtual machine to meet the services requirements (adjust disk size, inodes, partitionning, etc.). I have done this several times in the past on systems with Grub 1 but this is the first time with Grub 2, so I thought I’d share my process....

March 13, 2015

Nagios and LSI RAID cards

To monitor the status of a LSI RAID card, say for example a Dell PERC card, you will need to install NRPE, sudo, mpt-status and check_mpt.sh . Install sudo and NRPE via your package manager. You can grab mpt-status via apt if you use Debian/Ubuntu or here if you use CentOS. You can grab check_mpt.sh here. First, load the module mptctl if it’s not done already: modprobe mptctl To have the module loaded at boot, you can use your distribution specific behavior....

January 27, 2015

Exim GnuTLS Diffie-Hellman errors

I have been getting increasing number of errors in my Exim log related to GnuTLS Diffie-Hellman prime number. That prime number being too small causes Exim to abort the connection and initiate a new one to send the email over an unencrypted session. The exact error message is: TLS error on connection to foobar.example.com [x.x.x.x] (gnutls_handshake): The Diffie-Hellman prime sent by the server is not acceptable (not long enough). With a recent enough Exim installation, you can define the tls_dh_min_bits parameter to a value that you find acceptable....

June 21, 2014

rsyslogd auto-configuration

To have rsyslogd automatically create directories and files with whatever you send at it, just put this in your rsyslog.conf file (or a .conf file in /etc/rsyslog.d): # provide UDP syslog reception $ModLoad imudp $UDPServerRun 514 $template DynFile,"/var/log/syslogs/%fromhost-ip%-%fromhost%/%$YEAR%-%$MONTH%-%syslogfacility-text%" # log everything from remote servers to one file per host+month+facility if $inputname == 'imudp' or $inputname == 'imtcp' then ?DynFile # stop logging from remote servers if $inputname == 'imudp' or $inputname == 'imtcp' then ~ All directories and files are created under /var/log/syslogs, one directory per ip-hostname pair, and one file per facility per month....

June 15, 2014

Active Directory export script to import into SME Server

I had to migrate users from an Active Directory/Exchange combo to a SME server for temporary disaster recovery event. Here’s the script I wrote to create the export and recreate the users and their aliases in the SME server. The export was done before the disaster of course :) #!/bin/bash #ldapsearch -x -b "dc=customer,dc=com" -h 1.2.3.4 -D "domain\user" -W "(objectclass=user)" > activedirectory.ldiff File="activedirectory.ldiff" #reset files content echo > sme.users echo > sme....

March 9, 2014

VMware vCSA 5.1 password expiration

A few months ago, I was unable to login on my vCSA. At that time, I thought it ws a glitch, I rebooted (didn’t fix the issue) and changed the password of the users, which fixed the issue. Recently, I had the same issue. I concluded it could not be a glitch anymore and decided to search for root cause. The reason given by Veeam was “username or password incorrect”, which was wrong....

February 21, 2014

Nagios and Exim queue size

A simple script to check Exim queue size for Nagios NRPE: #!/bin/bash #arg1 = warning count #arg2 = critical count if \[ -z "$1" \] || \[ -z "$2" \] then echo "Usage: ${0} warningcount criticalcount" else if \[ "$1" -ge "$2" \] || \[ "$1" -le "0" \] || \[ "$2" -le "0" \] then echo "Error: incorrect values." else queuesize=$(/usr/sbin/exim4 -bpc) if \[ "$queuesize" -gt "$2" \] then echo "CRITICAL - exim queue size: $queuesize" exit 2 elif \[ "$queuesize" -gt "$1" \] then echo "WARNING - exim queue size: $queuesize" exit 1 else echo "OK - exim queuesize: $queuesize" exit 0 fi fi fi

February 14, 2014