NAME

device_mgr - Device Manager, used to create, remove and manipulate Device objects and their attributes


MODULE

base


SYNOPSIS

device_mgr [--help] [--man] [--db connectstring] [--new <names...> [--collection <name>]] [--copy <from> <to> [--collection <name>]] [--destroy <names...> [--cleanup]] [--find] [--diff <name1> <name2>]

  [(--add|--subtract|--remove) <item>]...
    [--overlays <name>]
  [--set|--get|--remove] <items>...
    [--<attr> [<value>]]
    [--interface (<nicnum>|all)
      [--name <ifname>]
      [--hostname <hostname>]
      [--address <ipaddress>]
      [--mac_address <macaddr>]
      [--net_mask <netmask>]
      [--gateway <ipaddress>]
      [--is_primary (0|1)]
      [--server_if (0|1)]
      [--nolaod (0|1)]
      [--mtu <bytes>]
      [--boot_if (0|1)] ]
      [--switch <devname> [--switch_port <port string>]]
    [--power [<dev>]
      [--power_port <num>]
      [--power_via_port <num>] ]
    [--console [<dev]
      [--console_port <num>]
      [--console_via_port <num>] ]
    [--disk all]
    [--disk <device> --partition <num>
      [--mountpoint <dir>]
      [--size <Gbytes>]
      [--fstype <name>]
      [--raid-level <num>]
      [--chunk-size <kbytes>]
      [--spare-disks <num_spares>]
      [--devices <dev1>,<dev2>,<dev3>,...]
      [--server <name> --path <dir>]
      [--options <mount opts>]
  [--all]
  [--force]
  [--flat|--table|--keyedtable]


DESCRIPTION

This tool is used to manage Device objects in the CIToolkit configuration database. It can be used to create new Devices, remove existing ones, or set, change or remove their attributes.

When retrieving existing attributes (with --get), results are displayed in a multi-line format by default. This can be changed to a single-line format (suitable for copy-and-paste back into a device_mgr --set command) by using the --flat option. Results can also be displayed more compactly using the --table and --keyedtable options.

device_mgr must be passed the name of an existing Device object, or the name of a collection which contains Device objects, or the name of a new Device to create.


OPTIONS

For complete usage information: "device_mgr --help" "device_mgr --get --help" "device_mgr --set --help" ...etc...

-new <names...> Create a new Device object and add it to the database. May be used with --type and --collection.

--copy <from> <to> Create a new Device object with the same attributes as an existing one. May be used with --type and --collection.

--type <name> When creating a Device object with either --new or --copy, change the object type (class) of the new object. Any attributes in the old object not supported by the new type will be dropped.

--collection <name> When createing a new Device with either --new or --copy, also add the new object to the specified existing collection.

--find List all Device objects in the database. Might be slow for very large databases as every object must be fetched and checked to see if it is an alias. (may not be combined with other options)

--classes [<name>], --types [<name>] List the types of objects that are supported by this tool, as well as shortcut names may be used with the --type option. You may optionally specify a class to display the subclasses of.

--methods [<class>] Display the methods implemented by the Device class, or specify a particular class of which to view method information, including parent classes.

--get <names...> Display information about existing Device objects. This is the default action. Run "device_mgr --get --help" for details on how to get specific attributes.

--flat Used with --get, print output in flat form appropriate to combine with other unix or CIT commands

--set <names...> Change attributes for existing Device objects. Run "device_mgr --set --help" for details on how to set specific, possibly complex, attributes.

--remove <names...> Remove attributes from existing Device objects. Run "device_mgr --remove --help" for more information.

--add <names...> Change list attributes for existing Device objects by adding an item to the attribute. Run "device_mgr --add --help" for more information.

--subtract <names...> Change list attributes for existing Device objects by removing an item from the attribute. Run "device_mgr --sub --help" for more information.

--destroy <names...> Remove the existing Device object or objects from the database. If it was part of any collections, or referenced by any Aliases, then a warning of dangling references will be reported.

--cleanup Used with --destroy, remove all references (Aliases or Collection membership) to the removed Device, instead of warning about dangling references.

--diff <name1> <name2> Display the differences between two Device objects. (may not be combined with other options)

--db <connectstring> Database type and connection information. For GDBM, "GDBM:" followed by the filename of the cluster database to use. For LDAP, the syntax is "LDAP:host:port:dbname"

--help Print extended usage information.

--man Print this manpage.


NOTES

device_mgr can be used to access virtually any simple key/value attribute. More complex attributes like interface, power, and console are also supported. Additional complex attributes are NOT supported and should be managed by accessing the object directly.


FILES

The default paths for location of the cluster configuration database, cloned directories, supporting libraries, and other settings are recorded in the CConf.pm config file. Set the environment variable CLUSTER_CONFIG to the location of CConf.pm, or use the default of /cluster/config


SEE ALSO

alias_mgr, collection_mgr, db_mgr, lookup