System Administration Guide: Network Interfaces and Network Virtualization

ProcedureHow to Generate Machine Parseable Output of the ipmpstat Command

You can generate machine parseable information by using the ipmpstat -P syntax. The -P option is intended to be used particularly in scripts. Machine-parseable output differs from the normal output in the following ways:

To correctly use the ipmpstat -P syntax, observe the following rules:

Ignoring either one of these rules will cause ipmpstat -P to fail.

  1. To display in machine parseable format the group name, the failure detection time, and the underlying interfaces, you would type the following:

    $ ipmpstat -P -o -g groupname,fdt,interfaces
    itops0:10.00s:subitops0 subitops1
    acctg1::[hme0 hme1]
    field2:20.00s:fops0 fops3 (fops2) [fops1]

    The group name, failure detection time, and underlying interfaces are group information fields. Thus, you use the -o -g options together with the -P option.

Example 8–8 Using ipmpstat -P in a Script

This sample script displays the failure detection time of a particular IPMP group.

getfdt() {
         ipmpstat -gP -o group,fdt | while IFS=: read group fdt; do
             [[ "$group" = "$1" ]] && { echo "$fdt"; return; }