Merge remote-tracking branch 'github/pr/1707'
authorFlorian Forster <octo@collectd.org>
Fri, 29 Sep 2017 06:49:29 +0000 (08:49 +0200)
committerFlorian Forster <octo@collectd.org>
Fri, 29 Sep 2017 06:49:29 +0000 (08:49 +0200)
1  2 
src/collectd.conf.in
src/collectd.conf.pod
src/dbi.c
src/oracle.c
src/postgresql.c

diff --combined src/collectd.conf.in
  #@BUILD_PLUGIN_GRPC_TRUE@LoadPlugin grpc
  #@BUILD_PLUGIN_HDDTEMP_TRUE@LoadPlugin hddtemp
  #@BUILD_PLUGIN_HUGEPAGES_TRUE@LoadPlugin hugepages
 +#@BUILD_PLUGIN_INTEL_PMU_TRUE@LoadPlugin intel_pmu
  #@BUILD_PLUGIN_INTEL_RDT_TRUE@LoadPlugin intel_rdt
  @BUILD_PLUGIN_INTERFACE_TRUE@@BUILD_PLUGIN_INTERFACE_TRUE@LoadPlugin interface
  #@BUILD_PLUGIN_IPC_TRUE@LoadPlugin ipc
  #  ReportByCpu true
  #  ReportByState true
  #  ValuesPercentage false
 +#  ReportNumCpu false
 +#  ReportGuestState false
 +#  SubtractGuestState true
  #</Plugin>
  #
  #<Plugin csv>
  #             </Result>
  #     </Query>
  #     <Database "customers_db">
+ #             #Plugin "mycompany"
  #             Driver "mysql"
  #             DriverOption "host" "localhost"
  #             DriverOption "username" "collectd"
  
  #<Plugin filecount>
  #     <Directory "/path/to/dir">
 +#             #Plugin "foo"
  #             Instance "foodir"
  #             Name "*.conf"
  #             MTime "-5m"
  #             Size "+10k"
  #             Recursive true
  #             IncludeHidden false
 +#             #FilesSizeType "bytes"
 +#             #FilesCountType "files"
 +#             #TypeInstance "instance"
  #     </Directory>
  #</Plugin>
  
  #    ValuesPercentage false
  #</Plugin>
  
 +#<Plugin intel_pmu>
 +#    ReportHardwareCacheEvents true
 +#    ReportKernelPMUEvents true
 +#    ReportSoftwareEvents true
 +#    EventList "/var/cache/pmu/GenuineIntel-6-2D-core.json"
 +#    HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD"
 +#</Plugin>
 +
  #<Plugin "intel_rdt">
  #  Cores "0-2"
  #</Plugin>
  #</Plugin>
  
  #<Plugin mcelog>
 -#     McelogClientSocket "/var/run/mcelog-client"
 -#     McelogLogfile "/var/log/mcelog"
 +#  <Memory>
 +#    McelogClientSocket "/var/run/mcelog-client"
 +#    PersistentNotification false
 +#  </Memory>
 +#  McelogLogfile "/var/log/mcelog"
  #</Plugin>
  
  #<Plugin md>
  #             QoS 2
  #             Topic "collectd/#"
  #             CleanSession true
 +#             CACert "/etc/ssl/ca.crt"
 +#             CertificateFile "/etc/ssl/client.crt"
 +#             CertificateKeyFile "/etc/ssl/client.pem"
 +#             TLSProtocol "tlsv1.2"
 +#             CipherSuite "ciphers"
  #     </Subscribe>
  #</Plugin>
  
  #     CacheFlush 1800
  @LOAD_PLUGIN_NETWORK@</Plugin>
  
 +#<Plugin nfs>
 +#     ReportV2 false
 +#     #ReportV3 false
 +#     #ReportV4 false
 +#</Plugin>
 +
  #<Plugin nginx>
  #     URL "http://localhost/status?auto"
  #     User "www-user"
  #     ForceSSL true
  #     VerifyPeer true
  #     CAPath "/path/to/folder"
 +#     #ConnectTimeout 5000
  #</Plugin>
  
  #<Plugin olsrd>
  #    </Result>
  #  </Query>
  #  <Database "product_information">
+ #    #Plugin "warehouse"
  #    ConnectID "db01"
  #    Username "oracle"
  #    Password "secret"
  #             StoreRates true
  #     </Writer>
  #     <Database foo>
+ #             #Plugin "kingdom"
  #             Host "hostname"
  #             Port "5432"
  #             User "username"
  #     ReportBytes true
  #     ValuesAbsolute true
  #     ValuesPercentage false
 +#     ReportIO true
  #</Plugin>
  
  #<Plugin table>
  #     <Table "/proc/slabinfo">
 +#             #Plugin "table"
  #             Instance "slabinfo"
  #             Separator " "
  #             <Result>
  #        Bucket 0.5 1.0   # -> bucket-latency-foo-0.5_1
  #        Bucket 1.0 2.0   # -> bucket-latency-foo-1_2
  #        Bucket 2.0 0     # -> bucket-latency-foo-2_inf
 +#        #BucketType "bucket"
  #      </DSType>
  #      Type "latency"
  #      Instance "foo"
  #     SystemManagementInterrupt true
  #     DigitalTemperatureSensor true
  #     PackageThermalManagement true
 -#     RunningAveragePowerLimit "7"    
 +#     RunningAveragePowerLimit "7"
  #</Plugin>
  
  #<Plugin unixsock>
  #      CollectPurge false         # Varnish 2 only
  #      CollectSession false
  #      CollectSHM true
 -#      CollectSMA false           # Varnish 2 only
 +#      CollectSMA false           # Varnish 2 & 4 only
  #      CollectSMS false
  #      CollectSM false            # Varnish 2 only
  #      CollectStruct false
  #      CollectVCL false
  #      CollectVSM false           # Varnish 4 only
  #      CollectWorkers false
 +#      CollectLock false          # Varnish 4 only
 +#      CollectMempool false       # Varnish 4 only
 +#      CollectManagement false    # Varnish 4 only
 +#      CollectSMF false           # Varnish 4 only
 +#      CollectVBE false           # Varnish 4 only
  #   </Instance>
  #</Plugin>
  
