NAME

netdb - Create, Modify or Delete NetDB Records


SYNOPSIS

netdb node admin --add admin, ... --remove admin, ... [ --input file | node ... ]

netdb node alias --add alias, ... --remove alias, ... name

netdb node comment [ --set comment | --clear ] [ --input file | node ... ]

netdb node custom --add name[=value], ... --remove name[=value], ... [ --input file | node ... ]

netdb node delete [ --keep_mx ] [ --force ] [ --input file | node ... ]

netdb node department --set department [ --input file | node ... ]

netdb node expiration [ --set date | --clear ] [ --input file | node ... ]

netdb node info [ --input file | node ... ]

netdb node ip_address --remove old_ip [ --add new_ip ] node

netdb node group --add group, ... --remove group, ... [ --input file | node ... ]

netdb node location --set building:room [ --input file | node ... ]

netdb node model --set make:model [ --input file | node ... ]

netdb node name --remove old_name [ --add new_name ] node

netdb node os --add os, ... --remove os, ... [ --input file | node ... ]

netdb node receive_mail_for --add mailname[:preference], ... --remove mailname, ... name

netdb node state --set state [ --input file | node ... ]

netdb node user --add user, ... --remove user, ... [ --input file | node ... ]

- or -

netdb node clone --template node --name name [ --location building:room | :room ] [ --hardware|hw hardware address [ --dhcp [ --roam ] ] ] [ --ip ip address[+] | none ] [ --model make:model ] [ --os os, ... ] [ --user user, ... ] [ --admin admin, ... ] [ --comment comment ]

- or -

netdb node interface --add hardware address [ --dhcp[=(on|off)] [ --options option=value,... ] [ --roam ] ] [ --ip ip address[+] ] node

netdb node interface --add none --ip ip address[+] node

netdb node interface --modify (hardware address | IP address) [ --hardware|hw hardware address | none ] [ --dhcp[=(on|off)] ] [ --options option=value,... ] [ --roam[=(on|off)] ] [ --ip ip address[+] ] node

netdb node interface --remove (hardware address | IP address), ... node

- or -

netdb user active_flag [ --set | --clear ] [ --input file | netid ... ]

netdb user all_groups_flag [ --set | --clear ] [ --input file | netid ... ]

netdb user all_records_flag [ --set | --clear ] [ --input file | netid ... ]

netdb user comment [ --set comment | --clear ] [ --input file | netid ... ]

netdb user default_domain --set domain [ --input file | netid ... ]

netdb user default_group --set group [ --input file | netid ... ]

netdb user delete [ --input file | netid ... ]

netdb user department --add department;... --remove department;... [ --input file | netid ... ]

netdb user group --add group,... --remove group,... [ --input file | netid ... ]

netdb user info [ --input file | netid ... ]

netdb user record --add record,... --remove record,... [ --input file | netid ... ]

netdb user starting_address [ --set address | --clear ] [ --input file | netid ... ]

- or -

netdb user clone --template netid [ --comment comment ] [ --input file | netid ... ]

netdb user create --domain domain --def[ault]_group group [ --department department;... ] [ --group group,... ] [ --[in]active ] [ --all_groups[=(on|off)] ] [ --all_records[=(on|off)] ] [ --record record,... ] [ --starting_address address ] [ --comment comment ] [ --input file | netid ... ]

- or -

netdb list [ departments | dhcp_options | groups | locations | models | oses | states ] [ string ]

- or -

netdb --keytab keytab --principal principal (node | user | list) ...

- or -

netdb --help

netdb --usage

netdb --version


DESCRIPTION

netdb is a utility for creating, modifying, and deleting NetDB records. Its first argument is the record type, e.g., node or network, or list, which lists valid values of various attributes. Its second argument is a keyword - clone, delete or the name of an attribute to be modified or listed. Keywords are followed by keyword-specific options and arguments. Keywords and options need not be spelled out completely - providing enough characters to uniquely identify a keyword or option is sufficient.

Record names may be specified as arguments or read from a file, one name per line, using the --input option. If the file specified is ``-'', the names are read from standard input. Any name or alias will work to identify a node record. Your default domain will be appended to unqualified node names. Users should be specified by NetID. If more than one record is given, netdb processes each in the order listed. If there is a problem deleting or modifying a particular record, netdb reports the error and continues to the next record.

The clone keyword creates a new record using an existing record as a template. The names of the existing and new records must be supplied; other record attributes are taken from the template. Options are available to override many of the template attribute values.

The list keyword lists all of the valid values of the given attribute for the current user. Include the optional string parameter to limit the listing to values that match the string. The ``*'' and ``?'' wildcards may be used in string.

