Managing Defective PTFs automatically

Several days ago, I opened a ticket to the IBM support for a problem that was affecting one of my production lpar. The technician ask me to generate a System Snapshot and once uploaded to website an automatic agent warned me about a defective PTF that was installed on my partition. I’ve also read the cover letter and wow, this PTF could make my savsys not good for a restore.

We are IBM i systems engineers, we must not panic, so let’s sling on our SQL buddy and figure out how to ferret out faulty PTFs installed on our systems.

The first way is to use QMGTOOLS utility that you can install following this page:

So from MG menu you can user option 24 (PTF MENU) and after that option 3 (COMPARE DEFECTIVE PTFS FROM IBM). Now, your IBM i system connects to IBM servers and check the list of installed PTFs with official list of defective PTFs.

This is one of the possible way to do that, but honestly is not my preferred one, that because it requires some manually actions, for instance you need at least to watch the spool file.

And here we are to my personally preferred method, using the DEFECTIVE_PTF_CURRENCY view in SYSTOOLS. This view is quite helpful because gives you all information you need when you talk about defective PTFs as ID of defective PTF, licensed product program and fixing PTF, now let’s test this query on my system:

select DEFECTIVE_PTF,PRODUCT_ID,APAR_ID, case when FIXING_PTF is null or FIXING_PTF='UNKNOWN' then '' else FIXING_PTF end as FIXING_PTF 
from systools.DEFECTIVE_PTF_CURRENCY

As you can see in my example, I have no rows, so it means that I haven’t got any defective PTF. If you look at my query I have tested the value of FIXING_PTF column, that because now we will create an easy RPG program that automatically check defective PTFs, list all fixing PTFs, order them and after that an email with report will be sent.

As you can see, if any defective PTF was found, the system will order the fixing PTF and will email me with the entire list of defective PTF.

You can find this code on my git repo. Consider that you need your partition is able to reach IBM servers for getting defective PTFs list and to order fixing PTFs.

And you, how do you manage defective PTFs on your system?

Andrea

AIX and PostgreSQL… What a couple!

A very important and often fascinating challenge (at least from my perspective) is to give a new way of reading and then using what are often unfortunately referred to as legacy systems. Being heavily involved in research and development at the place where I work, I have the opportunity to fulfil this challenge both out of personal ambition but more importantly to offer new solutions to new needs from customers.

In this article/guide, we will see how it is definitely easy to install and configure the relational DBMS PostgreSQL on AIX.

Why PostgreSQL? It is one of the most widely used open-source relational DBMSs in the world, some estimates say it is one of the most widely used and growing. There are several reasons to choose it as a DBMS, a rich support community, a natural propensity for scalability and security, support for some non-standard data types that make it extremely convenient to use in the context of users who are less experienced on the database part but more oriented towards development, and so on…

Why AIX? AIX is a Unix-like operating system from IBM, it is one of the most robust operating systems with less downtime required for enterprise contexts, the ideal system for a company that cannot stop its production. As for the IBM i, AIX is also facing a very important step, that is, the opening to the outside world and the integration with new open source technologies. There are many (even if not enough) packages that can be easily installed using the DNF package manager.

Unfortunately, PostgreSQL is not one of them, but let’s not get discouraged, it will still be possible to install it with some ease!

Firstly, go to PostgreSQL documentation in order to check if the minimum requirements are met. Let me say that you won’t have a problem in this case, that because you need to have at least AIX 6.1 (that is quite old :-D). In addition, you need to have installed GMAKE and GCC, if you don’t have that you can easily install via DNF. Now, save on your favourite tray this link, it gives you a lot of information about compiling PostgreSQL from source.

Getting source code: to do that, you have to choose what version of PostgreSQL you want to install, after that you can use WGET command (you can install this command via DNF) directly from your system, in my case I have chosen 16.6:

Extracting source code: now we have to extract our sources file from tar.gz archive, so in this case you can use GUNZIP command in this way gunzip postgresql-XXXX.tar.gz and with TAR you can extract all the files, use tar-xvf postgresql-XXXX.tar

Compiling source code: now go into the folder and run ./configure --without-icu, this will automatically check dependency and so on:

Now, you are ready to compile with make and when is completed with make all, and yes, as you can see you are compiling your PostgreSQL.

Installing: now the last point is to move all binaries file to the default bin path with make install, and yes, now your installation is completed.

The last point is to configure service account and your first database:

adduser postgres
mkdir -p /usr/local/pgsql/data
chown postgres /usr/local/pgsql/data
su - postgres
/usr/local/pgsql/bin/initdb -D /usr/local/pgsql/data
/usr/local/pgsql/bin/pg_ctl -D /usr/local/pgsql/data -l logfile start
/usr/local/pgsql/bin/createdb test
/usr/local/pgsql/bin/psql test

We are at the end of this tutorial, you have successfully installed your PG instance on your AIX. Let me take one moment to talk about High Availability. One of the best possible configurations is to use the PowerHA product for AIX to manage a resource on a cluster defined on multiple lpars. In this case, the database and its configuration must reside on a shared disk that can be switched between the various partitions. In addition, the last step is to define simple scripts that allow the service to be started and stopped when the resource group is activated/deactivated or simply moved from one node to another.

