Posted by: Rich Cumbers | May 6, 2009

WebSphere MQ manual Registry entries

Just a quick post, as much for my benefit as anyone else’s! In running our automation it was required that when a new queue manager is created we edit the windows registry for that queue manager. Put simply, I did the following steps:

  1. Created an XA Resource Manager using the MQ Explorer
  2. Started my Queue Manager to make sure my changes worked (they did)
  3. Stopped the Queue Manager
  4. Exported the ‘XA Resource Manager’ key for my Queue Manager using regedit into a file
  5. Deleted the ‘XA Resource Manager’ key from the registry.
  6. Started my Queue Manager to make sure my deletion did not break anything
  7. Stopped the Queue Manager
  8. Imported the registry file using regedit /s registry.file
  9. Tried to start the queue manager and got an error An expected stanza in the configuration data is missing or contains errors. and an fdc.

Turns out that all I need to do to get this to work is: amqmdain regsec and that will fix the registry permissions!

Infocenter page for amqmdain can be found here.

Advertisements
Posted by: Rich Cumbers | April 16, 2009

MS0T (Standalone MQ Explorer) & WebSphere MQ FTE

Recently IBM announced a SupportPac for WebSphere MQ for the Eclipse based WMQ Explorer. Called MS0T it is classified as a category 3 SupportPac and can be downloaded from the MS0T page.

One outcome of this Standalone edition of the WMQ Explorer is that you now no longer need to use the full WebSphere MQ installer and can just have the Explorer without the other parts of the product. This is pretty neat when you also want to administer your WebSphere MQ File Transfer Edition network on a remote machine without a full install. As of writing this post WMQ FTE does not support automatic installation of the File Transfer Plugin for the MQ Explorer and manual steps are required, and there are no plans to do so at present. Here are the manual steps required to make this work:

  1. Install SupportPac MS0T (currently Windows only, support for Linux coming soon!)
  2. Install the tools edition of WMQ FTE on the same machine as your Standalone Explorer is installed
  3. Create a file called com.ibm.wmqfte.link in the Standalone Explorer eclipse/links folder that contains the following path=c:/your/wmqfte/tools/install/location
  4. Start Explorer and you should see the familiar (if you have used it before) File Transfer Edition icons on the left hand side!

Please note: The slashes in the above property are forward slashes and must be forward slashes for this to work!

Let me know if you manage to get this working, or if not what went wrong!

Update: There is an official technote describing this exact scenario (written by using this post) http://www-01.ibm.com/support/docview.wss?uid=swg21394643. Thanks to Marcel Amrein for pointing this out.

Posted by: Rich Cumbers | March 30, 2009

Cypriot Wedding in 2010

Way back in 2007 I proposed to Su in Venice. She accepted and since then we have been saving up for the big day. We were originally going to have our wedding at a place called Manor Barn, near Petersfield. Unfortunately the date we wanted was unavailable, and on reflection the amount of money required to finance the one day was really rather astronomical! So we were back to the drawing board on when/where we would get married. Enter stage right foreign wedding ideas.

I have always been keen on the foreign wedding idea, ever since going to the (less then exotic) Belfast to attend a good friends wedding. The idea that the wedding is made in to more of trip rather then a day, where everyone invited is staying in the vicinity of the venue etc really appeals to me, making it much more of an event then a single day ever could. The Belfast wedding was a long weekend that was so much fun, as someone invited you felt much more involved with the wedding party, primarily I believe due to the fact that you were having breakfast with them, going on excursions etc. For me it was the most memorable wedding so far, and for all the right reasons!

The venue we have found is called Zucchinis and was recommended by a friend of Su’s family. We had a short break to go and check out the venue, make sure it was what we wanted etc. This morning we called their office and officially booked it! Cyprus here we come!

Posted by: Rich Cumbers | March 19, 2009

WebSphere MQ Java & Pub/Sub

