Technical article 110560

What SNMP capabilities are there in AFPS?

OpenServer 5.0.5

Written · Last revised

Problem

What SNMP capabilities are there in AFPS?

Solution

The SCO AFPS product provides an SNMP (Simple Network Management Protocol) agent that enables AFPS to be monitored by an SNMP management station. The facilities that are provided and how these can be accessed are discussed below.

Background
==========

In order to monitor what is happening on any system that has SNMP, an agent and a management station are required. The agent acts as a facility to gather all the information that can be obtained on the system and the management station is used to read this information. Generally a management station is a software package placed on a central PC/server in a network that is used to collate all the information it receives on request from the various SNMP agents around that network.

As there may be several SNMP agents present from different products on the one system, a special multiplexing SNMP component exists called the SMUX. The SMUX (SNMP Multiplexor Protocol) acts in between the SNMP agent and the system SNMP facilities and the SNMP management station. This can be seen in Figure (a).

The information that the particular SNMP agent collates, in this case the one for AFPS, is either collected from that agent by the management station on request via the SMUX, and/or it is sent to the SMUX in discrete amounts via "traps". The former is collected from the SMUX, and the latter is actively passed through via the SMUX. Traps are a mechanism to decide what information you want to monitor and when an event occurs that is specified by a particular trap, that information is collected and forwarded on to the SMUX. Traps are an ability to instruct a system to report an event. For example, for the operating system, you might want to monitor when the system did a cold start power on. This is specified in a standard supplied trap, type "0". This trap can be mimicked and seen as follows:

On one screen, type the command:
# trap_rece -d

Then from another screen, trip the trap:

# trap_send localhost public 0

On the first screen you should now see:

# trap_rece -d
Packet Dump:
        30 32 02 01   00 04 06 70   75 62 6c 69   63 a4 25 06
        09 2b 06 01   03 01 2a 2a   2a 2a 40 04   96 7e 14 de
        02 01 00 02   01 00 43 01   00 30 09 30   07 06 03 29
        01 01 05 00
Community: public
Enterprise: experimental.1.42.42.42.42
Agent-addr: 123.456.789.123     ( your systems IP address )
Cold start trap.
Time Ticks: 0
Name: iso.1.1.1
Value: NULL
Figure (a)
      +----------+           trap_rece(ADMN)
      |  SMUX    |
      |          | ---------------- > --------------------+
      +----------+                                        |
       ^       ^                                          |
       |       |                                          |
       |       |                                          |
       |       |                                          |
+---------+   +---------+                             +---------+
|   AFPS  |   |  other  |                             |   SNMP  |
|  Agent  |   |  Agent  |                             | Manager |
|         |   |         |                             |         |
+---------+   +---------+                             +---------+
      |
      +------ < < ----------- System information

To recap, a particular event will trigger a trap, which alerts the SNMP agent, which forwards the information via the SMUX to the SNMP management station.

Traps are an exclusive SNMP mechanism that in effect generate an alert, but "alerts" are also the name of a LAN manager/AFPS mechanism that essentially does the same thing; both bring some important issue to the attention of an administrator. AFPS alerts are issued on the network by the AFPS ALERTER service, and notification of one can be received by any workstation logged onto that network as a pop-up message on the Microsoft Windows console.

Associated Files
================

SCO provides an SNMP agent for the OpenServer 5 operating system and one is also provided in the AFPS product. The SNMP agent daemons can be seen as follows:

$ ps -ef |grep snmp*
root   460     1  0   Aug-19       ?    00:00:14 /etc/snmpd
root   851     1  0   Aug-19       ?    00:20:11 /usr/net/
servers/lanman/snmp/lmxsnmpd

The SNMP trap port number is 162, set in "/etc/services".

Some operating system associated files are kept in the "/etc" directory. These include:

snmpd.peers
snmpd.comm
snmpd.conf
snmpd.trap

The "/etc/snmpd.peers" file contains the following line for AFPS:

"lmxsnmpd"  1.3.6.1.4.1.77  "aintNoThing"