diff --combined src/collectd.conf.pod
@@@ -1474,19 -1474,6 +1474,19 @@@ in the un-aggregated (per-CPU, per-stat
  When set to B<true>, reports the number of available CPUs.
  Defaults to B<false>.
  
 +=item B<ReportGuestState> B<false>|B<true>
 +
 +When set to B<true>, reports the "guest" and "guest_nice" CPU states.
 +Defaults to B<false>.
 +
 +=item B<SubtractGuestState> B<false>|B<true>
 +
 +This option is only considered when B<ReportGuestState> is set to B<true>.
 +"guest" and "guest_nice" are included in respectively "user" and "nice".
 +If set to B<true>, "guest" will be subtracted from "user" and "guest_nice"
 +will be subtracted from "nice".
 +Defaults to B<true>.
 +
  =back
  
  =head2 Plugin C<cpufreq>
@@@ -1624,7 -1611,6 +1624,7 @@@ finance page and dispatch the value to 
  
    <Plugin curl>
      <Page "stock_quotes">
 +      Plugin "quotes"
        URL "http://finance.google.com/finance?q=NYSE%3AAMD"
        User "foo"
        Password "bar"
@@@ -1656,11 -1642,6 +1656,11 @@@ The following options are valid within 
  
  =over 4
  
 +=item B<Plugin> I<Plugin>
 +
 +Use I<Plugin> as the plugin name when submitting values.
 +Defaults to C<curl>.
 +
  =item B<URL> I<URL>
  
  URL of the web site to retrieve. Since a regular expression will be used to
@@@ -1821,11 -1802,6 +1821,11 @@@ The following options are valid within 
  Use I<Name> as the host name when submitting values. Defaults to the global
  host name setting.
  
 +=item B<Plugin> I<Plugin>
 +
 +Use I<Plugin> as the plugin name when submitting values.
 +Defaults to C<curl_json>.
 +
  =item B<Instance> I<Instance>
  
  Sets the plugin instance to I<Instance>.
@@@ -2041,6 -2017,7 +2041,7 @@@ than those of other plugins. It usuall
        </Result>
      </Query>
      <Database "product_information">
+       #Plugin "warehouse"
        Driver "mysql"
        Interval 120
        DriverOption "host" "localhost"
@@@ -2222,6 -2199,11 +2223,11 @@@ the daemon. Other than that, that name 
  
  =over 4
  
+ =item B<Plugin> I<Plugin>
+ Use I<Plugin> as the plugin name when submitting query results from
+ this B<Database>. Defaults to 'dbi'.
  =item B<Interval> I<Interval>
  
  Sets the interval (in seconds) in which the values will be collected from this
@@@ -2754,16 -2736,12 +2760,16 @@@ blocks, the following options are recog
  
  =over 4
  
 +=item B<Plugin> I<Plugin>
 +
 +Use I<Plugin> as the plugin name when submitting values.
 +Defaults to B<filecount>.
 +
  =item B<Instance> I<Instance>
  
 -Sets the plugin instance to I<Instance>. That instance name must be unique, but
 -it's your responsibility, the plugin doesn't check for that. If not given, the
 -instance is set to the directory name with all slashes replaced by underscores
 -and all leading underscores removed.
 +Sets the plugin instance to I<Instance>. If not given, the instance is set to
 +the directory name with all slashes replaced by underscores and all leading
 +underscores removed. Empty value is allowed.
  
  =item B<Name> I<Pattern>
  
@@@ -2809,21 -2787,6 +2815,21 @@@ Controls whether or not to include "hid
  "Hidden" files and directories are those, whose name begins with a dot.
  Defaults to I<false>, i.e. by default hidden files and directories are ignored.
  
 +=item B<FilesSizeType> I<Type>
 +
 +Sets the type used to dispatch files combined size. Empty value ("") disables
 +reporting. Defaults to B<bytes>.
 +
 +=item B<FilesCountType> I<Type>
 +
 +Sets the type used to dispatch number of files. Empty value ("") disables
 +reporting. Defaults to B<files>.
 +
 +=item B<TypeInstance> I<Instance>
 +
 +Sets the I<type instance> used to dispatch values. Defaults to an empty string
 +(no plugin instance).
 +
  =back
  
  =head2 Plugin C<GenericJMX>
@@@ -3116,92 -3079,6 +3122,92 @@@ Defaults to B<false>
  
  =back
  
 +=head2 Plugin C<intel_pmu>
 +
 +The I<intel_pmu> plugin collects performance counters data on Intel CPUs using
 +Linux perf interface. All events are reported on a per core basis.
 +
 +B<Synopsis:>
 +
 +  <Plugin intel_pmu>
 +    ReportHardwareCacheEvents true
 +    ReportKernelPMUEvents true
 +    ReportSoftwareEvents true
 +    EventList "/var/cache/pmu/GenuineIntel-6-2D-core.json"
 +    HardwareEvents "L2_RQSTS.CODE_RD_HIT,L2_RQSTS.CODE_RD_MISS" "L2_RQSTS.ALL_CODE_RD"
 +  </Plugin>
 +
 +B<Options:>
 +
 +=over 4
 +
 +=item B<ReportHardwareCacheEvents> B<false>|B<true>
 +
 +Enable or disable measuring of hardware CPU cache events:
 +  - L1-dcache-loads
 +  - L1-dcache-load-misses
 +  - L1-dcache-stores
 +  - L1-dcache-store-misses
 +  - L1-dcache-prefetches
 +  - L1-dcache-prefetch-misses
 +  - L1-icache-loads
 +  - L1-icache-load-misses
 +  - L1-icache-prefetches
 +  - L1-icache-prefetch-misses
 +  - LLC-loads
 +  - LLC-load-misses
 +  - LLC-stores
 +  - LLC-store-misses
 +  - LLC-prefetches
 +  - LLC-prefetch-misses
 +  - dTLB-loads
 +  - dTLB-load-misses
 +  - dTLB-stores
 +  - dTLB-store-misses
 +  - dTLB-prefetches
 +  - dTLB-prefetch-misses
 +  - iTLB-loads
 +  - iTLB-load-misses
 +  - branch-loads
 +  - branch-load-misses
 +
 +=item B<ReportKernelPMUEvents> B<false>|B<true>
 +
 +Enable or disable measuring of the following events:
 +  - cpu-cycles
 +  - instructions
 +  - cache-references
 +  - cache-misses
 +  - branches
 +  - branch-misses
 +  - bus-cycles
 +
 +=item B<ReportSoftwareEvents> B<false>|B<true>
 +
 +Enable or disable measuring of software events provided by kernel:
 +  - cpu-clock
 +  - task-clock
 +  - context-switches
 +  - cpu-migrations
 +  - page-faults
 +  - minor-faults
 +  - major-faults
 +  - alignment-faults
 +  - emulation-faults
 +
 +=item B<EventList> I<filename>
 +
 +JSON performance counter event list file name. To be able to monitor all Intel
 +CPU specific events JSON event list file should be downloaded. Use the pmu-tools
 +event_download.py script to download event list for current CPU.
 +
 +=item B<HardwareEvents> I<events>
 +
 +This field is a list of event names or groups of comma separated event names.
 +This option requires B<EventList> option to be configured.
 +
 +=back
 +
  =head2 Plugin C<intel_rdt>
  
  The I<intel_rdt> plugin collects information provided by monitoring features of
@@@ -3607,36 -3484,17 +3613,36 @@@ By default the plugin connects to B<"/v
  mcelog server is running. When the server is running, the plugin will tail the
  specified logfile to retrieve machine check exception information and send a
  notification with the details from the logfile. The plugin will use the mcelog
 -client protocol to retrieve memory related machine check exceptions.
 +client protocol to retrieve memory related machine check exceptions. Note that
 +for memory exceptions, notifications are only sent when there is a change in
 +the number of corrected/uncorrected memory errors.
  
 -=over 4
 +=head3 The Memory block
 +
 +Note: these options cannot be used in conjunction with the logfile options, they are mutually
 +exclusive.
 +
 +=over 3
  
  =item B<McelogClientSocket> I<Path>
  Connect to the mcelog client socket using the UNIX domain socket at I<Path>.
  Defaults to B<"/var/run/mcelog-client">.
  
 +=item B<PersistentNotification> B<true>|B<false>
 +Override default configuration to only send notifications when sent when there
 +is a change in the number of corrected/uncorrected memory errors. When set to
 +true notifications will be sent for every read cycle. Default is false. Does
 +not affect the stats being dispatched.
 +
 +=back
 +
 +=over 4
 +
  =item B<McelogLogfile> I<Path>
  
 -The mcelog file to parse. Defaults to B<"/var/log/mcelog">.
 +The mcelog file to parse. Defaults to B<"/var/log/mcelog">. Note: this option
 +cannot be used in conjunction with the memory block options, they are mutually
 +exclusive.
  
  =back
  
@@@ -3684,7 -3542,6 +3690,7 @@@ Synopsis of the configuration
     <Page "plugin_instance">
       Server "localhost"
       Key "page_key"
 +     Plugin "plugin_name"
       <Match>
         Regex "(\\d+) bytes sent"
         DSType CounterAdd
@@@ -3712,11 -3569,6 +3718,11 @@@ B<Page> block
  
  When connected to the memcached server, asks for the page I<Key>.
  
 +=item B<Plugin> I<Plugin>
 +
 +Use I<Plugin> as the plugin name when submitting values.
 +Defaults to C<memcachec>.
 +
  =item E<lt>B<Match>E<gt>
  
  Match blocks define which strings to look for and how matches substrings are
@@@ -4222,18 -4074,18 +4228,18 @@@ the B<collectd> branch
  Path to the PEM-encoded CA certificate file. Setting this option enables TLS
  communication with the MQTT broker, and as such, B<Port> should be the TLS-enabled
  port of the MQTT broker.
 -A valid TLS configuration requires B<CACert>, B<CertificateFile> and B<CertificateKeyFile>.
 +This option enables the use of TLS.
  
  =item B<CertificateFile> I<file>
  
  Path to the PEM-encoded certificate file to use as client certificate when
  connecting to the MQTT broker.
 -A valid TLS configuration requires B<CACert>, B<CertificateFile> and B<CertificateKeyFile>.
 +Only valid if B<CACert> and B<CertificateKeyFile> are also set.
  
  =item B<CertificateKeyFile> I<file>
  
  Path to the unencrypted PEM-encoded key file corresponding to B<CertificateFile>.
 -A valid TLS configuration requires B<CACert>, B<CertificateFile> and B<CertificateKeyFile>.
 +Only valid if B<CACert> and B<CertificateFile> are also set.
  
  =item B<TLSProtocol> I<protocol>
  
@@@ -4241,14 -4093,13 +4247,14 @@@ If configured, this specifies the strin
  C<tlsv1.2>) to use for the TLS connection to the broker. If not set a default
  version is used which depends on the version of OpenSSL the Mosquitto library
  was linked against.
 +Only valid if B<CACert> is set.
  
  =item B<CipherSuite> I<ciphersuite>
  
  A string describing the ciphers available for use. See L<ciphers(1)> and the
  C<openssl ciphers> utility for more information. If unset, the default ciphers
  will be used.
 -
 +Only valid if B<CACert> is set.
  
  =back
  
