Merge pull request #1876 from octo/issue/1819
authorSebastian Harl <sh@tokkee.org>
Thu, 11 Aug 2016 20:51:50 +0000 (22:51 +0200)
committerGitHub <noreply@github.com>
Thu, 11 Aug 2016 20:51:50 +0000 (22:51 +0200)
grpc plugin: Refactor plugin.

1  2 
src/collectd.conf.in
src/collectd.conf.pod

diff --combined src/collectd.conf.in
  #@BUILD_PLUGIN_CONTEXTSWITCH_TRUE@LoadPlugin contextswitch
  @BUILD_PLUGIN_CPU_TRUE@@BUILD_PLUGIN_CPU_TRUE@LoadPlugin cpu
  #@BUILD_PLUGIN_CPUFREQ_TRUE@LoadPlugin cpufreq
 +#@BUILD_PLUGIN_CPUSLEEP_TRUE@LoadPlugin cpusleep
  @LOAD_PLUGIN_CSV@LoadPlugin csv
  #@BUILD_PLUGIN_CURL_TRUE@LoadPlugin curl
  #@BUILD_PLUGIN_CURL_JSON_TRUE@LoadPlugin curl_json
  #@BUILD_PLUGIN_FILECOUNT_TRUE@LoadPlugin filecount
  #@BUILD_PLUGIN_FSCACHE_TRUE@LoadPlugin fscache
  #@BUILD_PLUGIN_GMOND_TRUE@LoadPlugin gmond
 +#@BUILD_PLUGIN_GPS_TRUE@LoadPlugin gps
  #@BUILD_PLUGIN_GRPC_TRUE@LoadPlugin grpc
  #@BUILD_PLUGIN_HDDTEMP_TRUE@LoadPlugin hddtemp
  @BUILD_PLUGIN_INTERFACE_TRUE@@BUILD_PLUGIN_INTERFACE_TRUE@LoadPlugin interface
  #  </Metric>
  #</Plugin>
  
 +#<Plugin gps>
 +#  Host "127.0.0.1"
 +#  Port "2947"
 +#  Timeout 0.015
 +#  PauseConnect 5
 +#</Plugin>
 +
  #<Plugin grpc>
- #     WorkerThreads 5
  #     <Listen "0.0.0.0" "50051">
  #             EnableSSL true
  #             SSLRootCerts "/path/to/root.pem"
  #             User "db_user"
  #             Password "secret"
  #             Database "db_name"
 +#             SSLKey "/path/to/key.pem"
 +#             SSLCert "/path/to/cert.pem"
 +#             SSLCA "/path/to/ca.pem"
 +#             SSLCAPath "/path/to/cas/"
 +#             SSLCipher "DHE-RSA-AES256-SHA"
  #             MasterStats true
  #             ConnectTimeout 10
  #             InnodbStats true
  #             SlaveStats true
  #             SlaveNotifications true
  #     </Database>
 +#     <Database galera>
 +#             Alias "galera"
 +#             Host "localhost"
 +#             Socket "/var/run/mysql/mysqld.sock"
 +#             WsrepStats true
 +#     </Database>
  #</Plugin>
  
  #<Plugin netapp>
  #             Header "X-Custom-Header: custom_value"
  #             SSLVersion "TLSv1"
  #             Format "Command"
 +#             Metrics true
 +#             Notifications false
  #             StoreRates false
  #             BufferSize 4096
  #             LowSpeedLimit 0