netdb uses your valid Kerberos ticket to authenticate you to the NetDB server. Or you can use the --keytab and --principal options to authenticate using a Kerberos keytab file. If you don't have a valid ticket, or specify an invalid keytab or principal, netdb exits with an error.

netdb exits with a status of 0 if all the requested changes are successful, otherwise it exits with a status of 1.


RECORD TYPES

netdb works on NetDB node and user records at this time.


NODE KEYWORDS

admin

Add and/or remove node administrators. Administrators can be specified by SUNetID or Admin Team Name. To identify the input as an admin team, append a colon (e.g. myteam:).

alias

Add and/or remove aliases of a node name.

clone

Create a new record using an existing record as a template.

comment

Set or clear the comment of a record or records.

custom

Add and/or remove node custom fields. Custom fields are specified as name=value with the value being optional.

delete

Delete a record or records. When deleting node records, mail exchanger entries on other nodes will also be removed unless the --keep_mx option is supplied. Deleting nodes of type router or those having more than 10 aliases and/or mail names requires confirmation unless the --force option is used.

department

Change the department associated with a node or nodes.

expiration

Set or clear the expiration date of a node or nodes. Specify dates in the mm/dd/yyyy form.

info

List information about a node or nodes.

interface

Add, modify, or remove node interfaces. Interfaces are identified by their hardware or IP addresses.

ip_address

Change or remove a node IP address. The old IP address is required. The operation will fail if node does not have old_ip or new_ip is not available. Use the interface keyword to add an IP address to a node.

group

Add and/or remove record groups.

location

Change the location of a node or nodes. The location is specified as building:room. Both building and room are required.

model

Change the make and model of a node or nodes. The new make and model are specified as make:model.

name

Change or remove a node name. The old name is required. It can be a node name, interface name, or interface IP address name. The operation will fail if node does not have old_name or new_name is not available.

os

Add and/or remove OSes running on a node or nodes.

receive_mail_for

Add and/or remove mail destination names to a node name. A mail exchanger (MX) preference value can be specified in the form mailname:preference. If no MX preference is supplied, a default value of 10 will be assigned.

state

Change the state of a node or nodes.

user

Add and/or remove users of a node or nodes. Users are specified by SUNetID.


USER KEYWORDS

active_flag

Set or clear the active flag for a user or users.

all_groups_flag

Set or clear the all-groups flag, which allows a user to create, modify, or delete records regardless of group membership.

all_records_flag

Set or clear the all-records flag, which allows a user to create, modify, or delete records of any type.

clone

Create a new user or users using an existing user as a template. The template user's comment field will not be carried over to the new records, but a new comment may be provided.

comment

Set or clear the comment for a user or users.

create

Create a new user or users with the specified attributes.

default_domain

Set or clear the default domain for a user or users.

default_group

Set or clear the default group for a user or users.

delete

Delete a user or users.

department

Change the departments with which a user or users are officially affiliated as Local Network Administrators.

group

Change the record groups to which a user or users have access. Users cannot create, modify, or delete records in groups they are not members of (unless they have all-groups access).

info

List information about a user or users.

record

Change the types of records that a user or users can create, modify or delete.

starting_address

Set or clear the starting address for a user or users.


OPTIONS

Modify Options

--add values

Add the specified values to the record or records. Values are input as a comma- or semicolon-separated list of strings, as specified for the particular keyword. To add a value containing the delimiter, escape it with a backslash (\); to add a value containing a backslash, escape the backslash with another backslash. For example, --add 'foo,bar\,baz,C:\\qux' adds the values foo and bar,baz and C:\qux.

--remove values

Remove the specified values from the record or records. Values are input as a comma- or semicolon-separated list of strings, as specified for the particular keyword. To remove a value containing the delimiter, escape it with a backslash (\); to remove a value containing a backslash, escape the backslash with another backslash.

--set value

Set the value of a single-valued attribute.

--clear

Clear the value of an optional single-valued attribute.

--input file

Read the names of the records to create or modify from file, one per line. If file is ``-'', names are read from standard input. Your default domain will be appended to unqualified names.

Clone Options

--template name

The name of an existing record used as a model for the new record.

--comment comment

Use the supplied comment for the new record.

Node Clone Options

--name name

The name of the new record.

--location building:room | :room

Override the template location with this location. To override just the room specify the location as :room.

--hardware|hw hardware address

The hardware address of the new node. Most common hardware address forms (e.g., 0800.2085.8b0f, 08:0:20:85:8b:f, or 08-00-20-85-8b-0f) are accepted.

--dhcp

Set the DHCP flag for the new node (hardware address required).

--roam

Set the DHCP roaming flag for the new node (hardware address and DHCP flag required).

--ip ip address[+] | none

