Tom's Blog

Back to Tom's Web

Fri, 27 Aug 2010

SMS Notifications for Nagios

I use Nagios for monitoring. Up to recently I used a regular modem to send sms text messages to various people when systems are going wrong. The way this works is by using smsclient which dials up to a TAP server. TAP is a fairly archaic way of sending messages. It's been fairly reliable however it has two major drawbacks, sending takes along time and it's limited to 160 characters. As far as I can tell it will not do long text messages. Which are really just multiple short message combined together in a special way.

I wanted a better way! Something that sounded nice was using the mobile network to send messages, that way I could bypass most of the internal infrastructure and take the notifying system as out of band as possible. After a good bit of research I finally settled on a Masetro 100 from RF Solutions. It also turns out that smstools can use it out of the box. I'm so pleased!

posted at: 16:10 | path: /2010/08/27 | permanent link to this entry

Thu, 29 Jul 2010

Weird Traceroute

I was looking at a development web site I am involved with and I was interested in where the site was in the big bad world, so I decided to traceroute to it[1]. What seemed very unusual was that the 5th hop reported an ip address in the 10.0.0.0/8 private address space. To quote Sam "10.what now?". I'm still amazed that packets with source addresses with private addresses are routed across the internet![2]

[1]
$ sudo traceroute -m 10 -N 1 -M default 78.86.199.179
traceroute to 78.86.199.179 (78.86.199.179), 10 hops max, 40 byte packets
 1  80-68-93-1.no-reverse-dns-set.bytemark.co.uk (80.68.93.1)  0.389 ms  0.174 ms  0.154 ms
 2  89-16-188-3.no-reverse-dns-set.bytemark.co.uk (89.16.188.3)  0.366 ms  0.440 ms  0.326 ms
 3  gi4-19.cr01.thn.bytemark.co.uk (80.68.80.73)  6.822 ms  6.707 ms  7.314 ms
 4  * * linx-gw1.betherenow.co.uk (195.66.224.232)  11.099 ms
 5  10.1.3.177 (10.1.3.177)  9.041 ms  8.237 ms  7.706 ms
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
$
$ sudo traceroute -m 10 -N 1 -M icmp 78.86.199.179
traceroute to 78.86.199.179 (78.86.199.179), 10 hops max, 40 byte packets
 1  80-68-93-1.no-reverse-dns-set.bytemark.co.uk (80.68.93.1)  0.216 ms  0.134 ms  0.092 ms
 2  89-16-188-3.no-reverse-dns-set.bytemark.co.uk (89.16.188.3)  0.404 ms  0.382 ms  0.451 ms
 3  gi4-19.cr01.thn.bytemark.co.uk (80.68.80.73)  8.107 ms  7.459 ms  7.462 ms
 4  linx-gw1.betherenow.co.uk (195.66.224.232)  7.653 ms  7.440 ms  8.356 ms
 5  10.1.3.177 (10.1.3.177)  10.940 ms  20.268 ms  9.236 ms
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
$
$ sudo traceroute -m 10 -N 1 -M tcp 78.86.199.179
traceroute to 78.86.199.179 (78.86.199.179), 10 hops max, 40 byte packets
 1  80-68-93-1.no-reverse-dns-set.bytemark.co.uk (80.68.93.1)  0.323 ms  0.437 ms  0.200 ms
 2  89-16-188-3.no-reverse-dns-set.bytemark.co.uk (89.16.188.3)  0.446 ms  0.333 ms  0.391 ms
 3  gi4-19.cr01.thn.bytemark.co.uk (80.68.80.73)  7.120 ms  6.713 ms  6.800 ms
 4  linx-gw1.betherenow.co.uk (195.66.224.232)  7.925 ms  7.737 ms  7.881 ms
 5  10.1.3.177 (10.1.3.177)  7.816 ms  7.500 ms  8.614 ms
 6  78-86-199-179.zone2.bethere.co.uk (78.86.199.179)  21.213 ms  21.239 ms  21.242 ms
 7  78-86-199-179.zone2.bethere.co.uk (78.86.199.179)  20.770 ms  21.662 ms  22.061 ms
