Aug 31

HA4i latest PHP interface now ready.

The PHP interface for HA4i is now complete. We have a little bit of tidying up to do to ensure the code is as bug free as possible but in the main the PHP coding is finished.

The latest screens have the requested control functions built in using either button controls or links, a few of these require JavaScript but we have kept that to an absolute minimum to ensure the main functionality is available without it.

We have added many new controls to be able you to start, stop, suspend or resume the processes where applicable. Another nice feature we have added is the ability to remove or retry errors directly from the PHP screens, previously you had to sign onto the Green Screen menus to get at this functionality. We have also added more information to a number of the screens to allow you to better understand what is going on.

The next step is to develop a configuration facility for the PHP scripts and an install process to allow the EasyCom Server to be installed and configured on each of the servers involved. We are going to recommend the use of the EasyCom Server even if the Zend Server install is present because we need to be able to access both systems using PHP, configuring a single Zend Server instance can be a struggle for some so having to create 2 could be a real problem. The EasyCom server will be installed by the product and it will be managed within the HA4i environment. The HTTP server can then be installed on any IBM i/Windows?Linux system you wish.

Here is a glimpse of the latest main screen.

Latest Main monitoring Screen

Monitor Screen HA4i

We are hoping the GA version of HA4i will be available for shipment by the end of October this year or earlier if we can get enough testing done beforehand.

If you are interested in looking at HA4i for High Availability or want to replace your existing HA product let us know and we will be happy to provide costings and a demo, you may very surprised at just how affordable the solution will be!


Aug 27

Keyed Data Queues in PHP

Having read through the information in the manuals a number of times and being very confused by what we found, we finally managed to get the data queue support in PHP via EasyCom to work. The biggest problem is the inadequate documentation supplied with PHP for addressing IBM i objects, not only are the examples badly written and hard to understand they are also wrong in many cases. We hope to work with Aura Equipments to fix this up but in the meantime we thought we would post the following code to help those who are struggling with sending and receiving data to keyed data queues.

// the $desc contains the data structure we will send, in this case a simple 10 characters
$desc = array("Name" => "StopMsg", "Type" => I5_TYPE_CHAR, "length" => 10);
// next we have to prepare the data queue call, you will notice that we have 4 as the last
// parameter, this is the key length as far as we can tell? (It worked)...
$DQHdl = i5_dtaq_prepare("*LIBL/HA4ICTLQ",$desc,4);
// next we will put an entry into the queue
$ret = i5_dtaq_send($DQHdl,"0000","STOP");
if(!$ret) var_dump(i5_error());
// our process ends here normally but we can receive from the data queue
// very easily by simply doing the following
$ret = i5_dtaq_read($DQHdl, "EQ", "0000");
// dump the output should be "STOP"

I hope that saves some others a lot of time in trying to understand the documentation? I hope we can get time to work on some improved documentation soon… If you have any comments or would like more information please let us know..


Aug 25

Further update to HA4i interface

After some hair pulling due to a connectivity problem with our IBM i we have now completed another part of the HA4i status interface. One of the questions we are regularly asked is how do I know what is waiting to be replicated from the source system to the target, we store the requests as they occur and have a program carry out the relevant action (can be a command request or a save and restore request) to the remote system in the order that they are received. An object which has multiple requests will only ever result in a single replication request because the last request will always get all previous attribute changes so we should never see multiple requests to save and restore the same object in the queue together.

We created a link on the initial status page which listed the number of replication requests that are waiting to be actioned, from this link we create a list of the actual requests which are to be performed. The resulting list is displayed to the user in the following page


Object Replication requests in Queue

We are very happy with the way the new interface structure is developing, one of the big drawbacks with 5250 screens is the lack of space available to create a single display which provides all of the information required at once. using the browser we can deliver all of the pertinent information is a single page and the user experience is significantly enhanced.

Hope the new interface is appealing to others as much as it is to us, having been around the HA market space for sometime we have often looked at how people use the products and if a GUI based interface is really that important? Our intention with this interface is to make it simpler and not simply add lots of bells and whistles which are meaningless to the user. If you have any opinions let us know..


Aug 13

New HA4i / RAP interface progressing

