BarryODonovan.com

The thoughts, ramblings and rants of Barry O'Donovan

Categories

My Links

Search Posts


I’m voting Green. Here’s why…

May 22nd, 2007 by Barry O'Donovan

We’re just coming to the end of three weeks of a fascinating political election campaign here in Ireland. Fascinating that is if you’re a political anorak. The big election is on Thursday and the two main blocks seem to be neck and neck with a hung Dáil a possibility.

People have asked how I’m voting and the answer is Green. The reactions are often skeptical or surprise. “Green? They won’t win.” They won’t win? Of course they won’t bloody win! Heck, they don’t even have enough candidates to form a Government!

Don’t get me wrong, I’m no a sandle wearing hippy; I voted Fianna Fáil last time (but to be fair – there was no credible opposition at the time). I’m voting Green because:

  1. I want Green policies implemented by the next Government: the only way to make that happen is to ensure that enough Green deputies are returned to the Dáil to put them in a position to help form the next Government;
     
  2. I don’t want to sound clichéd but I want a change in Government. Whether it’s small social organisations, multi-national companies or Government departments, they all have a leader. In our case, it’s the Taoseich and the Ministers and Junior Ministers that form the Government cabinet.
     
    And just like any walk of life, when the same people steer the ship they become complacent, lethargic and (as we’re seeing more and more) arrogant. That complacency and lethargy seeps through the ranks all the way to the bottom. Waste, mis-management, bad processes and “sticking to the status quo” become common place.
     
    A change of Government will put new Ministers in place. They will be enthusiastic and hands on. They will question the status quo. They will make new demands with new energy and vigor. Yes – it may take them some time to learn their brief in full but it’s at that enthusiastic time that they will question and poke the mandarins and the accepted norm.
     
  3. I’m worried about our economic future. Fianna Fáil would like us to believe that they are the only party with the credentials to manage the economy. They forget to mention that it was a labour Minister for Finance that gave us the first budget surplus in the nineties. They remind us that they had nine surpluses in ten years – is a surplus not as much of a mis-management than a deficit?
     
    But it’s not the ability to deliver a realistic budget that worries me – it’s our deadly dependency on petroleum. Did you know that we are dependent on imported fossil fuels for 90% of our energy requirements? Did you know that the cost if a barrel of crude oil has doubled in the lifetime of this Government? Did you know that we, the Irish tax payer, will pay over €500 million for carbon credits between 2008 and 2012? We’re the fourth more dependent country in the world on fossil fuels and our economy couldn’t currently exist without them – a commodity that is volatile, ever-decreasing in availability and ever-increasing in cost – we need to get away from fossil fuels.
     
    Through a variety of measures, the Greens will help reduce our carbon footprint. By reducing our carbon footprint, we reduce our dependency on fossil fuels. These measures include: new building standards which include heat efficiency; promotion (not advertising but through policy and financing) of renewable energy sources; pay as you use tax on car fuel (see below); real investment in public transport both in Dublin and around the country; joined up thinking for urban planning and, most importantly, they have an understanding and enthusiasm for tackling this dependency.
     
    My only concern here is that I’m not doing them justice in the above paragraph. Read their manifesto and energy policy yourselves.
     
  4. I’m sick of stupid planning decisions with out thought or regard to schools, public transport and other essential facilities.
     
  5. The end of car tax and VRT with the introduction of a pay as you go tax on petrol. This doesn’t seem to have gotten the public debate it deserves but it sounds ingenious to me. Cars cost so much money – both with VRT at the beginning and with tax, maintenance and insurance annually – people feel they have to use them. By reducing the annual cost and taxing on a per-use basis people may start reconsidering the car for some short trips.
     
    You know, I was out walking last night (strolling – not canvassing; I’m not a member of any political party) and the numbers of houses trying to cram three or more cars into their driveways was starking. I was walking in Dublin 16 and 18; places where public transport should be effective but it simply isn’t for a lot of people. Many of these cars were impeding the footpaths and straggling already narrow roads. The owners of these cars are no doubt wasting their lives away sitting in traffic this morning. A lot of these owners are also the children of the home owners who cannot afford to get a home of their own. These are bad legacies of our current Government (they do have good legacies too; I’m not blinkered). Hopefully with the Green’s combined policies and a role in Government, this situation will help reverse itself.
     
  6. Here’s a great one from their manifesto: carry out a feasibility study into the State re-taking control of Eircom, divesting any commercial operation, and maintaining the fixed line network as an open access infrastructure to all operators. As someone who has worked in the telecommunications sector for an OLO (Other Licensed Operator), I see first hand the disastrous decision it was to sell off Eircom. Think about the assets and infrastructure – at a minimum you have a copper pair into every premise in Ireland that has been built up over more than a hundred years. And we now have a commercial organisation more interested in their profits that the countries badly needed broadband infrastructure for the growth of our “knowledge economy”. Green Party, I hope you find a way to CPO their asses!
     
    By the way – if any member of Government defends that decision remind them that they are now trying to do it the correct way with the ESB: sell off the retail arm but retain control of the infrastructure and assets. Once bitten, twice shy? Or have they simply learnt from their disastrous mistake.
     
  7. Just to finish up, there is one more policy that I think is long overdue: no more corporate donations to political parties. For a modern, honest and impartisan Government, this is a policy that is long overdue. I am a strong democratic. I believe in politics and I’m not apathetic or ignorant to the very very hard work that politicians do. I believe the political parties should be 100% funded by the public exchequer. Then they’ll really work for us free of outside influences.

