Solstice AdminSuite 2.3 Administration Guide

How to Monitor Software Usage Using a Shell Script Wrapper

  1. Using the editor of your choice, open the shell script to which you wish to add the software usage monitoring commands.

  2. Before the program executable command line in the script, add the following swu_rpt command line.


    swu_rpt -p product name [-I identifier] [-s server] [-a attr1=val1, attr2=val2,...] -b
    

    In this command,

    -p product-name

    Indicates the name of the product that software usage is being recorded for; this option must always be included. 

    -I identifier

    Specifies a unique, alpha numeric identifier for usage records; swu_rpt will provide its own identifier if one is not specified.

    -s server

    Specifies the server to which the usage records are to be sent. The default is the host aliased to swusage_host.

    -a attr1=val1, attr2=val2,...

    Allows the user to give the software usage entry unique or more descriptive information.  

    -b

    Indicates that a begin entry should be recorded. 

  3. After the program executable in the script, add the following swu_rpt command.


    swu_rpt -p product-name [-I identifier] [-s server] [-a attr1=val1, attr2=val2,...] -e
    

    In this command,

    -p product-name

    Indicates the name of the product that software usage is being recorded for; this option must always be included. 

    -I identifier

    Specifies a unique, numerical identifier for usage records; swu_rpt will provide its own identifier if one is not specified.

    -s server

    Specifies the server to which the usage records are to be sent. The default is the host aliased to swusage_host.

    -a attr1=val1, attr2=val2,...

    Allows the user to give the software usage entry unique or more descriptive information.  

    -e

    Indicates that an end entry should be recorded. 

  4. Exit the script, saving your changes. Verify that the script is executable.

Example of Monitoring Software Usage Using a Shell Script Wrapper

The following example shows the software usage monitoring commands added to a shell script called dir_script that lists the directory in which it was called, the files in the directory, and the current date and time.


swu_rpt -p dir_script -I 295833 -s sherlock -a \
"Command1=pwd,Command2=ls,Options=-la,Command3=date" -b
pwd
ls -la
date
swu_rpt -p dir_script -I 295833 -s sherlock -a \
"Command1=pwd,Command2=ls,Command3=date" -e 

In this example, two software usage report entries are created and look like the following.

Report Entry 1 

 

Report Entry 2 

 

Type

Admin/Usage

Type

Admin/Usage

Product

dir_script

Product

dir_script

SubType

begin

SubType

end

Time

8444845890

Time

8444845892

UserID

30581

UserID

30581

User

jod

User

jod

Host

buck

Host

buck

Domain

forest.field.com

Domain

forest.field.com

HostID

1234567890

HostID

1234567890

Locale

C

Locale

C

Version

1

Version

1

Usage Server

sherlock

Usage Server

sherlock

RecordID

295833

RecordID

295833

C_Command1

pwd

C_Command1

pwd

C_Command2

ls

C_Command2

ls

C_Options

-la

C_Command3

date

C_Command3 

date