Oct 19

HA4i Ready for prime time with plenty of new features


HA4i Version 6.1 is now packaged and ready to ship! We had hoped to get the packaging complete about a month ago but a number of client requests had to be added so it put us back a number of weeks while we developed the new features and put the product back through testing. This will be the first release of HA4i which is a replacement for our existing RAP V4R1 product. We have made a lot of changes to the product which are all aimed at making HA4i a simpler and easier to manage High Availability Product for the SMB market.

While some of the features have been removed because they just added clutter and provided little use to the majority of our users we have added many new features which make this a very attractive High Availability solution for those customers who felt they could not afford one previously.

One of the most important aspects of this release is the simplification of the product, we have removed many of the sub menu’s and created intelligent start up processes to reduce the opportunity for error when controlling the product. We have also added some new features which provide a more granular approach to the apply process while ensuring we did not add complexity for the user in the start up process. As part of the new interface we have created a PHP based interface for the product which we can install if the customer needs it, if you have been following the blog for sometime you will have seen some screen shots from this interface. As usual we have not stopped and will continue to add features to the PHP interface as we move forward which will enhance the users experience when using the product. Here is the latest version of the main monitoring interface.

MainMonitor

Main Monitor Screen

Another area we took a good look at was the role swap process. When the user carries out a role swap there can be a number of problems which occur due to the availability of some information when systems are down or when a role swap is carried out with all of the processes up and running. We do request that the users end all activity before running the request on both systems but we have found a few just ignore that request and then complain bitterly when everything gets confused about what stage it should be in. So we have added more checking and data verification as part of the role swap process including the changing of the journal receivers and ending remote journal links automatically once the user has been asked for permission to carry it out. This has made the role swap process a lot more robust even when the rules are ignored… As with all programming tasks I am sure this will not be the end, I am sure there are some actions we have not considered and some user will prove just how stupid we can be…

Auditing has been included in the product from the beginning but as usual we are constantly trying to improve our processes to make them pick up more discrepancies and provide better checking of the objects. One area we just didn’t consider was the auditing of the profiles on the system, as the replication is totally automatic we had never seen any issues with profiles not being in sync. As usual a customer wanted to run audits against the profiles because he had been changing the profiles on the target by mistake and needed to bring everything back into line. The profile replication process only reacts to change notifications so unless he went through every profile and changed them we would not pick up the change. His request was quite simple, he wanted all of the profiles to be checked on the source and if they differ the differences noted to allow recovery at some later stage. As they have over 800 profiles on the system the thought of going through every profile manually did not please him..
So this release now has a profile audit function which will check the profile on each system logging any differences it finds. We did have to add a couple of exclusion such as the system profiles and the option to ignore the UID/GID settings which reduces the errors returned which have little bearing on the profile state.

Granularity was another concern we needed to address, in the previous version every receiver change was passed through a single apply processor. This version has added some granularity by allowing each remote journal to be controlled by an individual apply processor. Now you can have multiple journal receivers being applied at the same time which will also adds some improvements in the role swap times in those environments where multiple journals are configured between the systems. As you can see from the above monitoring screen we do allow the individual apply processes to be controlled via the PHP interface as well.

The replication of source files has been a problem for sometime, if you use the IBM journalling function to journal the files to your user journal and you have an active development environment with lots of code changes being worked on regularly the user journals can become very bloated very quickly. Every time you change a member even if its only a single line every line in the member will be added as a change in the user journal. RAP always provided the ability to replicate these objects at the object (FILE) level through the use of the tools we provided but it never had a trigger mechanism which would allow this to occur automatically. This release now uses the audit journal to capture the member changes and replicates the individual member on change. While this seems a bit similar to the bloating of the user journals it does offer a benefit in that the user journals are only applied occasionally, we restore the objects immediately which provides a smaller foot print for the DASD used to hold these changes on the target and the source. A couple of other objects have also been added to the support object list such as USRIDX and SAVF, as users ask for more objects we will continue to add them.

If you are interested in a demo of the product and its capabilities or would like to know more about it let us know, we could save you a lot of money on your existing installed HA product or surprise you at just how affordable HA really is.

Chris…

Oct 18

New download available for Remote Journal Management


We have a large number of remote journals which run for each of our systems to allow the testing of the various products, each time we IPL one of the systems we have to re-start each of the remote journals that is required for test and development which can take a long time! So we needed some method of allow each one to be started quickly and efficiently.
We originally had a number of CL programs which would start all of the remote journals we had configured, but this soon became useless as we added more and more journals or removed the ones we had been using originally. What we needed was a list of all of the journals on the system in a list so we could start the Remote Journal link from the list, if more than one needed to be started it would take each entry and start it individually.

Here is a screen shot of the panel we came up with.

List Of Journals with RJ Configured

Journals with RJ Configured

As you can see we have given a number of options for each list entry such as being able to start the remote journal link change the local journal receiver or WRKJRNA. If option 5 is taken it will show the remote journal details for the selected local journal which is provided in the following screen