$
$ sudo traceroute -m 10 -N 1 -M udp 78.86.199.179
traceroute to 78.86.199.179 (78.86.199.179), 10 hops max, 40 byte packets
 1  80-68-93-1.no-reverse-dns-set.bytemark.co.uk (80.68.93.1)  0.276 ms  0.096 ms  0.091 ms
 2  89-16-188-3.no-reverse-dns-set.bytemark.co.uk (89.16.188.3)  0.444 ms  0.409 ms  0.403 ms
 3  gi4-19.cr01.thn.bytemark.co.uk (80.68.80.73)  6.747 ms  6.797 ms  6.844 ms
 4  * linx-gw1.betherenow.co.uk (195.66.224.232)  7.620 ms  7.488 ms
 5  10.1.3.177 (10.1.3.177)  8.766 ms  7.501 ms  8.638 ms
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
$
$ sudo traceroute -m 10 -N 1 -M raw 78.86.199.179
traceroute to 78.86.199.179 (78.86.199.179), 10 hops max, 40 byte packets
 1  80-68-93-1.no-reverse-dns-set.bytemark.co.uk (80.68.93.1)  0.314 ms  0.097 ms  0.093 ms
 2  89-16-188-3.no-reverse-dns-set.bytemark.co.uk (89.16.188.3)  0.378 ms  0.412 ms  0.330 ms
 3  gi4-19.cr01.thn.bytemark.co.uk (80.68.80.73)  23.388 ms  8.331 ms  7.084 ms
 4  linx-gw1.betherenow.co.uk (195.66.224.232)  8.294 ms  7.517 ms  8.027 ms
 5  10.1.3.177 (10.1.3.177)  8.502 ms  7.589 ms  7.450 ms
 6  * * *
 7  * * *
 8  * * *
 9  * * *
10  * * *
$ 
[2]
$ tshark -r cap -R "ip.src == 10.0.0.0/8"
177   8.113729   10.1.3.177 -> 80.68.93.148 ICMP Time-to-live exceeded (Time to live exceeded in transit)
183   8.122267   10.1.3.177 -> 80.68.93.148 ICMP Time-to-live exceeded (Time to live exceeded in transit)
187   8.130944   10.1.3.177 -> 80.68.93.148 ICMP Time-to-live exceeded (Time to live exceeded in transit)
$ 

posted at: 22:56 | path: /2010/07/29 | permanent link to this entry

Thu, 22 Jul 2010

Spinning Phrases

I go to spinning quite a bit and have had I think six teachers over the last year since I started. I think every teacher has one phrase they use most, this not a bad thing, it's just something I have noticed. I present an anonymous list of them here.

posted at: 21:36 | path: /2010/07/22 | permanent link to this entry

Mon, 05 Jul 2010

Resolutions and Reading