Override the default IP address assignment. If ip address is specified, netdb creates the new node with exactly that IP address. If that IP address is not available, node creation fails. If a plus is appended, ip address+, netdb searches for available IP addresses starting at the specified IP address. The value none (or no or 0) means do not assign an IP address to the new node. A hardware address is required if no IP address is requested.

--model make:model

Override the template make and model with this make and model.

--os os, ...

Override the template OSes with these OSes.

--user user, ...

Override the template user field with these users. Users are specified by SUNetID.

--admin admin, ...

Override the template administrator field with these administrators. Administrators can be specified by SUNetID or Admin Team Name. To identify the input as an admin team, append a colon (e.g. myteam:).

Interface Options

--add (hardware address | none)

The hardware address of the interface to add. Most common hardware address forms (e.g., 0800.2085.8b0f, 08:0:20:85:8b:f, or 08-00-20-85-8b-0f) are accepted.

To add an interface without a hardware address use the value none. In this case the the --ip option is required since an interface must have at least a hardware address or an IP address.

--modify (hardware address | IP address)

The hardware or IP address of an interface to modify. See --add for valid hardware address forms.

--remove (hardware address | IP address), ...

The hardware or IP address(es) of interfaces to be removed. See --add for valid hardware address forms.

--hardware|hw hardware address | none

Change or remove the interface hardware address. See --add for valid hardware address forms. Use the value none to remove an existing hardware address.

--dhcp[=(on|off)]

Set or clear the DHCP flag for the interface. If neither on nor off is specified, the flag is set. The default state of the DHCP flag when adding an interface with a hardware address is on.

--roam[=(on|off)]

Set or clear the DHCP roaming flag for the interface. If neither on nor off is specified, the flag is set. The default state of the roaming flag when adding an interface is off. The roaming flag is automatically set off when the DHCP flag is off.

--options option=value,...

Add the specified DHCP options to the interface. To remove an option omit the value: --options option=.

--ip ip address[+]

Add ip address to the interface. If the IP address is not available, the interface modification fails. If a plus is appended to the IP address, ip address+, netdb searches for available IP addresses starting at the specified IP address.

User Create Options

--domain domain

Specify the default domain for the new user.

--def[ault]_group group

Specify the default group for the new user.

--group group,...

Specify other groups to which the new user should have access.

--department department;...

Specify the departments with which the new user is to be affiliated, in an official LNA capacity.

--[in]active

Specify whether the new user's account should be active or inactive upon creation.

--all_groups[=(yes|no)]

Specify whether the new user should or should not have all-groups access. By default, users are created without all-groups access. Using the --all_groups flag with no argument is equivalent to providing a yes argument.

--all_records[=(yes|no)]

Specify whether the new user should or should not have all-records access. By default, users are created without all-records access. Using the --all_records flag with no argument is equivalent to providing a yes argument.

--record record,...

Specify the record types to which the new user should have access.

--starting_address address

Specify a starting address for the new user.

Authentication Options

--keytab keytab

Path to a Kerberos keytab file to be used for authentication.

--principal principal

Authenticate as this Kerberos principal using the specified keytab.

Other Options

--help

Print a detailed description of how to use netdb.

--usage

Print a short description of how to use netdb.

--version

Print netdb version information.


EXAMPLES

Move nodes listed in file moved to Sugar Hall, room A3.
 netdb node location --set "Sugar Hall:A3" --input moved
   - or -
 netdb node loc --s "Sugar Hall:A3" --in moved
Delete node diamond
 netdb node delete diamond
   - or -
 netdb node del diamond
Create node chip based on node oldblock
  netdb node clone --template oldblock --name chip \
                   --hw aa:00:04:64:a7:08 --dhcp
Create a user stevie with the same access and affiliations as ray
 netdb user clone --template ray stevie
Grant all-groups access to the user nina
 netdb user all_groups_flag --set nina
   - or -
 netdb user all_g --s nina
List locations with names beginning with ``main''.
 netdb list location 'main*'
   - or -
 netdb list loc 'main*'


CAVEATS

Any SUNetID (e.g., John.Doe, or j.doe, or jdoe) will usually work for adding node users or administrators, but only the Kerberos SUNetID (e.g., jdoe) works for removing them. The same is true for creating, modifying, and deleting NetDB user records. This is because NetDB doesn't store all the SUNetIDs, only the Kerberos SUNetID.

The UNIX command interpreter, the shell, breaks commands up on spaces. Elements of a command that contain spaces must be quoted for the shell to treat them as a single entity. So when entering netdb commands that have elements containing spaces, comment or location for example, be sure to enclose those elements in quotes.

netdb allows you to quickly change any number of NetDB records. If you're not careful, you can screw them up just as fast.


SEE ALSO

NetDB online help (http://www.stanford.edu/group/networking/netdb/help/prod/index.html)