Wednesday, August 14, 2024

Who Stole my IBM i Disk Space ?

Solve Your IBM i Disk Use Issues with FREE Disk Utility
In some of my previous roles I often played an extra part as Disk Cop. This often meant scouring through thousands of libraries and directories to find large files and determining who owned them and why they were being kept online. If you understand the phenomena of the ever-growing disk usage you know why Cloud platforms have grown exponentially. It's because storage use never goes down. This post will introduce you to a FREE solution for handling your disk space woes. 

Most likely you might have these disk space questions:  

I need to check ALL the disk space on my IBM i?  

I can't seem to get a handle on our IFS files and I wonder what's taking up space?

The domain of checking free disk space used to belong to commercial utilities or the GO DISKTASKS menu, which was limited to locating only libraries. Let me introduce you to the Ncurses Disk Utility (ncdu). Ncdu is part of the open-source packages available for IBM i. To install ncdu from the PASE or SSH command line simply type: yum install ncdu  Or you can install ncdu from the Open-Source Package Management option in ACS.

After installation, simply change to the appropriate directory and type: ncdu or /QOpenSys/pkgs/bin/ncdu (if the open-source package binary directory is not in your file search path) from an SSH terminal command line. Ncdu must be run from an SSH terminal via putty or your favorite SSH terminal tool.

Listing Free Disk Space for a Single Library
After installation, go to an SSH terminal and log in to the command line and run the following command to check out the QGPL library and show the list of objects descending by size. Libraries exist as a directory inside of the /QSYS.LIB directory. 

ncdu /QSYS.LIB/QGPL.LIB


ncdu results for QGPL - largest objects in use at top in descending order
ncdu results for QGPL - largest objects in use at top in descending order 


After the object list is shown you can use the arrow keys to navigate the list of library objects IFS-style and determine which of them are the largest in-use objects. You can also type a question mark: ? to display options available. If you're brave enough you can use the d option to delete offending objects, but it might be safer to use this tool to identify large objects and delete them another way. It's up to you how you use the app. You have been warned to be careful when deleting objects!

Listing Free Disk Space for the entire IFS Root File System
You can also crawl the entire root / file system on your IBM i partitions using the following command:

ncdu /

It may take a few minutes to get an object list, but you now have a full picture of ALL the directories and libraries (everything under /QSYS.LIB) on your system. 


ncdu root / list results - largest objects in use at top in descending order
ncdu root / list results - largest objects in use at top in descending order

Once again you can navigate through the directories to locate offending objects and decide what to do with them. 

That's it. Start policing your IBM i disk space. 

ncdu is a great forensic analysis tool for determine large objects in use. Let me know if you find value in this tool. I surely have. 

This link on learning ncdu might also be helpful: 

This link points to some ncdu export processing examples

If your team needs mentoring or learning how to use ncdu or automatically monitoring disk utilization, or if your team needs help with process modernization discovery, training, mentoring and integration services, reach out and let's talk about your business automation pain points. Your team will be on track to streamlining and modernizing your
IBM i processes in no time. 



Sunday, August 11, 2024

ActiveMQ Can Integrate IBM i to Anything

In today's world there are a few ways to do platform agnostic messaging with IBM i. This post introduces you to ActiveMQ.

If your business has the need to send and receive messages and data across platforms in a transactional fashion, the classic way to do that internally on IBM i might be to use data queues. Data queues have been around since the early days of the AS/400. The AS/400 was introduced back in 1988. However data queues are generally used to communicate intra-system between RPG, CL and COBOL apps built within the IBM i operating system. In today's world of multi-platform communications with API calls and REST services across multiple servers and services, ActiveMQ and Kafka can be better vehicles for exchanging transaction data and messages than using data queues. The topic of this post will focus on using ActiveMQ to implement platform agnostic messaging from your IBM i. But the same concepts can be applied using Kafka and even RabbitMQ.

First some background on ActiveMQ from the ActiveMQ web site: Apache ActiveMQ® is the most popular open source, multi-protocol, Java-based message broker. It supports industry standard protocols so users get the benefits of client choices across a broad range of languages and platforms. Connect from clients written in JavaScript, C, C++, Python, .Net, and more. Integrate your multi-platform applications using the ubiquitous AMQP protocol. Exchange messages between your web applications using STOMP over websockets. Manage your IoT devices using MQTT. Support your existing JMS infrastructure and beyond. ActiveMQ offers the power and flexibility to support any messaging use-case. 

Let's talk about a few potential use cases for ActiveMQ messaging on your IBM i and other systems. These use case examples are meant to get you thinking about the potential uses for messaging with your apps. 

Shipment lookups - Let's say you have the need to do shipment lookups from an IBM i green screen or web application and it's not so easy to integrate to your shippers from RPG. You can set up a PHP, Node, Python, Java or other server that can easy make the calls to the external shipper. Then you set up a queue via ActiveMQ to receive the shipment lookup request data from your classic IBM i code. Requests are usually sent from direct RPG, COBOL or CL calls by composing a delimited request string of data, a JSON or XML packet. Response data can then be returned directly to your IBM i app from the message queue after a shipment lookup has been performed.