Just a quick post about WebSphere MQ Java Pub/Sub functionality. I have need to write an application that uses the Base Java Classes for WebSphere MQ, making use of some Pub/Sub. There is a fair amount of information on the web on how to subscribe but no information on how to unsubscribve. To subscribe to a topic all you need to do once you have a MQQueueManager object is the following:

int options = CMQC.MQSO_CREATE | CMQC.MQSO_RESUME | CMQC.MQSO_DURABLE | CMQC.MQSO_FAIL_IF_QUIESCING;
MQTopic topic = qmgr.accessTopic("topicName", "topicObject", options, null, "DurabeIdentifier");

Now you have the MQTopic object you can get messages that are published to the topic “topicObject/topicName”. As I mentioned the reason for this post was the lack of any information on the web, including the WebSphere MQ Using Java V7 manual, and the WebSphere MQ V7 infocenter on how to unsubscribe from the topic. Well eventually I gave up on the web, and decided to look at the MQ Test material that we have here at Hursley. The following code will unsubscribe from the topic:

if (topic != null) {
if (topic.isSubscribed()) {
topic.getSubscriptionReference().setCloseOptions(CMQC.MQCO_REMOVE_SUB);
topic.getSubscriptionReference().close();
}
topic.setCloseOptions(CMQC.MQCO_DELETE);
topic.close();
}

That will check if your topic is not null, is subscribed and then set some options to ensure that the subscription is deleted. Job done and only an hour wasted searching the docs!

Update:You do not need to use topic.setCloseOptions(CMQC.MQCO_DELETE);. This would actually throw an MQRC_OPTION_NOT_VALID_FOR_TYPE (mqrc 2045) error!

Posted by: Rich Cumbers | March 13, 2009

Getting MQ and DB2 to talk on windows

Something had to force me from the blogging wilderness that I have been in since August of 2008. I’ll freely admit that I have neglected this blog, and intend to change. No really I do. It is not that I have not done anything interesting since August, since my last post we have released WebSphere MQ File Transfer Edition 7.0 and are now planning and developing for the future releases. My lack of posting has not been down to lack of time. In the time that it takes to complete a mission on Far Cry 2 (xbox360 naturally), or watch an episode of 24 (fantastic 7th season) I could have posted 2 or 3 articles. I think it comes down to not really finding my blogging voice, when reading my posts back to myself I always cringe and I think this is something I am just going to have to get used to. I think the term “strap on a pair” would best describe what I need to do.

Anyway on to my post. My current day job involved setting up a WebSphere MQ V7 Queue Manager to use DB2 as a Resource Manager for XA transactions. There are some docs on the infocenter for WMQ V7 here and here, but in following these I did not manage to get my queue manager talking and playing nice with a DB2 instance. There is also a rather well written DeveloperWorks article by Mr Ben Ritchie that has only one drawback and that is following the instructions for Windows does not make it all work nicely. So I thought I would explain my setup, and what I had to do to get it to work.

I have a Windows machine that has both WebSphere MQ V7 and DB2 9.5 installed. I want to use WebSphereMQ as the coordinator for my XA transactions. Nothing fancy, just a simple XA connections. The first thing to do is to create the queue manager that you are going to use. For the purposes of this article I shall call my queue manager DATABASE_QM. I also have a database called XADATABASE. My windows userid is fred and my password is pass1234.

The first thing the docs do not tell you is that you need to copy/move a file called jdbcdb2.dll from <WMQ Install Dir>/java/lib/jdbc/jdbcdb2.dll to <WMQ Install Dir>/exits. If you do not do this setup, then in the AMQERR**.log you will find errors telling you that MQ cannot find the jdbcdb2.dll file. A simple copy/move action and you are ready to move to the next step

