Automatic email notifications from iSeries

Tags:
AS/400
RPG
Nagi needs to write a code on his iSeries 870 to send a notifications to his e-mail, such as server rebooting, jobs not started or need reply, etc. He's a Windows guy, and doesn't know where to start. Can someone help him with the code and possibly send him steps on how to write it and where and which LIB it will reside, as well as the CL commands? -- Michelle Davidson, editor, Search400.com
1

Answer Wiki

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

first, have SMTP configured (if no, seek search400 for help).
how to check ? :
SNDDST TYPE(*LMSG)
TOINTNET((‘myemail@mycompany.com’))
DSTD(DESCRIPTION)
MSG(MESSAGE)
LONGMSG(‘long message’)

second, insert this model everywhere you need.
for example in the startup program when need to check IPL starting (DSPSYSVAL QTRUPPGM give the name)

third, you need to survey your QSYSOPR message queue. I have a model for you at http://jplamontre.free.fr/jpltools.htm + search QSYSOPR

Discuss This Question: 6  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.
  • TomLiotta
    No offense, but having a "Windows" person assigned to this is nuts. Trying to grasp why the SNDDST command, for example, can be useful requires knowledge of obsolete functions that shouldn't even be used. The actual SMTP functions are what should be used. Most iSeries programmers can't even say why SNDDST can be such a problem. Unfortunately, it's most probable that the iSeries has never had any e-mail client (for SMTP) installed. Just like a Windows system, if there is no e-mail client on the machine, then sending e-mail can be a bit of a problem. Unless you're a C programmer experienced with sockets or maybe a decent Java programmer... (COBOL? RPG?) When nothing else is available, SNDDST can be used. That assumes that the SNA/SMTP gateway is correctly configured and active and that SMTP is correctly configured, including external routing attributes, and that the SMTP server is started. Setting up a mail server is not trivial. Setting one up and talking through it with SNA functions is tricky enough that the clear majority of iSeries developers don't do it. Those that do get it done will usually resist tinkering with it. How many Windows developers enjoy installing and configuring e-mail servers on Windows? How often is it done on Windows by iSeries (or Unix/Linux or Mac) developers? Tom
    125,585 pointsBadges:
    report
  • rrockk2018
     hate it when people post of part of the solution. This send the DSPSYSSTS activity print to your email. The an error, but it still works.  have taken the time to fix it yet

    DCL        VAR(&SYSTEM) TYPE(*CHAR) LEN(10)               
    MONMSG     MSGID(CPF0000)                                 
    RTVNETA    SYSNAME(&SYSTEM)                               
    DSPSYSSTS  OUTPUT(*PRINT) RESET(*YES)                     
    CPYSPLF    FILE(QPDSPSTS) TOFILE(library/ASPUSE) +          
                 JOB(*) SPLNBR(*LAST) CRTDATE(*LAST)          
    CPYTOIMPF  FROMFILE(library/ASPUSE) TOFILE(library/ASUSE1)    
    MONMSG     MSGID(CPF0000)                                 
    CPYTOPCD   FROMFILE(library/ASPUSE) TOFLR(ASP) +            
                 TODOC(ASP.TXT) REPLACE(*YES)                 
    MONMSG     MSGID(CPF0000)                                 
    SNDDST     TYPE(*DOC) TOINTNET((email@adress.com) +  
                 (email@adress.com)) DSTD('SYSTEM    +   
                 DISK USAGE') MSG('PLEASE OPEN ATTACHMENT +   
                 TO VIEW STORAGE STATUS FOR    *SYSBAS AND +  
                 ASP') LONGMSG('&SYSTEM') +                   
                 IMPORTANCE(*HIGH) PTY(*HIGH) DOC(ASP.TXT) +  
                 FLR(ASP)                                     
    35 pointsBadges:
    report
  • DgQStx
    We have used MailTool from BVS Tools on our iSeries for over 10years.  It works great with many handy features.  Price is reasonable.
    Curious why the "windows guy" is assigned to this task.
    20 pointsBadges:
    report
  • Subhendu Sen
    @DgQStx, What did it mean? Have you any problem to using this tool?
    134,650 pointsBadges:
    report
  • WoodEngineer
    Not clear what you are asking. Please expand.

    We have had no problems with this tool.  Support from the developer is terrific.  It will simplify getting e-mail up and running on your iSeries.  I think BVS Tools offers a 30-day free trial.
    8,225 pointsBadges:
    report
  • ToddN2000
    It may be possible this was not available to the Windows guy when it was originally asked in 2005.
    129,550 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.

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

Following

Share this item with your network: