Mfind Rich West ----- rwest@sarnoff.com usage: mfind [options] Originally by Ingo Dean, Mentor Graphics Corp. Modified, updated for Perl 5, SVR4 support and distribution configuration by Rich West, Sarnoff Corp. mfind is an extensible Machine Find utility. In any network of more than 10 machines, it sometimes becomes necessary to get a list of which machines meet some criteria. This utility is one possible answer to this problem. OPTIONS: -help Print this help message and exit -exec command Command to execute FOR each matched hostname (The string "{}" is replaced by hostname) example: -exec 'echo "rsh {} ls /tmp"' -rexec command Command to execute ON each matched hostname example: -rexec 'hostname' bugs: It just does an rsh, so you get all rsh's bugs as a bonus... -keys Print valid search keys and exit -print key1,key2 Print key list Note: the special key "all" will print all available information on that host -except name1,name2,... Do not list these hostnames if they match Do not execute -{r}exec command for these -verbose Verbosity option (For debugging) Search keys: (usage -keyname key1,key2 -keyname key1,key2 ) alias arch buildenv display hostids lastupdate memory mnts model modified name netinterface numcpu osrelease ostype rating status subnet swap vco EXAMPLES: (Note that all keys in example may not exist) Find all Sun4 machines in database: % mfind -arch sun4 Find all Sparc machines in database: % mfind -arch sun4c Find all machines (no matter what model) with greater than 64Mb memory: % mfind -memory +64 Find all Sparc2's and print name,hostid,memory: % mfind -arch sun4 -model 4/75 -print name,hostid,memory List all architectures in the database and count occurences: % mfind -print arch,model | sort | uniq -c Print name,architecture,model,hostid for certain machines: % mfind -name zaphod,fileserver1 -print name,arch,model,hostid NOTE: If key is prepended with a "+" sign, search is for items NUMERICALLY greater than key, if prepended with "-" sign, search is for items NUMERICALLY less than key. All other searches are based on PERL regular expressions. Searches for <= and >= can usually be done by specifying both keys ( -key +32,32 would find all with key equal to AND greater than 32 as the value).