# pmfind

## NAME



           **pmfind** - find PCP services on the network
    


## SYNOPSIS



           **pmfind**[**-CqrSV?**]  [**-D** _debug_] [**-m** _mechanism_] [**-s** _service_] [**-t**
           _timeout_]
    


## DESCRIPTION



           **pmfind** searches for instances of the specified PCP service being
           advertised on the network and prints a list of URLs corresponding
           to the services discovered.  It can be used in conjunction with
           pmfind_check(1) to automate the monitoring of remote PCP collector
           systems.
    


## OPTIONS



           The available command line options are:
    
           **-C** , **--containers**
                Performs containers discovery as well, for each discovered
                pmcd(1) service.
    
           **-m** _mechanism_ , **--mechanism** =_mechanism_
                This option sets the _mechanism_ that **pmfind** uses when
                performing service discovery.  By default, or if the keyword
                _all_ is specified, every available mechanism will be used
                (iteratively).  See the ``MECHANISMS'' section for a
                description of each available discovery mechanism.
    
           **-q** , **--quiet**
                This option suppresses all output on the standard output
                stream.
    
           **-r** , **--resolve**
                Requests that DNS name resolution be attempted for the
                addresses of any discovered services.  The default is to
                display the network addresses of any discovered services.
    
           **-s** _service_ , **--service** =_service_
                By default **pmfind** will search for all supported PCP services,
                however a specific PCP _service_ to discover can be specified
                using the **-s** option.  Supported services are pmcd(1), and
                pmproxy(1).
    
           **-S** , **--sources**
                Reports source identifiers for each discovered pmcd(1)
                service.  These identifiers are unique for each host, and are
                formed using the (non-optional) context labels available for
                every PCP collector.  Because the discovery process will
                often identify multiple paths to an individual collector
                host, this option is an important part of the process of
                using **pmfind** in conjunction with pmfind_check(1), to ensure
                only one pmie(1) and/or pmlogger(1) process is started for
                each discovered collector host.  The source identifiers
                reported by **pmfind** are the same as the source identifiers
                reported by the pminfo(1) and pmseries(1) commands.
    
           **-t** _seconds_ , **--timeout** =_seconds_
                Sets the maximum amount of time in _seconds_ that **pmfind** will
                take before interrupting the service discovery.  The _time_
                argument is a floating point number representing the number
                of seconds before timing out.  The default is to take as much
                time as is needed to complete the process.
    
           **-V** , **--version**
                Display version number and exit.
    
           **-?** , **--help**
                Display usage message and exit.
    


## MECHANISMS



           Supported mechanisms for service discovery are:
    
           **avahi** Searches for services which are broadcasting using mDNS via
                  **avahi-daemon**(8).  An optional suffix **",timeout=N"** may be
                  added to limit the amount of time waiting for the avahi-
                  daemon.  **N** is a floating point number specifying the number
                  of seconds to wait.  The default is 0.5 seconds.  This
                  timeout may also be specified by setting the environment
                  variable **AVAHI_DISCOVERY_TIMEOUT** to the desired number of
                  seconds.  If both are specified, then the value specified
                  in the environment variable takes precedence.
    
           **probe= <net-address>/<mask-bits>**
                  Actively probes the given subnet for the requested PCP
                  service(s).  **< net-address> **is an Inet or IPv6 network
                  address and **< mask-bits> **is the number of bits used to
                  define the subnet.  For example, 192.168.1.0/24 defines an
                  8 bit subnet consisting of the addresses 192.168.1.0
                  through 192.168.1.255.  An optional suffix **",maxThreads=N"**
                  may be added to limit the number of threads used while
                  probing.  The default is the value of FD_SETSIZE (which is
                  typically 1024) or the number of addresses in the subnet,
                  whichever is less.  An optional suffix **",timeout=N"** may be
                  added to limit the amount of time spent waiting for each
                  connection attempt.  N is a floating point number
                  specifying the number of seconds to wait.  The default is
                  0.02 seconds (20 milliseconds).
    
           **shell** Probes the list of addresses provided by scripts for
                  requested PCP service(s).  Several optional, comma-
                  separated parameters can also be provided.  The **"path=DIR"**
                  option specifies the directory where commands like
                  pcp-kube-pods(1) are located (defaults to
                  _$PCP_BINADM_DIR/discover/_).  This setting can be further
                  restricted to an individual command using the **command=CMD**
                  option, but the default is to use all available commands
                  from the **path**.  The **"maxThreads=N"** option limits the number
                  of threads used while probing.  The default is the value of
                  FD_SETSIZE (which is typically 1024) or the number of
                  addresses returned by the scripts, whichever is less.  The
                  **"timeout=N"** option may be added to limit the amount of time
                  spent waiting for each connection attempt.  N is a floating
                  point number specifying the number of seconds to wait.  The
                  default is 0.02 seconds (20 milliseconds).
    


## SIGNALS



           **pmfind** will interrupt the service discovery process when one of
           the following signals is received: SIGHUP, SIGPIPE, SIGINT,
           SIGTERM, SIGXFSZ, SIGXCPU.  **pmfind** will report any results which
           were discovered up to point of the interruption.
    


## DIAGNOSTICS



           The value of the exit status from the command is zero when
           services were successfully located, one if no services were found,
           and two if an error occurred.
    
           In the event of an error a message will be generated on standard
           error that is intended to be self-explanatory.
    


## FILES



           _$PCP_BINADM_DIR/discover_
                default path to address discovery scripts
    


## PCP ENVIRONMENT



           Environment variables with the prefix **PCP_** are used to
           parameterize the file and directory names used by PCP.  On each
           installation, the file _/etc/pcp.conf_ contains the local values for
           these variables.  The **$PCP_CONF** variable may be used to specify an
           alternative configuration file, as described in pcp.conf(5).
    


## DEBUGGING OPTIONS



           The **-D** or **--debug** option enables the output of additional
           diagnostics on _stderr_ to help triage problems, although the
           information is sometimes cryptic and primarily intended to provide
           guidance for developers rather end-users.  _debug_ is a comma
           separated list of debugging options; use pmdbg(1) with the **-l**
           option to obtain a list of the available debugging options and
           their meaning.
    


* * *