@@@ -4378,11 -4229,11 +4384,11 @@@ If enabled, the plugin sends a notifica
  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.
@@@ -5216,25 -5067,6 +5222,25 @@@ statistics available. Defaults to B<fal
  
  =back
  
 +=head2 Plugin C<nfs>
 +
 +The I<nfs plugin> collects information about the usage of the Network File
 +System (NFS). It counts the number of procedure calls for each procedure,
 +grouped by version and whether the system runs as server or client.
 +
 +It is possibly to omit metrics for a specific NFS version by setting one or
 +more of the following options to B<false> (all of them default to B<true>).
 +
 +=over 4
 +
 +=item B<ReportV2> B<true>|B<false>
 +
 +=item B<ReportV3> B<true>|B<false>
 +
 +=item B<ReportV4> B<true>|B<false>
 +
 +=back
 +
  =head2 Plugin C<nginx>
  
  This plugin collects the number of connections and requests handled by the
@@@ -5465,11 -5297,6 +5471,11 @@@ generate links like the one described a
  Example usage:
  C<c_rehash /path/to/certs/folder>
  
 +=item B<ConnectTimeout> I<Milliseconds>
 +
 +The B<ConnectTimeout> option sets the connect timeout, in milliseconds.
 +By default, the configured B<Interval> is used to set the timeout.
 +
  =back
  
  =head2 Plugin C<olsrd>
