[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference hydra::axp-developer

Title:Alpha Developer Support
Notice:[email protected], 800-332-4786
Moderator:HYDRA::SYSTEM
Created:Mon Jun 06 1994
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:3722
Total number of notes:11359

3686.0. "Candle Corp." by HYDRA::KENYON (The Foundation of Science...Fiction) Fri May 30 1997 14:55

    Company Name :  Candle Corp.
    Contact Name :  Jeff Nelson
    Phone        :  612-833-1003
    Fax          :  
    Email        :  [email protected]
    Date/Time in :  30-MAY-1997 13:52:50
    Entered by   :  Jeff Kenyon
    SPE center   :  MRO

    Category     :  VMS
    OS Version   :  V6.2
    System H/W   :  Alpha


    Brief Description of Problem:
    -----------------------------

POrting app to SNMP sub-agency.  Trying to use UCX V6.1., and the ENSMP agent
that UCX provides.  Is there an example of how the ESNMP agent works?  What are
the issues, how it works, and fits together.  How does it compile, link and
run, etc?
T.RTitleUserPersonal
Name
DateLines
3686.1my responseHYDRA::KENYONThe Foundation of Science...FictionFri May 30 1997 18:00380
From:	HYDRA::AXPDEVELOPER "[email protected]" 30-MAY-1997 16:51:26.54
To:	[email protected]
CC:	AXPDEVELOPER
Subj:	I: Information on using the UCX eSNMP, and an example program pointer/help.

Jeff,

I think I can help you with your ESNMP "how to get it going" issue.  Based on
the information I was able to gather, the support for this aspect of UCX sems
quite lacking.  Pardon my lack of knowledge regarding SNMP programming, so the
following is taken from another Digital employee that has struggled (and solved
most of the issues you described to me).

There are 2 discussion streams below.  One about configuring things to get an
ESNMP Chess MIB example program working properly, and then discussion about how
to build the example, where it is, etc.

Please tell me if this gets you going, and is what you are after.  You can see
some pleas for getting this documented, which I cannot find any references to.

Regards,

Jeff Kenyon
Alpha Developer Support

********************************************************************************
        Notes from internal Digital discussion - configuration stuff
********************************************************************************


I am able to successfully build the eSNMP example chess-mib subagent.

Now I am doing some testing on this example chess-mib subagent.

I could read every MIB-variable of the chess-subagent with my Network
Management Station (MibMaster, an excellent Web-based MIB Browser from 
Equivalence) but I am not able to set any value of the "read-write" accessable
MIB-variables. I have got some error message like "SNMP set request returned
such name".

I am using the SNMP community "public" for get and set requests.

What is wrong here ?

Could this have something to do with the UCX Services "SNMP" and ESNMP" ?

Though they were both disabled, I could get SNMP values from the chess-mib
subagent.

So what are the two UCX services "SNMP" and "ESNMP" for ?
Do they have to be configured and how do they have to be configured ?

Here is the UCX SHOW SERVICES output from my system:

------------------------------------------------------------------------------- 
Service             Port  Proto    Process          Address            State
 
ESNMP                242  UDP      ESNMP            0.0.0.0             Disabled
FINGER                79  TCP      UCX$FINGER       0.0.0.0             Enabled
FTP                   21  TCP      UCX$FTPD         0.0.0.0             Enabled
MOUNT                 10  UDP      UCX$NFS_M        0.0.0.0             Enabled
NFS                 2049  UDP      UCX$NFS          0.0.0.0             Enabled
PORTMAPPER           111  TCP,UDP  UCX$PORTM        0.0.0.0             Enabled
REXEC                512  TCP      UCX$REXECD       0.0.0.0             Enabled
RLOGIN               513  TCP      not defined      0.0.0.0             Enabled
RSH                  514  TCP      UCX$RSHD         0.0.0.0             Enabled
SNMP                 161  UDP      UCX$SNMP         0.0.0.0             Disabled
TELNET                23  TCP      not defined      0.0.0.0             Enabled
-------------------------------------------------------------------------------

================================================================================
          -< How to allow SET requests on MIB variables in UCX/eSNMP >-
--------------------------------------------------------------------------------

There are two things you must consider:

1. There must be a SNMP community with read-write access.

   Online UCX Help says that the only access type allowed is READ,
   but this can't be true for an officially supported product.
   So I have tried access type WRITE and it was accepted by UCX.
   Now I have got an SNMP Configuration with the default community
   "public" , Type "Read Write" and Address_List 0.0.0.0.
   
2. But this one alone does not solve my problem, I still got SET-request
   errors. Fortunately I found out in one of the SNMP related replies of
   this conference, that there are some "flags" available:
   A "Authen" flag and a "Sets" flag. The first one enables Authentication-
   Traps and the second one allows you to SET values to MIB variables.

With these two workarounds, which are unfortunately not documented, I have got
the chess-mib subagent working for GETs and SETs.

As I asked in .0 about the two services "SNMP" and "ESNMP" and their function
I have found out that these two services are in the UCX Service Configuration
Database after doing a @SYS$MANAGER:UCX$CONFIG.
The service "SNMP" can be enabled or disabled, it has no effect to accessing
the eSNMP subagents. The service "ESNMP" cannot be enabled, you will get an
error message like: %UCX-E-STARTERROR, Error starting ESNMP service
-RMS-F-IOP, operation invalid for file organization or device
So I leave/set these two services DISABLED.

To summarize all the above I have listed the UCX command sequence, which
works in my environment:

UCX>  SET CONFIG NOSNMP
UCX>  SET CONFIG SNMP /COMMUNITY="public" /TYPE=READ /CONTACT="Dieter Lukas" -
_UCX> /LOCATION=(FIRST="Take care",SECOND="and",THIRD="stay alive !!!") -
_UCX> /FLAGS=(AUTHEN,SETS) /ADDRESS=(16.185.224.12, 16.185.240.232)
UCX>  SET CONFIG SNMP /COMMUNITY="bvin" /TYPE=WRITE -
_UCX> /ADDRESS=(16.185.224.12,16.185.240.232)
UCX>  SHOW CONFIG SNMP/FULL

As you can see I use two seperate communities for read and read/write access,
and I am not allowing every host to access my system.

Here is the resulting output of the "SHOW CONFIG SNMP/FULL" UCX command:

------------------------------------------------------------------------------ 
SNMP Configuration
  
Flags:    AuthenTraps Sets                        
  
Contact:  Dieter Lukas
  
Location   
  First:  Take care
  Second: and
  Third:  stay alive !!!
 
Community           Type       Address_list
 
public              Read       16.185.224.12, 16.185.240.232
 
bvin                Read Write 16.185.224.12, 16.185.240.232

------------------------------------------------------------------------------

********************************************************************************
            Notes from internal Digital discussion - example info
********************************************************************************

I've previously developed an eSNMP subagent for a customer based on his
Private-MIB under Digital UNIX V3.2C.

Now I have to do the same job under OpenVMS V7.1 and UCX V4.1. for an other
customer.  So I took the documentation about "eSNMP Programming and Reference"
and I start reading ... and from this point I'm lost in space (though I've done
VMS application development some years ago):

