Smokes your problems, coughs fresh air.

Category: Technology (Page 17 of 47)

Installing Munin-node on a Debian or Ubuntu machine

If you want to gather statistics on a machine with a Munin server, install munin node:

aptitude -P install munin-node munin-plugins-extra

You will also need:

aptitude -P install libio-all-lwp-perl lynx

To make sure apache status works, go to /usr/share/munin/plugins and type:

./apache_processes autoconf

This will tell if your machine is configured correctly. On every machine that I install munin, it seems it has different dependencies, and if you’re missing anything, this autoconf will tell.

One of the things it will often say, is to enable extended status. Put that in /etc/apache2/mods-enabled/status.conf:

<IfModule mod_status.c>
blablabla
 
ExtendedStatus on
 
</IfModule>

Beware though, extended status makes apache slower.

You can then go to /etc/munin/plugins and symlink all apache_* from /usr/share/munin/plugins there. It may have already done that if the autoconf conditions were met when you installed them, but I’m not sure.

Then either set the allowed server IP address in /etc/munin/munin-node.conf, or do as I do and add this to that config:

Allow ^.*$

And use iptables to only allow access from a given IP to port 4949.

Fixing locale message in Ubuntu when logging in or SCPing

I’ve encountered this error occasionally when loggin in:

-bash: warning: setlocale: LC_ALL: cannot change locale (nl_NL.UTF-8)

This breaks things like scp or bzr via sftp. To fix it, I followed this advice:

cd /var/lib/locales/supported.d
cat /usr/share/i18n/SUPPORTED|grep -i nl > nl
dpkg-reconfigure locales

It’s not really pretty though; it shouldn’t give an error at all when a locale is missing. I mean, this way, I have to generate every possible locale to support logins from all over the world…

Getting a Xen hvc0 on a stock Ubuntu

When you install Ubuntu in Xen with xen-create-image, the console is automatically handled. If you want to add a console to a stock-installed Ubuntu, add this file to /etc/init and call it hvc0.conf:

# hvc0 - getty
#
# This service maintains a getty on hvc0 from the point the system is
# started until it is shut down again.
 
start on stopped rc RUNLEVEL=[2345]
stop on runlevel [!2345]
 
respawn
exec /sbin/getty -8 38400 hvc0

Useful extra Nagios commands

Here are some useful extra nagios commands I often use:

define command{
        command_name    notify-host-by-sms
        command_line    /usr/local/sbin/send-sms.sh -n $CONTACTPAGER$ -m "$HOSTNAME$: $HOSTSTATE$"
}
 
define command{
        command_name    notify-service-by-sms
        # Don't use service state, otherwise you only ever get to see 'critical' and not the reason.
        command_line    /usr/local/sbin/send-sms.sh -n $CONTACTPAGER$ -m "$SERVICEDESC$ on $HOSTNAME$: $SERVICEOUTPUT$"
}
 
define command{
        command_name    check_imaps
        command_line    /usr/lib/nagios/plugins/check_imap -H '$HOSTADDRESS$' --ssl -p 993 --certificate 15
}
 
define command{
        command_name    check_rdp
        command_line    /usr/local/lib/nagios/plugins/check_x224 -H $HOSTADDRESS$ -p $ARG1$ -w 10 -c 50
}
 
define command{
  command_name  check_pops
  command_line  /usr/lib/nagios/plugins/check_pop -H '$HOSTADDRESS$' --ssl -p 995 --certificate 15
}
 
define command{
  command_name  check_smtps
  command_line  /usr/lib/nagios/plugins/check_tcp -H $HOSTADDRESS$ -p 465
}

Often used Eagle parts and packages

Everytime I work with Eagle, I need to dig deep to remember which libraries and packages I used. Here’s a memory aid:

  • Pinheaders for flatcable: library con-lstb
  • Pinheaders for PC-fan like connectors: con-molex
  • Big single pin connectors: testpad or wirepad.
  • Fuse holder: lib: fuse, package: SH22,5A
  • Connector ‘printkroonsteen’: lib con-ptr500, part ak500/3 ak500/2 etc
  • Smaller footprint for high current diode: package diode, part DIODE-DO41-7.6

More to come…

Adding a disk to a RAID5 array on a 3Ware array with tw_cli

I wanted to know if I could extend the size of a RAID5 array on the 3Ware 9650SE, so I tried something.

I first had this:

# tw_cli /c0 show
Unit  UnitType  Status         %RCmpl  %V/I/M  Stripe  Size(GB)  Cache  AVrfy
------------------------------------------------------------------------------
u0    RAID-5    OK             -       -       256K    5587.9    RiW    ON
 
VPort Status         Unit Size      Type  Phy Encl-Slot    Model
------------------------------------------------------------------------------
p0    OK             u0   1.82 TB   SATA  0   -            ST32000542AS
p1    OK             u0   1.82 TB   SATA  1   -            ST32000542AS
p2    OK             u0   1.82 TB   SATA  2   -            ST32000542AS
p3    OK             u0   1.82 TB   SATA  3   -            ST32000542AS
p4    OK             -    1.82 TB   SATA  4   -            ST32000542AS
 
Name  OnlineState  BBUReady  Status    Volt     Temp     Hours  LastCapTest
---------------------------------------------------------------------------
bbu   On           Yes       OK        OK       OK       0      xx-xxx-xxxx

A 4 disk raid 5 and one extra disk.

Then I did this:

# tw_cli /c0/u0 migrate type=raid5 disk=4
Sending migration message to /c0/u0 ... Done.

Then I have this:

# tw_cli /c0/u0 show
 
Unit     UnitType  Status         %RCmpl  %V/I/M  Port  Stripe  Size(GB)
------------------------------------------------------------------------
u0       Migrator  MIGRATING      -       0%      -     -       -
 
su0      RAID-5    OK             -       -       -     256K    5587.9
su0-0    DISK      OK             -       -       p0    -       1862.63
su0-1    DISK      OK             -       -       p1    -       1862.63
su0-2    DISK      OK             -       -       p2    -       1862.63
su0-3    DISK      OK             -       -       p3    -       1862.63
su0/v0   Volume    -              -       -       -     -       50
su0/v1   Volume    -              -       -       -     -       5537.9
 
du0      RAID-5    OK             -       -       -     256K    7450.54
du0-0    DISK      OK             -       -       p0    -       1862.63
du0-1    DISK      OK             -       -       p1    -       1862.63
du0-2    DISK      OK             -       -       p2    -       1862.63
du0-3    DISK      OK             -       -       p3    -       1862.63
du0-4    DISK      OK             -       -       p4    -       1862.63
du0/v0   Volume    -              -       -       -     -       N/A
du0/v1   Volume    -              -       -       -     -       N/A

su0 and du0 are probably source and destination, giving me a new and bigger u0 at the end. But this is going to take a week to migrate, so I won’t know for a while… (edit: I contacted 3Ware support and they said the change in size is only seen after driver reload, which means a reboot in most cases).

« Older posts Newer posts »

© 2024 BigSmoke

Theme by Anders NorenUp ↑