All the configuration for the connection occurs in the database. Well everything except a single command. The configuration of the queue manager in Windows is best done using MQ Explorer. Access the queue manager properties by right clicking on the queue manager and selecting properties. Navigate to the “XA resource managers” menu option. Here is where you will add the details of the connection to the DB2 database. Click Add, and you will be presented with a dialog box. Here is where you Name your Resource Manager (anything you like), give it the name of the Switch File to use (jdbcdb2.dll), the XAOpenString which will consist of the following db=XADATABASE, userid=fred, pwd=pass1234, toc=p, tpm=mq; substitute your values for db, userid and pwd. Leave XACloseString blank, I won’t lie I have no idea what I would use this for, I just want to get MQ and DB2 talking! Finally ThreadOfControl is set to Process, which is good enough for me.

I mentioned the command to run on DB2, run the following:Β db2 UPDATE DBM CFG USING TP_MON_NAME MQ

Now aside from the action to move/copy jdbcdb2.dll to the exits folder you have followed what all the docs say you should do. The next step would be to stop the queue manager (if you have it running), and then start the queue manager. Except that does not work. You will get an error telling you that the queue manager could not connect to the Resource Manager. So here is the bit you really must do. The user id for which the default name is MUSR_MQADMIN that the ‘MQ Services’ process ‘amqmsrvn.exe’ is running as needs to belong to the group DB2USERS. The information about this can be found here. Once you add the user to the group, stop/start the MQ Services process, restart your queue manager and you should not have any error messages in your log files. At least it worked for me!

And so ends my self imposed blogging exile. Hope to post again soon, rather then 7 months down the line!

Posted by: Rich Cumbers | August 5, 2008

IBM Managed File Transfer

A while ago on Twitter I had alluded to a new project that I as working on. I had managed to fly the WebSphere MQ nest, after helping to get version 7 out of the door. I was unable to talk about the project i was working on as IBM had not announced the product for all sorts of reasons, mostly ones that could land people in court. However I have now found some time to talk about what I will be up to for the next few months…