The AFPS related SNMP files are in the "/usr/net/servers/lanman/snmp" directory. The file "lmxsnmpd.asn1" contains the MIB (management information database) definitions for AFPS which are a subset of the LAN Manager MIB II objects. These objects are described in the AFPS documentation listed at the end of this technical article. In general, for an operating system such as OpenServer 5, any MIB definitions are already built into the SNMP executables and code, so that these SNMP utilities are aware of the common object definitions, defined in, for example, RFC 1514. See the "/usr/include/snmp" directory.

AFPS Example
============

As an example, the AFPS ASN1 file lists the object "svStatPwErrors" which is described as the number of password violations on the server. The ASN1 file additionally describes in ASN.1 format (dot notation) how to refer to these objects. For example:

svStatPwErrors OBJECT-TYPE
    SYNTAX  Counter
    ACCESS  read-only
    STATUS  mandatory
    ::= { server 9 }

In this case, you would use the number:

1.3.6.1.4.1.77.1.2.2.9

The first part of this number is OSI standard format, where:

1 - is reserved for ISO 3 - International Organization 6 - DOD 1 - Internet 4 - Private 1 - Enterprises

The next part can be read following the scheme listed at the top of the AFPS "lmxsnmpd.asn1" file, so:

77 - lanmanager
1  - lanmgr-2
2  - server
9  - svStatPwErrors

There is no SNMP management station provided on the SCO OpenServer product; this would usually be third party software. However, you can check what the station would see - in other words, what the SMUX is receiving using the "trap_rece" command mentioned in the example earlier. You can also use the "getone(ADMN)" and "setany(ADMN)" commands to check and set the MIB object values.

The following is provided as an example.

For the operating system, get the system's name:

# getone localhost public sysName.0
Name: sysName.0
Value: scotest.london.sco.com
For the AFPS object:
# getone localhost public 1.3.6.1.4.1.77.1.2.9 |pg
Name: enterprises.77.1.2.9.0
Value: 0
Now set a password violation:
$ net logon administrator
Type your password:

Your logon attempt has failed due to an incorrect username or password. More help is available by typing NET HELPMSG 6446.

Check the violations encountered:
# getone localhost public 1.3.6.1.4.1.77.1.2.9 |pg
Name: enterprises.77.1.2.9.0
Value: 1

The "svStatPwErrors" parameter will store any password violations, but there is also a trap level set where the system will tell the management station that it has reached the level. The default number of invalid login attempts that can be made before an alert is set in the object "pwLogonAlertLevel".

# getone localhost public 1.3.6.1.4.1.77.2.2.4.1
Name: enterprises.77.2.2.4.1.0
Value: 5

Again, as with the operating system example earlier, you can trigger a trap and observe the result with "trap_rece -d". Start the program on one screen and try 5 more incorrect logins on another. This shows:

# trap_rece -d
Packet Dump:
        30 3c 02 01   00 04 06 70   75 62 6c 69   63 a4 2f 06
        08 2b 06 01   04 01 4d 02   01 40 04 96   7e 14 10 02
        01 06 02 01   04 43 04 07   37 83 1c 30   11 30 0f 06
        0a 2b 06 01   04 01 4d 02   02 04 02 02   01 00
Community: public
Enterprise: enterprises.77.2.1
Agent-addr: 123.456.789.123     < your systems IP address >
Enterprise Specific trap.
Enterprise Specific trap: 4
Time Ticks: 121078556
Name: enterprises.77.2.2.4.2
Value: 0
Packet Dump:
        30 3c 02 01   00 04 06 70   75 62 6c 69   63 a4 2f 06
        08 2b 06 01   04 01 4d 02   01 40 04 96   7e 14 10 02
        01 06 02 01   05 43 04 07   37 83 20 30   11 30 0f 06
        0a 2b 06 01   04 01 4d 02   02 05 02 02   01 00
Community: public
Enterprise: enterprises.77.2.1
Agent-addr: 123.456.789.123     < your systems IP address >
Enterprise Specific trap.
Enterprise Specific trap: 5
Time Ticks: 121078560
Name: enterprises.77.2.2.5.2
Value: 0

The numbers above are "2.2.4.2" or "numPWViolations" and "2.2.5.2", "numAccessViolations".

