IBM Books

Command and Technical Reference, Volume 1

pfind

Purpose

pfind - Specifies a parallel find of files with a matching expression.

Syntax

pfind [-w - | noderange | 'hostlist args'] find_args

Flags

The pfind command requires the first flag or parameter on the command line to be a specification of the hosts on which the command is to be executed.

-w -
Specifies that host names should be read from standard input. Host names can be in any format accepted by rsh.

Operands

noderange
Indicates a specification via "node number." The node number corresponds to the position of a node in a frame and its slots. A node number indicates frame and slot. For example, frame 1 slot 1 would be referred to by 1. Frame 2 slot 1 would be node number 17, while frame 3 slot 2 would be 34. If a node occupies more than one slot, either node number refers to that node. Node numbers can be specified as ranges such as 1-3, which would refer to frame 1 slots 1-3, or 23-29,50,2, which would refer to frame 2 slots 7-13, frame 4 slot 2, and frame 1 slot 2. This option is only valid for an SP system.

'hostlist args'
Specifies flags and arguments to be passed to the hostlist command. Hostlist allows several ways of listing hosts based on various criteria. Refer to the hostlist command.
Note:
To use the working collective file specified by the WCOLL environment variable, you must specify a null string as the first argument. Refer to the dsh command for more information about a working collective.

find_args
Specifies arguments to the AIX find command.

Description

The pfind command issues the AIX find command on multiple hosts. The output is formatted so that distinct output is displayed only once. The pfind command uses dsh to execute the find command on multiple hosts. The output of the ls commands is written to standard output and formatted. The pfind command is identical to pexec find.

Files

working collective file
See the dsh command.

|Environment Variables

|PSSP 3.4 provides the ability to run commands using secure remote |command and secure remote copy methods.

|To determine whether you are using either AIX rsh or rcp |or the secure remote command and copy method, the following environment |variables are used. |If no environment variables are set, the defaults are |/bin/rsh and /bin/rcp.

|You must be careful to keep these environment variables consistent. |If setting the variables, all three should be set. The DSH_REMOTE_CMD |and REMOTE_COPY_CMD executables should be kept consistent with the choice of |the remote command method in RCMD_PGM: |

|For example, if you want to run pfind using a secure remote |method, enter:

|export RCMD_PGM=secrshell
|export DSH_REMOTE_CMD=/bin/ssh
|export REMOTE_COPY_CMD=/bin/scp

Security

|You must have access to the AIX remote commands or the secure remote |commands to run this command.

This command will automatically forward the DCE credentials if K5 is an enabled AIX authentication method and the user of the command has DCE credentials that can be forwarded. The special DCE credentials for root, called the machine or self host principal credentials, cannot be forwarded. To obtain DCE credentials that can be forwarded as a root user, a root user must issue dce_login -f.

Location

/usr/lpp/ssp/bin/pfind

Related Information

Commands: dsh, find, hostlist, pexec

Examples

To find out if the file elvis is contained in /usr/bin on any host1, host2, and host3 (described previously), enter:

pfind -w host1,host2,host3 /usr/bin -print -name "elvis"
 

pfps

Purpose

pfps - Finds and performs operations on processes on multiple hosts in parallel based on the value of an expression.

Syntax

pfps [-w - | noderange | 'hostlist args'] operation [expression]

Flags

The pfps command requires the first flag or parameter on the command line to be a specification of the hosts on which the command is to be executed.

-w -
Specifies that host names should be read from standard input. Host names can be in any format accepted by rsh.

Operands

noderange
Indicates a specification via "node number." The node number corresponds to the position of a node in a frame and its slots. A node number indicates frame and slot. For example, frame 1 slot 1 would be referred to by 1. Frame 2 slot 1 would be node number 17, while frame 3 slot 2 would be 34. If a node occupies more than one slot, either node number refers to that node. Node numbers can be specified as ranges such as 1-3, which would refer to frame 1 slots 1-3, or 23-29,50,2, which would refer to frame 2 slots 7-13, frame 4 slot 2, and frame 1 slot 2. This option is only valid for an SP system.

'hostlist args'
Specifies flags and arguments to be passed to the hostlist command. Hostlist allows several ways of listing hosts based on various criteria. Refer to the hostlist command.
Note:
To use the working collective file specified by the WCOLL environment variable, you must specify a null string as the first argument. Refer to the dsh command for more information about a working collective.

operation
Must be at least one of the following:

-print
If expression is not specified, all process information is listed. If expression is specified, process information for which the expression is true is listed. Output is in ps auw format.

-kill signal
Causes matching processes to be stopped with the specified signal if the user is authorized or owns the process. The signal can be specified as a number or the name of the signal (for example, HUP).

-nice n
Causes the nice value to be set for matching processes if the user is authorized.

expression
The expression must be at least one of the following:

-n name
Evaluates to true if the fully qualified name of the process matches the name.