Remote Journal Details

Remote Journal details

As we know a number of clients have similar requirements where many remote journals are configured between systems we have placed the programs and displays in a package which is available for download from our download page. The save file contains everything you need such as menus,command and panel groups with context sensitive help. Just copy the save file to your IBM i, restore the JRNMASTER library and GO DFTMNU to access the main menu. Any problems let us know and we will try to fix them as soon as we can.

Enjoy!

Chris…

Oct 12

PHP to update a flat file.


As part of the ongoing update to our RAP product we need to provide a configuration file that could store information about the systems the product is running on. This file will have to be updated if a roleswap occurred which got us wondering how to update a flat file with PHP.

The problem is the flat file has to be rewritten as soon as you change any of the data within it, you cannot just update a section in the middle of the file. So we needed to develop a solution that would read the existing file, find the particular line we were interested in and then update just that line.

here is a sample of the file we would be reading

#config file ha4i.conf
# this is the *MGT or Source server, on a switch this
# variable has to be changed to reflect the current server
# type.
src_server=shield2
# this is the target server, the same applies as above
tgt_server=shield3
# this is the installation library for HA4i, it
# should be set on installation.
install_lib=HA4I61
# the time out variable for persistent connections
timeout=”300″
# the number of seconds before a page refresh occurs for
# the main monitoring page.
refresh=”250″
# the maximum number of messages to display from a message queue
maxmsg=200
# the number of characters before text wrapping occurs when
# displaying the email messages
wrap=60
# the minimum messages level to be retrieved
maxsev=0
# Valid User Name, if this is unset you must also unset the usr
# and pwd entry to allow the connections to access the IBM i systems.
# the user name and password must be correct for both the source and
# target systems.
# valid_usr can be set to any character string
# usr must be set to a IBM i profile which exists on both systems
# and has enough authority to use HA4i
# pwd is the password for the profile and should be the same on both systems
# valid_usr=User_Name
# usr=Profile_Name
# pwd=Password