We have had a number of comments about the new interface we developed for DR4i which is our Disaster Recovery solution for the IBM i and many asking when we will provide the same kind of monitoring interface for our RAP product.

We have been developing a new release of RAP which should be available in the 4th qtr of this year and took the opportunity to clean up the product and add the new apply technology we developed for the DR4i product. This gave us the ability to use the same PHP code on the new product as we developed for DR4i to show the apply processes. However the sending system status has to be collected as well, which requires additional code to complete. We did consider a couple of options to handle this with the data being pulled from both systems via PHP using sepearate EasyCom Server installs back to a single HTTP server, but after some deliberation we decided to use a new transport mechanism which is part of RAP to pull the data back to the target system before dispatching it to the PHP/HTTP server. This save on complexity and cost as you now only need a single HTTP or EasyCom server instance which is running on the target system.

The first changes we made were to add the status for the additional servers which already run on the source system, we had 2 servers for the object replication process and added a new server for the status distribution (This will also provide some level of synchronization from target to source when fully developed). Next we needed to show the object replication status and what the audit journal state was, we liked the splitting of the journals on DR4i so it was a fairly simple decision to add the Audit Journal in the same manner. Once we had this in place we just needed to add some additional data screens to show the information related to the monitors such as a list of profile and object replication errors plus any waiting object replication requests.

Here are the new screens so far. First is the sign on screen, because we have some Javascript functionality built in we needed to sense if it was going to work, the sign on screen now shows a warning if Javascript is disabled. An important design requirement is that anything which requires Javascript is not critical to the overall feel of the interface, as we are primarily using this as a monitoring interface we can ignore any buttons or screen displays which do not work when Javascript is disabled or provide alternative methods to complete the task.


Sign On Screen

Next we have the main display, you can now see the source servers and the object replication status all in one place, much better than having to use 2 systems and multiple screen to get the information!

Main screen

Main Monitoring screen

If we have any profile errors you can get a list to see what they are, not a lot of data and pretty simple but it is not meant to be hard…


List of Profile Errors

The last screen we developed was the object replication errors, this shows the details about the error plus any relevant information such as the command used or the path to the object.


List of Object Errors

We are still working on additional functionality but feel we are heading in the right direction, using EasyCom as the PHP i5_Toolkit server is definitely working out for us and it will be suggested to anyone who is going to run our PHP based interfaces. Next task will be to extract and show a list of the objects which are waiting replication.

If you would like to know more about the PHP EasyCom server or any of our products, please let us know and we will happily show you what we are doing.


Aug 07

Virtualization of our non IBM i server and EasyCom

One of the tasks we had been considering for a long time was the virtualization of the main server to be able to run multiple Linux and Windows servers at the same time. Over the last couple of weeks we have successfully migrated to a server with is running ProxMox as the virtualization platform with multiple 64 and 32 bit Debian servers and a Windows Server Client.

Set up was pretty easy using the templates provided by Proxmox for the Debian servers including a Sugar CRM server, the windows server was a little different because it had to be installed from the CD’s we had but it did work once we got used to the network setup. Most of what we did comes from a similar setup we did for the local TeenRanch which is a local Christian Camp where we have been supplying support for a network and hotspot set up for the camps etc. They needed the ability to provide internet connectivity over a wide area with lots of trees and obsticles to work around plus they needed to be able to control the access and reduce the problems they had with bandwidth limitations. The now have a fully redundant WiFi network with both 2 and 5 Ghz back hauls to the relevant buildings. We also set up a Hotspot solution to allow the users to pay for some access where required. Our set up was much easier as we simply needed to have the Linux and Windows servers available for test and development work particularly with the EasyCom solution.

The server responses are a less than we used to get with a single operating system running but the difference is acceptable. The disks are all raid 5 protected and we think the card which is a lower level one is affecting the speed of the server somewhat? Eventually the server will be replaced with a new one running the newer chipsets which should improve the response times plus additional memory will help a lot as we only have 4GB on the system today. So far we have been impressed with what we have achieved, we can now take snapshots of the servers so recovery back to a known state is definitely going to be a lot easier.