-tn name
Evaluates to true if the name of the process matches the name.

-o owner
Evaluates to true if the user name of the process matches the owner.

-pty name
Evaluates to true if the name matches the process controlling terminal.

-rtime hh:mm
Evaluates to true for processes whose total execution time is hh:mm time or longer.

-stime dd:hh:mm
Evaluates to true for processes that have started at least dd days, hh hours, and mm minutes ago.

-r state
Evaluates to true for processes in the specified run state.

-cpu percentage
Evaluates to true for processes using greater than the specified percentage of system CPU.

-mem percentage
Evaluates to true for processes consuming more than the specified percentage of system memory.

-or
Evaluates the expression by ORing together the terms.

Description

The pfps command performs operations on processes on one or more hosts in parallel. These operations include printing information about processes (-print), sending a signal to the process (-kill), and changing the priority of the process (-nice).

Authorization is via an Access Control List (ACL) on each node and is required when users try to kill a process that they do not own or nice a process to a higher priority. ACLs for pfs are contained in the /etc/sysctl.pfps.acl file.

An expression can also be specified using the preceding flags to select processes for when the expression evaluates to true. Flags are ANDed together unless the -or flag is used.

Parentheses can be used to group flags, but parenthesis must be separated from flags by a space. Also, parenthesis or any special shell character should be escaped with a backslash (\).

Since pfps uses sysctl, proper authentication and authorization to issue these commands is necessary.

Files

/etc/sysctl.pfps.acl
The ACL file which authorizes listed principals to use the nice and kill options.

|Environment Variables

|PSSP 3.4 provides the ability to run commands using secure remote |command and secure remote copy methods.

|To determine whether you are using either AIX rsh or rcp |or the secure remote command and copy method, the following environment |variables are used. |If no environment variables are set, the defaults are |/bin/rsh and /bin/rcp.

|You must be careful to keep these environment variables consistent. |If setting the variables, all three should be set. The DSH_REMOTE_CMD |and REMOTE_COPY_CMD executables should be kept consistent with the choice of |the remote command method in RCMD_PGM: |

|For example, if you want to run pfps using a secure remote |method, enter:

|export RCMD_PGM=secrshell
|export DSH_REMOTE_CMD=/bin/ssh
|export REMOTE_COPY_CMD=/bin/scp

Security

Since pfps uses sysctl, proper authentication and authorization to issue these commands is necessary.

Location

/usr/lpp/ssp/bin/pfps

Related Information

Commands: hostlist, kill, nice, ps, renice, sysctl

Examples

  1. To list all processes on all hosts in the SP system, enter:
    pfps '-a' -print
    
  2. To restart daemon processes on host1 and host2 that were running for more than one day (the user must be listed in the /etc/sysctl.pfps.acl on each host or the command is ignored for that host), enter:
    pfps -w host1,host2 -rtime 24:00 -tn daemond -kill HUP
    
  3. To list all processes belonging to root that are using more than 10% of system CPU or 10% of system memory on hosts listed in the ./wcollective file, enter:
    WCOLL=./wcollective pfps '' \( -cpu 10 -or -mem 10 \) -o root -print
    

pls

Purpose

pls - Specifies a parallel list of files and directories.

Syntax

pls [-w - | noderange | 'hostlist args'] ls_args

Flags

The pls command requires the first flag or parameter on the command line to be a specification of the hosts on which the command is to be executed.

-w -
Specifies that host names should be read from standard input. Host names can be in any format accepted by rsh.

Operands

noderange
Indicates a specification via "node number." The node number corresponds to the position of a node in a frame and its slots. A node number indicates frame and slot. For example, frame 1 slot 1 would be referred to by 1. Frame 2 slot 1 would be node number 17, while frame 3 slot 2 would be 34. If a node occupies more than one slot, either node number refers to that node. Node numbers can be specified as ranges such as 1-3, which would refer to frame 1 slots 1-3, or 23-29,50,2, which would refer to frame 2 slots 7-13, frame 4 slot 2, and frame 1 slot 2. This option is only valid for an SP system.

'hostlist args'
Specifies flags and arguments to be passed to the hostlist command. Hostlist allows several ways of listing hosts based on various criteria. Refer to the hostlist command.
Note:
To use the working collective file specified by the WCOLL environment variable, you must specify a null string as the first argument. Refer to the dsh command for more information about a working collective.

ls_args
Specifies arguments to the AIX ls command.

Description

The pls command issues the AIX ls command on multiple hosts. The output is formatted so that duplicate output is displayed only once. The pls command uses dsh to execute the ls command on multiple hosts. The output of the ls commands is written to standard output and formatted. The pls command is identical to pexec ls.

Files

working collective file
See the dsh command.

|Environment Variables

|PSSP 3.4 provides the ability to run commands using secure remote |command and secure remote copy methods.

