Solstice AdminSuite 2.3 Administration Guide

Printing Software Usage Data from the Master Log File

After the software usage data has been moved from the local queue to the master log file on the host server, you may want to print the information in the master log file to another file, stdout (screen), or printer.

The software usage record entries are not formatted in the master log file. The swu_print command moves and formats the software usage report entries in the master log file to another file or the standard output device. Three options can be used with the swu_print command to format the entries differently.

The options available with the swu_print command are listed in Table 13-2, along with an example of how the software usage report entries are formatted with the associated option.

Table 13-2 swu_print Options

Option 

Format Example 

 

 

-a

PRODUCT 

maker 

vi 

SUBTYPE 

Begin 

Begin 

TIME  

Feb 26 17:08:17 

Feb 27 19:09:19 

 RECORD_ID IDstring IDstring

USER 

jod 

jad 

 HOST sherlock holmes

-d

TYPE=Admin/Usage 

Product=maker 

SubType=Begin 

Time=819653293 

UserID=49740 

User=jod 

Host=buck 

Domain=field.forest.com 

HostID=55003efc 

Locale=C 

Version=1 

Server=sherlock 

RecordID=IDString 

 

 

-s

PRODUCT 

maker 

vi 

TIME 

01:31:47  

19:09:19  

USER 

jod 

jad 

HOST 

buck 

doe 

Formatting these entries enables you to use awk or another search tool to search on keywords; formatting also enables you to easily translate the entries into another database or report.


Note -

swu_print does not delete the software usage report entries from the master log file. In order to get rid of these entries, you must delete the master log file. Otherwise, entries are appended to the software usage report entries that you already copied out using the swu_print command. This could result in your file system becoming full; see "How to Remove the Master Log File" for information about how to safely remove this file.


The report entries created by the software usage monitoring system vary depending upon the command used to generate the entry; however, all entries have some fields that will always appear. Table 13-3 provides a list of all possible report entries, along with a description of each entry, and a list of when the entry is used.

Table 13-3 Report Entries

Field 

Possible Entries 

Description 

When Used 

Type

Admin/Usage 

Indicates the record is a system administration, software usage entry. 

Always 

Product

Varies 

Indicates the product name (or program name) of the software that is being logged; specified with the swu_rpt command or function.

Always 

User

Varies 

Indicates the user who ran the software. The entry will indicate the user's login name. 

Always 

SubType

Begin 

Intended to indicate that the software associated with this record has begun execution at the indicated time. 

swu_rpt command options -b or -c

 

End 

Intended to Indicate that the software associated with this record has ended execution at the indicated time. 

swu_rpt command options -e or -c

 

Install 

Intended to indicate that the software associated with this record has been installed. 

swu_rpt command -i option

 

Enable Queue 

Indicates that the local swu_queue has been enabled.

swu_queue command -e option

 

Disable Queue 

Indicates that the local swu_queue has been disabled.

swu_queue command -d option

Time

Varies 

Indicates the time the software began execution, ended execution, or was installed. The value indicates the value of time in seconds since 00:00:00 UTC January 1, 1970. 

Always 

UserID

Varies 

Indicates the user ID of the user who ran the software. 

Always 

Host

Varies 

Indicates the name of the workstation or server that the program or command was run on. 

Always 

Domain

Varies 

Indicates the name service domain that the host resides in. 

Always 

HostID

Varies 

Indicates the hardware serial number of the host workstation or server. 

Always 

 

Locale 

Varies 

Indicates the current value of the LANG environment variable. 

Always 

Version 

Varies  

Indicates the software usage monitoring version (specified by the software usage monitoring program). 

Always 

Usage Server 

Varies 

Indicates the software usage server to which usage entries are to be sent. 

Always 

RecordID 

Varies 

Indicates a unique, numerical ID that is specified with the swu_rpt command; if no identifier is specified, the parent process ID process and time is used as the default. 

Always 


Note -

If the field variable is not set, ?? would be the entry for the field variable because software usage monitoring could not determine its value.


To copy and format the software usage monitoring report entries in the master log file to another file or the standard output device, you need to perform the following procedure.

How to Print Software Usage Data from the Master Log File

  1. Log in to the software usage monitoring host server.

  2. Open a command tool and enter the swu_print command.


    $ swu_print [-a|-d|-s] [-f filename] [-l log_file]

    In this command,

    -a

    Specifies the format swu_print is to use (default - all). Refer to Table 13-2for format examples.

    -d

    Specifies the format swu_print is to use (dump). Refer to Table 13-2 for format examples.

    -s

    Specifies the format swu_print is to use (summary). Refer to Table 13-2 for format examples.

    -f filename

    Specifies the file to which information in the log file will be directed. 

    -l log_file

    Specifies the master log file. If this option is not specified, the default file /opt/SUNWswusg/swusage.log is used.