netdb - Create, Modify or Delete NetDB Records
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)
[ --dhcp[=(on|off)] ] [ --options option=value,... ]
[ --roam[=(on|off)] ] [ --ip ip address[+] ] node
netdb node interface --remove (hardware address | IP address), ... node
- or -
netdb list [ departments | dhcp_options | groups
| locations | models | oses | states ] [ string ]
- or -
netdb --help
netdb --usage
netdb --version
netdb --configure
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.
For modify and delete, 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 record. Your default domain
will be appended to unqualified names. 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. If you don't have a valid ticket, 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.
netdb only works on NetDB node records at this time.
- 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.
- --add values
-
Add the specified values to the record or records. Values are
input as a comma separated list of strings.
- --remove values
-
Remove the specified values from the record or records. Values are
input as a comma separated list of strings.
- --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 modify from file, one per line.
If file is ``-'', names are read from standard input. Your default
domain will be appended to unqualified names.
- --template name
-
The name of an existing record used as a model for the new record.
- --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:).
- --comment comment
-
Use the supplied comment for the new record.
- --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.
- --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.
- --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.
- --configure
-
Configure netdb to use a different version of java.
- 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
- List locations with names beginning with ``main''.
-
netdb list location 'main*'
-
- or -
-
netdb list loc 'main*'
Any SUNetID (e.g., John.Doe, or j.doe, or jdoe) will
usually work for adding node administrators, but only the Kerberos
SUNetID (e.g., jdoe) works for removing administrators. This is
because NetDB doesn't store all the SUNetIDs, only 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.
NetDB online help (http://www.stanford.edu/group/networking/netdb/help/html/helpnetdb.html)