|To determine whether you are using either AIX rsh or rcp |or the secure remote command and copy method, the following environment |variables are used. |If no environment variables are set, the defaults are |/bin/rsh and /bin/rcp.

|You must be careful to keep these environment variables consistent. |If setting the variables, all three should be set. The DSH_REMOTE_CMD |and REMOTE_COPY_CMD executables should be kept consistent with the choice of |the remote command method in RCMD_PGM: |

|For example, if you want to run pls using a secure remote |method, enter:

|export RCMD_PGM=secrshell
|export DSH_REMOTE_CMD=/bin/ssh
|export REMOTE_COPY_CMD=/bin/scp

Security

|You must have access to the AIX remote commands or the secure remote |commands to run this command.

This command will automatically forward the DCE credentials if K5 is an enabled AIX authentication method and the user of the command has DCE credentials that can be forwarded. The special DCE credentials for root, called the machine or self host principal credentials, cannot be forwarded. To obtain DCE credentials that can be forwarded as a root user, a root user must issue dce_login -f.

Location

/usr/lpp/ssp/bin/pls

Related Information

Commands: dsh, ls, pexec

Examples

To list the contents of /usr from each host1, host2, and host3 (described previously), enter:

pls -w host1,host2,host3 /usr
 

pmanchown

Purpose

pmanchown - Changes the ownership of a user's Problem Management subscriptions.

Syntax

pmanchown
{-d Old_DCE_Principal | -k Old_Kerberos_V4_Principal |
 
{-u Old_AIX_Owner -n Old_AIX_Hostname}}
 
{-D New_DCE_Principal | -K New_Kerberos_V4_Principal |
 
{-U New_AIX_Owner -N New_AIX_Hostname}}

Flags

-d
Specifies the old DCE principal name.

-k
Specifies the old Kerberos Version 4 principal name.

-u
Specifies the old AIX owner name.

-n
Specifies the old AIX hostname.

-D
Specifies the new DCE principal name.

-K
Specifies the new Kerberos Version 4 principal name.

-U
Specifies the new AIX owner name.

-N
Specifies the new AIX hostname.

Operands

None.

Description

Use the pmanchown command to change the ownership of a user's Problem Management subscriptions. The first set of arguments (where the flags are all lowercase letters) identify the old subscription owner. The second set of arguments (where the flags are all uppercase letters) identify the new subscription owner. Note that the -d, -k, and -u flags are mutually exclusive; you cannot identify the old subscription owner by multiple ownership attributes. The -D, -K, and -U flags are also mutually exclusive; you cannot identify the new subscription owner by multiple ownership attributes.

The pmanchown command simply finds all subscriptions belonging to the old owner and transfers the ownership to the new owner. After running the command, the system administrator should refresh all of the pmand daemons in the system partition. If the pmanchown command is run several times in succession, then you can delay refreshing the pmand daemons until after the last invocation of pmanchown.

Security

You must have write access to the SDR to run this command.

Implementation Specifics

This command is part of the IBM Parallel System Support Programs (PSSP) Licensed Program (LP).

Location

/usr/lpp/ssp/bin/pmanchown

Examples

To transfer ownership of all subscriptions which belong to the Kerberos Version 4 principal joe@xyz.com to the DCE principal /.../xyz.com/joe, enter:

pmanchown -k joe@XYZ.com -D /.../xyz.com/joe 

pmanctrl

Purpose

pmanctrl - Controls the Problem Management subsystem.

Syntax

pmanctrl {-a | -s | -k | -d | -c | -t | -o | -r | -h}

Flags

-a
Adds the Problem Management subsystem.

-s
Starts the Problem Management subsystem.

-k
Stops the Problem Management subsystem.

-d
Deletes the Problem Management subsystem.

-c
Deletes the Problem Management subsystem from all system partitions.

-t
Turns tracing on for the Problem Management subsystem.

-o
Turns tracing off for the Problem Management subsystem.

-r
Required by the syspar_ctrl command, but does not do anything.

-h
Displays usage information.

Operands

None.

Description

Problem Management is a general purpose facility for monitoring and reacting to specific event occurrences within the SP system. The pmanctrl command controls the operations of the subsystems that are required for Problem Management. These subsystems are under the control of the System Resource Controller (SRC) and belong to a subsystem group called pman. Associated with each subsystem is a daemon.

An instance of the Problem Management subsystem executes on the control workstation and on every node of a system partition. Because Problem Management provides its services within the scope of a system partition, its subsystems are said to be system partition sensitive. For this reason, the pmanctrl command is normally invoked by the syspar_ctrl command during installation of the system, boot or reboot of individual nodes, and partitioning or repartitioning of the system.

From an operational point of view, the Problem Management subsystem group is organized as follows:

Subsystem:
Problem Management

Subsystem Group:
pman

SRC subsystems:
pman and pmanrm

The pman subsystem is associated with the pmand daemon. The pmanrm subsystem is associated with the pmanrmd daemon.