@@@ -5705,12 -5532,15 +5711,12 @@@ The OpenVPN plugin reads a status file 
  traffic statistics about connected clients.
  
  To set up OpenVPN to write to the status file periodically, use the
 -B<--status> option of OpenVPN. Since OpenVPN can write two different formats,
 -you need to set the required format, too. This is done by setting
 -B<--status-version> to B<2>.
 +B<--status> option of OpenVPN.
  
  So, in a nutshell you need:
  
    openvpn $OTHER_OPTIONS \
 -    --status "/var/run/openvpn-status" 10 \
 -    --status-version 2
 +    --status "/var/run/openvpn-status" 10
  
  Available options:
  
@@@ -5765,6 -5595,7 +5771,7 @@@ plugin's documentation above for detail
        </Result>
      </Query>
      <Database "product_information">
+       #Plugin "warehouse"
        ConnectID "db01"
        Username "oracle"
        Password "secret"
@@@ -5787,6 -5618,11 +5794,11 @@@ values submitted to the daemon. Other t
  
  =over 4
  
+ =item B<Plugin> I<Plugin>
+ Use I<Plugin> as the plugin name when submitting query results from
+ this B<Database>. Defaults to 'oracle'.
  =item B<ConnectID> I<ID>
  
  Defines the "database alias" or "service name" to connect to. Usually, these
@@@ -5842,7 -5678,7 +5854,7 @@@ The address of the OVS DB server JSON-R
  enable the interface, OVS DB daemon should be running with C<--remote=ptcp:>
  option. See L<ovsdb-server(1)> for more details. The option may be either
  network hostname, IPv4 numbers-and-dots notation or IPv6 hexadecimal string
 -format. Defaults to B<'localhost'>.
 +format. Defaults to C<localhost>.
  
  =item B<Port> I<service>
  
@@@ -5908,7 -5744,7 +5920,7 @@@ The address of the OVS DB server JSON-R
  enable the interface, OVS DB daemon should be running with C<--remote=ptcp:>
  option. See L<ovsdb-server(1)> for more details. The option may be either
  network hostname, IPv4 numbers-and-dots notation or IPv6 hexadecimal string
 -format. Defaults to B<'localhost'>.
 +format. Defaults to C<localhost>.
  
  =item B<Port> I<service>
  
@@@ -6140,6 -5976,7 +6152,7 @@@ L<http://www.postgresql.org/docs/manual
      </Writer>
  
      <Database foo>
+       Plugin "kingdom"
        Host "hostname"
        Port "5432"
        User "username"
@@@ -6461,6 -6298,11 +6474,11 @@@ activating this option. The draw-back i
  amount of time will be lost, for example, if a single statement within the
  transaction fails or if the database server crashes.
  
+ =item B<Plugin> I<Plugin>
+ Use I<Plugin> as the plugin name when submitting query results from
+ this B<Database>. Defaults to 'postgresql'.
  =item B<Instance> I<name>
  
  Specify the plugin instance name that should be used instead of the database
@@@ -7128,20 -6970,14 +7146,20 @@@ one (exclusive)
  
  When the C<rrdtool> plugin uses a cache (by setting B<CacheTimeout>, see below)
  it writes all values for a certain RRD-file if the oldest value is older than
 -(or equal to) the number of seconds specified. If some RRD-file is not updated
 +(or equal to) the number of seconds specified by B<CacheTimeout>.
 +That check happens on new values arriwal. If some RRD-file is not updated
  anymore for some reason (the computer was shut down, the network is broken,
 -etc.) some values may still be in the cache. If B<CacheFlush> is set, then the
 -entire cache is searched for entries older than B<CacheTimeout> seconds and
 -written to disk every I<Seconds> seconds. Since this is kind of expensive and
 -does nothing under normal circumstances, this value should not be too small.
 -900 seconds might be a good value, though setting this to 7200 seconds doesn't
 -normally do much harm either.
 +etc.) some values may still be in the cache. If B<CacheFlush> is set, then
 +every I<Seconds> seconds the entire cache is searched for entries older than
 +B<CacheTimeout> + B<RandomTimeout> seconds. The entries found are written to
 +disk. Since scanning the entire cache is kind of expensive and does nothing
 +under normal circumstances, this value should not be too small. 900 seconds
 +might be a good value, though setting this to 7200 seconds doesn't normally
 +do much harm either.
 +
 +Defaults to 10x B<CacheTimeout>.
 +B<CacheFlush> must be larger than or equal to B<CacheTimeout>, otherwise the
 +above default is used.
  
  =item B<CacheTimeout> I<Seconds>
  
@@@ -7371,7 -7207,6 +7389,7 @@@ B<Synopsis:
    <Plugin snmp_agent>
      <Data "memAvailReal">
        Plugin "memory"
 +      #PluginInstance "some"
        Type "memory"
        TypeInstance "free"
        OIDs "1.3.6.1.4.1.2021.4.6.0"