Since Christmas I have been up to loads. I went skiing in March and I went to Cuba in June. I have done well with resolutions, I managed to stay super healthy for January and managed to mostly keep to it since. However I utterly failed to read LWN :-(

I did however keep up the reading and by my standards I have read loads! So far I have read:

I'm currently reading The Magicians - Lev Grossman. I'm also almost finished the backlog of books everyone suggested after Christmas, so any recommendations we most welcome!

posted at: 22:06 | path: /2010/07/05 | permanent link to this entry

Mon, 04 Jan 2010

New Year's resolutions

It's time for some new years resolutions! Hopefully if they are cast in stone (well blog) there is more of a chance of success.

posted at: 23:35 | path: /2010/01/04 | permanent link to this entry

Fri, 27 Nov 2009

Intermediate Exam

I passed my amateur radio Intermediate exam, so now I can kick out 50W! My new call sign is 2E0TDS. My thanks goes to all at SADARS that helped with the practical day and two days of lectures and exams. All I need now is some sort of radio!

posted at: 15:22 | path: /2009/11/27 | permanent link to this entry

Fri, 20 Nov 2009

Dublin Trip

Last week I got back from a little holiday in Dublin. I went over for my cousins graduation. I had an amassing time, it was a very relaxed and slow paced get away from everything. We went to all sorts of different cafes, restaurants and live music bars in the evening. It felt so luxurious to stay in a hotel in the centre of town, we were able to roll out of which ever bar we were in, hail a cab and be back home in no time. Coming back to a made bed and fresh towels can't be beaten.

A few places stood out. One night we went for a Mexican in Acapulca which was amazing in it's self but it was topped off by their "Deep Fried Ice Cream" desert. We also went to a restaurant type cafe one day. I can't remember the name of it now, but it served the best hot chocolate I have ever had. Then there was the Queen of Tarts which is a lovely little cafe with amazing carrot cake.

We did not stay in the hotel for the whole time, the last night one of my cousins friends put us up in their amazing house. They took us to a very strange but also very cool place that only served tea. It was called The Tea Garden. It had one of the most relaxing atmospheres I have been in. It was divided up into small booths with raised floors, cushions and small tables. We took our shoes off and sat round the small table and just relaxed! The waitress then came round and was able to recommend which teas to try. It was cool socialising without booze. When the tea came the pots had little night lights to keep them warm. We then just whiled the time away chatting.

It was not all food and drink mind, we did fit in a trip to the book of kells. We finished the trip off on the last day with an late afternoon visit to Bewley's.

posted at: 21:58 | path: /2009/11/20 | permanent link to this entry

Fri, 09 Oct 2009

GPG Bench Cipher

After reading depesz's great speeding-up-dumprestore-process blog post. I started thinking about how to securely transfer a file from one server to another in the fastest possible way. The problem being that scp/sftp is slow for various reasons. ftp, http, nc, cifs, rsync are all plain text so can be quickly discounted. I don't know if ssltunnel suffers from the same window limitations that ssh suffers from. I guess using a dedicated vpn would do the trick. However I liked the idea of using gpg. I was not sure which cipher to use so I decided to run a few benchmarks to see. The results are on my wiki. Once the encrypted file has been created then it can be transfered using any of the available plain text mechanisms. I think nc or ftp have the least overhead.

posted at: 16:53 | path: /2009/10/09 | permanent link to this entry

Tue, 15 Sep 2009

Big Disk

So today I played a bit with some big cheep disks. I have 3 fairly old desktops each with 4*1TB disks, all exported via ATA over Ethernet to a much more modern sort of disk head. Basically it's a "build a large store on half a shoe string" project. I've not quite got the network side of it sorted yet. Currently the disk head's gigabit card is being saturated. On a single disk node each disk can do about 80M read sustained. If all 4 are read at the same time it goes down to about 50M, which is 200M in total. Which seems quite amazing for a Pentium 4 3.0Ghz. Also this seems a bit high as the PCI bus can only do 133M, I'm guessing that the onboard sata ports are somehow separated from the extra pci sata card I added. Interestingly one disk node can sustain 80M read from disk to the disk head. Again this backs down to 30M if all 4 disks are read, thats 120M total, no surprise this is saturating the gigabit link. So the major bottleneck is the disk head. Currently max raid sync speed is 10M, ie 120M total for 12 disks. Ideally 3 nics in the disk head would be best, but then there is no way for the data to get to the disk head.

The /proc/mdstat seems quite impressive (slow rate due to mkfs):

md0 : active raid5 etherd/e3.12[12] etherd/e3.11[10] etherd/e3.10[9] etherd/e3.9[8] etherd/e2.8[7] etherd/e2.7[6] etherd/e2.6[5] etherd/e2.5[4] etherd/e1.4[3] etherd/e1.3[2] etherd/e1.2[1] etherd/e1.1[0]
      10721828480 blocks level 5, 64k chunk, algorithm 2 [12/11] [UUUUUUUUUUU_]
      [==>..................]  recovery = 13.4% (130652288/974711680) finish=158828.3min speed=87K/sec

The mkfs looks like it won't finish for ages, also theres still not definitive information about stride, stripe and other random things.

$ sudo mkfs -t ext3 -E stride=16,stripe-width=176 /dev/soda/store 
mke2fs 1.41.3 (12-Oct-2008)
Filesystem label=
OS type: Linux
Block size=4096 (log=2)
Fragment size=4096 (log=2)
670121984 inodes, 2680456192 blocks
134022809 blocks (5.00%) reserved for the super user
First data block=0
Maximum filesystem blocks=0
81802 block groups
32768 blocks per group, 32768 fragments per group
8192 inodes per group
Superblock backups stored on blocks: 
        32768, 98304, 163840, 229376, 294912, 819200, 884736, 1605632, 2654208, 
        4096000, 7962624, 11239424, 20480000, 23887872, 71663616, 78675968, 
        102400000, 214990848, 512000000, 550731776, 644972544, 1934917632, 
        2560000000

Writing inode tables:  3351/81802

posted at: 22:40 | path: /2009/09/15 | permanent link to this entry

Wed, 12 Aug 2009

Yoga

So my gym is closed for 10 days for a refurbishment. They are going to replace all the cardio equipment with awesomely new kit. I'll be able to check my progress online and I'll be able to plug in a video iPod and watch on the screen. The problem is, while it's closed I have no gym to go to! So I decided to try some classes instead. Tonight I tried a Yoga one and it was great, both relaxing and tiring at the same time, I really enjoyed it. I think I'll be going more often in the future and hopefully it will help improve my skiing.

posted at: 22:07 | path: /2009/08/12 | permanent link to this entry

Mon, 03 Aug 2009

Wedding Meal

I went to Tony and Grainne and Tonys wedding on Friday. It was a lovely day and I wish them all the best in the future.

Anyway, I learnt something while at the hotel that annoyed me. The name of the meal at the wedding reception. Hint: it's not lunch. It's called the Wedding reception, I'm not entirely sure why, but it really does get on my nerves.

posted at: 20:16 | path: /2009/08/03 | permanent link to this entry

Fri, 24 Jul 2009

I'm back from Ireland

I got back on Monday night after cutting it worryingly close to get to the airport, 2 hours in advance try 40 min! Only for Ryanair to delay the flight by an hour and tell no one. Then there's the Post Holiday Blues, aka PTD. It hit bad on Tuesday night but I think I'm used to the grind stone again now.

Also I'm not laughing now:

$ psql -c "select count(*) from rssr.entries where read = false;" rssr
 count 
 -------
   9941
   (1 row)

$
In other news I might be going to see "STOCKWELL: THE INQUEST" in the Landor Theatre on Monday night. My post holiday resolution is to go to London for more culture.

posted at: 00:18 | path: /2009/07/24 | permanent link to this entry

Thu, 02 Jul 2009

I'm off on my holidays

No Internet for 2 weeks, just as I catch up on my feeds too!
$ psql -c "select count(*) from rssr.entries where read = false;" rssr
 count 
 -------
      0
      (1 row)
$

posted at: 23:53 | path: /2009/07/02 | permanent link to this entry

Wed, 24 Jun 2009

Cineworld have an public xml data source

I just found out that Cineworld have a public xml data source. It's over in the syndication subdir of their main site. There are more technical details over on my CineworldScrape page. I feel a bit sad in a way, my scraper has been working for more or less 3 years now in some form or another. The annoying thing is that they don't actually export all the data I use. Being quite visual I have grown used to using the thumbnails that each movie has to help me pick which films to see. Apart from this it's a great step forward. However the problem is there's know knowing if Cineworld will pull this service or even if they want it public. For now I'll continue to use my scraper.

posted at: 21:30 | path: /2009/06/24 | permanent link to this entry

Thu, 18 Jun 2009

Passed Foundation

I passed my foundation exam on Sunday. Big thanks to all the helpfull folk at SADARS. I am now M6TDS.

posted at: 17:05 | path: /2009/06/18 | permanent link to this entry

Sat, 13 Jun 2009

ICMP Redirect

Today I found out where Linux exposes the extra routing information gathered from ICMP redirects. "ip route show cache" will show the entire cached routing table. It's a bit hard to read so "ip route show cache 1.2.3.4" is better. For example 192.168.1.0/24 is a network the is connected via a host on my 192.168.0/24 network. My default gateway (192.168.0.1) has a static routing entry to the host who gateways for the 192.168.1.0/24 network (192.168.0.57). So When a random host on the 192.168.0.0/24 network pings a host on the 192.168.1.0/24 network it first sends to 192.168.0.1 but it sends an ICMP redirect saying that in the future it would be better to just send direct to 192.168.0.57 in the future.
$ ip route show cache 192.168.1.20
$ ping 192.168.1.20
PING 192.168.1.20 (192.168.1.20) 56(84) bytes of data.
64 bytes from 192.168.1.20: icmp_seq=1 ttl=63 time=2.25 ms
From 192.168.0.1: icmp_seq=2 Redirect Host(New nexthop: 192.168.0.57)
64 bytes from 192.168.1.20: icmp_seq=2 ttl=63 time=2.34 ms
64 bytes from 192.168.1.20: icmp_seq=3 ttl=63 time=1.32 ms
64 bytes from 192.168.1.20: icmp_seq=4 ttl=63 time=1.24 ms
^C
--- 192.168.1.20 ping statistics ---
4 packets transmitted, 4 received, 0% packet loss, time 3012ms
rtt min/avg/max/mdev = 1.241/1.791/2.344/0.511 ms
$
$ ip route show cache 192.168.1.20
192.168.1.20 from 192.168.0.62 via 192.168.0.57 dev eth1 
    cache   mtu 1500 advmss 1460 hoplimit 64
192.168.1.20 via 192.168.0.57 dev eth1  src 192.168.0.62 
    cache   mtu 1500 advmss 1460 hoplimit 64
$
The Guide to IP Layer Network Administration with Linux is an excellent guide!

posted at: 15:46 | path: /2009/06/13 | permanent link to this entry

Fri, 12 Jun 2009

Libata Errors

I learned over the years to read the old ide subsystem errors for Linux and genrally am able to get a feel for the sort of hardware error thats coming. However i have yet to really get a feel for the libata errors, I'm not really used to reading the errors. I friend linked me to a page on the lib ata wiki

posted at: 14:48 | path: /2009/06/12 | permanent link to this entry

Sat, 06 Jun 2009

Fedora needs legwork

I played with fedora more today. There are loads of packages in the default repos these days. However I still find my self missing things from Debian. For example, I can't do a "yum search" while doing a "yum upgrade". Why? I also miss the small helper scripts that save on legwork. For example update-grub, in debian when a new kernel gets installed the initrd and grub gets updated and just works. With Fedora I have to manually update the grub config and if say I forget to create the initrd it, it means a trip to the 13 PC's I just upgraded!

posted at: 00:06 | path: /2009/06/05 | permanent link to this entry

Sun, 31 May 2009

CineworldScrape released to public

I have finally documented cineworldscrape and made it available to the general public. So with any luck google will index it!

posted at: 20:51 | path: /2009/05/31 | permanent link to this entry

Wed, 27 May 2009

First Post!

Finaly a I have a blog!

posted at: 19:27 | path: /2009/05/27 | permanent link to this entry

Powered by PyBlosxom