The subsystem names on the nodes are pman and pmanrm. There is one of each subsystem per node and it is associated with the system partition to which the node belongs.

On the control workstation, there are multiple instances of each subsystem, one for each system partition. Accordingly, the subsystem names on the control workstation have the system partition name appended to them. For example, for system partitions named sp_prod and sp_test, the subsystems on the control workstation are named pman.sp_prod, pman.sp_test, pmanrm.sp_prod, and pmanrm.sp_test.

Daemons:
pmand and pmanrmd

The pmand daemon provides the majority of Problem Management functions.

The pmanrmd daemon provides command-based resource monitor data to the pmand daemon.

The pmanctrl command provides a variety of controls for operating the Problem Management subsystems:

Unless the -c flag is used, the pmanctrl command only operates within a single partition. On a node, the pmanctrl command operates within the system partition to which the node belongs. On the control workstation, the pmanctrl command operates within any single partition, which can be chosen by setting the SP_NAME environment variable.

When the pmanctrl command is called with the -a flag, it uses the mkssys command to add the subsystems to the SRC, and it takes the necessary steps to make sure that the subsystems are automatically started when the node is booted.

When the pmanctrl command is called with the -s flag, it uses the startsrc command to start the pman and pmanrm subsystems.

When the pmanctrl command is called with the -k flag, it uses the stopsrc command to stop the pman and pmanrm subsystems.

When the pmanctrl command is called with the -d flag, it uses the rmssys command to delete the subsystems from the SRC, and if there are no more Problem Management subsystems remaining, it makes sure there is no /etc/inittab entry for the Problem Management subsystem.

When the pmanctrl command is called with the -c flag, it stops all running Problem Management subsystems, removes them all from the SRC, and makes sure there is no /etc/inittab entry for the Problem Management subsystem.

When the pmanctrl command is called with the -t flag, it uses the traceson command to turn on tracing in the pman subsystem. Tracing is not available for the pmanrmd subsystem.

When the pmanctrl command is called with the -o flag, it uses the tracesoff command to turn off tracing in the pman subsystem. Tracing is not available for the pmanrmd subsystem.

While they are running, the Problem Management daemons provide information about their operation and errors by writing entries in a log file that is located in the /var/adm/SPlogs/pman directory. On the control workstation, the pmand daemon writes to a log file named pmand.syspar_name.log, and the pmanrmd daemon writes to a log file named pmanrmd.syspar_name.log, where syspar_name is the name of the system partition. On the nodes, the pmand daemon writes to a log file named pmand.log and the pmanrmd daemon writes to a log file named pmanrmd.log .

Exit Values

0
Indicates the successful completion of the command.

nonzero
Indicates that an error occurred.

Security

You must have root privilege to run this command.

Implementation Specifics

This command is part of the IBM Parallel System Support Programs (PSSP) Licensed Program (LP).

Prerequisite Information

The "Using the Problem Management subsystem" chapter in PSSP: Administration Guide

IBM AIX Commands Reference

Information about the System Resource Controller (SRC) in IBM AIX General Programming Concepts: Writing and Debugging Programs

Location

/usr/lpp/ssp/bin/pmanctrl

Related Information

PSSP commands: syspar_ctrl

AIX commands: mkssys, rmssys, startsrc, stopsrc

Examples

  1. To add the Problem Management subsystem to the SRC, enter:
    pmanctrl -a
    
  2. To start the Problem Management subsystem, enter:
    pmanctrl -s
    
  3. To stop the Problem Management subsystem, enter:
    pmanctrl -k
    
  4. To delete the Problem Management subsystem from the SRC, enter:
    pmanctrl -d
    
  5. To clean up the Problem Management subsystem on all system partitions, enter:
    pmanctrl -c
    
  6. To turn tracing on for the Problem Management daemon, enter:
    pmanctrl -t
    
  7. To turn tracing off for the Problem Management daemon, enter:
    pmanctrl -o
    

pmandef

Purpose

pmandef - Defines events and resulting actions to the Problem Management subsystem.

Syntax

To subscribe to an event and associate a set of actions with that event, use the following:

pmandef
-s HandleName -e ResourceVariable:ResourceIdentifier:Expression
 
[-r RearmExpression] [-i] [-c EventCommand ] [-C RearmCommand]
 
[-t EventTrapid] [-T RearmTrapid] [ -l EventLogText]
 
[-L RearmLogText] [-x EventCmdTimeout]
 
[-X RearmCmdTimeout ] [-U UserName ] [-m UserLabel ]
 
[-h {Host1[,Host2,...] | - | local} | -N NodeGroup | -n NodeRange]

To deactivate or activate a Problem Management subscription, use the following:

pmandef
{-d | -a} HandleName [-h {Host1[, Host2,...] | -} |
 
-N NodeGroup | -n NodeRange]