@@@ -7415,12 -7250,6 +7433,12 @@@ scalar data type B<Instance> has no eff
  
  Read plugin name whose collected data will be mapped to specified OIDs.
  
 +=item B<PluginInstance> I<String>
 +
 +Read plugin instance whose collected data will be mapped to specified OIDs.
 +The field is optional and by default there is no plugin instance check.
 +Allowed only if B<Data> block defines scalar data type.
 +
  =item B<Type> I<String>
  
  Collectd's type that is to be used for specified OID, e.E<nbsp>g. "if_octets"
@@@ -7433,9 -7262,9 +7451,9 @@@ Collectd's type-instance that is to be 
  =item B<OIDs> I<OID> [I<OID> ...]
  
  Configures the OIDs to be handled by I<snmp_agent> plugin. Values for these OIDs
 -are taken from collectd data type specified by B<Plugin>, B<Type>,
 -B<TypeInstance> fields of this B<Data> block. Number of the OIDs configured
 -should correspond to number of values in specified B<Type>.
 +are taken from collectd data type specified by B<Plugin>, B<PluginInstance>,
 +B<Type>, B<TypeInstance> fields of this B<Data> block. Number of the OIDs
 +configured should correspond to number of values in specified B<Type>.
  For example two OIDs "IF-MIB::ifInOctets" "IF-MIB::ifOutOctets" can be mapped to
  "rx" and "tx" values of "if_octets" type.
  
@@@ -7574,13 -7403,6 +7592,13 @@@ available and free. Defaults to B<false
  This is useful for deploying I<collectd> in a heterogeneous environment, where
  swap sizes differ and you want to specify generic thresholds or similar.
  
 +=item B<ReportIO> B<true>|B<false>
 +
 +Enables or disables reporting swap IO. Defaults to B<true>.
 +
 +This is useful for the cases when swap IO is not neccessary, is not available,
 +or is not reliable.
 +
  =back
  
  =head2 Plugin C<syslog>
@@@ -7616,7 -7438,6 +7634,7 @@@ filesystem or CSV (comma separated valu
  
    <Plugin table>
      <Table "/proc/slabinfo">
 +      #Plugin "slab"
        Instance "slabinfo"
        Separator " "
        <Result>
@@@ -7643,14 -7464,10 +7661,14 @@@ The following options are available ins
  
  =over 4
  
 +=item B<Plugin> I<Plugin>
 +
 +If specified, I<Plugin> is used as the plugin name when submitting values.
 +Defaults to B<table>.
 +
  =item B<Instance> I<instance>
  
 -If specified, I<instance> is used as the plugin instance. So, in the above
 -example, the plugin name C<table-slabinfo> would be used. If omitted, the
 +If specified, I<instance> is used as the plugin instance. If omitted, the
  filename of the table is used instead, with all special characters replaced
  with an underscore (C<_>).
  
@@@ -7720,7 -7537,6 +7738,7 @@@ user using (extended) regular expressio
  
    <Plugin "tail">
      <File "/var/log/exim4/mainlog">
 +      Plugin "mail"
        Instance "exim"
        Interval 60
        <Match>
          <DSType "Distribution">
            Percentile 99
            Bucket 0 100
 +          #BucketType "bucket"
          </DSType>
          Type "latency"
          Instance "foo"
@@@ -7753,13 -7568,11 +7771,13 @@@ The config consists of one or more B<Fi
  logfile to parse. Within each B<File> block, there are one or more B<Match>
  blocks, which configure a regular expression to search for.
  
 -The B<Instance> option in the B<File> block may be used to set the plugin
 -instance. So in the above example the plugin name C<tail-foo> would be used.
 -This plugin instance is for all B<Match> blocks that B<follow> it, until the
 -next B<Instance> option. This way you can extract several plugin instances from
 -one logfile, handy when parsing syslog and the like.
 +The B<Plugin> and B<Instance> options in the B<File> block may be used to set
 +the plugin name and instance respectively. So in the above example the plugin name
 +C<mail-exim> would be used.
 +
 +These options are applied for all B<Match> blocks that B<follow> it, until the
 +next B<Plugin> or B<Instance> option. This way you can extract several plugin
 +instances from one logfile, handy when parsing syslog and the like.
  
  The B<Interval> option allows you to define the length of time between reads. If
  this is not set, the default Interval will be used.
@@@ -7863,7 -7676,6 +7881,7 @@@ B<Synopsis:
    <DSType "Distribution">
      Percentile 99
      Bucket 0 100
 +    BucketType "bucket"
    </DSType>
  
  =over 4
@@@ -7900,17 -7712,11 +7918,17 @@@ the following schema
    Bucket  20  50
    Bucket  50   0
  
 -Metrics are reported with the I<type> C<bucket> and the I<type instance>
 +Metrics are reported with the I<type> set by B<BucketType> option (C<bucket> 
 +by default) and the I<type instance>
  C<E<lt>TypeE<gt>[-E<lt>InstanceE<gt>]-E<lt>lower_boundE<gt>_E<lt>upper_boundE<gt>>.
  
  This option may be repeated to calculate more than one rate.
  
 +=item B<BucketType> I<Type>
 +
 +Sets the type used to dispatch B<Bucket> metrics.
 +Optional, by default C<bucket> will be used.
 +
  =back
  
  =back
@@@ -7947,8 -7753,7 +7965,8 @@@ B<Synopsis:
         Index 1
     </Metric>
     <File "/var/log/snort/snort.stats">
 -       Instance "snort-eth0"
 +       Plugin "snortstats"
 +       Instance "eth0"
         Interval 600
         Collect "snort-dropped"
     </File>
@@@ -8000,11 -7805,6 +8018,11 @@@ I<File> block but there can be multipl
  
  =over 4
  
 +=item B<Plugin> I<Plugin>
 +
 +Use I<Plugin> as the plugin name when submitting values.
 +Defaults to C<tail_csv>.
 +
  =item B<Instance> I<PluginInstance>
  
  Sets the I<plugin instance> used when dispatching the values.
@@@ -8268,9 -8068,9 +8286,9 @@@ collections. The different bits of thi
  
  Boolean enabling the use of logical core numbering for per core statistics.
  When enabled, C<cpuE<lt>nE<gt>> is used as plugin instance, where I<n> is a
 -sequential number assigned by the kernel. Otherwise, C<coreE<lt>nE<gt>> is used
 -where I<n> is the n-th core of the socket, causing name conflicts when there is
 -more than one socket.
 +dynamic number assigned by the kernel. Otherwise, C<coreE<lt>nE<gt>> is used
 +if there is only one package and C<pkgE<lt>nE<gt>-coreE<lt>mE<gt>> if there is
 +more than one, where I<n> is the n-th core of package I<m>.
  
  =back
  
@@@ -8376,11 -8176,6 +8394,11 @@@ Synopsis
       CollectVCL         false
       CollectVSM         false
       CollectWorkers     false
 +     CollectLock        false
 +     CollectMempool     false
 +     CollectManagement  false
 +     CollectSMF         false
 +     CollectVBE         false
     </Instance>
   </Plugin>
  
@@@ -8456,10 -8251,7 +8474,10 @@@ log messages which is flushed to disk w
  =item B<CollectSMA> B<true>|B<false>
  
  malloc or umem (umem_alloc(3MALLOC) based) storage statistics. The umem storage
 -component is Solaris specific. Only available with Varnish 2.x. False by
 +component is Solaris specific.
 +Note: SMA and SMF share counters, enable only the one used by the Varnish
 +instance.
 +Only available with Varnish 2.x. False by
  default.
  
  =item B<CollectSMS> B<true>|B<false>
@@@ -8469,8 -8261,7 +8487,8 @@@ component is used internally only. Fals
  
  =item B<CollectSM> B<true>|B<false>
  
 -file (memory mapped file) storage statistics. Only available with Varnish 2.x.
 +file (memory mapped file) storage statistics. Only available with Varnish 2.x.,
 +in varnish 4.x. use CollectSMF.
  False by default.
  
  =item B<CollectStruct> B<true>|B<false>
@@@ -8501,29 -8292,6 +8519,29 @@@ statistics subsystems). Only available 
  
  Collect statistics about worker threads. False by default.
  
 +=item B<CollectVBE> B<true>|B<false>
 +
 +Backend counters. Only available with Varnish 4.x. False by default.
 +
 +=item B<CollectSMF> B<true>|B<false>
 +
 +file (memory mapped file) storage statistics. Only available with Varnish 4.x.
 +Note: SMA and SMF share counters, enable only the one used by the Varnish
 +instance.
 +Used to be called SM in Varnish 2.x. False by default.
 +
 +=item B<CollectManagement> B<true>|B<false>
 +
 +Management process counters. Only available with Varnish 4.x. False by default.
 +
 +=item B<CollectLock> B<true>|B<false>
 +
 +Lock counters. Only available with Varnish 4.x. False by default.
 +
 +=item B<CollectMempool> B<true>|B<false>
 +
 +Memory pool counters. Only available with Varnish 4.x. False by default.
 +
  =back
  
  =head2 Plugin C<virt>