diff --combined src/collectd.conf.pod
@@@ -1457,16 -1457,6 +1457,16 @@@ installed) to get the current CPU frequ
  sure B<cpufreqd> (L<http://cpufreqd.sourceforge.net/>) or a similar tool is
  installed and an "cpu governor" (that's a kernel module) is loaded.
  
 +=head2 Plugin C<cpusleep>
 +
 +This plugin doesn't have any options. It reads CLOCK_BOOTTIME and
 +CLOCK_MONOTONIC and reports the difference between these clocks. Since
 +BOOTTIME clock increments while device is suspended and MONOTONIC
 +clock does not, the derivative of the difference between these clocks
 +gives the relative amount of time the device has spent in suspend
 +state. The recorded value is in milliseconds of sleep per seconds of
 +wall clock.
 +
  =head2 Plugin C<csv>
  
  =over 4
@@@ -2411,7 -2401,7 +2411,7 @@@ I<TypeInstance> will be used
  
  =item B<MappedOnly> B<true>|B<false>
  
 -When set to B<true>, only metrics that can be mapped to to a I<type> will be
 +When set to B<true>, only metrics that can be mapped to a I<type> will be
  collected, all other metrics will be ignored. Defaults to B<false>.
  
  =back
@@@ -2641,78 -2631,6 +2641,78 @@@ source, this is optional. Otherwise th
  
  =back
  
 +=head2 Plugin C<gps>
 +
 +The C<gps plugin> connects to gpsd on the host machine.
 +The host, port, timeout and pause are configurable.
 +
 +This is useful if you run an NTP server using a GPS for source and you want to
 +monitor it.
 +
 +Mind your GPS must send $--GSA for having the data reported!
 +
 +The following elements are collected:
 +
 +=over 4
 +
 +=item B<satellites>
 +
 +Number of satellites used for fix (type instance "used") and in view (type
 +instance "visible"). 0 means no GPS satellites are visible.
 +
 +=item B<dilution_of_precision>
 +
 +Vertical and horizontal dilution (type instance "horizontal" or "vertical").
 +It should be between 0 and 3.
 +Look at the documentation of your GPS to know more.
 +
 +=back
 +
 +Synopsis:
 +
 + LoadPlugin gps
 + <Plugin "gps">
 +   # Connect to localhost on gpsd regular port:
 +   Host "127.0.0.1"
 +   Port "2947"
 +   # 15 ms timeout
 +   Timeout 0.015
 +   # PauseConnect of 5 sec. between connection attempts.
 +   PauseConnect 5
 + </Plugin>
 +
 +Available configuration options:
 +
 +=over 4
 +
 +=item B<Host> I<Host>
 +
 +The host on which gpsd daemon runs. Defaults to B<localhost>.
 +
 +=item B<Port> I<Port>
 +
 +Port to connect to gpsd on the host machine. Defaults to B<2947>.
 +
 +=item B<Timeout> I<Seconds>
 +
 +Timeout in seconds (default 0.015 sec).
 +
 +The GPS data stream is fetch by the plugin form the daemon.
 +It waits for data to be available, if none arrives it times out
 +and loop for another reading.
 +Mind to put a low value gpsd expects value in the micro-seconds area
 +(recommended is 500 us) since the waiting function is blocking.
 +Value must be between 500 us and 5 sec., if outside that range the
 +default value is applied.
 +
 +This only applies from gpsd release-2.95.
 +
 +=item B<PauseConnect> I<Seconds>
 +
 +Pause to apply between attempts of connection to gpsd in seconds (default 5 sec).
 +
 +=back
 +
  =head2 Plugin C<grpc>
  
  The I<grpc> plugin provides an RPC interface to submit values to or query
@@@ -2751,11 -2669,6 +2751,6 @@@ connections
  
  =back
  
- =item B<WorkerThreads> I<Num>
- Number of threads to start for handling incoming connections. The default
- value is B<5>.
  =back
  
  =head2 Plugin C<hddtemp>
@@@ -3734,11 -3647,6 +3729,11 @@@ Synopsis
        Port "3306"
        MasterStats true
        ConnectTimeout 10
 +      SSLKey "/path/to/key.pem"
 +      SSLCert "/path/to/cert.pem"
 +      SSLCA "/path/to/ca.pem"
 +      SSLCAPath "/path/to/cas/"
 +      SSLCipher "DHE-RSA-AES256-SHA"
      </Database>
  
      <Database bar>
        SlaveStats true
        SlaveNotifications true
      </Database>
 +
 +   <Database galera>
 +      Alias "galera"
 +      Host "localhost"
 +      Socket "/var/run/mysql/mysqld.sock"
 +      WsrepStats true
 +   </Database>
    </Plugin>
  
  A B<Database> block defines one connection to a MySQL database. It accepts a
  single argument which specifies the name of the database. None of the other
  options are required. MySQL will use default values as documented in the
 -section "mysql_real_connect()" in the B<MySQL reference manual>.
 +"mysql_real_connect()" and "mysql_ssl_set()" sections in the
 +B<MySQL reference manual>.
  
  =over 4
  
@@@ -3826,36 -3726,10 +3821,36 @@@ privileges. See the B<User> documentati
  If enabled, the plugin sends a notification if the replication slave I/O and /
  or SQL threads are not running. Defaults to B<false>.
  
 +=item B<WsrepStats> I<true|false>
 + 
 + Enable the collection of wsrep plugin statistics, used in Master-Master
 + replication setups like in MySQL Galera/Percona XtraDB Cluster.
 + User needs only privileges to execute 'SHOW GLOBAL STATUS'
 + 
  =item B<ConnectTimeout> I<Seconds>
  
  Sets the connect timeout for the MySQL client.
  
 +=item B<SSLKey> I<Path>
 +
 +If provided, the X509 key in PEM format.
 +
 +=item B<SSLCert> I<Path>
 +
 +If provided, the X509 cert in PEM format.
 +
 +=item B<SSLCA> I<Path>
 +
 +If provided, the CA file in PEM format (check OpenSSL docs).
 +
 +=item B<SSLCAPath> I<Path>
 +
 +If provided, the CA directory (check OpenSSL docs).
 +
 +=item B<SSLCipher> I<String>
 +
 +If provided, the SSL cipher to use.
 +
  =back
  
  =head2 Plugin C<netapp>
@@@ -7170,7 -7044,7 +7165,7 @@@ port in numeric form
  =item B<AllPortsSummary> I<true>|I<false>
  
  If this option is set to I<true> a summary of statistics from all connections
 -are collectd. This option defaults to I<false>.
 +are collected. This option defaults to I<false>.
  
  =back
  
@@@ -7951,14 -7825,6 +7946,14 @@@ create output in the I<JavaScript Objec
  
  Defaults to B<Command>.
  
 +=item B<Metrics> B<true>|B<false>
 +
 +Controls whether I<metrics> are POSTed to this location. Defaults to B<true>.
 +
 +=item B<Notifications> B<false>|B<true>
 +
 +Controls whether I<notifications> are POSTed to this location. Defaults to B<false>.
 +
  =item B<StoreRates> B<true|false>
  
  If set to B<true>, convert counter values to rates. If set to B<false> (the