IBM recently announced that we are delivering a managed file transfer product, built on top of WebSphere MQ. (see product page here: http://www-306.ibm.com/software/integration/wmq/filetransfer/index.html). The long of the short is that we are delivering a product that will allow the end user to transfer files from A to B using WebSphere MQ as the transport. Some of the features currently in plan are things like scheduling and triggering.

We are working with 2 week iterations, with scrum meetings every day at 10 and yes we stand to try and keep it short, with each team member explaining what work they did yesterday, what work they are doing today, and anything that is blocking their progress. Currently there is a definite line between developers and testers, though not in the “Us vs Them” manner that sometimes exists. I am currently working as a developer, whilst also looking at the performance of our product and I am having a fantastic time. I have not had this much fun at work for ages, and it is showing in the time I am coming to work, and my general happiness around the house when home.

So far things are going very well, I am learning the code base, the team are delivering reguarly fortnightly code drops, which are ready for customer consumption.. On that note we are fully into our Early Access Program (EAP) and are deciding on a per iteration basis if the product should be given to customers. Watch this space for more information on my experience with Agile at IBM….

Posted by: Rich Cumbers | June 24, 2008

Pollen Forecast on Twitter

I recently attended a hackday event with Dale. Mashed2008 was my first, and it certainly will not be my last. We hacked together a current cost idea, and won! However that was not this hack. On the train on the way in I was discussing some simple hacks with @thomasj. One issue I have is that my hayfever is very up and down, and the bbc pollen forecast seems to be quite good at being ‘High’ when I want to rip my eyes out, and ‘Low’ when I can get away with not eating ant-histamines like smarties.

So using the power of twitter (when it is not down), and a simple perl script to get the data from the page and I now have @pollen_south which gives me the south feed. If I get requests I might add the other areas that the bbc use, but as a simple hack it work pretty well. The only downside was that I totally forgot about doing the hack until the point during the presentations when I slowly lost the will to live.

Posted by: Rich Cumbers | June 3, 2008

openmoko software repairs

Last September Dale went to MobileCampLondon, and managed to snaffle an openmoko neo1973 device. Search on google for more information about openmoko then I can talk about here, but basically it is an opensource mobile phone, running on an ARM processor and using a linux operating system. At some point whilst playing with it Dale managed to break the device and it has sat in his house ever since.

Today however he gave the device to me, with the initial task of making it usable again. The symptoms firstly where that it would not turn on. No feedback, no backlight, nothing. A quick google search and flick through the openmoko wiki told me to “Remove the battery for 30 seconds, and then charge for around 2 hours before turning on”. This worked, and I was soon presented with the bootup screen. Boot up takes around 3 minutes when you first start it, and if all is working well you are briefly confronted with a “Please Wait…” message followed by the UI loading. I managed to get to the Please Wait message, but it would go no further. Hmmmm….

There is a usb port on the side of the phone, and connecting it to a laptop (mine is running linux) enables you to connect to the phone using ethernet over usb. Simply set up the port using:

sudo ifconfig usb0 192.168.0.200 netmask 255.255.255.0

and then you can

 ssh as root to 192.168.0.202

where the default root password is blank. It may take short while to connect, so be patient! Looking in /var/log/messages I found that the kernel and rootfs were corrupt, which would require that I flash the phone again. Not only would I have to flash the phone but I would be flashing someone else’s phone so turning it into a useless brick was definately not an option. Fortunately there are really easy to use tools to do this.

dfu-util is an application written by openmoko to help with flashing your phone. As the phone is still very much in development this is probably an every day occurrence and so the tool is very quick and easy to use. Firstly I installed the required ubuntu libraries:

sudo apt-get install libusb-dev autogen pkg-config

and then downloaded the debian version of dfu-util from http://packages.debian.org/dfu-util. You also need to have usb file mounting, which can be enabled by adding:

 usbfs   /proc/bus/usb   usbfs   defaults

to your /etc/fstab. A reboot maybe required to enable the usbfs, unless you know of a better way. From there I used the

dfu-util -l

command to display the usb devices I could use, I got the following output (using root):

root@jester:~# dfu-util -l
dfu-util - (C) 2007 by OpenMoko Inc.
This program is Free Software and has ABSOLUTELY NO WARRANTY

Found Runtime: [0x1457:0x5119] devnum=2, cfg=0, intf=2, alt=0, name="USB Device Firmware Upgrade"
Found Runtime: [0x0a5c:0x2110] devnum=3, cfg=0, intf=3, alt=0, name="UNDEFINED"
root@jester:~#

Using the following two commands I was able to upload the kernel and rootfs:

dfu-util -a kernel -R -D ./uImage-2.6.24+git20080421-r0-om-gta01.bin -d 0x1457:0x5119
dfu-util -a rootfs -R -D ./Openmoko-openmoko-devel-image-glibc-ipk-P1-Snapshot-20080421-om-gta01.rootfs.jffs2 -d 0x1457:0x5119

Note that as I had two devices using dfu-util -l I had to specify the one I was interested in using by specifying the -d flag.

So now I have a fully working openmoko phone, and it is running the latest recommended build. Just need to do something with it now! I will be testing the phone over the next week and may well post my thoughts on how the development is doing. Who knows maybe there is an openmoko/currentcost idea to be developed…..

Posted by: Rich Cumbers | May 28, 2008

So now I have a slug with SLUGOS…..

….what should I do (aside from upload currentcost data)?! Dale has an excellent post about the installation, and for me it was pretty much the same. The only real difference was that as Dale is very much a windows chap he used Sercomm Firmware Updater, and as I am more of a linux chap I used upslug2 to flash the device. upslug2 is a simple application that scans for slugs that are in admin mode, and then if you pass the correct parameters will go ahead and flash the firmware, very quick and easy to do!

This post is about getting the slug to be a functional mini linux box (for example the creation of a non-root user).

Bash

I prefer bash to the sh shell, so ‘ipkg install bash’ was the first installation I did. Job Done.

Who wants to be root anyway?

I am primarily an Ubuntu user, have been now for over 2 years and am very happy with it. I like the lack of root user, although you can configure it, and the more or less enforced use of sudo. So my first task was to add a user that was not root, and setup sudo. I started trying to use ‘useradd’, but it was not there, but swapping the two words to ‘adduser’ brought up what we come to expect. a cryptic message stating that I should use ‘adduser {OPTIONS] username‘. Note the lack of mentioning what the actual options could be! A quick google search and I found the following: http://tinylogin.busybox.net/TinyLogin.html which on it details the required options and what to do with them, and thus I constructed: ‘adduser -s /bin/bash -h /home/cumbers cumbers’. Next I created the user directory, chown’d it to my user and did a passwd to set my password.

sudo was just as simple as installing bash. ‘ipkg install sudo’ was all that was required, and then a visudo to edit the sudoers file. I like to use the wheel group with a password so uncommented the relevant line, and then created a wheel group using ‘addgroup wheel’.

With the two steps above I now had a system that I felt was a little more secure in my sometimes careless typing world!

Timezones and ntp

According to the tzdata packages we (the UK) are not in tzdata-europe as you would suspect, but are in fact in tzdata-misc package! A simple ln -s /etc/localtime /usr/share/zoneinfo/<final path to your locale> and I was setup. Again using the ipkg tool I installed the ntpclient and ntp-tools packages. There are various sites that deal with configuring this, so just give it a google!

Miscellaneous

I also installed the following (in no particular order)

  • findutils – gives me locate and updatedb
  • coreutils – something no admin should be without
  • tar
  • gzip
  • ncftp – powerful ftp client, including bookmarks
  • grep

What next for the slug?

The device is surprisingly repsonsive and I am looking forward to pushing it to its limits. Dale has already recompiled perl modules so that he can use the full mysql package, before find out about sqllite, but there seems to be a lot you can do with this piece of kit, so who knows maybe an mp3 server, or just a samba share point for the house! This device was bought to replace an old shuttle pc, that seemed to use about 40W to publish the data, my resting wattage in my house is now around 60, which is pretty damn good!

Posted by: Rich Cumbers | May 7, 2008

Breakdown of currentcost xml output

With all the blogject/tweetject activity going on with James Taylor, Chris Hodgins, Nick O’Leary and of course Andy-SC, and with Nick’s excellent guide to getting the data and creating custom graphs, I thought it would be good to blog about the actual xml data, and in doing so create a reference article for new people joining the currentcost foray! I do not know what all the data stands for, and this article will get updated as and when I am told/I work it out!

Updated: XML notations have been updated in line with comments to blog post. Thank you to everyone for helping with this!

<msg>
  <date>
    <dsb>00030</dsb> // This is the 'days since birth'
    <hr>00</hr><min>20</min><sec>11</sec> // The Time
  </date>
  <src>
    <name>CC02</name> // The name of the device
    <id>00077</id>  // Communication channel for device
    <type>1</type> // Hardware version of the device.
    <sver>1.06</sver> // Software version
  </src>
  <ch1>
    <watts>00168</watts> // Value from the 1st channel clamp
  </ch1>
  <ch2>
    <watts>00000</watts> // Value from the 2nd channel clamp
  </ch2>
  <ch3>
    <watts>00000</watts> // Value from the 3rd channel clamp
  </ch3>
  <tmpr>25.6</tmpr> // Current Temperature as recorded by unit
  <hist>
    <hrs> // Total Kwh used in 2 hour blocks
      <h02>000.3</h02>
      ....
      <h26>003.1</h26>
    </hrs>
    <days> // Total Kwh used per day(s)

      <d01>0014</d01>
      ....
      <d31>0000</d31>
    </days>
    <mths> // Total Kwh used per month(s)

      <m01>0000</m01>
      ....
      <m12>0000</m12>
    </mths>
    <yrs> // Total Kwh used per year(s)

      <y1>0000000</y1>
      ....
      <y4>0000000</y4>
    </yrs>
  </hist>
</msg>

Questions that I would like answered.

  • Is the data stored in persistent memory? Answered by AndySC. Yes it is flash memory πŸ™‚
  • What does DSB stand for? Answered by Nick in comments below and xml above

« Newer Posts - Older Posts »

Categories