Mar 132010
 

Monitoring your HDD using SMART and Nagios Monitoring of your computer systems is a good idea. There are many tools that let you verify that specified services are running, and available for clients. I use Nagios. You can check that Apache is still running, Postfix is still accepting mail, and various other things. If you can write a test, Nagios can monitor it. Typically, people monitor network connections, applications, and bandwidth consumption. Until recently, I did not monitor disk health. That recently changed. I started using three new tools: sysutils/munin sysutils/smartmontools net-mgmt/nagios-check_smartmon In this article I’ll show you how I added SMART monitoring to my Nagios installation. munin is straight forward to install, but is outside the scope of this article. It is for another time. This article also assumes you have Nagios installed and nrpe running on the host you are monitoring. I am using Fruity for my nagios configuration, so I will be […]

Jan 262010
 
cssh - cluster ssh

cssh – cluster ssh Have you ever needed to do the same task on more than one machine at a time? If so, then clusterssh is the tool for you. From their homepage: ClusterSSH is a tool for making the same change on multiple servers at the same time. The ‘cssh’ command opens an administration console and an xterm to all specified hosts. Any text typed into the administration console is replicated to all windows. All windows may also be typed into directly. This tool is intended for (but not limited to) cluster administration where the same configuration or commands must be run on each node within the cluster. Performing these commands all at once via this tool ensures all nodes are kept in sync. I found cssh very useful when I was setting up some jails, each of which was used for Bacula regression testing. Using Using cssh is easy. First, install it: cd […]

Jan 232010
 

Problems starting a jail with ezjail Over the weekend I was setting up a few FreeBSD jails to do some regression testing for the Bacula project. I had two already configured and running from my earlier work. My goal was to create a couple more and test multiple versions of databases etc. I found I could create a jail, but not login. When I checked in via the console, I saw that the initial startup script which did the jail setup was not running. I fixed it with a simple mv command. The rest of this article outlines the symptoms and how I fixed it. The symptoms I started the jail: # ezjail-admin start mysql51.example.org Configuring jails:. Starting jails: mysql51.example.org. Then I tried to login into them: $ ssh -A mysql51.example.org Password: Password: Password: Received disconnect from 10.55.0.102: 2: Too many authentication failures for dan This stumped me. I knew the password. The investigation Why […]

Jan 192010
 

Integrating the Tape Library with an existing Bacula installation In a recent article, I wrote about how to setup the various tools, such as mtx-changer, to allow your tape library to work with Bacula. In this article, I’ll show how I integrated this tape library into my existing Bacula configuration. Given the previous work, I will assume you have mtx-changer working will with your tape library. The configuration Here are a few extracts from my bacula-dir.conf file which relate to the tape library: # Definition of DLT tape storage device Storage { Name = DigitalTapeLibrary Address = bacula.example.org SDPort = 9103 Password = “VeryComplexPassword” Device = “DEC TL800” Media Type = DLT } And from bacula-sd.conf: Autochanger { Name = “DEC TL800” Device = “DEC TZ89” Description = Digital DLT MiniLibrary – TL891 Changer Device = /dev/pass4 Changer Command = “/usr/local/sbin/mtx-changer %c %o %S %a %d” } Device { Name = “DEC TZ89” Description = […]

Jan 182010
 
Tape Libraries & Bacula

Tape Libraries & Bacula I am attempting to revive a long unused-tape library. I want it active so I can go away on holiday and not worry about changing tapes. At present, I use a single DLT-7000 drive, which needs a new tape every three or four days. My strategy includes filling each tape, then starting a new one. This approach may or may not be something that is applicable to your needs. I am using Bacula 3.0.2 here. With PostgreSQL 8.3.7, and mtx version 1.3.11. Just saying. Connecting the device These are my existing devices before attaching my tape library: # camcontrol devlist <QUANTUM DLT7000 1E48> at scbus1 target 5 lun 0 (sa0,pass0) <USB 2.0 Storage Device 0100> at scbus2 target 0 lun 0 (pass1,da0) <HL-DT-ST DVDRAM GSA-H10A JL02> at scbus4 target 0 lun 0 (pass2,cd0) That existing sa0 is used by my Bacula installation. That is important to note, as you will see […]

Dec 212009
 

