NAME
build_mdb - build mdb from NIS
SYNOPSIS
build_mdb mdb
DESCRIPTION
build_mdb is a script that builds an instance file from the data in the NIS hosts and networks maps. With some modification, it can use standard /etc/hosts or DNS (that is, named ) files.
The script first creates several awk scripts and puts them in /usr/tmp. It then uses ypcat to create two files, /tmp/hosts.nnnn /tmp/nets.nnnn, where nnnn is the current process ID. If you are not using NIS, you'll need to modify the script to copy your /etc/hosts and /etc/networks files (or convert your named database) into the two files in /tmp. The hosts file in /tmp should have the format:
<addr><white space><hostnames>#<space><comment>
while the networks file in /tmp should have the format:
<name>
is the name of the host or network
<addr>
is the addr of the host or network in A.B.C.D form
<comment>
is an optional comment field.
Once the files are created, extra whitespace is removed and the script looks for duplicate network or host names. If any are found, the script terminates without further processing. You should remove the duplicate names and run the script again.
All network names are prepended with ``Net.''. If a network does not have a name, the script generates an entry of the form Net.<networknumber>.
To limit the number of elements in a view, networks are broken into views at each byte in their address. Records are placed in the view for the next level of network they are in. For example, a host with an address 1.2.3.4 would be placed in view ``Net.1.2.3''. A network 1.2.3 would be placed in view ``Net.1.2'', etc.
OPTIONS
mdb The file where the instance information should be written. The file will contain a record for each host in the NIS database. In addition, it will contain a view instance for each network.
DEFAULTS
The script has some defaults you may wish to change by editing the script (see the top of the file):
default_proxy
The machine to use as the proxy when the instance records are built. As delivered, this is the name of the machine where build_mdb is run.
default_color
The default glyph color. As delivered, glyphs are set to white.
default_elem_type
The default type of element. As delivered, elements are set to the type component.sun4.
default_view
The default type of view when making views (from subnets). As delivered, views are of type view.subnet.
NOTES
The script doesn't understand subnetting very well. If you have a netmask set to something that doesn't end on a byte boundary, you probably won't like the way the views are constructed.
The script doesn't try to find out what type of component something is. All components are set to one type. The same is true for networks.
It doesn't figure out which agents are installed. While is is technically possible, it would take too much time to really be practical in large networks.
It doesn't connect anything with buses or connections. It just places elements in a view corresponding to their network.
Duplicate component names should probably be treated as gateways rather than rejected.