We use the server mainly for demonstrations such as the EasyCom server running from Linux and Windows. We have also set up a Windows implementation which is actually running on a Windows 7 Thinkpad because we needed the ability to show how the PHP interface can be run an any Apache/PHP server linking back to the IBM i for the data even while we are travelling (We can VPN back to the IBM i and it works really well). The Linux servers are also running 32 and 64 bit versions so we have the relevant EasyCom modules installed with multiple PHP websites running on each again something which was important as we move forward with our relationship with Aura Equipment and EasyCom.

The next challenge will be to virtualize the IBM i to run multiple copies of i/OS and possible a Linux/AIX partition just for fun… That will probably have to wait until we buy the next Power 7 system which should happen either late this year or early next.

If you want to see EasyCom running without the IBM HTTP server on IBM i please let us know, we will be happy to show what we have achieved with the product so far, our intention is for our next product releases to all have the EasyCom server bundled as part of the solution. The cost of the EasyCom server is so attractive in comparison to the Zend Server (EasyCom is used to provide all of the i5 toolkit functions even on Zend Server installs!) that it makes a lot better financial sense than going for the IBM i/Zend Server solution which is free for the first year but has a fairly hefty cost for support thereafter.


Aug 05

To SEEK or not to SEEK!

I have been wrestling with what seemed to be a problem with the i5_data_seek() functions for a few days, the problem I was looking to resolve was how to save the RRN of a record in a list so that I could list only a single field with a link that would display the entire record when requested.

Originally I was using the content of one of the fields to find the record and display is. The following code shows how I looked for the data in the file. I was using a query to look for an array of characters within an array of characters. This was obviously not the best way but I know the strings would all be very different to each other as they represent the confirmation ID returned from an SMTP server.

// copy the string as the id to use
<a href="dspemdets.php?id=<?php echo($rec[2]); ?>">Details</a></td>
function get_email_dets($id,&$conn,$br) 
// search through the file for a string in the confirmation field
// LIKE will look for a string within a string
$query = "SELECT * FROM EMLOG where EMCNFM LIKE '" .$id ."%'";
$result = i5_query($query);
// error
	echo("Error code: " .i5_errno($result));
	echo("Error message: " .i5_errormsg($result));
// fetch the rows and display	
$rec = i5_fetch_row($result);

Initially this all worked fine but I found that when I moved my SMTP server and it returned different confirmation ID’s it stopped working! I think it was something to do with the layout of the characters versus numbers but not sure! The original confirmation ID’s were ‘1276180853 qp 4086′ but the new server returned ‘queued as 4A42913807E’. Not something I understand too much but not working in some instances was not acceptable!

Having used SQL I thought I would use this for retrieving the records passing in the RRN as the record to get, I only did this because my initial tries with using the i5_data_seek() function were getting me nowhere and I needed to fix the problem. After some digging around I found that the DB2 SQL engine has a method of doing this using the RRN token. I could use the i5_bookmark() function to store the RRN as part of the list build and then use that to get the record back when I needed it. Below are the snippets of code which I used.

// use the RRN as the id
<a href="dspemdets.php?id=<?php echo(i5_bookmark($file)); ?>">Details</a></td>
function get_email_dets($id,&$conn,$br) {
// set up the query	
// set up the query	
$query = "SELECT * FROM EMLOG where RRN(EMLOG) = " .$id;
$result = i5_query($query);
// error
	echo("Error code: " .i5_errno($result));
	echo("Error message: " .i5_errormsg($result));
// fetch the rows and display	
$rec = i5_fetch_row($result); 

This worked fine but I was determined to find out if the i5_data_seek could be used in a similar fashion. I tried to use the manuals as a guide to using this technology and every time it seemed to return an error stating that the parameters passed were wrong. As it turns out the manuals have the wrong information, they show I5_READSEEK as the parameter to be used where it should be I5_READ_SEEK. Some corresponding with Aura Equipment Support put me on the right track and the following code now works! I must admit I was also using I5_DATA_SEEK at one point which caused even more confusion :-)

$file = i5_open('EMLOG');
if($file === false) {
      return -1;
echo("ID=" .$id); 
$result = i5_data_seek($file,$id);
// error
      echo("Error code: " .i5_errno($result));
      echo("Error message: " .i5_errormsg($result));
$rec = i5_fetch_row($file,I5_READ_SEEK);       

So if you need the save the RRN of a record in a list and use it for retrieval of the full record at a later time then the above shows a number of ways to get the record back.