Upgrading PostgreSQL From time to time, I need to upgrade PostgreSQL. When you are upgrading between minor revisions, you must dump and restore your databases. This article shows how I do this with FreeBSD 8.x and PostgreSQL 8.3, but this should be applicable to most other operating systems and versions of PostgreSQL. NOTE: If, for example, you are moving from PostgreSQL 8.3.7 to 8.3.9, you do not have to dump. But between minor revisions, for example 8.3.x to 8.4.x, you must dump and reload. The outline In short, the process is this: Upgrade the PostgreSQL client Use the *new* client to dump the *old* data Shutdown the PostgreSQL server Upgrade the PostgreSQL server initdb the PostgreSQL server load the databases vacuum analyse Upgrade the PostgreSQL client When you move from one PostgreSQL minor version to another, you must dump and reload using the *new* PostgreSQL client. Why? The new client will know the format expected […]

Nov 302009
 

mailwrapper exited on signal 11 With software comes upgrades. I have been running FreeBSD 6.x on several servers at home. I recently upgraded them to 8.x, using 7.x as a stepping stone. The upgrade process went well. All systems are up and running. However, I have noticed one particular problem which I now know how to avoid in future. Avoiding Sendmail I recently upgraded my development server to FreeBSD 8.0-PRERELEASE (which has since been released). I started to notice this error from time to time: Nov 29 15:35:00 ngaio kernel: pid 91715 (mailwrapper), uid 1001: exited on signal 11 (core dumped) After mentioning the error on IRC, it was suggested that my recent buildworld had overwritten my installed Postfix binaries. To fix the situation, I rebuilt Postfix: portupgrade -f postfix postfix stop postfix start To prevent this from happening again, the following was added to /etc/src.conf (a file which did not exist, so I created […]

Nov 292009
 

logcheck – a log file scanner Every decent system generates logs. They are useful both from a forensic and from a debug point point of view. Some systems generate huge volumes of logs. Scanning those logs manually is both tedious and error-prone. This calls for an automated solution. Enter logcheck. Logcheck will scan your log files and report any entries which do not match a list previously flagged as OK to ignore. The pattern matching is flexible and easily extended. Background logcheck has been around at least 10 years. I starting using logcheck in 1999, just about 10 years ago. Since then, logcheck underwent quite a transformation. It once had just a handful of matching files. Now it has over 180 files. logcheck works by ignoring known benign patterns and reports any log file entries that do not match those patterns. You can add to these patterns easily. Logcheck can scan a number of files. […]

Nov 242009
 

spamd-setup gives 404 spamd is a wonderfully simple but amazingly effective spam fighting tool. It originated with the OpenBSD project. I’ve been using it since early 2007. This short post documents a situation I’ve seen a few people encounter lately. Background spamd-setup is usually run on a regular basis via cron. It can be used to download various lists of spam sources. The OpenBSD website has a number of available lists. Sometimes lists go away. Sometimes new lists come into being.. The symptom Not so long ago, I started seeing message like this: From: root@nyi.example.org (Cron Daemon) To: root@nyi.example.org Subject: Cron /usr/local/sbin/spamd-setup X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: X-Cron-Env: Message-Id: Date: Sat, 21 Nov 2009 01:48:03 +0000 (GMT) ftp: Error retrieving file – `404 Not Found’ ftp: Error retrieving file – `404 Not Found’ This is the output from the cronjob which invokes spamd-setup. From what you can see, two lists are not being retrieved. But which […]

Nov 222009
 

c partition goes away in FreeBSD 8 FreeBSD 8.0 will soon be released. It promised many new improvments. I’ve been upgrading some of my servers to 8.0 lately. Recently I encountered one interesting problem with disk partitions. It was easily fixed, but I thought I should document it because I know someone else is going to hit it. Details Today I upgraded my development server from FreeBSD 7.2 to FreeBSD 8.0-PRERELEASE. I had recently upgraded from 6.4 to 7.2, so I expected no problems upgrading to 8.0, as supported by recent experiences with a few other machines. I was wrong. When rebooting the 8.0 kernel, the system could not find /dev/mirror/gm0s1c. All it saw was: [dan@ngaio:~] $ ls -l /dev/mirror/ total 0 crw-r—– 1 root operator 0, 100 Nov 18 23:29 gm0 crw-r—– 1 root operator 0, 103 Nov 18 23:29 gm0s1 [dan@ngaio:~] $ I altered /etc/fstab to comment out that line and proceeded to […]