pcp
[Top] [All Lists]

PCP Updates: Service Discovery Additions

To: PCP Mailing List <pcp@xxxxxxxxxxx>
Subject: PCP Updates: Service Discovery Additions
From: Dave Brolley <brolley@xxxxxxxxxx>
Date: Thu, 19 Jun 2014 14:59:20 -0400
Delivered-to: pcp@xxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0
Hi All,

A couple of additions to the service discovery API and pmfind(1).

  1. For service discovery options, I finally decided on adding a new globalOptions string to pmDiscoverServices and leaving the local options as overloads in the existing service (no overloads yet) and mechanism (probe mechanism has a maxThreads option) strings. I had originally leaned toward overloading the service string for global options, but then thought that there could be legitimate reasons down the road to do this for possible service-specific options.

    I used this to implement a new "resolve" option in the API which corresponds to new -r and --resolve options for pmfind(1). This asks for host name resolution in the results.

  2. I added a new pmServiceDiscoveryInterrupt(3) API for interrupting the discovery process. When called, the process is interrupted, finishes normally and reports whatever results were discovered (if any) up the point of the interruption. Using this new API, pmfind(1) now catches SIGHUP, SIGPIPE,  SIGINT,  SIGTERM,  SIGXFSZ,  and SIGXCPU and interrupts the service discovery when it receives them.
Man pages have been updated/created. See the following commits to my brolley/dev branch in pcpfans.

Dave

---------------------------------------------------------------------------------

commit e35998585c8795781a48a53d66212c90f5f34575
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date:   Thu Jun 19 13:04:52 2014 -0400

    Update service discover man pages.
    
    - New parameter to pmDiscoverServices(1)
    - New command line flags for pmfind(1)
    - New man page for pmServiceDiscoveryInterrupt(1)

commit a8b87e24ec15ed1ec798b1e39f815d528cb0f17a
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date:   Thu Jun 19 12:07:58 2014 -0400

    New pmServiceDiscoveryInterrupt() API.
    
    Used to interrupt service discovery. The service discovery
    process will be interrupted and will finish normally, returning
    whatever results (if any) were discovered to that point.
    
    pmfind(1) now uses this API to implement response to several
    common signals: SIGHUP, SIGPIPE, SIGINT, SIGTERM, SIGXFSZ, SIGXCPU.
    When one of these signals is received, pmfind(1) will interrupt the
    discovery process and print the results obtained up to that point.
    
    Also made the service discovery API re-usable by ensuring that
    all options and settings are reset on each use.

Author: Dave Brolley <brolley@xxxxxxxxxx>
Date:   Mon Jun 16 14:15:23 2014 -0400

    Update existing pmfind(1) tests to test the -r and --resolve options.

commit 1380d1bbf57327077cc9c0424fe49882c914f958
Author: Dave Brolley <brolley@xxxxxxxxxx>
Date:   Mon Jun 16 14:12:30 2014 -0400

    Add a global options argument to the __pmDiscoverServices() internal API.
   
    All callers updated.
   
    Use it to implement the "resolve" option in the API which reqests
    resolution of the discovered addresses. Used by
    pmfind(1) to implement the -r and --resolve command line options.

<Prev in Thread] Current Thread [Next in Thread>
  • PCP Updates: Service Discovery Additions, Dave Brolley <=