or

pmandef
{-d | -a} all

To query or remove a Problem Management subscription, use the following:

pmandef
{-q | -u} { HandleName | all}

Flags

Flags that specify the type of request follow:

-s HandleName
Specifies that this is a subscribe request and the remaining flags define the Problem Management subscription. The HandleName provides a means to identify this subscription to Problem Management using the -d, -a, -u, or -q flags. The all keyword cannot be used as a handle name for a subscribe request.

-d {HandleName | all}
Specifies that the actions associated with the subscription identified by HandleName should be turned off or deactivated. The all keyword deactivates all subscriptions owned by the user. The -h, -N, and -n flags cannot be used with the all keyword on a deactivate request.

-a {HandleName | all}
Specifies that the actions associated with the subscription identified by HandleName should be turned on or activated. The all keyword activates all subscriptions owned by the user. The -h, -N, and -n flags cannot be used with the all keyword on an activate request.

-u {HandleName | all}
Specifies that this is an unsubscribe request and the subscription identified by HandleName should be removed. The all keyword unsubscribes all subscriptions owned by the user.

-q {HandleName | all}
Requests all of the Problem Management daemons, for which the subscription identified by HandleName is defined, to provide status about the named subscription. The all keyword queries all subscriptions owned by the user.

Flags that specify the hosts to be affected by the request follow:

-h {Host1[,Host2 ,...] | - | local}
For a subscribe request, specifies the hosts that belong to the subscription. For an activate or deactivate request, specifies the hosts to be activated or deactivated, which can only include hosts that belong to the subscription. The hosts may be specified as a comma-separated list of host names or the hyphen (-) may be used to indicate that host names are to be read from standard input, or the local keyword may be used to indicate that the list of hosts is to be obtained from the NodeNum field in the event instance vector. Use of the local keyword also causes any resulting actions to occur on the same host where the event occurs. All specified hosts must reside in the same system partition. The local keyword is not allowed for an activate or deactivate request.

-N NodeGroup
For a subscribe request, specifies the node group that contains all of the hosts that belong to the subscription. For an activate or deactivate request, specifies the node group that contains all of the hosts to be activated or deactivated, which can only include hosts that belong to the subscription. All specified hosts must be in a partitioned-bound node group.

-n NodeRange
For a subscribe request, specifies the node range that contains all of the hosts that belong to the subscription. For an activate or deactivate request, specifies the node range that contains all of the hosts to be activated or deactivated, which can only include hosts that belong to the subscription. A node range is a series of numbers that are separated by commas and hyphens, which indicate a set of node numbers, such as 0-3,5,8-10. All specified hosts must reside in the same system partition.

Flags that define a Problem Management subscription follow:

-e ResourceVariable:ResourceIdentifier:Expression
Specifies the Event Management resource variable, resource identifier and expression that define the event for which actions are generated for this Problem Management subscription. Refer to IBM RS/6000 Cluster Technology: Event Management Programming Guide and Reference for further information about Event Management event definitions.

-r RearmExpression
Specifies the Event Management re-arm expression, which together with the resource variable, resource identifier and expression specified by the -e flag, defines the re-arm event for which actions are generated for this Problem Management subscription. Refer to IBM RS/6000 Cluster Technology: Event Management Programming Guide and Reference for further information about Event Management event definitions.

-i
Specifies that the Problem Management subsystem should not request an immediate evaluation of the event defined by the -e flag, when the event is registered with the Event Management subsystem. After it receives the event registration, Event Management must wait until the next observation of the resource before it may generate events for the event registration that belongs to this subscription. If you do not specify the -i flag, Event Management may generate an event based on the current value of the resource, even if the resource value has not changed recently. This flag is ignored by the Problem Management subsystem on hosts running PSSP releases older than PSSP 3.1.

-c EventCommand
Specifies a command to be executed when the event defined by the -e flag occurs. The command will be interpreted by the user's login program, so EventCommand may contain additional arguments and shell metacharacters. For example:
echo this is a test >/tmp/event.out

is allowed.

-C RearmCommand
Specifies a command to be executed when the re-arm event defined by the -r flag occurs. The command will be interpreted by the user's login program, so RearmCommand may contain additional arguments and shell metacharacters. For example:
echo this is a test >/tmp/rearm.out

is allowed.

-t EventTrapid
Specifies that a Simple Network Management Protocol (SNMP) trap should be sent when the event defined by the -e flag occurs. EventTrapid is the specific trap ID to be used.

-T RearmTrapid
Specifies that an SNMP trap should be sent when the re-arm event defined by the -r flag occurs. RearmTrapid is the specific trap ID to be used.

-l EventLogText
Specifies text that should be written to the AIX error log and BSD syslog when the event defined by the -e flag occurs.

-L RearmLogText
Specifies text that should be written to the AIX error log and BSD syslog when the re-arm event defined by the -r flag occurs.

