Posts Tagged ‘IBM i’

Where’s Waldo…um, Pete!

Nothing like a move from a monolithic, easy to maintain gem of a framework like Liferay to a distributed, micro-service based bespoke solution to suck the very life and free time out of your schedule. The whole of the IBM i community knows the beauty of a single, integrated operating environment and how that can reduce complexity, boost productivity and make troubleshooting issues easier. Now I get to deal with “where did it fail” mysteries of databases in one cloud, applications in another cloud, services from who knows where connected by a service bus in yet another cloud. I have been spoiled by living in a single ecosystem running on bullet proof hardware for decades.

So I have been scrambling and getting ready for a big move to higher complexity and stress. But I am looking forward to sharing what I have learned as the PowerUp18 conference comes to San Antonio in barely a month. MORE stress to get those presentations done!

Comments Off on Where’s Waldo…um, Pete!

The pieces of Java 8 on IBM i

Ah, pieces of 8, wish it WERE gold.

So this is a short story about installing Java 8 on IBM i. A quick Google search on “Install Java 8 on IBM i” takes you here: Which is exciting because the big blue button says: “Download Version 8” AWESOME (well, um, not…). First you have to find the download link for IBM i which is at the bottom of the page and takes you to ESS. There, the challenge is to find the licensed program 5770JV1 (for me…). The product isn’t listed.  More Googling…which finds a reference on how to find the licensed product for JAVA….

As it turns out, 5770JV1 is found as part of 5770-SS1. Select it in ESS and click “Continue” (NOT at the top of the list…click the “Continue” at the bottom of the list…). Then click “Continue” on the next page…..

to continue….

Here is where you need to understand how the “hide/show” works (“hide/show” WHAT? would be my first question but IBM assumes you know what “hide/show” does: It hides/shows details…..)

So click on “hide/show” and you should see a long list of packages which again, you need to click on “hide/show” on “5827: i7.2 B_GROUP1 v07.02.00,ENU,DVD” There you will see the two entries for Java 8 (32 and 64 bit). Select these two small files (416MB) and you’ll get a 1.8 GB download (yeah, you get the whole DVD anyway)

Once you have downloaded and mounted the DVD, go to install licensed programs and take the option to install 5770JV1 option 16 and then install 5770JV1 option 17 (you will probably need to use the “Add” option rather than finding the product/option in the list)

Make sure you install the latest PTF’s after you finish installing the licensed programs.

Now your Java is no longer in pieces…..

Comments Off on The pieces of Java 8 on IBM i

Mobile application development and IBM i (Part four) – Mobilize me!

So we have this great little 5250 application which is now just an ugly web application.  Truth is, this thing is so lightweight that as a web application, it is pretty snappy.  But, not ALL applications are going to be this light weight and unless your standards are as low as mine when it comes to GUI, you’ll want to make this a *little* prettier.  Here is where we are, so far:

The great news is that with CSS3 and HTML5 the road from ugly to beautiful is short and sweet.  We just need to add a bit of css and perhaps a javascript library to improve things.  But there is some redesign needed as well, especially since we are now going to add some more heft to the size of the application.  Our original design had two separate CGI programs which basically presented the two screens of information.  In each case a page is constructed at the server end and sent back to the browser to be rendered.  Not a great design since a large portion of the page really doesn’t change.  And imagine if we had headers, footers and graphics on the page as well.  All that back and forth can eat bandwidth and breaks our “good citizen” rule.  So we need a new approach.

First, we are going to change from multiple pages to a single page.  In jQuery mobile, the “trick” that is used is to define a div and treat it as if it were a page.  With jQuery, jQuery mobile and the css added to the file, we can start to redesign the page like so:


<div data-role=”page” id=”main” data-theme=”b” >


<div data-role=”page” id=”punches” data-theme=”b” >



That creates two “pages” for jQuery mobile to work with.  The library takes care of the heavy lifting of showing and hiding the pages as we “page” back and forth.  Make sense?