As you can see the file is a number of lines with some that are comments (begin with ‘#’) and others carry the elements we are interested in. So we needed to split out the lines so only the elements with a xxx=xxx format would be read, we could then identify the actual element we were interested in before writing those elements back to the file.

Here is the code we wrote to handle this..


function switch_sys() {
$config_file = "scripts/ha4i.conf";
$comment = "#";
// create the array
$lines = file($config_file);
// copy the array elements for src & tgt
foreach($lines as $val) {
if(!strchr($val,"#")) {
$pieces = explode("=",$val);
if($pieces[0] == 'src_server')
$new_tgt = $pieces[1];
elseif($pieces[0] == 'tgt_server')
$new_src = $pieces[1];
}
}
// update the lines array
$count = sizeof($lines);
for($i = 0; $i < $count; $i++) {
if(!strchr($lines[$i],"#")) {
$pieces = explode("=",$lines[$i]);
if($pieces[0] == 'src_server') {
$lines[$i] = 'src_server=' .$new_src;
}
elseif($pieces[0] == 'tgt_server') {
$lines[$i] = 'tgt_server' .$new_tgt;
}
}
}
// now write the lines back to the file
// open the config file
$fp = fopen($config_file, "w");
if(!$fp) {
echo("Failed to open file");
return 0;
}
for($i = 0; $i < $count; $i++) {
fputs($fp,$lines[$i]);
}
fclose($fp);
}

A couple of points about the above code. Firstly we have used the file() function to create an array of the file contents. Next we have to loop through that array to find the two elements we are interested in, the src_server and tgt_server elements (we need to reverse these when a switch occurs). Once we have found each element we store its content in a couple of variables after exploding the line into a couple of elements divided by the "=" sign. Now we have the new variable we need to write them back to the array, I could not write them back immediately as I could not be certain they would be in the same order. So we loop through the array again looking for the same elements and updating the $line element as required. Now that the array has the updated strings we can write the data back to the file!

This is the result

#config file ha4i.conf
# this is the *MGT or Source server, on a switch this
# variable has to be changed to reflect the current server
# type.
src_server=shield3
# this is the target server, the same applies as above
tgt_server=shield2
# this is the installation library for HA4i, it
# should be set on installation.
install_lib=HA4I61
# the time out variable for persistent connections
timeout="300"
# the number of seconds before a page refresh occurs for
# the main monitoring page.
refresh="250"
# the maximum number of messages to display from a message queue
maxmsg=200
# the number of characters before text wrapping occurs when
# displaying the email messages
wrap=60
# the minimum messages level to be retrieved
maxsev=0
# Valid User Name, if this is unset you must also unset the usr
# and pwd entry to allow the connections to access the IBM i systems.
# the user name and password must be correct for both the source and
# target systems.
# valid_usr can be set to any character string
# usr must be set to a IBM i profile which exists on both systems
# and has enough authority to use HA4i
# pwd is the password for the profile and should be the same on both systems
# valid_usr=User_Name
# usr=Profile_Name
# pwd=Password

I am sure we could do this in another way, but several tries at finding a shorter way to do it ended in failure! So if like use you want to read a flat file looking for a specific entry and then update that entry this is one way you can do it!

Happy PHP'ing...

Chris...

Oct 12

RAP V4R1 new PTF03 available

We are going to be announcing the next release of our High Availability product (HA4i) which will replace RAP in a few weeks so we have rolled up all outstanding fixes and enhancements and put them into a new PTF for Version 4.1. This will be the last roll up of fixes for Version 4.1.

You can download the new fix package from our website under the product pages. Remember to install all of the save files into QGPL before running the LODPTF and APYPTF commands. Becuase these PTF’s are cumulative there is no need to install the previous fixes before installing the latest one.

Chris…

Oct 02

Installing FREE trials of Shield products requires PTF SI35983 or SI35991.


We are getting quite a few requests for help when installing the free trials we provide for our products. The problem is IBM changed the license manager so a key which is generated on a V6R1 system will not work on a product packaged on a V5R4 and vice versa.

IBM has provided a couple of fixes for this with the following PTF’s.
SI35991 for V6R1 & SI35983 for V5R4.
Install the relevant PTF for your OS before attempting to install the product and the key should be successfully installed.

Chris…

Oct 01

Audit Journal ZC & ZR entry Access Specific Data


We have been adding new functionality to our High Availability product RAP when we came across the Access Specific Data for the ZC and ZR entries. Some testing showed that this entry contained additional data about the object the entry was for, in particular it contained the member name for any *FILE entries. The manuals had no information about the content or its layout and the header files in QSYSINC only show the layout for spool file and Image catalog entries. A quick email to the VIC support center eventually came back with the following information.

The data is in the following format
*XXXXX (object type)
Type of access:
What type of access the record is being sent for…add, remove… (Whether the data is for a ZC or ZR record)
Access Specific Data: The format of the data for the specified access type and record (ZR or ZC)

————————————————–
*ALRTBL

Type of access:
Add 1 (ZC record)
Remove 38 (ZC record)

Access Specific Data: Char 7 message id
————————-
*DEVD

Type of access:
Open 30 (ZC record)

Access Specific Data: char 10 api name QTACTLDV
————————-
*DTAARA
*DTAQ
*LIB

Type of access:
Apply 4 (ZC record)
Remove 38 (ZC record)

Access Specific Data: char 40 reserved
char 10 command name APYJRNCHG or RMVJRNCHG
———————-
*DTADCT

Type of access:
Change 7 (ZC record)

Access Specific Data: char 10 definition name
Type of access:
Create 14 (ZC record)

Access Specific Data: char 10 library name
char 1 ‘/’
char 10 file name

Type of access:
Delete 17 (ZC record)
Rename 39 (ZC record)

Access Specific Data: char 10 definition name (name and type of definition being renamed or deleted)
char 2 ‘ (‘
char 3 definition type
char 2 ‘) ‘
—————————–
*FILE

Type of access:
Add 1 (ZC record)
Change 7 (ZC record)
Check 8 (ZC record)
Clear 10 (ZC record)
Initialize 25 (ZC record)
Open 30 (ZC record ZR record)
Remove 38 (ZC record)
Reorganize 36 (ZC record)

Access Specific Data: Char 10 member name

Type of access:
Rename 39 (ZC record)

Access Specific Data: char 10 member name
char 10 old member name

Type of access:
Change 7 (ZC record)
Read 35 (ZR record)

Access Specific Data: char 10 member name
char 10 user name

Type of access:
Apply 4 (ZC record)
Remove 38 (ZC record)

Access Specific Data: char 10 member name
char 30 reserved
char 10 command name APYJRNCHG or RMVJRNCHG
————————
*FTR

Type of access:
Add 1 (ZC record)
Change 7 (ZC record)
Copy 13 (ZC record)
Remove 38 (ZC record)
Rename 39 (ZC record)

Access Specific Data: char 10 group name of action entry
or
Type of access:
Add 1 (ZC record)
Change 7 (ZC record)
Copy 13 (ZC record)
Move 28 (ZC record)
Remove 38 (ZC record)

Access Specific Data: char 10 sequence number
——————————-
*JOBSCD

Type of access:
Add 1 (ZC record)
Change 7 (ZC record)
Hold 24 (ZC record)
Release 37 (ZC record)
Remove 38 (ZC record)

Access Specific Data: char 10 entry name
char 6 entry number
———————–
*JRN

Type of access:
End Rollback 72 (ZC record)

Access Specific Data: char 13 ‘END ROLLBACK ‘
char 20 commit cycle id
———————–
*MSGF

Type of access:
Add 1 (ZC record)
Change 7 (ZC record)
Remove 38 (ZC record)

Access Specific Data: char 7 message id
————————-
*SCHIDX

Type of access:
Add 1 (ZC record)
Remove 38 (ZC record)

Access Specific Data: char 10 panel group name
——————–

Hope that helps others looking at the content of the audit journal entries.
Chris…