|
I did it like this:
MGTCPAGE: PGM PARM(&PAGER &DATE &TIME &TXT)
DCL VAR(&DATE) TYPE(*CHAR) LEN(8)
DCL VAR(&TIME) TYPE(*CHAR) LEN(8)
DCL VAR(&PAGER) TYPE(*CHAR) LEN(7)
DCL VAR(&TXT) TYPE(*CHAR) LEN(4000)
DCL VAR(&MSGTXT) TYPE(*CHAR) LEN(4011)
DCL VAR(&SRLNBR) TYPE(*CHAR) LEN(8)
DCL VAR(&SYSNAME) TYPE(*CHAR) LEN(9)
DCL VAR(&HOUR) TYPE(*CHAR) LEN(2)
DCL VAR(&DECHOUR) TYPE(*DEC) LEN(2)
DCL VAR(&QDOW) TYPE(*CHAR) LEN(4)
/* ****************************************************************** */
/* ***********************GLOBAL ERROR HANDLER*********************** */
/* ****************************************************************** */
DCL VAR(&MSGID) TYPE(*CHAR) LEN(7)
DCL VAR(&MSGKEY) TYPE(*CHAR) LEN(4)
MONMSG MSGID(CPF0000) EXEC(GOTO CMDLBL(ERROR))
/* ****************************************************************** */
/* Retrieve the system SN & add the system name to the message text. */
RTVSYSVAL SYSVAL(QSRLNBR) RTNVAR(&SRLNBR)
IF COND(&SRLNBR *EQ ' 10xxxxx') THEN(CHGVAR +
VAR(&SYSNAME) VALUE('Test System'))
IF COND(&SRLNBR *EQ ' 10xxxxxx') THEN(CHGVAR +
VAR(&SYSNAME) VALUE('Prod System'))
CHGVAR VAR(&MSGTXT) VALUE(&SYSNAME *BCAT &TXT)
/* Don't page me for Response Time messages on weekends! */
RTVSYSVAL SYSVAL(QDAYOFWEEK) RTNVAR(&QDOW)
IF COND(&QDOW *EQ '*SAT' *AND %SST(&TXT 1 3) +
*EQ 'R/T') THEN(GOTO CMDLBL(SNDMSG))
IF COND(&QDOW *EQ '*SUN' *AND %SST(&TXT 1 3) +
*EQ 'R/T') THEN(GOTO CMDLBL(SNDMSG))
/* Don't page me after 10pm or before 7am! */
RTVSYSVAL SYSVAL(QHOUR) RTNVAR(&HOUR)
CHGVAR VAR(&DECHOUR) VALUE(&HOUR)
IF COND(&DECHOUR *LT 07) THEN(GOTO CMDLBL(SNDMSG))
IF COND(&DECHOUR *GT 21) THEN(GOTO CMDLBL(SNDMSG))
SBMJOB CMD(SNDDST TYPE(*LMSG) TOINTNET(((&PAGER +
*TCAT +
'.beeper@xxxxxxxxxxxxxxxxxxxx'))) +
DSTD(MESSAGE) LONGMSG(&MSGTXT)) +
JOB(MGTCPAGE) JOBQ(QPGMR) SCDDATE(&DATE) +
SCDTIME(&TIME)
GOTO CMDLBL(END)
ERROR: RCVMSG PGMQ(*SAME) MSGTYPE(*ANY) MSGKEY(*NONE) +
WAIT(0) KEYVAR(&MSGKEY) MSGID(&MSGID)
SNDUSRMSG MSGID(&MSGID) MSGF(QCPFMSG) MSGTYPE(*INFO) +
TOMSGQ(mymsgq)
GOTO CMDLBL(END)
SNDMSG: SNDUSRMSG MSG(&MSGTXT) MSGTYPE(*INFO) TOMSGQ(mymsgq)
END: ENDPGM
Then create a command similar to this one:
CMD PROMPT('Management Central Page')
PARM KWD(PAGER) TYPE(*CHAR) LEN(7) CHOICE('Pager +
number') PROMPT('Enter Pager Number(no +
dash)')
PARM KWD(DATE) TYPE(*CHAR) LEN(8) DFT(*CURRENT) +
CHOICE('Date, *CURRENT') PROMPT('Enter Date')
PARM KWD(TIME) TYPE(*CHAR) LEN(8) DFT(*CURRENT) +
CHOICE('Time, *CURRENT') PROMPT('Enter Time')
PARM KWD(TXT) TYPE(*CHAR) LEN(4000) +
CHOICE('Text') PROMPT('Enter Text')
Compile and put both in QUSRSYS on all your systems, then put commands
like this in your monitor:
MGTCPAGE PAGER(5551212) TXT(' > 95%')
MGTCPAGE PAGER(5551212) TXT('R/T > 1 second')
You'll get messages like this:
Test System > 95%
and
Prod System R/T > 1 second
Regards,
Scott Ingvaldson
iSeries System Administrator
GuideOne Insurance Group
-----Original Message-----
date: Fri, 13 Jan 2006 12:03:20 -0600
from: "Jon Sinner" <JSinner@xxxxxxxx>
subject: Iseries Navigator Message Monitor
Does anyone have any experience working with the Message Monitor in
Management Central
I configured the monitor and I have create a program to call on a
triggered event.
The problem is that the parameters that are passed into the program are
garbage.
Does anyone have a working program or any advise that they would be
willing to share.
TIA
Jon
DISCLAIMER:
This message and accompanying documents are covered by the Electronic
Communications Privacy Act, 18 U.S.C. ?? 2510-2521, and contains information
intended for the specified individual(s) only. This information is
confidential. If you are not the intended recipient or an agent responsible for
delivering it to the intended recipient, you are hereby notified that you have
received this document in error and that any review, dissemination, copying, or
the taking of any action based on the contents of this information is strictly
prohibited. If you have received this communication in error, please notify us
immediately by e-mail, and delete the original message.
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2025 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.