For the “main” page, the first page we see that has the last punch and current time and date information as well as the buttons, there really isn’t all that much difference between the “classic” CGI page and our mobile page.  We have a table with our information formatted into it.  The “punches” page, where we list the information on the punches returned from the server, hasn’t changed all that much either except on both pages the /% %/ variable delimiters are gone because we are not making the round trip to the server so our CGI program no longer has to dump the information into the variables.  So how, you ask, are we going to get data into the HTML forms?  Ah! For that we use the magic of AJAX, JSON and the jQuery libraries.


AJAX is the easiest part to understand.  All AJAX does is send a small bit of data to the server (think of it as a miniscule web page) which the server reads and executes.  That execution may return data, or it may not (usually does).  The server packages up the data and sends it back to the AJAX requestor. At that point, the function that called the AJAX deals with the response.


The second piece, JSON, is a little harder to understand.  Basically, JSON is just a string of data in a particular format.  Basically the format is this:  { “name”:value}.  Deceptively simple but very powerful because if you know anything about JavaScript you know that looks very similar to an object definition in JavaScript.  So, as an example, if we wanted to create an object called Person and add some attributes to it you would do it something like this:

personObj=new Object();

But we could also do it like this:

And when we needed to get values from the object we would do it like so:

var first = personObj.firstname;

It shouldn’t take much of your brain’s CPU cycles to think: Hey, wait a minute!  If I had a string formatted like so on the server: ‘{firstname:”John”,lastname:”Doe”,age:50,eyecolor:”blue”}’ and I returned that string to my web page with an AJAX call,  I can create objects of data on the client without much effort!  Pseudocode would be something like:
var personObj = getJsonFromAjax();  Nice!  That is EXACTLY what we will do with a little help from jQuery.


If we want to start hooking some of this stuff up, let’s begin by assuming that we have returned a JSON formatted string to our client application.  jQuery pretty much handles all of the heavy lifting:

jsonURL =  ‘cgi_mobile.pgm?action=getList’;  // URL that calls our CGI program on the server