By voting Green you will help ensure that have a mandate sufficient to put them in a coalition Government and the stronger the mandate they receive, the greater their negotiating position for their policies.

Voting Green doesn’t get you a Green Government, but it does get you some Green policy implemented in Government. If we can even get some of the above implemented, I believe we’ll all be better off.

Now, the obligitory party political broadcast. The theme is clear:



Posted in Politics, Rants | 2 Comments »

Nagios Alerts via SMS with Kapow

May 19th, 2007 by Barry O'Donovan

I have a client who required a Nagios installation with alerting via SMS (*). They use Kapow as their SMS gateway.

There were two aspects required:

  1. The sending of alerts via the SMS gateway;
  2. The monitoring of available credits on the SMS gateway;

 

1. Send Alerts via SMS Gateway

The sendsms script is:

#! /bin/bash

USERNAME=username
PASSWORD=password
SENDSMSADDRESS="https://www.kapow.co.uk/scripts/sendsms.php"
MAXMSGLENGTH=320

read -n $MAXMSGLENGTH -r MSG

MSG=`php -r "echo urlencode( \"$MSG\" );"`

wget -q -O - "$SENDSMSADDRESS?username=$USERNAME&password=$PASSWORD&mobile=$1&sms=$MSG"

I use a quick hack with PHP to URL encode the string. I didn’t know a shell command off hand but I’m open to suggestions. This can be tested with:

echo This is a test message | sendsms 353861234567

Edit /etc/nagios/misccommands.cfg to include the following:

# 'host-notify-by-sms' command definition
define command{
        command_name    host-notify-by-sms
        command_line    /usr/bin/printf "%b" "Host '$HOSTALIAS$' is $HOSTSTATE$: $OUTPUT$" | /usr/local/bin/sendsms $CONTACTPAGER$
        }

# 'notify-by-sms' command definition
define command{
        command_name    notify-by-sms
        command_line    /usr/bin/printf "%b" "$NOTIFICATIONTYPE$: $SERVICEDESC$@$HOSTNAME$: $SERVICESTATE$ ($OUTPUT$)" | /usr/local/bin/sendsms $CONTACTPAGER$
        }

Ensure your /etc/nagios/contacts.cfg is updated to include notification by SMS with your mobile number:

