Email Alerts for AS/400 Subsystem not running
95 pts.
0
Q:
Email Alerts for AS/400 Subsystem not running
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.
ASKED: Mar 31 2009  11:59 AM GMT
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
0
360 pts.
0
A:
 RATE THIS ANSWER
0
Click to Vote:
  •   0
  •  0
  • AddThis Social Bookmark Button
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.

Alternatively, there's an API that you can use.

Regards,

Martin Gilbert.

BTW, I think you r-click system, select monitors, then job.
Last Answered: Apr 1 2009  8:12 PM GMT by OldSysAdmin   360 pts.
Latest Contributors: Gilly400   23625 pts.
0
0
Discuss This Answer:
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _



_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _

Hugheswilliams   95 pts.  |   Mar 31 2009  3:48PM GMT

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.

 

Gilly400   23625 pts.  |   Apr 1 2009  10:31AM GMT

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.

 

Hugheswilliams   95 pts.  |   Apr 2 2009  8:40AM GMT

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

 

Gilly400   23625 pts.  |   Apr 2 2009  9:38AM GMT

Hi,

I like a challenge. One solution coming up.

Regards,

Martin Gilbert.

 

Gilly400   23625 pts.  |   Apr 2 2009  10:13AM GMT

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.

 

Hugheswilliams   95 pts.  |   Apr 2 2009  10:50AM GMT

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

 

Gilly400   23625 pts.  |   Apr 2 2009  11:38AM GMT

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.

 

OldSysAdmin   360 pts.  |   Apr 2 2009  6:14PM GMT

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.

 

Mcl   2500 pts.  |   Apr 2 2009  6:26PM GMT

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

 

Hugheswilliams   95 pts.  |   Apr 3 2009  8:29AM GMT

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

 

RonKoontz   1355 pts.  |   Apr 6 2009  1:48PM GMT

Gilly400,
Using operations Nav can I put a monitor for a specific CPF message or severity code and have it send?

 

Gilly400   23625 pts.  |   Apr 6 2009  2:01PM GMT

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.

 

Ddduck   30 pts.  |   Aug 6 2009  8:17AM GMT

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

 

Whatis23   4040 pts.  |   Aug 6 2009  6:23PM GMT

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:

 <a href="http://search400.techtarget.com/news/article/0,289142,sid3_gci968106,00.html" title="http://search400.techtarget.com/news/article/0,289142,sid3_gci968106,00.html" target="_blank">http://search400.techtarget.com/news/art…</a>

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.

 

Ddduck   30 pts.  |   Aug 7 2009  3:47AM GMT

But I dont have iSeries client access.
Do you think CL program can do that? and how?

 

Yorkshireman   3200 pts.  |   Aug 7 2009  2:22PM GMT

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.

 

Ddduck   30 pts.  |   Aug 10 2009  7:38AM GMT

I DONT want have extra PC for monitor.
CL program is enough.

Any CL programming expert here?

thanks in advance.

 

Yorkshireman   3200 pts.  |   Aug 10 2009  4:03PM GMT

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..

 
0