url: jsonURL,
async: false,
cache: false,
success: function(data){

jsonContent = $.parseJSON(data);
alert(‘(JSON exception)’);
return false;

This code snippet would call the cgi_mobile.pgm and pass the action ‘getList’ and then the program would return that list in a JSON formatted string which is parsed back to an object using the $.parseJSON function in jQuery.  You can take a look at the program source but basically the CGI program simply formats the data using a ‘json’ template and sends back the result which is a JSON string.  It does it EXACTLY the way it would take an HTML template and send back HTML.  You can take a look at the jsonlist.json template but there isn’t anything new except it formats the data as a JSON string.

That string is actually an array of JSON objects (because that is the way I formatted it!) so now I have an array of objects and those objects are “punches”.  It looks like this:

[ { “lastPunch”: “IN”, “punchDate”: “12/30/11”, “punchTime”:”07:40:38″ } ,{ “lastPunch”: “IN”, “punchDate”: “12/30/11”, “punchTime”:”08:07:43″}]  In fact, you can see the “raw” data just by calling that action in your browser:

Nothing special.  AND since we now have an object we can iterate through and format our table on the client side with a little bit of javascript:

for(var i =0;i<jsonContent.length;i++)
var rec = jsonContent[i];
html = html + ‘<tr><td><input type=text name=lastPunch id=lastPunch value=’+rec.lastPunch+’ readonly></td>’
html = html + ‘<td><input type=text name=punchDate id=punchDate value=’+rec.punchDate+’ readonly></td>’
html = html + ‘<td><input type=text name=punchTime id=punchTime id=punchTime value=’+rec.punchTime+’ readonly></td></tr>’


Once we have that HTML constructed, jQuery just let’s us stuff the html into the empty body of the table in our “punches” “page”:

$(“#punchList tbody”).html(html);

And then we change the “page” (basically hiding the div we are on and showing the div named “punches”)

Not a whole lot of magic here.  Just taking advantage of the capabilities of AJAX, JSON, and jQuery.

Believe it or not, the hard part is done.  We can easily take this mobile web application and turn it into a mobile “native” application using PhoneGap.  But, that will have to wait until next week (or so).  Remember that you can get this code right here.

OH!  I missed giving you a link to the actual web application.  You will find that here:

Have fun!

Comments Off on Mobile application development and IBM i (Part four) – Mobilize me!

Tracking the time

I have kind of lost track of time.   Christmas-New Years tends to be a time when I ‘play’ a bit with new technologies and have a chance to try things on for size.  Alas, work has prevented me from playing!  But, all work and no play makes for a very dull boy so I DID manage to pull off a quick playtime in the name of expediency.

As a contract programmer (among other things) one of the biggest challenges is to track the time I spend on various projects and activities.  A few years back I wrote a simple time tracking application which I started to use and then abandoned because I couldn’t *easily* track time.  I wanted it to be so easy that all I had to do was log in, click and start recording my time on a project.  I also wanted to be able to manually add and change time.  Nothing fit the bill.

Quite by accident I stumbled across Kimai.  I was initially put off because the site was in German (it took me a while to find the UK flag indicating an English version). But, since I run PHP on i and it was a snap to install, I was quickly up and running.  This is a GREAT time tracking application.  Easy to use.  Easy to set up.

I have barely scratched the surface on using it but I will report additional progress in the future. The great thing about the app is that I can use it anywhere I have Internet access.  I hope to find a mobile app version (there *was* one but it is no longer available)  so I can record time while away from my desk.

Give it a try.  A great application…a *real* time saver!

Comments Off on Tracking the time

Revisiting Nagios to monitor IBM i

It’s been a while since I played with Nagios but my son had recently shown me the Cacti plugin that works with Nagios and it was cool enough that I decided to get Nagios up and running again.

I have an SLES 11 SP1 PPC64 Linux installation that is running on my JS12 blade under VIOS (that is a mouthful!) and although I intend to run Asterisk on the JS12, I have plenty of running room for Nagios as well so I went ahead and installed Nagios. The Quickstart guide was the easiest for me.  It recommended using wget to pull the files and everything went smoothly from there. The biggest requirements are to make sure you have php and java installed but most servers these days would have those common applications already installed.

Right after I got it installed I realized I had a hosed up PHP5 installation that I had never really addressed.  I also had a devil of a time getting the KDE desktop running, all of which came back to haunt me.  I traced the PHP5 problem to a module that wasn’t flagged as executable and finally got the basic Nagios web app running under Apache. The desktop is still a little squirrely but it works well enough to move around.

The next thing to do was to install the client apps for the IBM i.  I remember being *very* confused about how to get all of this working on the i before.  The confusion comes from where to install the files Nagios needs in order to run the scripts for the i.  Long ago I thought they went on the i (NO!  Nothing is installed on the i) and the instructions from the ancient version of the as400NagioPlugin were a little lean and unclear as well.  You can find the as400NagiosPlugin at the site.

The simple instruction is that everything hangs out in the nagios folder in Linux, which in my case is /usr/local/nagios.  On the  Linux box where Nagios is installed, untar the file to a convenient place and then run the ./install script.  It will prompt you for your Nagios installation folder and also for your Java executable location. You will need to do a quick hack of the .as400 file in the libexec folder of nagios to change the userid and password to log on to the IBM i (remember that the “.” makes it hidden).  In the current version of as400NagiosPlugin the checkcommands.cfg file is supposed to go in the /etc folder.  What I did is rename the file to ibmicommands.cfg and dropped it into the /usr/local/nagios/etc/objects folder.  I also hacked the templates.cfg file to add a ibmi-server type just in case you want to have some server specific settings just for your i. I also added an ibmi-server (copy of the local-service service) just in case you want to tweak your IBM i settings.

The actual services that will run and check in with the i are in services.example which I changed to ibmi.cfg and put in the /usr/local/nagios/etc/objects folder.

I don’t know if this is a recent Nagios change or not but the final step in all this is to change the nagios.cfg to add the ibmicommands.cfg  and ibmi.cfg file references to the files referenced in nagios.cfg. I placed the ibmicommands.cfg reference just after the commands.cfg line e.g.



I added the ibmi.cfg reference in the section just after the entry for Linux servers:

# Definitions for monitoring an IBM i machine


I have zipped up the relevant files as examples.  Remember that nagios.cfg goes in the etc folder in the nagios folder and the ibmicommands.cfg, ibmi.cfg and templates.cfg files go in the etc/objects folder in the nagios folder. Make sure you change the IP of the IBMihost in the ibmi.cfg.  Also, and this is very important, telnet uses unencrypted text to communicate to the server so the user ID and password are being sent unencrypted.  I hope to fix this by adding the tn5250j jar to the mix and using the 5250 protocol bean to communicate with the i  using SSL.

You can find the configuration files I used (hacked)  here.

The next “to-do’s” on the list are to add some more Java methods that implement service checking on the i.  I’d like to monitor the web servers I run and things like JDBC connections, etc.  I also want to get Cacti installed and running. I also want to add the SSL option using tn5250j.  Of course I’ll post back here as I make more progress.

It has been nice to revisit Nagios now that I clearly understand how the client agents work with the servers that they monitor.  Still some more work to do to make this a bit more secure and robust, but this was quick, easy and adds the IBM i to the servers I can monitor with Nagios.

1 Comment »

A little Linux success

After ranting about how difficult it was to install Linux on the blade (vs IBM i), I was hoping I’d get some quick resolution.  However, the scenario ended up like this:

The VIOS folks tossed it over the wall to the Linux folks.

The Linux folks determined that I did NOT have a support agreement for Linux on the blade.  They closed the call.

I reopened the call, arguing that the problem manifested itself when using the terminal window to install Linux but the terminal window, being a part of VIOS (IVM) would be part of a supported product.


I then, through trial and error, determined it to be a Firefox issue.  I *could* install with IE8 but not with FF.  I reported this back to IBM expecting that they would proceed with determining the cause of the incompatibility and get it fixed.  Au Contraire!  Browser incompatibilities are not part of the mission of IBM support so they closed the call.

I did pick up this tidbit though, and I document it here so I can find it again: You can start the terminal for a given partition in VIOS by issuing the mkvt -ID X command  from the command line where X is the number of the partition.  To exit the partition terminal use the key combination ENTER, ~, . (period).   Whether the VIOS terminal is running in the “Remote Control” window from the AMM or from Telnet or SSH, the commands work.  So now I have a workaround.

I was able to finally get the SLES 11 Linux (PPC64)  partition running and accessible from VNC using a technique found at the Novell site where I posted. Read it all the way through.  The solution is posted at the end of the link in the post:

So that gets Linux (SLES 11 PPC64)  running again.  Now if I can get WAS 7 going on my i, the software application installation challenges for the week are done.

Comments Off on A little Linux success

The easiest partition on a JS12 blade (is NOT Linux)

A few months back I participated in the IBM i 7.1 beta program and I absolutely marveled at how ridiculously simple it was to install i5/OS on a new partition.  Create the partition, activate it, use Operations Console to connect, bada bing!  start feeding the beast with DVD’s and …done.  It maybe took two hours start to finish.

Having experienced a quick and easy install with a “difficult” operating system, I decided to try something easy.  A well supported, well known, easy to install Linux distro.  Since Suse Linux Enterprise Server is supported in the Power PC 64 bit world, I downloaded SLES 11 and pulled up the install instructions and have now spent two days trying to get the distro to install.  I have posted to a few forums but apparently Linux on Power, particularly on a JS12 blade running VIOS and the IVM to install the OS is a bit of a mystery.

The maddening part is that I have done this somewhat successfully before but I am not making much progress at the moment. The issue is getting a terminal window to display so that I can begin the install process. The JS12 implementation guide says to start a Remote control session using the AMM (easy to do) and then activate the defined partition in the IVM (also easy to do), and use the IVM option to “Open a Terminal Window” (another easy step). So far so good. The part that doesn’t seem to be working is the “terminal window” popup in the IVM that is supposed to appear to authenticate only appears for a second or two and then it disappears without an opportunity to log in. The AMM Remote Control terminal window changes from displaying the VIOS console to a blank screen. Seems to me that in my last successful attempt at installing Linux using the IVM I saw all the installation prompts in the remote console of the AMM but I can’t be sure.

The missing terminal window is a show stopper since there is no way to install the OS headless.  In fact, the original install of SLES11 was deleted because I couldn’t get the GUI to ever run, even after installing the OS in text mode (which is no easy feat).

Ah! Would it were that Linux was as easy to install as i5/OS!  Whenever I DO get it installed, I will post the “trick” here (whatever it is) so at least I can find it again…

Comments Off on The easiest partition on a JS12 blade (is NOT Linux)

A successful Common Experience

The 1960’s returned, for a few days at least, during the Common Conference and meeting and 50th anniversary celebration in Orlando. If you didn’t attend, you missed a great conference. I’d say this: If you didn’t attend for economic reasons I can understand, but the investment for me was worth every penny. If you didn’t attend because you thought Common’s best years were behind it, then you missed an opportunity to experience some of it’s former glory. It was a vibrant and fun week.

That is not to say everything was perfect. The austerity measures taken by the board last year did impact the evening activities, particularly the “Ask the experts” night and the “fun and games” night. Without substantial food and at least subsidized alcohol (the staple of the IBM i user) the events were poorly attended. I *can* tell you that the Common staff did their very best to provide as much as the budget allowed but when some budgets were cut completely (like the CaN budget that provided those evening activities) there is only so much you can do. My hope is that next year the CaN budget will receive some attention so that the “community” activities aren’t shortchanged.

The BEST part of the conference were the great, well attended sessions. Although the conference was smaller in the number of sessions offered, it still felt “large” because the facilities were “right sized” for the event. Overall I’d give the conference a B+ grade.

It will be interesting to see how the San Antonio event turns out. It is structured much differently in terms of speaker/volunteer compensation and size. If successful, it could point the way back to the restoration of some of the benefits cut last year (we hope!).

If you missed the Common Conference then you really MISSED a great conference. Make sure you register and get in on the fun in Minneapolis next spring!

Comments Off on A successful Common Experience

Some March Musings

Shortly after I posted the Busybox post I received an email from the vendor whose device I was working with, offering assistance.  Nice!  I really haven’t leveraged it (yet) because the toughest nut I had to crack was the roundtrip to the clock on the update and retrieval of data (which IS done).  THAT would still be much, much easier if I could access the clock  using JDBC but there have been a few advantages I have uncovered in working with just the http server and shell scripting. My next challenge is to get the whole thing as secure as possible, but security isn’t critical here: The data doesn’t carry any personally identifiable information and although someone who intercepted the data could manipulate it (I guess), there is a verification step that takes place that makes erroneously paying someone doubtful.

Adding to the mix is the need for checking to see if the clocks are online, updating the data en-mass and clearing data that has been retrieved without losing anything.  Still working through that as well.  The UI is pretty much done but I am not 100% happy with it.  The difficulty is viewing the time clock “punches” in a way that is easy to view.  If someone punches in and out 8 times in one day, how do you present that?  As a horizontal row or as a set of vertical transactions?   Best way to handle it is with agile, iterative steps I think.  See how it works and then improve it.

Lots of chatter about Flex over on the list today.  I have seen some demos and sooner or later I’ll take the plunge.  But right now, jQuery and Web 2.0 techniques are my bread and butter for now.  I need to get the application done, and sell a few dozen, before I even think about moving to a new development platform.  All of the data I/O is using Ajax at the moment.  Seems like the most flexible way to go.

I have about a week or two left with this project and then I need to return to ASAAP for some additional polishing work and then jump into the IVR replacement.  Nice to have work, but it would be better to have some income (still working on that!).

Comments Off on Some March Musings

The end of the rainbow

Somewhere over the rainbow, bluebirds fly…

Yes! The JS12 is still rockin and rolling so we are finally out of the woods and can once again rely on the trusty i to keep going and going.  There are still a couple of mysteries to solve: The bang! light on the SAS Connectivity Module when the tape drive is plugged in (it works though) and the mysterious “Message ID . . . . . . :   CPF9E7F” i5/OS usage limit exceeded message.  — Current processor usage across all active i5/OS partitions is 2.00  — Current processor usage for the local partition is 1.00.

Since I only have a single processor allocated to the i partition and and only one i partition configured, IBM and myself haven’t been able to figure out why i5/OS is still reporting 2 processors active for i5/OS.  PTF to come, no doubt.

Looking into some Ruby 1.9 issues and some other odds and ends while still trying to make ends meet by consulting.  At least I have a machine I can work with and I can, once again, pull the plug on the 270.

Hope to report on some CRUD frameworks in an upcoming post.  Busy as ever, but more productive now that I am not burning up time trying to keep the JS12 running…

Comments Off on The end of the rainbow

WP Login