1. Nothing is told about the eSNMP environment under OpenVMS/UCX.
   What are the names of the master- and subagent VMS processes? Where
   are the images located ? Where and when they get started ? What about
   eSNMP configuration under OpenVMS ? Where is the "smbd.conf" file
   located, ... I'll stop here with the last concluding question.
   "WHERE IS THE ESNMP CONFIGURATION CHAPTER OR DOCUMENT ?"
    
2. I know from Digital UNIX that there was an eSNMP example called Chess-MIB. 
   Now I've  tried to find the corresponding files under OpenVMS.
   ... and I found them in SYS$COMMON:[SYSHLP.EXAMPLES.UCX.SNMP].
   
.
.
.  Text about issues since resolved removed.
.
.

================================================================================
                   -< MIBcompiling problem fixed by myself >-
--------------------------------------------------------------------------------

MIBcompiling of the Chess-MIB example
=====================================

1. The UCX/eSNMP chess example files in SYS$COMMON:[SYSHLP.EXAMPLES.UCX.SNMP]
   are incomplete !!!
   There is one file missing named RFC1442.MY;1
   I have got it from the chess-MIB example files under Digital UNIX 4.0 and
   copied it to SYS$COMMON:[SYSHLP.EXAMPLES.UCX.SNMP]
   The file RFC1442.MY;1 contains the OID-definitions which are required
   by CHESS_MIB.MY;1.
   
2. Next I have done the following command:

   mibcomp RFC1442.MY;1,CHESS_MIB.MY;1 chess
   
   ... and as a result 11 objects written to chess_tbl.c and chess_tbl.h
   
PS: The eSNMP/Digital UNIX command sequence "mosy, snmpi" is equivalent to
    the eSNMP/UCX "MIBCOMP" command.

For those of you who do not have access to Digital UNIX I have included the
RFC1442.MY in this reply.

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

          SNMPv2-SMI DEFINITIONS ::= BEGIN     -- from RFC1442


          -- the path to the root

          internet       OBJECT IDENTIFIER ::= { iso 3 6 1 }

          directory      OBJECT IDENTIFIER ::= { internet 1 }

          mgmt           OBJECT IDENTIFIER ::= { internet 2 }

          experimental   OBJECT IDENTIFIER ::= { internet 3 }

          private        OBJECT IDENTIFIER ::= { internet 4 }
          enterprises    OBJECT IDENTIFIER ::= { private 1 }

          security       OBJECT IDENTIFIER ::= { internet 5 }

          snmpV2         OBJECT IDENTIFIER ::= { internet 6 }

          -- transport domains
          snmpDomains    OBJECT IDENTIFIER ::= { snmpV2 1 }

          -- transport proxies
          snmpProxys     OBJECT IDENTIFIER ::= { snmpV2 2 }

          -- module identities
          snmpModules    OBJECT IDENTIFIER ::= { snmpV2 3 }

