

Usage: 
======

   ctys-macmap [options] <seach-string>


Description:
============

   Searches within the given list of "macmap.fdb" for matching lines,
   and shows the requested fields of result. Simple awk-regexpr as for
   "ctys-vhost" are supported.

   The result is pre-sorted, though in case of multiple results these
   will be presented sorted.

   The contents of "macmap.fdb" are given as one record on each line
   with the following fields.

      <nodename>;<IP-Address>;<MAC-Address>

   For the generation of macmap.fdb from standard dhcp.conf and the
   limitation to static assignment data refer to "ctys-extractMAClst".


Options:
========

   -n|-i|-m
       -n  Print: <name>
       -i  Print: <IP>
       -m  Print: <MAC>

     
   -h
      Print help.

     
   -p <db-dir-path-list>
      Two syntaxes are supported for <db-dir-path-list>:

       - PATH-like with FS=':':
         <db-dir-path-list>=<db-dir-path>[:<db-dir-path>[:...]]

       - ctys-conformant with FS='%', due to leveled scanner-hierarchies:
         <db-dir-path-list>=<db-dir-path>[%<db-dir-path>[%...]]
 
      So, both supported field seperators are reserved values.

      Directory paths for databases, containing a file with hard-coded
      name "macmap.fdb".

      When missing, the default DEFAULT_DBPATHLST will be used.


      ATTENTION: Currently no spaces are supported within pathnames!


    <simple awk-regexpr>

      A "simple" regexpr for awk, used as in given extract:

         awk -v s="${argLst}" 
          '
          $0~s&&n==1  {cache=cache $1;  mx=1;}
          ...
            

      Therefore e.g. 

          ctys-macmap  -n -m '00:50:56:.3:..:.9'

      generates the following matches:

          tst009;00:50:56:13:11:39
          tst108;00:50:56:13:11:49



EXAMPLES:
=========

   The following examples describe som variants of starting a remote
   machine by Wake-On-LAN. This is utilized within ctys when using the
   PM pluging "LINUX".

   The evaluation of the MAC-address could be done by several eys from
   the "macmap.fdb" database. This is the common source when using

      "ctys-macmap -m <execution-instance>" 
      "ether-wake <mac-address-from-ctys-macmap>"

   or 

      "ctys -t LINUX -a create=<-WoL-target> <execution-instance>"


   ctys-macmap is particularly useful, when the map-database is not
   yet generated and e.g. local MAC-address for Wake-On-LAN is
   required for a known name of a PM. Than just call:

     "ctys-macmap -m <pm-name>"

   getting the MAC-address

     "00:50:56:13:11:39"


   For Wake-On-LAN a.k.a. WoL use the following e.g. in conbination
   with ksu of Kerberos:

       "ksu -e ether-wake `ctys-macmap -m ws1`"
      

   For using "ksu" as a sudo replacement edit "/root/.k5users" only,
   "/root/.k5users" is not required.

   For further information on "ksu" as a replacement for su/sudo refer
   to Kerberos manuals.

   For further information on activating "wol" refer to
   "http://ahh.sourceforge.net".


Todo:
=====

  - Introduce "vendor.fdb" for MAC-Vendor-replacement.