Some violation details are listed on the server in the "net config" command, for example:

# net config server
...
Access thresholds
Network I/O errors                    0
Password violations                   5
Permission violations                 5
System errors                         5
...
Set it via the "ACCESSALERT" parameter:
# net config server /ACCESSALERT:2
The command completed successfully.
# net config server
Permission violations                 2

You can also retrieve several of the AFPS objects at once with the command:

# getmany localhost public 1.3.6.1.4.1.77 |pg
Other
=====

The "snmpstat(ADMN)" command provides a facility to show the state and other statistics of the SNMP service. This command can also be used to examine other systems on the network if they are running SNMP. For example, use the command:

# snmpstat <name of remote machine> public

The examples above used dot notation to refer to the objects, but generally they can also be referred to by their name equivalents. The "getmany(ADMN)" command has a "-f" option to specify a file containing the "mosy(ADMN)" and "post_mosy(ADMN)" compiled list of names. The post_mosy command creates a list of object names mapped to dot numbers. As an example, to use this with "gated(ADMN)":

# post_mosy -i /etc/gated-mib.defs -o /tmp/ab
# getmany -f /tmp/ab localhost public mib-2 |pg
# getone -f /tmp/ab localhost public snmpOutBadValues.0
Name: snmpOutBadValues.0
Value: 3
However, the getmany command will default to showing the objects it
is aware of if it cannot read the format of the file specified with
the "-f" option. The mosy/post_mosy compilation of the AFPS .asn1
file does not currently work.  The mosy/post_mosy utilities are
joined in "mibcomp.sh(ADMN)"; however, the actual command is
"/usr/bin/mibcomp". This has been resolved in the next release of
SCO OpenServer 5.

The "getmany(ADMN) command can be used to see several of the objects available on the operating system at once. For example:

# getmany localhost public system
or
# getmany localhost public 1.3.6.1.2.1   (for MIB-2)
(see "/usr/include/snmp/snmp-mib.h")

The "setany" command can be use to alter the value of objects, for example:

		# setany localhost public "ifAdminStatus.2" -i 3
		Error code set in packet - General Error Index: 1

By default, "public" objects are "read" only. Edit the setting in "/etc/snmpd.comm" to WRITE and restart the server and retry. Also try using the server name/IP address instead of localhost.

SCO OpenServer 5 also provides an SNMP Agent Configuration utility as part of the SCOadmin interface. This is not an SNMP management station utility and so cannot monitor events. It does provide the output seen in the "snmpstat" command mentioned above. It can be used to edit the SNMP "conf/comm/trap/peers" files. However, note that for SCO OpenServer Release 5.0.4, the interface is broken. For Release 5.0.5, the Edit options for the files do not have the correct names associated with the actual file contents. These have been reported to SCO Engineering.

The operating system SNMP daemon "/etc/snmpd" logs information into its log file "/usr/adm/snmpd.log" by default. It can be redirected to standard output, that is, usually the console, by specifying the "-v" option on the command line. See the manual page for "snmpd(ADMN)" for more details.

See also

SCO AFPS 3.5.2n System Guide, Chapter 7, "Using SNMP".

SCO OpenServer 5 Networking Guide, Chapter 10, "Configuring the Simple Network Management Protocol (SNMP)".

Manual pages: getone(ADMN), getmany(ADMN), setany(ADMN), trap_send(ADMN), trap_rece(ADMN), snmpd(ADMN), snmpstat(ADMN), mosy(ADMN), post_mosy(ADMN), mibcomp.sh(ADMN), smux_api(SLIB).

SMUX example code in "/usr/src/cmd/net/smux-samp".

From the Xinuos technical article database, record 110560. Reproduced with permission. The original is at www.sco.com/ta/110560, which is reachable but blocked from search engines.

Next step

Need this fixed rather than explained?

Tell us the release, what the system runs and what it is doing. We will reply by email with what we would do next.

  • You deal with the people who do the work
  • No obligation, and no upgrade required before we will help
  • We tell you plainly if something is not worth doing

Send an enquiry

We reply by email. If a server is down, say so in the first line. You can also write to help@scoexpert.com.