-x EventCmdTimeout
Specifies a time limit in seconds for the command specified by the -c flag. If the command does not complete within EventCmdTimeout seconds, it will be sent a SIGTERM signal. If the command does not terminate after an additional 5 seconds, the SIGTERM signal will be followed by a SIGKILL signal. If the -x flag is not specified, the command runs until completion.

-X RearmCmdTimeout
Specifies a time limit in seconds for the command specified by the -C flag. If the command does not complete within RearmCmdTimeout seconds, it will be sent a SIGTERM signal. If the command does not terminate after an additional 5 seconds, the SIGTERM signal will be followed by a SIGKILL signal. If the -X flag is not specified, the command runs until completion.

-U UserName
Specifies the user to run the commands specified by the -c and -C flags. If the -U flag is omitted, the commands will run as the user who issued the subscribe request.

-m UserLabel
Specifies a tag to associate with the subscription. The Problem Management subsystem does not use this tag for anything, so the user can specify anything as a tag. The tag can be retrieved with the pmanquery command.

Operands

None.

Description

The Problem Management subsystem allows you to specify that an action takes place as the result of a specific event occurrence within the SP system. The Problem Management subsystem registers for the event with the Event Management subsystem. When the Event Management subsystem reports the occurrence of the event back to Problem Management, the Problem Management subsystem performs the requested action on your behalf. The actions that are performed as the result of an event can be any or all of the following:

The pmandef command is the command line interface for making such requests to the Problem Management subsystem. For example, running the following command on node 5:

pmandef -s Program_Monitor \
-e 'IBM.PSSP.Prog.pcount:NodeNum=12;ProgName=mycmd;UserName=bob:X@0==0' \
-r "X@0==1" -c "echo program has stopped >/tmp/myevent.out" \
-C "echo program has restarted >/tmp/myrearm.out"

causes the command echo program has stopped >/tmp/myevent.out to run on node 5 whenever the number of processes named "mycmd" and owned by user "bob" on node 12 becomes 0. When this number increases back to 1, the command echo program has restarted >/tmp/myrearm.out runs on node 5.

If you do not want the command to run on the same node from which the pmandef command was issued, then use one of the -h, -N , or -n flags.

The following example causes the commands to run on both k21n01 and k21n02 whenever bob's program dies or gets restarted on either nodes 12 or 13.

pmandef -s Program_Monitor \
-e 'IBM.PSSP.Prog.pcount:NodeNum=12-13;ProgName=mycmd;UserName=bob:X@0==0' \
-r "X@0==1" -c /usr/local/bin/start_recovery \
-C /usr/local/bin/stop_recovery -h k21n01,k21n02

The following example causes the commands to run on nodes 1, 2, 3, and 7 whenever bob's program dies or gets restarted on any of nodes 1, 2, 3, 4, 5, or 13. If bob's program dies on node 4, the command /usr/local/bin/start_recovery runs on nodes 1, 2, 3, and 7.

pmandef -s Program_Monitor \
-e 'IBM.PSSP.Prog.pcount:NodeNum=1-5,13;ProgName=mycmd;UserName=bob:X@0==0' \
-r "X@0==1" -c /usr/local/bin/start_recovery \
-C /usr/local/bin/stop_recovery -n 1-3,7

If you want to define a subscription for more than one node but you want the command to run only on the same node where the event occurs, use the -h local option. Consider the following command:

pmandef -s Filesystem_Monitor \
-e 'IBM.PSSP.aixos.FS.%totused:NodeNum=10-14;VG=myvg;LV=mylv:X>95' \
-l "filesystem is almost full" -h local

Whenever the file system associated with the " mylv" logical volume and " myvg" volume group on node 11 becomes more than 95 percent full, the text filesystem is almost full gets written to the AIX error log and BSD syslog only on node 11. Whenever the same thing occurs on node 12, the same text gets written to the AIX error log and BSD syslog only on node 12. The file system filling up on node 11 is really a separate event than the file system filling up on node 12 or node 13, and the -h local option is just a convenient way to define actions for several events at the same time.

Issuing the pmandef command with the -s flag to associate an action with an event creates a Problem Management "subscription." When you issue the pmandef command to create a Problem Management subscription, the definition of the subscription gets stored in the System Data Repository (SDR) so the definition becomes permanent. As soon as the subscription gets stored in the SDR, the pmandef command also requests the affected Problem Management daemons within the SP system to start acting on the new subscription. Since it is possible for some of the nodes affected by this to be down, the pmandef command is considered successful once the subscription is stored in the SDR. The inability to reach all of the affected Problem Management daemons is not considered to be an error, because they will eventually pick up the new subscription once they get restarted.

If the Event Management resource variable, resource identifier, expression, or re-arm expression contains an error, the error will not get discovered until the Problem Management daemon registers for the event with the Event Management subsystem. When this happens, the subscription definition does not automatically get removed from the SDR. You must remove the subscription by using the pmandef command with the -u flag. The argument to the -u flag is the same name that was previously specified as the argument to the -s flag.

