# Using oammon

The oammon utility enables you to perform the following operations:

- Monitor for board errors and other messages from the OAM system

- Capture these messages in a flat file (oammon.log)

- Send an alert notification message to all NMS OAM client applications

Note: NMS OAM utilities such as oammon can only run if ctdaemon and NMS OAM have been started. Therefore oammon does not log OAM startup information. OAM startup information is logged to the file startup.log. Refer to Logging startup events for information.

To launch oammon, enter oammon at the command line, followed by any command line options. Precede each option with a hyphen (-). If the option includes data, specify the data directly after the option on the command line. Valid options are described in oammon command line options.

When you invoke oammon without command line options, oammon displays an interactive menu and immediately begins logging messages to a file named oammon.log. The oammon interactive menu appears as follows:

'Enter' to output log file tail, based on
current screen output line count
'c' to change screen output line count
(current count is 10)
'p' to poll screen output every 10 seconds
'q' or 'x' to exit

Enter any of the following commands:

Command | Description
--- | ---
c | Changes the number of lines of message that oammon prints to the screen every 10 seconds (the default is ten lines). After entering c, enter a positive integer to indicate the number of lines of message text to print.
p | Prints the last 10 lines of received message text to the screen every 10 seconds. This is a toggle command. The first time you enter p, it enables on-screen polling. The second time you enter p, it disables on-screen polling.
q | Exits oammon.

For oammon to report messages, ctdaemon must be running. (To learn how to start Natural Access in this mode, refer to Starting the Natural Access Server.) If oammon is started before ctdaemon, it displays:

Waiting for CT Access Server...

When oammon is running and ctdaemon starts, oammon displays the interactive menu and begins logging messages to the file oammon.log (located in \nms\oam\log\ under Windows, and /opt/nms/oam/log/ under UNIX or Linux). Each time you start oammon, the previous oammon.log file is moved to oammon.bak, and a new oammon.log file is created for the current session.

Messages reported by oammon include trace messages from managed components in the system. For more information about tracing, refer to the board documentation.

To monitor multiple hosts, start a separate instance of oammon for each host. Each instance monitors one host only.

## oammon command line options

The following table describes the oammon command line options:

Option | Use this option to...
--- | ---
-? | Display a Help screen and terminate.
-h | Display a Help screen and terminate.
-v | Run in verbose mode and return extended board information.
-s messagetext | Send a test alert notification message containing text messagetext to all applications currently monitoring for alert messages (for example, another instance of oammon that is monitoring). oammon then terminates. messagetext can be any string of characters. Applications receive an OAMEVN_ALERT event containing a pointer to an OAM_MSG structure containing the message text. For more information about alert notification, refer to the NMS OAM Service Developer's Reference Manual.
-L | Print logged messages to stdout. This option is recommended for diagnostic purposes only.
-f filename | Log messages to a file named filename and to stdout. This option is ignored unless the -L option is also used.
-@ server | Monitor activity on a resource server, where server is a host name or IP address. If unspecified, oammon monitors the local host on which it was initialized. This option is ignored unless the -L option is also used.