Email Alerts for AS/400 Subsystem not running

345 pts.
Tags:
AS/400 administration
AS/400 email alert
AS/400 subsystems
iSeries email alert
Hi, I want my i series to send me email alerts when any of the AS400 subsystems are not active. Please can some one let me know the CL code for this.

Answer Wiki

Thanks. We'll let you know when a new response is added.

Hi,

You’ll probably need to use a WRKACTJOB OUTPUT(*PRINT) JOB(*SBS), copy the spooled output to a database file and read the database file to check which subsystems are active.

<a href=”http://publib.boulder.ibm.com/infocenter/systems/scope/i5os/index.jsp?topic=/apis/qwdrsbsd.htm”>Alternatively, there’s an API that you can use.</a>

Regards,

Martin Gilbert.

BTW, I think you r-click system, select monitors, then job.

Discuss This Question: 18  Replies

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy
  • Hugheswilliams
    Hi Martin, Thanks for your reply. Unfortunately,I am not very familiar with CL scripting.Please can you let me know the remaining of the CL Code to follow once I make the output from WRKACTJOB. Many Thanks in advance.
    345 pointsBadges:
    report
  • Gilly400
    Hi, I just thought of another way of doing this, which involves no programming whatsoever. You can use Ops Navigator/i-Series Navigator :- Right click on your system, select Job. Give the monitor a name and description, type your subsystem name in under subsystem, click on add (you can add multiple subsystems here). Select the metrics tab, select job status, click on add, then in the lower pane, select end of job and click on add. Select the status threshold tab, select the "trigger when job is in any selected status" and fill in the trigger command with the command to send email. You can use &JOBNAME as a variable to give the subsystem name to your command. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Hugheswilliams
    hi Martin, Thanks for the second method. Unfortunately Ops Navigator is not installed on the AS400 and CL Programming seems to be the only way. Will it be possible for you to give me some visibility of how to move ahead with CL.. Once agin thanks for all your help. regards Hughes
    345 pointsBadges:
    report
  • Gilly400
    Hi, I like a challenge. One solution coming up. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Gilly400
    Hi Hughes, To start with you're going to need a file with a list of the subsystems that you need to check, I'll call it SBSCHK for this explanation, with a field name of SBSNAM (Subsystem name, 10 long character). You'll need to fill the file with all the subsystems that you need to check (you can use UPDDTA for this). You'll then need a program to retrieve the data from this file and call a second program to check whether the subsystem retrieved is active :-
      PROGRAM1
    PGM /* Declare the subsystem file */ DCLF SBSCHK /* Get a list of active subsystems into file QTEMP/WRKACTJOB */ OVRPRTF QPDSPAJB HOLD(*YES) WRKACTJOB OUTPUT(*PRINT) JOB(*SBS) CRTPF QTEMP/WRKACTJOB RCDLEN(132) CPYSPLF FILE(QPDSPAJB) TOFILE(QTEMP/WRKACTJOB) SPLNBR(*LAST) DLTSPLF FILE(QPDSPAJB) SPLNBR(*LAST) /* Read and process the subsystem file */ READ: RCVF MONMSG CPF0864 EXEC(GOTO ENDPGM) CALL PROGRAM2 PARM(&SBSNAM) GOTO READ ENDPGM: ENDPGM
      PROGRAM2
    PGM PARM(&SBSNAM) /* Declare the file with active subsystems */ DCLF QTEMP/WRKACTJOB READ: RCVF MONMSG CPF0864 EXEC(GOTO ENDOFFILE) /* If the subsystem name is found, then it's active - the program is completed */ IF COND(%SST(&WRKACTJOB 2 10) *EQ &SBSNAM) THEN(GOTO ENDPGM) GOTO READ ENDOFFILE: /* If your program gets here, the subsystem is not active, so insert your send e-mail command here, you can use &SBSNAM as the subsystem name in your email message */ ENDPGM: ENDPGM To compile the programs, you'll need the SBSCHK file in your library list. To compile the second program you'll need to create the WRKACTJOB in your QTEMP (and compile the program interactively) - CRTPF QTEMP/WRKACTJOB RCDLEN(132). You may need to add some MONMSG checking for errors. You'll also need to add your sommand for sending e-mail - see the comment in PROGRAM2. Of course you can change the program names, file names or variable names as you see fit. Hope this gets you where you need to be. Please let me know if it works for you or if you have any problems with it. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Hugheswilliams
    Hi Martin, Thanks a mill for all your help. I can bottom this out now .Parallely I have started updating my CL as well. I hope I can make this run now via the scheduler.:-) Best Regards Hughes
    345 pointsBadges:
    report
  • Gilly400
    Hi Hughes, Maybe you'll need another little CL to run the job every 5 minutes or so :- PGM LOOP: CALL PROGRAM1 /* Wait 5 minutes, then try again */ DLYJOB DLY(300) GOTO LOOP ENDPGM Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • OldSysAdmin
    Operations Navigator (i Series Navigator) is "installed" on every AS400. You need the client installed on your PC as part of Client Access (i Series Access). Very handy tool. Some functions can only be performed via Ops Nav.
    945 pointsBadges:
    report
  • mcl
    Yeah, Ops-Nav or iSeries Navigator is part of the IBM client suite that you install on your desktop PC. The "monitors" are part of "Management Central". I've found that the monitors work best is they execute a command. The command can call a CL program. Unfortunately, I don't think IBM provided any simple way to send an email - which is probably what you want for alerts. There are lots of references on the web for setting up SMTP on the iSeries, also references for using monitors from Management central. To be truthful, if you are not familiar or comfortable with CL programming, you might want to look at an off-the-shelf package for system monitoring. What it might save you in time would be worth the cost. Regards Mike
    2,740 pointsBadges:
    report
  • Hugheswilliams
    Hi Guys, Thanks a lot for all your advices. I will currently work with Martins' CL and that way I will also get achance to develop my CL Skills which becomes important for further process improvements on i series. I also understand the importance of i Series Navigator amd will be installing the client on my PC so as to utilize the capabilities fully. Regards Hughes Williams
    345 pointsBadges:
    report
  • RonKoontz
    Gilly400, Using operations Nav can I put a monitor for a specific CPF message or severity code and have it send?
    1,780 pointsBadges:
    report
  • Gilly400
    Hi, Yes, you can specify specific message queues, message Id's, types (completion, inquiry, etc), severity less than, greater than, equal etc. It's quite flexible. Regards, Martin Gilbert.
    23,730 pointsBadges:
    report
  • Ddduck
    Hi, What about this situation? the subsystem(sbsA) is running, but one or two job is missing in sbsA. How can check it by using CL? Regards, ddduck
    30 pointsBadges:
    report
  • Whatis23
    Configuring a monitor in Ops iNav is very easy as well as setting up email capability on the i5. As noted, there are many docs on the web to do this, here's one: http://search400.techtarget.com/news/article/0,289142,sid3_gci968106,00.html I setup a QSYSOPR monitor for all RNQ* and RPG* inquiry messages as well as specific CPA messages. When a program errors, the monitor triggers the SNDDST command and an email is sent to specific techs as we are not a 24/7 shop. It also sends a text to their cell phone. This worked so well we were able to discontinue our contract with Robot Alert.
    5,665 pointsBadges:
    report
  • Ddduck
    But I dont have iSeries client access. Do you think CL program can do that? and how?
    30 pointsBadges:
    report
  • Yorkshireman
    ddduck you *do* have Navigator.. Maybe need to install that part onto your PC. go take your Geeks gently by the neck and demand the CD, or discovewr where it lurks on the network.
    5,580 pointsBadges:
    report
  • Ddduck
    I DONT want have extra PC for monitor. CL program is enough. Any CL programming expert here? thanks in advance.
    30 pointsBadges:
    report
  • Yorkshireman
    You don't need an EXTRA PC - just the one you are using to access the iSeries now. Or are you on a *real 5250/5291 or whatever dumb terminal? Client access is the screen emulator almost everyone uses now - there are a couple of others, such as TN5250, but CA comes with the box, and does what it says, and includes all the components for being a screen, a printer (or several of them) connecting to multiple boxes, being a drag and drop interface with Navigator, writing SQL, drawing pretty SQL database referential drawings - just loads of stuff. Try it - you'll like it..
    5,580 pointsBadges:
    report

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following