--NOTE, The macros have been deleted...

          -- names of objects

          ObjectName ::=
              OBJECT IDENTIFIER


          -- syntax of objects

          ObjectSyntax ::=
              CHOICE {
                  simple
                      SimpleSyntax,

                    -- note that SEQUENCEs for conceptual tables and
                    -- rows are not mentioned here...

                  application-wide
                      ApplicationSyntax
              }


          -- built-in ASN.1 types

          SimpleSyntax ::=
              CHOICE {
                  -- INTEGERs with a more restrictive range
                  -- may also be used
                  integer-value
                      INTEGER (-2147483648..2147483647),

                  string-value
                      OCTET STRING,

                  objectID-value
                      OBJECT IDENTIFIER,

                  -- only the enumerated form is allowed
                  bit-value
                      BIT STRING
              }



          -- application-wide types

          ApplicationSyntax ::=
              CHOICE {
                  ipAddress-value
                      IpAddress,

                  counter-value
                      Counter32,

                  gauge-value
                      Gauge32,

                  timeticks-value
                      TimeTicks,

                  arbitrary-value
                      Opaque,

                  nsapAddress-value
                      NsapAddress,

                  big-counter-value
                      Counter64,

                  unsigned-integer-value
                      UInteger32
              }

          -- in network-byte order
          -- (this is a tagged type for historical reasons)
          IpAddress ::=
              [APPLICATION 0]
                  IMPLICIT OCTET STRING (SIZE (4))


          -- this wraps
          Counter32 ::=
              [APPLICATION 1]
                  IMPLICIT INTEGER (0..4294967295)

          -- this doesn't wrap
          Gauge32 ::=
              [APPLICATION 2]
                  IMPLICIT INTEGER (0..4294967295)

          -- hundredths of seconds since an epoch
          TimeTicks ::=
              [APPLICATION 3]
                  IMPLICIT INTEGER (0..4294967295)

          -- for backward-compatibility only
          Opaque ::=
              [APPLICATION 4]
                  IMPLICIT OCTET STRING

          -- for OSI NSAP addresses
          -- (this is a tagged type for historical reasons)
          NsapAddress ::=
              [APPLICATION 5]
                  IMPLICIT OCTET STRING (SIZE (1 | 4..21))

          -- for counters that wrap in less than one hour with only 32 bits
          Counter64 ::=
              [APPLICATION 6]
                  IMPLICIT INTEGER (0..18446744073709551615)

          -- an unsigned 32-bit quantity
          UInteger32 ::=
              [APPLICATION 7]
                  IMPLICIT INTEGER (0..4294967295)

          -- indistinguishable from INTEGER, but never needs more than
          -- 32-bits for a two's complement representation
          Integer32 ::=
              [UNIVERSAL 2]
                  IMPLICIT INTEGER (-2147483648..2147483647)

END

---------------------- cut here ---------------------------------------------
================================================================================
                          -< all problems fixed now >-
--------------------------------------------------------------------------------

For those who are interested in building the eSNMP chess-MIB example
subagent all problems are finally fixed now.
To solve the last one (undefined symbols: select, sleep) I had to
use the compiler switch '/PREFIX=ALL' to define DECC$SELECT() and DECC$SLEEP()
instead of select() and sleep().

To summarize all the fixed problems in building the chess-MIB example
subagent I have written a DCL command procedure BUILD.COM which should play the
role of the missing UNIX makefile.

By invoking BUILD.COM everything is done for you and you should get the
final CHESS_SUBAGENT.EXE image file which runs without any problem.

------------ cut here --------------------------------------------------------
$!
$! BUILD.COM
$!
$ MIBCOMP RFC1442.MY,CHESS_MIB.MY CHESS /PRINT
$ CC/INCLUDE=UCX$SNMP/PREFIX=ALL/DEFINE=OPENVMS CHESS_METHOD.C
$ CC/INCLUDE=UCX$SNMP/PREFIX=ALL/DEFINE=OPENVMS CHESS_MIB.C
$ CC/INCLUDE=UCX$SNMP/PREFIX=ALL/DEFINE=OPENVMS CHESS_TBL.C
$ LINK CHESS_SUBAGENT.OPT/OPTIONS

------------ cut here --------------------------------------------------------
    
3686.2closing...HYDRA::KENYONThe Foundation of Science...FictionFri Jun 06 1997 09:4813
From: <[email protected]>
Subject: Re: I: Information on using the UCX eSNMP, and an example program
	 pointer/help.

There's more in here than I expected to find (regarding the UCX SNMP
configuration). This, plus the programming example, are exactly what I
need. Thanks very much.

-Jeff E. Nelson
-Candle Corporation
-Internet: [email protected]