cyberz.org

June 8, 2009

Bacula mail changer script (aka poor man’s autoloader)

Filed under: News, Solaris, Technical, Unix — Tags: , , , — andrea @ 11:16 pm

I enjoy Bacula for automated home backups on DLT and DDS tape drives. Being used at home there’s no – obviously – big-dollar-company-manager to ask for an autoloader; and when the time of a tape change comes bacula lacks a simple way to request a manual tape change and just hangs up. So I managed to build a fake autoloader shell script, which, using emails, would emulate a real autoloader. This script, which I baptised mail-changer, features:

  • email support
  • periodic email resend when tape change is needed
  • tape detection and check (if you’re supposed to insert tape 4 and you enter 5, the script will kindly refuse the tape, unload it and send a warning email message asking for the right one)

(more…)

January 3, 2009

Nagios nrpe and sudo: “NRPE: Unable to read output”

Filed under: Unix — Tags: , , , — andrea @ 7:21 pm

On CentOS 5 (and RedHat EL as well), you can encounter the following behaviour when configuring an nrpe plugin with sudo:

[andrea@feyd ~]$ /usr/lib/nagios/plugins/check_nrpe -H 1.2.3.4 -c check_md_raid
NRPE: Unable to read output

(more…)

April 12, 2008

SSH X11 forwarding issue

Filed under: Unix — Tags: , , , — andrea @ 10:38 pm

Recently I’ve been in an awkward situation with ssh and X11 forwarding, where ssh using the classic -Y (or -X) switch wasn’t working (DISPLAY was not set):

[andrea@duncan ~]$ ssh -Y root@vladimir
root@vladimir's password:
Last login: Sat Apr 12 23:30:09 2008 from ***
[root@vladimir ~]# echo $DISPLAY
[root@vladimir ~]#

If you are experiencing the same and your sshd_config looks fine (which means TCP and X11 forwarding is already enabled) then the answer is missing xauth!

On RedHat yum install xauth will do the trick

February 27, 2008

seq equivalent

Filed under: Unix — Tags: , — andrea @ 8:19 pm

On platforms without seq (MacOSX, Solaris), you can emulate it using dc as follows (note the upper bound and the lower bound):

echo '[1+pdupper bound>aq]salower bound 1-lax' | dc

For example:

alia:~ andrea$ echo '[1+pd5>aq]sa0 1-lax' | dc
0
1
2
3
4
5
alia:~ andrea$

Powered by WordPress