How to... Alert for IBMi WRKPRB entries not in a closed state.
Mike Davison
IBM Champion 2024, 2025. Fighting the good fight for IBM Power, Security and System Admin. IBM i, AIX, RHEL, SUSE, Ubuntu, VIOS
Here is one of my "Cool rules".
The Halcyon Object Monitor is pretty useful. You can use it to check the state of any object, anywhere within your system. You can even run SQL queries against database files with it - and this is how we are going to deploy it here.
Using the object monitor, we are going to query the file QUSRSYS/WSXPALRT and find out if we have any problems that are not in a closed state.
WSXPALRT is the database file for problems.
By using the object monitor we can periodically check on the state of any WRKPRB entries on our IBMi.
Add a new object rule to an object rule group:
- Enter a title for the rule
- Here we limit the rule to running Monday to Friday and only between 08:00 and 08:01.
- By Setting suspend on alert to 5 minutes, we will only generate the one alert per day.
- We will use a rule type of *RCDCNT
- We will send a console message (this is optional of course)
- We run a DSPPRB OUTPUT(*PRINT) command - this output is can be picked up by an output queue rule and mailed to yourself. this will only occur if we have a positive alert generated.
On the criteria screen;
- Use a Rule type of *RCDCNT
- Use the filename: QASXPROB
- Use a library of QUSRSYS
- Check member set to *FIRST
- Use the SQL select statement in the snippet below.
- Set "Alert when records" to *GT
- Set Value to 0.
SELECT WSXPALRT FROM QUSRSYS/QASXPROB WHERE WSXPST <> 'C'
Press <Enter> to save the rule criteria.
For the Console message, we can tailor it using a substitution variable, &V7.
Then the message shown on the console looks like this:
Hopefully you have found this article useful. If you are a customer you can always contact us at [email protected] for any support queries.
If you are interested in our software, please contact us via our website at www.helpsystems.com
Mike Davison
Senior Technical Consultant