define contact{
        contact_name                    barryo
        alias                           Barry O'Donovan
        service_notification_period     barryoworkhours
        host_notification_period        barryoworkhours
        service_notification_options    w,u,c,r
        host_notification_options       d,u,r
        service_notification_commands   notify-by-email,notify-by-sms
        host_notification_commands      host-notify-by-email,host-notify-by-sms
        email                           joe@bloggs.com
        pager                           353868017669
}

Sin é.

 

2. Monitor SMS Gateway Credits

The plugin code is:

#! /bin/bash

USERNAME=username
PASSWORD=password
CHECKCREDITSADDRES="https://www.kapow.co.uk/scripts/chk_credit.php"

CRIT=$1
WARN=$2

CREDITS=`wget -q -O - "$CHECKCREDITSADDRES?username=$USERNAME&password=$PASSWORD"`

if [[ -z $CREDITS || ! $CREDITS -ge 0 ]]; then
        echo -e "$CREDITS\\n";
        exit 3;
elif [[ $CREDITS -le $CRIT ]]; then
        echo -e "$CREDITS SMS credits remaining\\n";
        exit 2;
elif [[ $CREDITS -le $WARN ]]; then
        echo -e "$CREDITS SMS credits remaining\\n";
        exit 1;
else
        echo -e "$CREDITS SMS credits remaining\\n";
        exit 0;
fi

Create a plugin configuration file for Nagios, say /etc/nagios-plugins/config/sms_credits.cfg:

# 'check_sms_credits' command definition
define command{
        command_name    check_sms_credits
        command_line    /usr/local/bin/check_sms_credit $ARG2$ $ARG1$
        }

Where $ARG1$ is the warning threshold and $ARG2$ is the critical threshold.

I add the service to the Nagios monitoring box via /etc/nagios/config/sms_credit.cfg:

#
# check sms credits on Kapow - barryo 20070519
#

define service{
        use                             core-service
        host_name                       noc
        service_description             SMS Credits
        check_command                   check_sms_credits!50!100
}

And I believe that’s it.

*) The monitoring box is in a different country to the servers it monitors so a network failure will not prevent the alert getting out.

Posted in Linux, OSS, Recipes | 8 Comments »

O2 XDA Exec as a Modem

May 10th, 2007 by Barry O'Donovan

I recently purchased an O2 XDA Exec to fulfill by on-call/support obligations. With a trip away this weekend, I decided to play it safe and just make sure it worked as a modem for an install of Windows hidden away on a tiny partition of my laptop (which of course includes PuTTY).

I have actually installed PuTTY on the XDA as well and it works great but it’s only really practical for quick fixes or real emergencies when it’ll “have to do”.

The use of the XDA as a modem for accessing the Internet from a PC via USB is not very intuitive but fortunately someone else had done all the work: http://www.pcurtis.com/xda.htm. Their instructions are reproduced below for prosperity. The Internet access point for O2 in Ireland is internet and the GPRS username/password is gprs/gprs.

Use of XDA as a Modem for accessing the Internet from a PC via USB

Although the comprehensive handbook and advertising material indicated this was possible it took considerable research on the Internet to implement the use of the XDA as a modem for GPRS/3G access from a PC. This was not entirely unexpected as it took a very long time to find out how to do the same with our Sony T610 phone. We have finally succeeded and are providing detailed instructions which work for a USB cable.

The following procedures have only been tested with the XDA so far but should be applicable to any PDA running Windows Mobile 5. I have therefore used PDA instead of XDA throughout this section.

Firstly one must understand that use of PDA as a modem for accessing the Internet involves running a built in program called Wireless Modem on the PDA which simulates a modem on the PDA USB port (or on the Bluetooth or IR connections). When this program is running it is just like an old fashioned external modem box with a screen display with an online and data lights – when the program is running the USB connection is completely different and when it is plugged in it will be recognised as a new modem device. One must therefore install a USB modem on your computer which uses the special driver supplied on the applications disk with the PDA. Only then can you set up a Dial-up internet connection using the PDA.