@@@ -8588,7 -8356,7 +8606,7 @@@ will be collected
  =item B<BlockDeviceFormat> B<target>|B<source>
  
  If I<BlockDeviceFormat> is set to B<target>, the default, then the device name
 -seen by the guest will be used for reporting metrics. 
 +seen by the guest will be used for reporting metrics.
  This corresponds to the C<E<lt>targetE<gt>> node in the XML definition of the
  domain.
  
@@@ -9349,7 -9117,6 +9367,7 @@@ Synopsis
          Prefix "collectd/"
          Database 1
          MaxSetSize -1
 +        MaxSetDuration -1
          StoreRates true
      </Node>
    </Plugin>
@@@ -9412,12 -9179,6 +9430,12 @@@ to C<0>
  The B<MaxSetSize> option limits the number of items that the I<Sorted Sets> can
  hold. Negative values for I<Items> sets no limit, which is the default behavior.
  
 +=item B<MaxSetDuration> I<Seconds>
 +
 +The B<MaxSetDuration> option limits the duration of items that the
 +I<Sorted Sets> can hold. Negative values for I<Items> sets no duration, which
 +is the default behavior.
 +
  =item B<StoreRates> B<true>|B<false>
  
  If set to B<true> (the default), convert counter values to rates. If set to
diff --combined src/dbi.c
+++ b/src/dbi.c
@@@ -62,6 -62,7 +62,7 @@@ struct cdbi_database_s /* {{{ *
  {
    char *name;
    char *select_db;
+   char *plugin_name;
  
    cdtime_t interval;
  
@@@ -107,10 -108,10 +108,10 @@@ static const char *cdbi_strerror(dbi_co
    msg = NULL;
    status = dbi_conn_error(conn, &msg);
    if ((status >= 0) && (msg != NULL))
 -    ssnprintf(buffer, buffer_size, "%s (status %i)", msg, status);
 +    snprintf(buffer, buffer_size, "%s (status %i)", msg, status);
    else
 -    ssnprintf(buffer, buffer_size, "dbi_conn_error failed with status %i",
 -              status);
 +    snprintf(buffer, buffer_size, "dbi_conn_error failed with status %i",
 +             status);
  
    return buffer;
  } /* }}} const char *cdbi_conn_error */
