Nagiosgraph for Postgresql replication

5 Jun

To track postgresql replication lag with nagios you need to create a plugin to track nagios replication. I initially tried to read the ‘slave_lag’ directly from Postgresql, but permissions etc were a pain – so i just created a cron that dumped it every 5 mins and this reads that… the command to read the lag from Postgresql itself is commented out:

#!/bin/bash

# too hard with permissions
#delay=$( sudo -u postgresql psql -h127.0.0.1 -p5433 -c "SELECT extract(epoch from now() - pg_last_xact_replay_timestamp()) AS slave_lag;" 2>/dev/null | tail -n 3 | head -n 1 | awk '{$1=$1};1')

delay=`tail -n 1 /tmp/postgres_lag.txt | awk '{print $4}'`
delay_int=`printf "%.0f" $delay`
output="Replication Delay: $delay seconds"

if [ "$delay_int" -le 300 ]
then
 echo "OK- $output"
 exit 0
elif [ $delay_int -le 2000 ]
then
 echo "WARNING- $output"
 exit 1
elif [ $delay_int -gt 2000 ]
then
 echo "CRITICAL- $output"
 exit 2
else
echo "UNKNOWN- $output"
exit 3
fi

You then need to edit your nagiosgraph ‘map’ file (called ‘map’) and add this:

# Replication delay
/output:.*eplication Delay: ([.\d]+)\sseconds/
and push @s, [ 'seconds',
 [ 'data', GAUGE, $1 ] ];

WordPress – Jetpack

17 May
transport error – HTTP status code was not 200 (502) xmlrpc

was getting the above error when trying to activate Jetpack for WordPress

Turns out it was php / nginx config error, added the following to nginx.conf where it was starting the php-fpm:

fastcgi_buffers 8 16k;
fastcgi_buffer_size 32k;

BEETHEFIRST Keeps it Safe and Simple

10 Nov

BEETHEFIRST Keeps it Safe and Simple.

namecheap dns with hotmail or outlook domain

6 Oct
  1. Select “All host records” in right hand menu
  2. Select “User (Mail Server’s Host Name Required)”
  3. Click “Save” so new input boxes come up
  4. in “HOST NAME” enter “@” <— this is the real trick
  5. Add the Outlook “MAILSERVER HOST NAME” to be something like bskdjfksjdfxxxxx.pamx1.hotmail.com.
  6. Set “MX PREF” to “10”
  7. Set “TTL” to 3600

The real trick is knowing the “HOST NAME” should be “@”. 

In reality MX records shouldn’t need host names… confusing

southstart

4 Oct

Things learned from SouthStart today:

  1. Write down your goals (Michalewicz)
  2. Work out margins
  3. Leila Henderson had some good suggestions on what software to use for media, though i need to look over the videos to get what they were.
  4. Are we pricing our product too low
  5. Think of a hack, e.g. redirecting users from WordPress.com who want changes.

congrata to voxie box and baby bargains for winning the pitch comp!
 

Dell RAID monitoring with Nagios

30 Sep

Using the check_perl.pl plugin to monitor RAID devices on Dell PowerEdge servers.

Started receiving this error:

    Host does not understand the Dell Storage OID

Due to the DELL services that handle the SNMP requests not being up.

I fixed it like this:

    sudo yum update srvadmin* #well this might not be necessary
    sudo /etc/init.d/dataeng restart
    sudo /etc/init.d/snmpd restart

A good job

25 Sep

I’ve come to the conclusion that there are 4 things to look for in a job:

  1. Reasonable pay
    1. Doesn’t have to be huge, but enough to live ok on
    2. (Plenty of studies have shown that after $x/year people aren’t any happier earning more)
  2. Good conditions
    1. People are OK
    2. Office is OK
    3. Commute is OK
    4. Hours are OK
  3. Useful skills
    1. If you ever have to or want to leave, you can get another job
    2. (i.e. don’t learn to make buggy whips)
  4. Blue sky
    1. If the business goes gangbusters, you’re in for a payday
    2. (i.e. your maximum upside isn’t a 5% bonus)