Informing the IBM Community

An Ansible IBM i Disk Checker

0
(0)

This article slightly deviates from my usual open source articles on IBM i.

I say slightly, as this article will be about Ansible and yes Ansible is open-source.  Thank-you Red Hat.

This article will not be an introduction to Ansible.  My good friend Glenn Robinson, has written a great couple of PowerWire articles on that topic.  These can be found here.

One of our clients has been going through a spate of disk failures on his server and asked if there is anything we can do to monitor this situation.  As always with clients, we said of course!

For this task, I’ll be running the Ansible control node on our main IBM i server, which will also, as we are at it, check all our other partitions.

For Ansible to be run as the control node, we need to install its open-source package.

The figure below shows the option we need to take, from Access for Client Solutions (ACS) Open source package management.

For the shell command line interface enthusiasts, a quick yum install ansible will also install the product onto your server.

The first check I recommend with using Ansible is to run the ping module to ensure we can reach all our Ansible hosts.

ansible ibmi -m ping

Just to be clear, the Ansible ping command is an Ansible core module, it does more than the TCP/IP ping and well worth using to ensure all is good with communications and Ansible.

The results of the Ansible ping can be seen in the figure below.

  1. Use the Ansible ping module over all IBMi hosts
  2. The results back from the Galatea (7.3) IBM i partition
  3. The results back from the Proteus (7.1) IBM i partition

We have got back the results we wanted, now let us check the disks.

I will use an Ansible playbook to allow each of the individual stages required to check our IBM i disk set.

It has three steps.  They are;

  1. Run a query over the SYSDISKSTAT view to see if there are any failing disks
  2. For debugging, let me know the result of the SQL statement above
  3. Send an email to support, letting them know of any issues

Running the playbook in a shell session, gives the following results;

For ease, the steps above collate to the steps in the playbook figure, and to follow up the email received was.

Conclusion

Hopefully this article has whetted your appetite for Ansible on IBM i.  If it has, how about attending my Ansible on IBM i Workshop at the International Power meeting in June 2022 in the UK.  Hopefully, I can see you all there.  Full details can be found here.

All the examples I have written for this article, and previous ones, can be found on my open-source repository on GitHub, which can be found at https://github.com/AndyYouens/f_Learning

If you have any questions, either on this article, or anything else on the IBM i, use the comments below, or send me a message on twitter @AndyYouens

Andy Youens is an IBM i consultant/instructor at Milton Keynes, UK-based FormaServe Systems with over 40 years IBM midrange experience. 

IBM Champion

How useful was this post?

Click on a star to rate it!

Average rating 0 / 5. Vote count: 0

No votes so far! Be the first to rate this post.


Comments

One response to “An Ansible IBM i Disk Checker”

  1. Mr M Ryan avatar
    Mr M Ryan

    Fantastic!

    I’ll pin you down at the i-UG Conference and we’ll look further into this one. Cheers!

Leave a Reply

Your email address will not be published. Required fields are marked *