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) [ --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
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.
netdb works on NetDB node and user records at this time.
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:).
Add and/or remove aliases of a node name.
Create a new record using an existing record as a template.
Set or clear the comment of a record or records.
Add and/or remove node custom fields. Custom fields are specified as name=value with the value being optional.
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.
Change the department associated with a node or nodes.
Set or clear the expiration date of a node or nodes. Specify dates in the mm/dd/yyyy form.
List information about a node or nodes.
Add, modify, or remove node interfaces. Interfaces are identified by their hardware or IP addresses.
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.
Add and/or remove record groups.
Change the location of a node or nodes. The location is specified as building:room. Both building and room are required.
Change the make and model of a node or nodes. The new make and model are specified as make:model.
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.
Add and/or remove OSes running on a node or nodes.
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.
Change the state of a node or nodes.
Add and/or remove users of a node or nodes. Users are specified by SUNetID.
Set or clear the active flag for a user or users.
Set or clear the all-groups flag, which allows a user to create, modify, or delete records regardless of group membership.
Set or clear the all-records flag, which allows a user to create, modify, or delete records of any type.
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.
Set or clear the comment for a user or users.
Create a new user or users with the specified attributes.
Set or clear the default domain for a user or users.
Set or clear the default group for a user or users.
Delete a user or users.
Change the departments with which a user or users are officially affiliated as Local Network Administrators.
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).
List information about a user or users.
Change the types of records that a user or users can create, modify or delete.
Set or clear the starting address for a user or users.
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 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 the value of a single-valued attribute.
Clear the value of an optional single-valued attribute.
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.
The name of an existing record used as a model for the new record.
Use the supplied comment for the new record.
The name of the new record.
Override the template location with this location. To override just the room specify the location as :room.
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.
Set the DHCP flag for the new node (hardware address required).
Set the DHCP roaming flag for the new node (hardware address and DHCP flag required).
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.
Override the template make and model with this make and model.
Override the template OSes with these OSes.
Override the template user field with these users. Users are specified by SUNetID.
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:).
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.
The hardware or IP address of an interface to modify. See --add for valid hardware address forms.
The hardware or IP address(es) of interfaces to be removed. See --add for valid hardware address forms.
Change or remove the interface hardware address. See --add for valid hardware address forms. Use the value none to remove an existing hardware address.
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.
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.
Add the specified DHCP options to the interface. To remove an option omit the value: --options option=.
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.
Specify the default domain for the new user.
Specify the default group for the new user.
Specify other groups to which the new user should have access.
Specify the departments with which the new user is to be affiliated, in an official LNA capacity.
Specify whether the new user's account should be active or inactive upon creation.
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.
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.
Specify the record types to which the new user should have access.
Specify a starting address for the new user.
Path to a Kerberos keytab file to be used for authentication.
Authenticate as this Kerberos principal using the specified keytab.
Print a detailed description of how to use netdb.
Print a short description of how to use netdb.
Print netdb version information.
netdb node location --set "Sugar Hall:A3" --input moved
- or -
netdb node loc --s "Sugar Hall:A3" --in moved
netdb node delete diamond
- or -
netdb node del diamond
netdb node clone --template oldblock --name chip \
--hw aa:00:04:64:a7:08 --dhcp
netdb user clone --template ray stevie
netdb user all_groups_flag --set nina
- or -
netdb user all_g --s nina
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 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.
NetDB online help (http://www.stanford.edu/group/networking/netdb/help/prod/index.html)