And you, have you ever tried to install and use open source apps on AIX? Let me know about

Andrea

How to implement a simple IBM i monitor – part 2

In the last post, I’ve presented a simple way to monitor some particular metrics of your IBM i.

In addition to system monitors, you can go for message and queue monitoring. It is often the case that some information about the status of some system services as well as application services is poured into some message queue (typically the QSYSOPR), hence the need to have an effective probe to take in those messages.

For this reason, again through the Navigator for I GUI, it is possible to go and define the monitoring of certain messages and in some cases even the responses that the system gives on its own. Once connected to Navigator, please click MONITORS and choose MESSAGE MONITORS. Now click on CREATE NEW MESSAGE MONITOR and compile form as you prefer. In my example, I’m going to configure a QSYSOPR monitor that works only in office time.

Now, clicking on Message Set you are able to define trigger and relative actions, to do that you need to specify a list of msgid that you want to monitor. You can start using pre-defined msgid lists shipped by IBM that cover some system topic. Even in this page, you can define some automatic replies that system can give to MSGW jobs:

The last thing, but not the least, is the capability to perform an action when a message as been sent on the message queue, for instance you can remove that message from the queue or you can perform some OS command (like sending email ecc):

I think that for this topic is everything, please give me your feedback about monitoring world and your experience about that.

Andrea

How to implement a simple IBM i monitor – part 1

One of the most important allies of a sysadmin is a good monitoring system.

In this first tutorial, I will show you how it’s so easy implementing an IBM i system monitor using features that are already included in the OS without using third part software.

To do that, we are going to use IBM Navigator for i, so once connected please click on the icon below and choose SYSTEM MONITORS:

At this point, you are able to see active monitors (if you there are any) or you can proceed configuring one new. Let’s consider that nowadays there is quite a little set of metrics that you can use for your own monitoring tool. Some days ago I created a new idea to ask IBM to give the opportunity to create your own metrics by using SQL, here you can find the link to my idea, if you find it interesting please vote that.

So let’s start with a simple monitoring example; so I want to create a monitor that must control my disk space utilization… So, from the drop-down list, choose CREATE NEW SYSTEM MONITOR. Once clicked, choose Disk Storage Utilization (average) from the metric list and after that you have to choose the frequency of the check, in my example I’ve chosen 5 minutes.

Now that we have chosen what kind of metric I want to use and the frequency of the check, we only need to set of thresholds, and we have to define what happens when the threshold has been reached using OS commands.

In my case, I will define one threshold that is triggered when disk is used more than 70% for more than two intervals. When the condition is verified, monitor will email me:

As you probably understand, you can define a combination of metrics monitored in the same “check”.

Consider that once you enable your monitoring, automatically the system starts probing the system status according to what you set. This data is stored and can be analysed by graph; this is a very convenient feature if you want to check the data over the long term to determine, for example, whether there are any growth trends. It is also possible to check monitoring log, you can also see when some threshold as been reached.

Here you can find an example of monitoring graph:

I will put another post on this blog about message monitoring.

Andrea

The importance of sharing an Idea

What makes the difference in a platform?

Of course, stability and resilience that is the ability to always be able to rely on the availability of the system, its application services, and especially its data.

Another focus is the simplicity of the tool and the management of the user experience. Ideally, it would then be ideal to have rich documentation that can help the end user but especially the platform manager.

One point that is often overlooked, however, is the aspect of the user community and the possibility of being able to contribute to the evolution of this platform. Here, in the context of IBM Power systems there is ample room for community and its members, just think of you reading this post, all the various more or less organized groups of people who share their information, their knowledge and sometimes their questions. Over the years, I have had the pleasure and opportunity to be able to attend some events such as the Common Europe or Tech Exchange, and I was able to see how specialists in the field were extremely willing to engage in discussion by giving different points of view to the various speakers.

However, the very interesting thing that I would like to focus on is the possibility of making suggestions or making requests. Yes because in the first instance a platform belongs to those who use it, those who fight with it and bang their heads on it every day. IBM in this case provides the Ideas portal, the place where any developer, systems engineer, end user can propose new features, changes to tools or system behaviours, etc. to IBM developers.

Giving feedback on the portal is very easy, just log in with an IBM id (everyone can create their own for free), and select the technology for which you are opening an implementation request. Among the most popular are requests related to IBM i systems, AIX and PowerVM. At this point, it will be necessary to enter a title to the idea, and the tool will check that there is not already an idea with similar content to that suggested in the title. Finally, once you have verified that it is okay, you will need to detail the request as much as possible-the more information the better.
The game is done!

The Ideas Portal also allows users to compare and evaluate the ideas of other users. In fact, from there, it is possible to check the other proposed ideas and give your support by voting them.

So, at this point, please try to take a look of Ideas Portal and let me know what do you think about.

Andrea