How to... Alert for IBMi WRKPRB entries not in a closed state.

How to... Alert for IBMi WRKPRB entries not in a closed state.

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:

  1. Enter a title for the rule
  2. Here we limit the rule to running Monday to Friday and only between 08:00 and 08:01.
  3. By Setting suspend on alert to 5 minutes, we will only generate the one alert per day.
  1. We will use a rule type of *RCDCNT
  2. We will send a console message (this is optional of course)
  3. 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;

  1. Use a Rule type of *RCDCNT
  2. Use the filename: QASXPROB
  3. Use a library of QUSRSYS
  4. Check member set to *FIRST
  5. Use the SQL select statement in the snippet below.
  6. Set "Alert when records" to *GT
  7. 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


                                   

要查看或添加评论,请登录

Mike Davison的更多文章

社区洞察

其他会员也浏览了