Realtime credit card processing - A credit card request can be composed from RPG and sent to your credit card processing program via JSON, a REST call and an ActiveMQ message. The credit card request gets processed and then the response token or other information can be returned back to the RPG program or directly to a DB2 database table once the transaction is complete. 

Incoming orders or mobile work - Let's say your company has implemented a mobile app to handle capturing new orders on an iOS or Android device. As orders are completed the data can be dropped into a message queue for ActiveMQ to pick it up and send the data to an RPG, COBOL or other process which ultimately updates the system of record database without needing to re-key order data. Orders and service requests could also be staged to a mobile device over message queues as well. 

Sending order or shipment data to e-commerce site - As orders and shipments get fulfilled from an IBM i ERP system, transactions can be queued up for a remote Linux or Cloud based e-commerce app to pick up. On the e-commerce site an agent can be set to receive the order, shipment or inventory updates and auto-update the SQL Server, Oracle, PostgreSQL or MariaDB database in real-time fashion.

Placing EDI supplier orders - Imagine your team currently enters material and parts orders into your IBM i ERP system and then the same orders end up being re-keyed by hand to your supplier's portal, even though they offer a web API.  What if new and updated orders could be entered into your IBM i system once and then updated in real-time to your supplier portal using their integration API. Many hours of manual effort can be saved by entering and checking supplier order status via a web API.

All of the above integration scenarios are available to your RPG, COBOL and CL applications without forcing your classic IBM i RPG development team to learn new methods of coding to implement APIs and integrations between your various application platforms and apps. 

For a little more in-depth reading I listed a couple of articles below. Read these if you want to learn more about ActiveMQ and give it a try with your IBM i. 

Using ActiveMQ message queues on the IBM I

ActiveMQ from PowerWire - Andy Youens

Apache ActiveMQ Site

If your team needs mentoring or learning how to use ActiveMQ, or if your team needs help with process modernization discovery, training, mentoring and integration services, reach out and let's talk about your business automation pain points. Your team will be on track to streamlining and modernizing your IBM i processes in no time. 

Web Site: https://www.mobigogo.net

Email: info@mobigogo.net



Monday, August 05, 2024

IBM i, .Net and C# - Modernizing Your Apps

There are many ways to approach modernizing IBM i applications. They all depend upon your organization's technical background, culture and history. For today's article I'm focusing on using .Net as a modernization platform, however there are many other ways to approach modernizing your apps as well. 

The modernization concepts described in the article can most likely be employed using your favorite language and platform as well based on your team's experience level and desire for a particular technology stack. 

I have been writing applications using C# since .Net was introduced. Over the years I have used .Net to integrate to IBM i from Windows, Linux and even MacOS. If you have been wanting to create apps for your IBM i that utilize C# and .Net, read on to learn about the possibilities. 

In today's development world, C# is the predominant language in the .Net ecosystem and to a lesser extent VB. All kinds of applications that connect to, augment and provide ancillary services to IBM i can be created quickly with .Net. 

Desktop Apps - Desktop applications created using WinForms and XAML are a popular way to create apps running primarily on the Windows desktop. An example of a Windows desktop application is the IBM i PDM/SEU replacement component that I wrote recently called: Work with IBM i - Programming Development Manager for Windows (PDM). This tool is a Windows based replacement for the PDM and SEU tools on IBM i. It sports a built-in editor and can also be hooked up to VS Code for use with Code for i, RDI, Notepad++ and any other external editor you want to use. I'm also working on adding an IFS manager to the utility right now as well. Check it out and let me know what you think. It's FREE to use

Console Apps - These are Windows, Linux or MacOS command line apps that you may want to schedule to do specific work that connects to IBM i via ODBC, JT400, SSH or other web services. I can think of things such as data transfer, exporting or importing data from Excel, XML, JSON and other formats. Other examples include: SFTP file upload upload/download from IBM i to a desktop or server directory, integration to Office 365 to send and receive email, integrating information to SharePoint and OneDrive documents and folders, generating reports with tools like Jasper or Crystal Reports, performing system monitoring activities, connections to web services and more. The automation opportunities for console apps are endless. Console apps are also a nice way to create apps that can be integrated to process automation scripts or other pipelines. Or they can be scheduled to run using the Windows job scheduler or other scheduling tools. Console apps can also be integrated with PowerShell, Bash, Python, PHP or BAT files and other scripting languages to create cohesive automation processes. 

Windows Services - A windows service by its definition is an application that is integrated to the Windows service bus and can be started and stopped using the Windows Service Manager. Many of the IBM i integrated applications you would create for a Windows console app can be easily turned into a Windows Service. A service app doesn't have to be scheduled because the service is always on and processing data from your IBM i system on a regular basis.  

