SunScreen 3.2 Administrator's Overview

Displaying and Creating Log Macros

Log macros are actually a derivative of the general SunScreen variable mechanism. Therefore, the variable naming and value structures exist for log macros, namely:

Log macros are configured in the registry using the logmacro edit subcommand of ssadm. For group-Screen installations, they are configured on the primary Screen.


Note -

You do not have to save a log macro to use it; it is saved when it is created. However, to propagate log macro definitions from a primary Screen to secondaries, you must activate the configuration.


Examples: Log Macros on the Primary Screen

The following are examples of using log macros while logged into the primary Screen.

To display the definition of a non-Screen specific macro:


admin% ssadm -r primary edit Initial
edit> logmacro print name=mail-only
NAME="mail-only" ENABLED VALUE="svc smtp" DESCRIPTION="SMTP mail" ...

To define a non-Screen specific macro:


admin% ssadm -r primary edit Initial
edit> logmacro add name=pkts-only value="loglvl pkt" Description="only network packets"
edit> quit

To define a macro for a specific Screen:


admin% ssadm -r primary edit Initial
edit> logmacro add sys=Screenname name=SFO value="port SFO" description="routing SFO" 
edit> quit

Note -

Although, the output produced by print surrounds the value of each item in double quotes, these are only necessary on input if there are embedded spaces within the values of items. Also, although print outputs all tag names in capital letters (for example, NAME=), these tags are recognized in a case-insensitive manner on input (for example, name=, Name=, NAME= are equivalent.)


You can create expediency log macros on any Screen using logmacro as a subcommand of ssadm (rather than an ssadm edit subcommand). The syntax of the rest of the usage is the same as given above.

Examples: Log Macros on the Secondary Screen

The following are examples of using log macros while logged into the secondary Screen.

To display the definition of a non-Screen-specific macro:


admin% ssadm -r secondary logmacro print name=mail-only
NAME="mail-only" ENABLED VALUE="svc smtp"
DESCRIPTION="SMTP mail" ...

To define a macro for a specific Screen:


admin% ssadm -r secondary logmacro add sys=secondary 
name=SFO-routing value="port rip src SFO-routers" 
description="routing activity in SFO district"

Caution - Caution -

Do not define log macros on secondary Screens which are not Screen-specific.