Using the hostname instead of the IP address of the target system in OPSCAWTO function
search cancel

Using the hostname instead of the IP address of the target system in OPSCAWTO function

book

Article ID: 44196

calendar_today

Updated On:

Products

OPS/MVS Event Management & Automation

Issue/Introduction

When calling the CA OPS/MVS function OPSCAWTO, how to use the hostname instead of the IP address of the target system?

Introduction:

When a change in the first argument of the OPS/MVS OPSCAWTO function is implemented to use a hostname instead of an IP address, invalid results may occur. Messages indicating that SNMP traps have been sent successfully can be seeing but they never arrive to its final intended destination.

To better explain this situation, take the example where you already have configured the Common Services ENFSNMP startup member SNMPCNFG with the IP address and hostname of the target system using the DEBUG option:

123.123.1.123          162 snmpv3 public DEBUG
snmprec.world.com  162 snmpv3 public DEBUG

If a change in the first argument of code MSGtext = OPSCAWTO('123.123.1.123',"'"MSGtxt"'",'D')

is implemented as: MSGtext = OPSCAWTO('snmprec.world.com',"'"MSGtxt"'",'D') 

then messages like this will indicate that the SNMP traps, in form of an alert, were successfully sent. 

IP address:

21:44:31 do_snmp: found matching configuration entry, statement number 142
21:44:31 do_snmp: using SNMPv1
21:44:31 snmpv1: routine entered
21:44:31 vb_list: OID string: 1.3.6.1.4.1.791.2.4.2
21:44:31 vb_list: OID value type: OCTETSTRINGEBCDIC
21:44:31 vb_list: OID value > NORMAL PROBLEM MISMATCH Task=QUERYMON Current State=USING Desired State=IPADDR <
21:44:31 do_snmp: do_snmpv1 returned rc=0
21:44:31 do_send: socket(1) port(162) opened to sendto 123.123.1.123

hostname:

21:47:30 Arg 001-->OCTETSTRINGEBCDIC<--
21:47:30 arg 8 is < NORMAL PROBLEM MISMATCH Task=QUERYMON Current State=USING Desired State=HOSTNAME
21:47:30 Arg 002--> NORMAL PROBLEM MISMATCH Task=QUERYMON Current State=USING Desired State=HOSTNAME
21:47:30 arg 9 is <>
21:47:30 do_snmp: no matching configuration entry, using default entry
21:47:30 name2ip: cache timeout for snmprec.world.com 
21:47:30 name2ip: snmprec.world.com converted to 123.123.1.123 
21:47:30 do_send: sent 139 bytes of data, node=snmprec.world.com 

The above indicates that the call to the OPS/MVS OPSCAWTO function that is using the hostname never reach its final intended destination.

 

Environment

 OPS/MVS-Event Management & Automation-for JES2
 

Resolution

Modify the  Common Services ENFSNMP configuration startup member SNMPCNFG.  This member is located in the  Common Services library CAW0OPTV. It contains the nodes definitions for the SNMP traps. The nodes are entered either as IPv4 or IPv6 addresses and a hostname can also be used.

123.123.1.123          162 snmpv3 public
snmprec.world.com  162 snmpv3 public

The Common Services ENFSNMP task uses the contents of the SNMPCNFG member to compare against the node specified in the ENFSNMP Event to select the SNMP protocol and other necessary parameters. However, no attempts are made to convert from a hostname to an IP address or vice versa.