Munin monitoring Graph Performance

Goal

Speed up munins performance by moving the generated html files and graphs to a temporary file system (tmpfs)

Intro

Munin [1] (1.x) updates its data and graphs every 5 minutes. On a system that has a lot of monitoring to perform, the time to collect the data (munin-update),  generating the graphs (munin-graph), creating the html files (munin-html) and checking the limits (munin-limits) can exceed the 5 minutes available before the next update will be performed. The consequence are gaps in the graphs.

In the log files of munin the time needed for each of the four phases is documented. This can also be visualized with the munin processing time plugin. It shows that the graphing is the phase which takes the most time to complete.
Continue reading

Suspend idle harddisks and monitor the suspension

Goal

Suspend idle hard disks and monitor the suspension state

Intro

To save energy modern disks can spin down when not used. Depending on the disk, savings from 3 to 10 Watts can be achieved. Using the SMART capabilities hdparm can set a spin down timeout on each disk. To check the state of a disk hdparm can also output the state of a disk. As there is no automatic mechanism to be notified if a disk changes its state from idle to suspended state or vice versa another solution is presented in this blog post. The idea is to query the disks for their state periodically and save the value to a database. The problem is, that between to measurements the state can not be tracked. So using smartctl, a tool from the smartmontools is used to get the SMART value “Start Stop Count” from each disk and also save its output to the database. This is important as a spin down timeout that is set too low can result in frequent spin downs and ups, which may shorten the lifetime of a hard drive.
Continue reading

Connect with WinSCP and Putty via Jump-In SSH host

Goal

A SCP Connection needs to be established, but a connection to a host with WinSCP is not possible, because no direct access is available. But a jump in SSH server is reachable from your PC and the jump in SSH server has access to the desired server.

Intro

There is a firewall or another restriction between your local PC and the machine you want to scp to. No direct connection can be established. For example you’re on the road and the file server’s SSH port¬† in your home or office is not accessible from the internet. But another machine at your site, which can access the file server is running SSH accessible from the internet.
Continue reading

Send email on SSH login using PAM

Goal

When a user logs in using SSH an email should be sent.

Intro

There are different ways to send an email when someone logs into a machine using SSH. One way could be to parse the auth log file periodically, but this is error prone and rather complex. An easier way is to call a script, that is hooked into PAM, the central authentication service on Linux systems.
Continue reading