When you say embedded in your control group - are you referring it as EXIT statement for SNDSMPTEMM ? --- Yes.
If yes - we can do that way when backup starts and backup completes , but how could you embed it with for control group backup ended abnormally/ completed with errors ? --- Like I said, it's a simple
down and easy way to get notified when the backed starts and ends.
That is the reason , We wrote a sample program for those error messages to be monitored. --- I agree, to monitor the backup from beginning to end, your program is a nice solution. We also use ROBOT software
watch our processes. Something goes sideways, we get the system message. Then of course we use DSPLOGBRM to dig into it.
Original Message:
Sent: 10/26/2023 2:50:00 PM
From: Avinash Chandra Mandavilli
Subject: RE: BRMS MSGID Monitoring : CLP
Hello Michael,
When you say embedded in your control group - are you referring it as EXIT statement for SNDSMPTEMM ?
If yes - we can do that way when backup starts and backup completes , but how could you embed it with for control group backup ended abnormally/ completed with errors ?
That is the reason , We wrote a sample program for those error messages to be monitored.
------------------------------
Avinash Chandra Mandavilli
------------------------------
Original Message:
Sent: Thu October 26, 2023 09:54 AM
From: Michael Mayer
Subject: BRMS MSGID Monitoring : CLP
Nice solution. We have the SNDSMTPEMM command embedded in our control group backups. It tells us when a backup starts & completes. A handy, quick way to notify yourself about how a backup ran (or didn't). We have a BRMS control group that has several STRBKUBRM commands in it. We have a before and after SNDSMTPEMM command for each of them. A rather simple way to help yourself. Of course, make sure the SMTP server is running.
------------------------------
Michael Mayer
IBM i on Power System Admin
ERMCO-ECI
Dyersburg, Tennessee 38024
731.676.4318
Blog: https://ibmireference.blogspot.com
Original Message:
Sent: Wed October 25, 2023 06:23 AM
From: Avinash Chandra Mandavilli
Subject: BRMS MSGID Monitoring : CLP
Hello Robert & all,
I implemented in the following way , now i being alerted when backup completes, ended abnormally or completed with errors . Sample CLP below
Thank you for all your responses and Inputs
STRBKUBRM CTLGRP(WEEKLYB) SBMJOB(*NO)
MONMSG MSGID(BRM1049) EXEC(GOTO CMDLBL(CONT))
CONT: MONMSG MSGID(BRM10A1) EXEC(GOTO CMDLBL(CONT1))
CONT1: MONMSG MSGID(BRM1820) EXEC(GOTO CMDLBL(CONT2))
CONT2:
LOOP: RCVMSG MSGQ(QSYS/QSYSOPR) MSGTYPE(*LAST) RMV(*NO) +
MSGID(&MSGID)
IF COND(&MSGID *EQ 'BRM1049') THEN(DO)
SNDDST TYPE(*LMSG) +
TOINTNET((abcd@gmail.com *PRI)) +
DSTD(DAILYT) LONGMSG(&BRM1049) +
SUBJECT(&BRM1049)
DLYJOB DLY(15)
GOTO CMDLBL(DONE)
ENDDO
GOTO CMDLBL(LOOP)
------------------------------
Avinash Chandra Mandavilli
Original Message:
Sent: Mon October 16, 2023 03:19 PM
From: Robert Berendt
Subject: BRMS MSGID Monitoring : CLP
Just noticed something else. STRBKUBRM ... SBMJOB(*YES)
The only *ESCAPE message you're ever going to get is if it cannot submit the job to run as another job. Which is unlikely unless your default job description uses a nonexistent job queue or some such thing. Try something like this.
PGM
DCL VAR(&ABNORMAL) TYPE(*CHAR) LEN(1) VALUE('0')
STRBKUBRM CTLGRP(DAILYB) SBMJOB(*NO)
MONMSG MSGID(CPF0000 BRM0000) EXEC(DO)
/* Analyze joblog, retrieve messages, etc to determine exactly what message you got which indicated +
that this backup ended abnormally */
CHGVAR &ABNORMAL VALUE('1')
ENDDO
IF COND(&ABNORMAL<>'1') THEN(DO)
/* Backup ended successfully. You could analyze DSPLOGBRM for details */
ENDDO
ENDPGM
------------------------------
Robert Berendt IBMChampion
Original Message:
Sent: Fri October 13, 2023 04:56 PM
From: Avinash Chandra Mandavilli
Subject: BRMS MSGID Monitoring : CLP
Hello IBM Programmers ,
First of all , i would like to say that I'm not super good in programming skills
Anyways, I would like to call the control group from CLP and monitor this BRMS message ID ( BRM1049 ) while backup is running, if the following MSGID picks , i should get alerted to my inbox. Unfortunately the program is not getting created because of this warning 30 error . Incase if my program is incorrect . Please provide your 2cents of guidance :) . Appreciate your help.
MONMSG MSGID(BRM1049) EXEC(DO)
*CPD0896 30 Messages Cannot be monitored on this command
Sample Program :
PGM
DCL VAR(&BRM1049) TYPE(*CHAR) LEN(80)
DCL VAR(&BRM4116) TYPE(*CHAR) LEN(80)
DCL VAR(&BRM10A1) TYPE(*CHAR) LEN(80)
DCL VAR(&BRM1820) TYPE(*CHAR) LEN(80)
CHGVAR VAR(&BRM1049) VALUE('Control group DAILYB type *BKU processing is complete')
STRBKUBRM CTLGRP(DAILYB) SBMJOB(*YES)
MONMSG MSGID(BRM1049) EXEC(DO)
SNDDST TYPE(*LMSG) TOINTNET((abcd@gmail.com)) DSTD('&BRM1049') MSG(&BRM1049) LONGMSG(&BRM1049) SUBJECT(&BRM1049)
ENDDO
GOTO CMDLBL(DONE)
DONE:
ENDPGM
------------------------------
Avinash Chandra Mandavilli
------------------------------