The use of GPRS/3G requires the setting up the PDA modem by a special initialisation string with details of the GPRS access point or, in some cases it will be already set if you have just made a connection using the required access point. You then connect (dial) using a magic code of *99# instead of an ordinary telephone number. You need to know the access point, username and password for you providers GPRS/3G service to do this in the case of O2 the access point is mobile.o2.co.uk , the user name is web, o2web or faster and the password for all of them is password. In the case of Vodafone UK prepay the access point (APN) is pp.vodafone.co.uk , the username is wap and the password is also wap . Try Ross Barkman’s Page or http://www.formatc.de/roaming/gprs.htm for complete sets of GPRS settings world wide.

So in detail:

  1. Disconnect the PDA USB cable from your computer if it is plugged in
  2. If you have installed ActiveSync on the computer it should be disabled by Right clicking the ActiveSync icon in your computer tooltray, open “Connection Settings” and Uncheck “Allow USB Connection”.
  3. On your PDA: Go to “Beam” (in Settings/Connections), and uncheck “Receive all Incoming beams”.
  4. Turn on the telephone in Wireless settings and check you have a signal.
  5. Then in Programs, click on “Wireless Modem” click on Tools/Options and Check the Preset GPRS connections and write in the APN, your network provider’s internet access point (mobile.o2.co.uk for O2 and pp.vodafone.co.uk for Vodafone) and click OK. Set the Connection type to USB and click on “Start” and leave the program running.
  6. Now, connect your PDA to the computer with the USB cable and after a few seconds the “Found New Hardware Wizard” should start on your computer. Click “Install from a specific location”, then “Don’t search. I will choose.”, then click on “Modems”, and “Have Disk.” and go to the folder on the CD provided which contains the HTC USB Driver. The HTC USB Modem will be shown in the compatible hardware: click to install. Continue if you receive the alert of the software not passing the Windows XP compatibility test (Continue anyway). Click Finish.
  7. Now, in Control Panel of your computer, open “Phone and Modem Options”. Select the “HTC USB Modem” and click on “Properties”. In the “Advanced” tab type or cut and paste into “Extra initialization commands” the following string AT+CGDCONT=1,”IP”,”xxx”,”",0,0 where xxx is your internet access point ie for Vodafone the string is AT+CGDCONT=1,”IP”,”pp.vodafone.co.uk”,”",0,0 . Click Ok to finish.
  8. Finally, on your computer, go to “Network Connections” and click “Create a new connection”. Choose “Connect to the internet”, then “Set up my connection manually”. Click “Connect using a dial-up modem”, then give a name to your ISP. In phone number type *99#. Get username and password from your network provider – for Vodafone UK use wap for both
  9. Make a shortcut of this connection on your desktop for quick access.
  10. NB ALWAYS use the same USB connector or you will need to set up another!

    Every time you want to use the PDA as a modem:

    1. Disconnect PDA USB cable if connected
    2. If necessary Disable ActiveSync on your computer as above by unchecking the “Allow USB connection”
    3. If necessary turn on the telephone and check for a signal.
    4. Open Wireless Modem program on your device and push on Start (with the Connection Type on USB) and leave it running.
    5. Connect your device USB cable (always using the same connector on the PC )
    6. Dial from your desktop using the shortcut you created

    After you have finished:

    1. Close the connection on the computer to stop being charged then
    2. Remove the USB cable before you
    3. Close the Wireless Modem program but remember to
    4. Enable ActiveSync by re-enabling the USB connection before you
    5. reconnect the USB cable (always using the same connector on the PC) when you want to start synchronisation.

Coming soon: O2 XDA Exec, GPRS, USB and Linux.

Posted in News | 9 Comments »