Web Applications - .Net supports several web application types that can be created using the ASP.Net framework. From simple HTML applications to complex React or Blazor-based web apps, .Net can help you easily build highly capable applications to enhance and modernize your existing IBM i applications. Imagine a web-based order entry system capturing real-time orders augmenting your old, tired 5250 screen-based systems. .Net web applications can also be self-hosted with a built-in web server component or served up using Apache, NGINX or Internet Information Server (IIS) on Windows or Linux servers and cloud-based hosted VMs.

Web APIs - Web APIs are the universal communicator for the Internet. The ASP.Net platform allows developers to create new web services and web APIs very quickly, allowing value to be unlocked quickly from their IBM i applications and data. Web services are a safe way to make IBM i data available in a useful manor to vendors and customers. Web APIs can connect directly to IBM i data or be hosted in a cloud environment where the IBM i securely refreshes data without exposing the IBM i system directly to the web. 

Mobile Apps - Let's say you have employees in the field and want to make information available to them in real-time on their phones or tablets. Or maybe you need them to be able to work offline. A mobile app is the best way to go. By using .Net to create mobile applications and services you can modernize your business and streamline your paper-based processes by providing an app to allow real-time work to get done. There's often a large return on investment (ROI) to be had by creating a mobile application for your organization to gather information more efficiently without re-keying or entering data into an old green screen app. And you can eliminate the paper and shipping costs associated with old-style paperwork.

Single Pane of Glass - Dashboard - Picture this - A customer service representative receives an inbound call or email with a status request. The customer wants to check their order shipment status. The rep first navigates to the CRM system to get the customer number.  Next they are required to navigate to the green screen Order Entry System to look up order and shipment numbers on separate screens. Then they log in to the UPS or Fedex web site to check on a shipment status. Finally, the service rep needs to compose an email response or generate and print some correspondence to physically send out to the customer or vendor. This conundrum is referred to as swivel-chair processing, where an employee has to navigate between several applications to get a single answer to a business question. This is a huge time waste for customers and employees, forcing companies to have larger service staffs than needed. Imagine if employees could spend time servicing customers rather than attending to mundane questions that could be answered online. Everybody wins.

.Net is a great platform for creating integrated desktop or web-based applications that provide dashboards to display real-time metrics reporting using a single form, single pane of glass or 360-degree view. This approach to providing real-time information to customers, vendors and employees allows users and managers to interact with related information from one or more systems via a single dashboard in real-time at the press of a button instead of swiveling between many apps to answer a single question.  

Middleware - When you need to create components that queue data or push transactions between systems, .Net is a great platform to build those apps on. Imagine syncing real-time data between DB2 and other databases, queueing up and processing transactions via Kafka, ActiveMQ, RabbitMQ or other message queuing components and then processing the data via your IBM i system.

Intersystem Communications - Perhaps you have a few systems that need a real-time service bus between them to exchange information. Creating a pipeline to communicate between those systems in real-time can be accomplished using .Net and the various communication mechanisms such as HTTP, WebSocket, gRPC, RPC, WebHook and other methods. As an example, imagine committing a source member in a Git DevOps pipeline and having it trigger a process back on IBM i or one of your other systems to ingest and compile the source changes. DevOps automation is just one of many places where intersystem communications can allow systems to work together in a real-time fashion. 

Desktop Automation - Imagine pressing a function key from a 5250 screen or web app and having it launch a new link in your desktop browser. Or your customer service system auto-generates a new word correspondence document from a template on your IBM i business system and you want to auto-launch it in MS Word or Office 365 for editing before sending it out. Or you want to transfer files securely between your desktop and an IBM i folder without needing to set up insecure Windows file shares. And maybe you want to transfer print files to your user desktops directly from a print queue without the need to physically print the documents. Desktop automation with .Net is a great way to make all of  this desktop automation happen. 

RPA - Robotic Process Automation - Microsoft Power Apps and Power Automate are tools that can be used on the desktop and in the cloud to write automation scripting that can interact with web and desktop applications, send/receive database information, compose and send or receive email messages, ingest and process Excel, XML and JSON files, perform secure file transfers and more. If your company is using Office 365 you probably already have a FREE desktop license available to you and you may not even know it yet. This tool is a must-learn for any automation your team is doing today. 

Artificial Intelligence-AI - Many organizations are just getting started trying to put GenAI and tools such as ChatGPT to use in their organizations. .Net Copilot has been introduced for Windows and other Office services. And ChatGPT is being used by many to start embracing AI into their organizations and business processes to augment user-driven processes. If your organization is thinking about AI, Microsoft Power Automate and other products are being infused with AI automation. I would love to hear your thoughts on AI and IBM i.

If your team needs help with process modernization discovery, training, mentoring and integration services, reach out and let's talk about your business automation pain points. Your team will be on track to streamlining and modernizing your IBM i processes in no time. 

Web Site: https://www.mobigogo.net

Email: info@mobigogo.net