The pmandef command with the -u flag removes the subscription definition from the SDR and tells the appropriate Problem Management daemons to stop monitoring for the event associated with that subscription. The pmandef command with the -d can be used to turn off or "deactivate" a subscription. This also tells the appropriate Problem Management daemons to stop monitoring for the event associated with that subscription, but it does not remove the subscription definition from the SDR. The subscription remains deactivated until you call pmandef with the -a flag to "activate" the subscription. You can also use the pmandef command with the -q flag to query the appropriate Problem Management daemons for status about a subscription. This just tells you whether each daemon is currently monitoring for the event associated with that subscription.

The pmandef command requires the user to have Problem Management access on the local node to make the necessary changes to the SDR. If the user does not have Problem Management access on the local node, the command will be unsuccessful. The user should also have Problem Management access on the nodes that are affected by the subscription for the Problem Management daemons on those nodes to dynamically process the request. If the user does not have Problem Management access to any of these nodes, the Problem Management daemons on these nodes will not process the request until the next time they are restarted or refreshed. See the "Using the Problem Management subsystem" chapter in PSSP: Administration Guide for information on obtaining Problem Management access in each of the supported PSSP trusted services security configurations.

When a new subscription is created using the pmandef -s command, the user's current security context is used to establish ownership of the subscription. Modifications to the subscription using the pmandef command with the -u, -d and -a flags are only allowed by a user who can be identified as the owner of the subscription. See the "Using the Problem Management subsystem" chapter in PSSP: Administration Guide for a complete description of subscription ownership in all of the supported PSSP trusted services security configurations. Subscription ownership is also used to decide whether the action that results from an event should be allowed.

After the Problem Management daemon receives notification that an event has occurred, and before it performs the action for that event, the Problem Management daemon checks to see whether the subscription owner is authorized to perform the requested action on the node where the Problem Management daemon is running. If the requested action is an entry in the AIX error log and BSD syslog or the generation of an SNMP trap, the subscription owner must have |AIX remote commands access to the node as the root user. If the requested action is execution of a command, the subscription owner must have |AIX remote commands access to the node as the command user. The command user is by default the same user who issued the pmandef -s command to create the subscription. A different user can be specified to pmandef by using the -U flag. See the "Using the Problem Management subsystem" chapter in PSSP: Administration Guide for a complete description of obtaining |AIX remote commands access.

Exit Values

0
Indicates the successful completion of the command.

1
Indicates the successful completion of the command, but the output contains a warning message.

2
Indicates that the command was unsuccessful.

Security

You must have Problem Management access to run this command.

You must have the appropriate |AIX remote commands access for requested actions to be executed in response to events.

Implementation Specifics

This command is part of the IBM Parallel System Support Programs (PSSP) Licensed Program (LP).

Prerequisite Information

IBM RS/6000 Cluster Technology: Event Management Programming Guide and Reference

The "Using the Problem Management subsystem" chapter in PSSP: Administration Guide

Location

/usr/lpp/ssp/bin/pmandef

Related Information

Commands: pmanquery, sysctl

Examples

In this example, a user issues the command:

pmandef -s Program_Monitor \
 
-e 'IBM.PSSP.Prog.pcount:NodeNum=12;ProgName=mycmd;UserName=relish:X@0==0' \
-r "X@0==1" -c /usr/local/bin/start_recovery \
-C /usr/local/bin/stop_recovery -n 5 -U ketchup

A subscription named "Program_Monitor" will be created on the local node if the user has Problem Management access. The requested actions for this subscription are for node 5, so the user must also have Problem Management access on node 5, in order for the Problem Management daemon on node 5 to act on this subscription immediately. Otherwise, the Problem Management daemon will not act on this subscription until the next time it gets restarted.

This subscription requests that whenever the number of processes named "mycmd" and owned by user relish on node 12 becomes 0, the command start_recovery will run on node 5. When the number of processes increases back to 1, the command stop_recovery will run on node 5. The subscription also requests that the commands start_recovery and stop_recovery are to run on node 5 as the user ketchup.

Once the subscription is created, any user who can be identified as the subscription owner can deactivate, activate, or remove this subscription.

To deactivate, enter:

pmandef -d Program_Monitor

To activate, enter:

pmandef -a Program_Monitor

To remove, enter:

pmandef -u Program_Monitor

pmanquery

Purpose

pmanquery - Queries the System Data Repository (SDR) for a description of one or more Problem Management subscriptions.

Syntax

pmanquery
-n {HandleName | all} [-q] [-k {KerberosV4Principal | all}]
 
[-p {DCEPrincipal | all}] [-U {AIXUsername | all} -H {Hostname | all}] [-a | -d | -t | -x]

Flags

