RAID Monitoring: PERC H710 Mini and Debian

Debian 7 works with the PERC H710 Mini in a Dell R520 out of the box. To monitor this however you need a binary from LSI. Helpfully, this comes in a packaged form from http://hwraid.le-vert.net/wiki/DebianPackages

http://blog.mattandanne.org/2012/01/hardware-raid-controllersrequire.html pointed me in the right direction. To install, add the repo in a .list file:

deb http://hwraid.le-vert.net/debian wheezy main

and then add the key:

wget -O - http://hwraid.le-vert.net/debian/hwraid.le-vert.net.gpg.key | apt-key add -

Update the repository lists, and then install the relevant package:

apt-get install megaclisas-status

Running megaclisas-status should then give the status of the array(s). The script is set up by default to email root every two hours if there is a problem. These defaults can be overridden using a defaults file:

/etc/default/megaclisas-statusd

You need to create this if necessary. The defaults are:

MAILTO=root # Where to report problems
PERIOD=600 # Seconds between each check (default 10 minutes)
REMIND=7200 # Seconds between each reminder (default 2 hours)
RUN_DAEMON=yes

(can be found in)

/etc/init.d/megaclisas-statusd

If you have the system set up to divert root email to you then it should just work.

Installation and configuration of EAGLE 7 licencing server

File download

The links on the cadsoft page were broken when I did this. The licencing setup files were found at:

ftp://ftp.cadsoft.de/eagle/licensing/7.0.0/

The later version directories only contain the lichostid files (also included in the full install). You do need this for the hostid – it doesn’t just work off the MAC address!

Install (Windows)

Put the unzipped file tree somewhere convenient – on Shuna it’s just stuck in C:

To install the server as a service, use the command line switch:

lmadmin -installservice "EAGLE flexlm"

or whatever you want the service to be called. You have to dig deep into the pdf documentation to find that one!

Log into the web interface

http://licencehost:8090

Login with default credentials (admin:admin) and change the password

Licence file

As per documentation – Administration > Vendor Daemon Configuration > Import License. This should import the file which points to the vendor daemon in the file tree.

Client configuration

Choose multi-user licence. Server is

shuna.physics.gla.ac.uk

and we’re currently using the default port (21111)

A nice way of configuring linux system-wide login notifications using PAM

There are several ways to have a linux box email you when someone logs in to it. Most of these use a script in either the local profile files (for individual users) or the system-wide profile (and/or in sshrc). Another nice way is to use the pam authentication system to do the job. A setup is given at:

http://blog.stalkr.net/2010/11/login-notifications-pamexec-scripting.html

Brief setup

Assuming Debian here.

Make sure the system is set up to talk to an email server and has some way of sending emails from the command line. The script here assumes the mailx package is installed.

Quick test:

echo "test" | mail -s "test" user@example.com

Create a script somewhere sensible (e.g. /usr/local/bin) and make it executable.

#!/bin/sh
[ "$PAM_TYPE" = "open_session" ] || exit 0
{
echo "User: $PAM_USER"
echo "Ruser: $PAM_RUSER"
echo "Rhost: $PAM_RHOST"
echo "Service: $PAM_SERVICE"
echo "TTY: $PAM_TTY"
echo "Date: `date`"
echo "Server: `uname -a`"
} | mail -s "`hostname -s` $PAM_SERVICE login: $PAM_USER" user@example.com

replacing user@example.com with the required email address. Note that you could send the email to root or another local account if you have that aliased to an external address.

edit /etc/pam.d/common-session to add at the end:

session optional pam_exec.so /usr/local/bin/login_notify

and test it by logging in with an ssh session (terminal or winscp etc.)

Sudo uses common-session-noninteractive – not sure whether it would be best to put this in /etc/pam.d/sudo as well…

Wireless problems with Ubuntu 13.10 and self-signed certificates

Ubuntu 13.10 (and possibly 13.04) seem to have a problem with self-signed certificates when authenticating to wireless radius servers (i.e. the GUPHYSICS wifi). This is discussed in a variety of places:

https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1104476

The problem seems to be that the Network Manager setup is adding the line:

system-ca-certs=true

to

/etc/NetworkManager/system-connections/GUPHYSICS

even if you tick ignore when the system asks about certs the first time. Changing the value of the setting to false seems to fix this, although there is a possibility that it might get changed back by NM. (or delete the setting entirely, which seems to have happened on this laptop. Hmmm)

There is apparently a bugfix in place and rolled out to other distributions, but Ubuntu doesn’t have it yet…

Another way to fix this would be to get the certificate (probably in .pem format) and point the settings to it.

Test of dokuwiki mathjax plugin

Examples/Usage

(Copied from https://www.dokuwiki.org/plugin:mathjax)

NOTE that the default configuration uses \$ (dollar signs) to delimit TeX formulas. This may cause trouble if you have \$ characters in any pages. The default configuration also lets you escape the dollar signs, however, by changing them to ”\$”. This should correct any problems you might have.

Once the plugin is installed, you can write TeX formulas in your wiki with the following syntax (by default — all delimiters are configurable):

Inline Math

Use dollar signs:

$a^2 + b^2 = c^2$
$a^2 + b^2 = c^2$

or escaped parentheses:

\(1+2+\dots+n=\frac{n(n+1)}{2}\)
\(1+2+\dots+n=\frac{n(n+1)}{2}\)

Display Math

To display math on its own line, use double dollar signs:

$$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$
$$ \frac{d}{dx}\left( \int_{0}^{x} f(u)\,du\right)=f(x) $$

or escaped square brackets:

\[ \sin A \cos B = \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right] \]
\[ \sin A \cos B = \frac{1}{2}\left[ \sin(A-B)+\sin(A+B) \right] \]

A wide range of math environments will work as well:

$\begin{align*}
e^x & = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \cdots \\
& = \sum_{n\geq 0} \frac{x^n}{n!}
\end{align*}$
$\begin{align*}
e^x & = 1 + x + \frac{x^2}{2} + \frac{x^3}{6} + \cdots \\
& = \sum_{n\geq 0} \frac{x^n}{n!}
\end{align*}$

updatedb.mlocate hangs on stale NFS mounts (Proxmox)

After properly configuring postfix on the Proxmox hosts to send email, emails to root were noticed daily:

/etc/cron.daily/mlocate:
 /usr/bin/updatedb.mlocate: `/var/lib/mlocate/mlocate.db' is locked (probably by an earlier updatedb)
 run-parts: /etc/cron.daily/mlocate exited with return code 1

After logging on to one of the boxes, killing (-9) the updatedb process and running it with verbose on:

updatedb.mlocate -v

The output indicated it was hanging on one of the ”/mnt” directories. Looking at the output of ”mount” a couple of old nfs shares were noticed, that should have been deleted (and didn’t appear in the GUI). Unmounting these shares made updatedb run happily.

If the unmount complains the device is busy, check the updatedb.mlocate process has been killed.

Configuring Proxmox hosts (and other postfix installs) to send email via smarthost

Proxmox uses postfix as its MTA. To configure this to send email via smarthost run

dpkg-reconfigure postfix

For general type we want Satellite

SMTP server - usual

Mailbox size – could use the suggested 51200000 here – should be more than big enough seeing as nothing should be ending up in the system mailbox anyway.

Once this is done, edit ”/etc/aliases”. It should look like:

postmaster: root
nobody: root
hostmaster: root
webmaster: root
www: root

Add a line at the end:

root: Your.Email@example.com

Regenerate the database with ”newaliases” (or possibly ”postalias filename” on other distributions)

Test with something like

echo "test" | mail -s "test mail sent to root" root