@@@ -131,12 -132,12 +132,12 @@@ static int cdbi_result_get_field(dbi_re
      long long value;
  
      value = dbi_result_get_longlong_idx(res, index);
 -    ssnprintf(buffer, buffer_size, "%lli", value);
 +    snprintf(buffer, buffer_size, "%lli", value);
    } else if (src_type == DBI_TYPE_DECIMAL) {
      double value;
  
      value = dbi_result_get_double_idx(res, index);
 -    ssnprintf(buffer, buffer_size, "%63.15g", value);
 +    snprintf(buffer, buffer_size, "%63.15g", value);
    } else if (src_type == DBI_TYPE_STRING) {
      const char *value;
  
@@@ -172,7 -173,10 +173,10 @@@ static void cdbi_database_free(cdbi_dat
      return;
  
    sfree(db->name);
+   sfree(db->select_db);
+   sfree(db->plugin_name);
    sfree(db->driver);
+   sfree(db->host);
  
    for (size_t i = 0; i < db->driver_options_num; i++) {
      sfree(db->driver_options[i].key);
@@@ -298,6 -302,8 +302,8 @@@ static int cdbi_config_add_database(oco
        status = cf_util_get_string(child, &db->host);
      else if (strcasecmp("Interval", child->key) == 0)
        status = cf_util_get_cdtime(child, &db->interval);
+     else if (strcasecmp("Plugin", child->key) == 0)
+       status = cf_util_get_string(child, &db->plugin_name);
      else {
        WARNING("dbi plugin: Option `%s' not allowed here.", child->key);
        status = -1;
@@@ -540,7 -546,8 +546,8 @@@ static int cdbi_read_database_query(cdb
  
    udb_query_prepare_result(
        q, prep_area, (db->host ? db->host : hostname_g),
-       /* plugin = */ "dbi", db->name, column_names, column_num,
+       /* plugin = */ (db->plugin_name != NULL) ? db->plugin_name : "dbi",
+       db->name, column_names, column_num,
        /* interval = */ (db->interval > 0) ? db->interval : 0);
  
    /* 0 = error; 1 = success; */
diff --combined src/oracle.c
@@@ -62,6 -62,7 +62,7 @@@ struct o_database_s 
    char *connect_id;
    char *username;
    char *password;
+   char *plugin_name;
  
    udb_query_preparation_area_t **q_prep_areas;
    udb_query_t **queries;
@@@ -141,6 -142,7 +142,7 @@@ static void o_database_free(o_database_
    sfree(db->username);
    sfree(db->password);
    sfree(db->queries);
+   sfree(db->plugin_name);
  
    if (db->q_prep_areas != NULL)
      for (size_t i = 0; i < db->queries_num; ++i)
@@@ -192,6 -194,7 +194,7 @@@ static int o_config_add_database(oconfi
    db->connect_id = NULL;
    db->username = NULL;
    db->password = NULL;
+   db->plugin_name = NULL;
  
    status = cf_util_get_string(ci, &db->name);
    if (status != 0) {
        status = cf_util_get_string(child, &db->username);
      else if (strcasecmp("Password", child->key) == 0)
        status = cf_util_get_string(child, &db->password);
+     else if (strcasecmp("Plugin", child->key) == 0)
+       status = cf_util_get_string(child, &db->plugin_name);
      else if (strcasecmp("Query", child->key) == 0)
        status = udb_query_pick_from_list(child, queries, queries_num,
                                          &db->queries, &db->queries_num);
@@@ -476,7 -481,8 +481,7 @@@ static int o_read_database_query(o_data
      column_names[i] = column_names[i - 1] + DATA_MAX_NAME_LEN;
  
    ALLOC_OR_FAIL(column_values, column_num * sizeof(char *));
 -  ALLOC_OR_FAIL(column_values[0],
 -                column_num * DATA_MAX_NAME_LEN);
 +  ALLOC_OR_FAIL(column_values[0], column_num * DATA_MAX_NAME_LEN);
    for (size_t i = 1; i < column_num; i++)
      column_values[i] = column_values[i - 1] + DATA_MAX_NAME_LEN;
  
  
    status = udb_query_prepare_result(
        q, prep_area, (db->host != NULL) ? db->host : hostname_g,
-       /* plugin = */ "oracle", db->name, column_names, column_num,
+       /* plugin = */ (db->plugin_name != NULL) ? db->plugin_name : "oracle",
+       db->name, column_names, column_num,
        /* interval = */ 0);
    if (status != 0) {
      ERROR("oracle plugin: o_read_database_query (%s, %s): "
@@@ -635,7 -642,7 +641,7 @@@ static int o_read_database(o_database_
      if ((status != OCI_SUCCESS) && (status != OCI_SUCCESS_WITH_INFO)) {
        char errfunc[256];
  
 -      ssnprintf(errfunc, sizeof(errfunc), "OCILogon(\"%s\")", db->connect_id);
 +      snprintf(errfunc, sizeof(errfunc), "OCILogon(\"%s\")", db->connect_id);
  
        o_report_error("o_read_database", db->name, NULL, errfunc, oci_error);
        DEBUG("oracle plugin: OCILogon (%s): db->oci_service_context = %p;",
diff --combined src/postgresql.c
@@@ -58,7 -58,7 +58,7 @@@
   * is ignored. */
  #define C_PSQL_PAR_APPEND(buf, buf_len, parameter, value)                      \
    if ((0 < (buf_len)) && (NULL != (value)) && ('\0' != *(value))) {            \
 -    int s = ssnprintf(buf, buf_len, " %s = '%s'", parameter, value);           \
 +    int s = snprintf(buf, buf_len, " %s = '%s'", parameter, value);            \
      if (0 < s) {                                                               \
        buf += s;                                                                \
        buf_len -= s;                                                            \
@@@ -139,6 -139,7 +139,7 @@@ typedef struct 
    char *password;
  
    char *instance;
+   char *plugin_name;
  
    char *sslmode;
  
@@@ -250,6 -251,8 +251,8 @@@ static c_psql_database_t *c_psql_databa
  
    db->instance = sstrdup(name);
  
+   db->plugin_name = NULL;
    db->sslmode = NULL;
  
    db->krbsrvname = NULL;
@@@ -300,6 -303,8 +303,8 @@@ static void c_psql_database_delete(voi
  
    sfree(db->instance);
  
+   sfree(db->plugin_name);
    sfree(db->sslmode);
  
    sfree(db->krbsrvname);
@@@ -322,7 -327,7 +327,7 @@@ static int c_psql_connect(c_psql_databa
    if ((!db) || (!db->database))
      return -1;
  
 -  status = ssnprintf(buf, buf_len, "dbname = '%s'", db->database);
 +  status = snprintf(buf, buf_len, "dbname = '%s'", db->database);
    if (0 < status) {
      buf += status;
      buf_len -= status;
@@@ -424,9 -429,9 +429,9 @@@ static PGresult *c_psql_exec_query_para
        params[i] = db->user;
        break;
      case C_PSQL_PARAM_INTERVAL:
 -      ssnprintf(interval, sizeof(interval), "%.3f",
 -                (db->interval > 0) ? CDTIME_T_TO_DOUBLE(db->interval)
 -                                   : plugin_get_interval());
 +      snprintf(interval, sizeof(interval), "%.3f",
 +               (db->interval > 0) ? CDTIME_T_TO_DOUBLE(db->interval)
 +                                  : plugin_get_interval());
        params[i] = interval;
        break;
      case C_PSQL_PARAM_INSTANCE:
    }
  
    return PQexecParams(db->conn, udb_query_get_statement(q), data->params_num,
 -                      NULL, (const char *const*)params, NULL, NULL, 0);
 +                      NULL, (const char *const *)params, NULL, NULL, 0);
  } /* c_psql_exec_query_params */
  
  /* db->db_lock must be locked when calling this function */
@@@ -539,9 -544,11 +544,11 @@@ static int c_psql_exec_query(c_psql_dat
    else
      host = db->host;
  
-   status =
-       udb_query_prepare_result(q, prep_area, host, "postgresql", db->instance,
-                                column_names, (size_t)column_num, db->interval);
+   status = udb_query_prepare_result(
+       q, prep_area, host,
+       (db->plugin_name != NULL) ? db->plugin_name : "postgresql",
+       db->instance, column_names, (size_t)column_num, db->interval);
    if (0 != status) {
      log_err("udb_query_prepare_result failed with status %i.", status);
      BAIL_OUT(-1);
@@@ -629,7 -636,7 +636,7 @@@ static char *values_name_to_sqlarray(co
    str_len = string_len;
  
    for (size_t i = 0; i < ds->ds_num; ++i) {
 -    int status = ssnprintf(str_ptr, str_len, ",'%s'", ds->ds[i].name);
 +    int status = snprintf(str_ptr, str_len, ",'%s'", ds->ds[i].name);
  
      if (status < 1)
        return NULL;
@@@ -667,10 -674,10 +674,10 @@@ static char *values_type_to_sqlarray(co
      int status;
  
      if (store_rates)
 -      status = ssnprintf(str_ptr, str_len, ",'gauge'");
 +      status = snprintf(str_ptr, str_len, ",'gauge'");
      else
 -      status = ssnprintf(str_ptr, str_len, ",'%s'",
 -                         DS_TYPE_TO_STRING(ds->ds[i].type));
 +      status = snprintf(str_ptr, str_len, ",'%s'",
 +                        DS_TYPE_TO_STRING(ds->ds[i].type));
  
      if (status < 1) {
        str_len = 0;
@@@ -722,7 -729,7 +729,7 @@@ static char *values_to_sqlarray(const d
  
      if (ds->ds[i].type == DS_TYPE_GAUGE)
        status =
 -          ssnprintf(str_ptr, str_len, "," GAUGE_FORMAT, vl->values[i].gauge);
 +          snprintf(str_ptr, str_len, "," GAUGE_FORMAT, vl->values[i].gauge);
      else if (store_rates) {
        if (rates == NULL)
          rates = uc_get_rate(ds, vl);
          return NULL;
        }
  
 -      status = ssnprintf(str_ptr, str_len, ",%lf", rates[i]);
 +      status = snprintf(str_ptr, str_len, ",%lf", rates[i]);
      } else if (ds->ds[i].type == DS_TYPE_COUNTER)
 -      status = ssnprintf(str_ptr, str_len, ",%llu", vl->values[i].counter);
 +      status = snprintf(str_ptr, str_len, ",%llu", vl->values[i].counter);
      else if (ds->ds[i].type == DS_TYPE_DERIVE)
 -      status = ssnprintf(str_ptr, str_len, ",%" PRIi64, vl->values[i].derive);
 +      status = snprintf(str_ptr, str_len, ",%" PRIi64, vl->values[i].derive);
      else if (ds->ds[i].type == DS_TYPE_ABSOLUTE)
 -      status = ssnprintf(str_ptr, str_len, ",%" PRIu64, vl->values[i].absolute);
 +      status = snprintf(str_ptr, str_len, ",%" PRIu64, vl->values[i].absolute);
  
      if (status < 1) {
        str_len = 0;
@@@ -936,7 -943,7 +943,7 @@@ static int c_psql_shutdown(void) 
  
      if (db->writers_num > 0) {
        char cb_name[DATA_MAX_NAME_LEN];
 -      ssnprintf(cb_name, sizeof(cb_name), "postgresql-%s", db->database);
 +      snprintf(cb_name, sizeof(cb_name), "postgresql-%s", db->database);
  
        if (!had_flush) {
          plugin_unregister_flush("postgresql");
@@@ -1139,6 -1146,8 +1146,8 @@@ static int c_psql_config_database(oconf
        cf_util_get_string(c, &db->password);
      else if (0 == strcasecmp(c->key, "Instance"))
        cf_util_get_string(c, &db->instance);
+     else if (0 == strcasecmp (c->key, "Plugin"))
+       cf_util_get_string (c, &db->plugin_name);
      else if (0 == strcasecmp(c->key, "SSLMode"))
        cf_util_get_string(c, &db->sslmode);
      else if (0 == strcasecmp(c->key, "KRBSrvName"))
      }
    }
  
 -  ssnprintf(cb_name, sizeof(cb_name), "postgresql-%s", db->instance);
 +  snprintf(cb_name, sizeof(cb_name), "postgresql-%s", db->instance);
  
    user_data_t ud = {.data = db, .free_func = c_psql_database_delete};