HP3000-L Archives

September 1999, Week 1

HP3000-L@RAVEN.UTC.EDU

Options: Use Monospaced Font
Show Text Part by Default
Show All Mail Headers

Message: [<< First] [< Prev] [Next >] [Last >>]
Topic: [<< First] [< Prev] [Next >] [Last >>]
Author: [<< First] [< Prev] [Next >] [Last >>]

Print Reply
Subject:
From:
Chris Bartram <[log in to unmask]>
Reply To:
Date:
Wed, 1 Sep 1999 18:10:05 -0400
Content-Type:
Text/Plain
Parts/Attachments:
Text/Plain (198 lines)
 In <[log in to unmask]> [log in to unmask] writes:

> Want to e-mail spooler reports generated off the 3K.  Automate if possible.
> Have ESPUL from RAC.
>
> Any quick, cheap, easy way to do this ?
>
> Use Outlook from Micky$oft as e-mail.

<plug alert; though I personally recommend ESPUL I have no financial
 interest in it... just netmail :-) >

We use ESPUL and NetMail/3000 to email all kinds of spoolfiles...
Some examples:

In ASPCONF, we select $STDLISTS (or any other name/criteria you like) and do
a:

  SETVAR
  MPE XEQ OPSMAIL.XEQ.SYS !SPFDFID

setvar sets various JCWs, which allows the spoolfile id to be passed to the
command file 'opsmail',which mails to a list of administrators. The command
file is simply:

------------------------------cut here----------------------------
parm spid
xeq sendhtml.xeq.sys ^hpops.data.sys,batch,,&
 !spid,'System Job Listing from HP3000'
------------------------------cut here----------------------------

(sendhtml.xeq.threek is a command file that comes with NetMail/3000)

A simpler example, just add lines like the following to a job stream:

------------------------------cut here----------------------------
!xeq sendhtml.xeq.sys ^admusers.data.sys,batch,,!HPSPOOLID,&
! 'The $Stdlist for Daily Accounting Job'
------------------------------cut here----------------------------

Which emails the current job's $stdlist to a list of addresses listed in a
flat file (admusers.data.sys). It could also just specify one address on
the command line (instead of the indirect file reference). This command file
also automatically converts the message to a TEXT/HTML format which is both
readable by normal mail clients, and specially formed to NOT be mangled by
M$Exchange/Lookout (i.e. it'll maintain it's alignment and not get wrapped or
highlighted in random places as Lookout is want to do).

And pardon the more involved stuff, but this is pretty nifty (if probably
alot more involved than you may want):

We also configured a dummy dtc with a port configured as a printer, with
device class names listing dozens of users on the system. Then with the
following configs in ESPUL, all these users can route any report to a device
 ;DEV=username - where these reports then get routed to the users' mailboxes.
For example, :file out;dev=CBARTRAM   :listf,2;*out   will send the listf to
my mailbox.

ESPUL ASPCONF stuff:

------------------------------cut here----------------------------
*
* Handle printouts to be emailed (using pseudo devices)
*

SELECT D=CBARTRAM OR D=USER1 OR D=USER2 OR D=USER3 OR D=USER4 OR&
 D=USER5
  SETVAR
  MPE XEQ MAILTO.XEQ.SYS !SPFDEVICE,!SPFDFID,!SPFNAME
  PURGE
END
------------------------------cut here----------------------------

MAILTO.XEQ.SYS figures out the email address for each user. In our case, we
got tricky and used Security/3000 (from VESoft). By adding a user-field called
"email" to each profile, we keep a centralized list of every user's email
addresses. The MAILTO command file calls another command file (MAILADDR.XEQ)
which looks up the userid's profile and sets a civar "email" to the email
address of the user.

MAILTO looks like this:

------------------------------cut here----------------------------
parm userid,dfid,spname
#
# This command file accepts a dfid of a spoolfile and a userid
# and checks the security profiles for an email
# address for this individual. If an email-address is found, the
# $stdlist is e-mailed to the person that streamed the job.
#
echo Mailto: !userid !dfid
xeq mailaddr.xeq.sys "!userid.@"
if "!email"<>"" then
  echo #!dfid e-mailed to !email
  xeq sendhtml.xeq.sys !email,batch,,!dfid,"MACS Report #O!dfid !spname"
endif
------------------------------cut here----------------------------


And MAILADDR looks like this:

------------------------------cut here----------------------------
parm userstring

#
# This command file accepts a userstring (i.e. a logon; USER.ACCT or
# SESSION,USER.ACCT) and proceeds to lookup the 'email' address for the
# Security/3000 profile which matches that logon.
#
# Requires Security/3000
# Requires a user-field called "email" which should be set to the user's
#  full internet-style e-mail address for each profile
#

setvar userid ups("!userstring")
setvar email ""
continue
purge tmpemail,temp > $NULL
echo setvar email veprofileinfo("!userid").uf("email")  > tmpemail
echo quit                                               >> tmpemail
continue
run mpex.pub.vesoft;stdin=tmpemail > $NULL

if "!email"="" then

  if pos(",","!userid")>0 then
#
# userid is name,user.acct
#
    setvar userid2 word('!userid',',. ',2)
    if "!userid2"="MGR" then
      setvar userid2 word('!userid',',. ',1)
    endif

   else
#
# userid is user.acct
#
    setvar userid2 word('!userid',',. ',1)
  endif

  setvar userid2 "!userid2.@"
  continue
  purge tmpemail,temp > $NULL
  echo setvar email veprofileinfo("!userid2").uf("email")  > tmpemail
  echo quit                                                >> tmpemail
  continue
  run mpex.pub.vesoft;stdin=tmpemail > $NULL

endif
------------------------------cut here----------------------------

Finally, here's two other suggestions for utilizing ESPUL (and netmail)
..excerpts from an ASPCONF file:

------------------------------cut here----------------------------
*
* Scan @.SYS $Stdlists for errors; if errors found, send a copy to the
*  system printer (LPLASER) and email a copy to the operations users
* Also, defer the original (pri=3), flag it in the archive, and send a
* tell message to @.sys and the console.
*

SELECT FILE=$STDLIST AND [log in to unmask] AND PRI<>3
  NOHIDE COPY
    SETVAR
    EXAMINE ERRORS.DATA.SYS
      NOHIDE COPY
      ALTER P=3
      COPY P=13;D=LPLASER;OWNER;HIGHLIGHT
      CONSOLE "SysJob !SPFJOBTYPE!SPFJOBNUMBER has errors!"
      TELL @.SYS;SysJob !SPFJOBTYPE!SPFJOBNUMBER has errors!
      FLAG "ERRs"
      MPE XEQ OPSMAIL.XEQ.SYS !SPFDFID
    END
  NOHIDE SELECTED
END

*
* E-mail HP Predictive support reports
*

SELECT OWNER=MANAGER.SYS AND FILE=PSLIST
  SETVAR
  MPE XEQ OPSMAIL.XEQ.SYS !SPFDFID
  PURGE
END

------------------------------cut here----------------------------

Hope that gives you some ideas...

(We assembled a very good list of error messages to scan for - per the
errors.data.sys file. If anyone wants a copy email me. It's formatted one
string per line - as ESPUL wants it.)

      -Chris Bartram

ATOM RSS1 RSS2