OPS/MVS - How to Issue Ping Command
search cancel

OPS/MVS - How to Issue Ping Command

book

Article ID: 135657

calendar_today

Updated On:

Products

OPS/MVS Event Management & Automation

Issue/Introduction

Is it possible to issue a PING command in OPSMVS?  I have tried Address TSO and Address UNIX and get a system dump each time.  Also, is there a way to capture the PING results and send via email?  

Environment

OPS/MVS  All releases

Resolution

The PING command can be issued directly from OPSLOG by issuing a   / (slash) followed by the 3 letter OPSTOSF ID for the system, followed by the PING command.

 

For example, if the OPSTOSF is ABC, issue command:

/ABC PING 192.0.2.1   

 

To determine the OPSTOSF for your system, issue command /D OPDATA.  The 3 letter identifier will show up under the PREFIX column next to OWNER OPSTOSF:

For example:  

 14:52:47 D OPDATA

 14:52:47 IEE603I 14.52.47 OPDATA DISPLAY 420

 14:52:47  PREFIX     OWNER      SYSTEM     SCOPE     REMOVE   FAILDSP

 14:52:47  ABC          OPSTOSF     XXXX         SYSTEM    NO       PURGE

 

REXX code can be used if capturing PING results, and sending the output via an email, is desired.    Member EMAILMSG provide in the **.CCLXSAMP library provides the overall mechanism for sending the email.   To this, code similar to the following would be used to capture the ping:  

 

/* Rexx */ 

address tso
"PING host.name.com"   
DO WHILE QUEUED() > 0
 PULL IT
 SAY IT
END
return 

 

Alternatively, the ping command can also be issued from Unix Systems Services (USS) and the output captured in a stem variable using the following code:

/* Rexx */
cmd = 'ping host.name.com'                   
address uss "usscmd command('"cmd"') stem(out) wait(15)"
i = 1                                                   
do while i <= out.0                                     
 say out.i                                              
 i = i + 1                                              
end                                                     
return