Flags that specify the scope of the search follow:

-n {HandleName | all}
Searches for Problem Management subscriptions with the specified handle name that was previously given as the argument to the -s flag of the pmandef command. The all keyword allows any handle name to be selected by the search of the SDR. The all keyword cannot be used in conjunction with the -a, -d, or -t flags.

-k {KerberosV4Principal | all}
Searches for Problem Management subscriptions owned by the specified Kerberos Version 4 principal. The all keyword allows any Kerberos Version 4 principal to be selected by the search of the SDR. The all keyword cannot be used in conjunction with the -a, -d, or -t flags.

-p {DCEPrincipal | all}
Lists Problem Management subscriptions owned by the specified DCE principal. The all keyword allows any DCE principal to be selected by the search of the SDR. The all keyword cannot be used in conjunction with the -a, -d, or -t flags.

-U {UserName | all}
Lists Problem Management subscriptions owned by the specified AIX username. The all keyword allows any AIX user name to be selected by the search of the SDR. The all keyword cannot be used in conjunction with the -a, -d, or -t flags. The -U and -H flags may only be used together to specify an AIX username and hostname combination.

-H {Hostname | all}
Lists Problem Management subscriptions owned by the specified hostname. The all keyword allows any hostname to be selected by the search of the SDR. The all keyword cannot be used in conjunction with the -a, -d, or -t flags. The -U and -H flags may only be used together to specify an AIX username and hostname combination.

Flags that format the output follow:

-q
Suppresses the output of the header line.

-a
Lists output by node numbers in column format that represent the set of nodes that have not "deactivated" the subscription identified by the -n flag. The all keyword cannot be used with the -n, -k, -p, -U or -H flags when -a is used.

-d
Lists output by node numbers in column format that represent the set of nodes that have "deactivated" the subscription identified by the -n flag. The all keyword cannot be used with the -n, -k, -p, -U or -H flags when -d is used.

-t
Lists output by node numbers in column format that represent the set of all nodes that recognize the subscription identified by the -n flag. This is the sum of the node lists that get printed by the -a and -d flags. The all keyword cannot be used with the -n, -k, -p, -U or -H flags when -t is used.

-x
Adds three additional fields to the output: pmTotalNodeList, pmActivatedList and pmDeactivatedList. These fields each represent a set of node numbers as a series of hexadecimal digits which form a bitmask, where the rightmost bit position represents node 0, and the node numbers increase as you shift to the left. If the bit position for a node number is "on", the node number belongs to the set. Otherwise, the node number does not belong to the set. For example, the bitmask "05" represents the set of nodes 0 and 2. The bitmask "1c93" represents the set of nodes 0, 1, 4, 7, 10, 11 and 12. The pmTotalNodeList, pmActivatedList and pmDeactivatedList fields use this format to represent the same sets of node numbers that would be printed by the -t, -a, and -d flags respectively. The advantage to using the -x flag is that it enables an application to retrieve all of the data that describe a Problem Management subscription without having to run pmanquery multiple times.

Operands

None.

Description

After a Problem Management subscription definition is stored in the SDR by the pmandef command, you can use the pmanquery command to retrieve the subscription definition. The pmanquery command prints the details of the subscription definition in raw format which can then be parsed by other applications.

The -n, -k , -p, -U and -H flags control the scope of the search for subscriptions in the SDR. If none of the -k, -p, -U or -H flags is specified, the pmanquery command searches for Problem Management subscriptions that are owned by the end user, based on the end user's current security context. See the "Using the Problem Management subsystem" chapter in the PSSP: Administration Guide for a complete description of the user's security context as in pertains to Problem Management. Refer to the Examples section for pmanquery flag usage information.

Implementation Specifics

This command is part of the IBM Parallel System Support Programs (PSSP) Licensed Program (LP).

Prerequisite Information

The "Using the Problem Management subsystem" chapter in PSSP: Administration Guide

Location

/usr/lpp/ssp/bin/pmanquery

Related Information

Commands: pmandef

Examples

  1. To search for a subscription named my_handle that is owned by the end user, enter:
    pmanquery -n my_handle
    
  2. To search for a subscription named my_handle that is owned by the Kerberos Version 4 principal hotdog@XYZ.COM, enter:
    pmanquery -n my_handle -k hotdog@XYZ.COM
    
  3. To search for all subscriptions that are owned by the Kerberos Version 4 principal hotdog@XYZ.COM, enter:
    pmanquery -n all -k hotdog@XYZ.COM
    
  4. To search for all subscriptions that are owned by the end user, enter:
    pmanquery -n all
    
  5. To search for all subscriptions named my_handle, enter:
    pmanquery -n my_handle -k all -p all -U all -H all
    
  6. To search for all subscriptions, enter:
    pmanquery -n all -k all -p all -U all -H all
    


[ Top of Page | Previous Page | Next Page | Table of Contents | Index ]