Merge remote-tracking branch 'github/pr/2453'
authorFlorian Forster <octo@collectd.org>
Fri, 6 Oct 2017 13:32:01 +0000 (15:32 +0200)
committerFlorian Forster <octo@collectd.org>
Fri, 6 Oct 2017 13:32:01 +0000 (15:32 +0200)
1  2 
src/collectd.conf.in
src/collectd.conf.pod
src/varnish.c

diff --combined src/collectd.conf.in
  #<Plugin curl_xml>
  #  <URL "http://localhost/stats.xml">
  #    Host "my_host"
 +#    #Plugin "stats"
  #    Instance "some_instance"
  #    User "collectd"
  #    Password "thaiNg0I"
  #      Type "magic_level"
  #      #InstancePrefix "prefix-"
  #      InstanceFrom "td[1]"
 +#      #PluginInstanceFrom "td[1]"
  #      ValuesFrom "td[2]/span[@class=\"level\"]"
  #    </XPath>
  #  </URL>
  #             </Result>
  #     </Query>
  #     <Database "customers_db">
 +#             #Plugin "mycompany"
  #             Driver "mysql"
  #             DriverOption "host" "localhost"
  #             DriverOption "username" "collectd"
  #     NotifySensorAdd false
  #     NotifySensorRemove true
  #     NotifySensorNotPresent false
 +#     SELEnabled false
 +#     SELClearEvent false
  #</Plugin>
  
  #<Plugin iptables>
  #    </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"
  #<Plugin processes>
  #     CollectFileDescriptor true
  #     CollectContextSwitch true
 +#     CollectMemoryMaps true
  #     Process "name"
  #     ProcessMatch "name" "regex"
  #     <Process "collectd">
  #      CollectManagement false    # Varnish 4 only
  #      CollectSMF false           # Varnish 4 only
  #      CollectVBE false           # Varnish 4 only
+ #      CollectMSE false           # Varnish-Plus 4 only
  #   </Instance>
  #</Plugin>
  
diff --combined src/collectd.conf.pod
@@@ -1624,7 -1624,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 -1655,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 -1815,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>.
@@@ -1888,7 -1877,6 +1888,7 @@@ The B<curl_xml plugin> uses B<libcurl> 
   <Plugin "curl_xml">
     <URL "http://localhost/stats.xml">
       Host "my_host"
 +     #Plugin "curl_xml"
       Instance "some_instance"
       User "collectd"
       Password "thaiNg0I"
         Type "magic_level"
         #InstancePrefix "prefix-"
         InstanceFrom "td[1]"
 +       #PluginInstanceFrom "td[1]"
         ValuesFrom "td[2]/span[@class=\"level\"]"
       </XPath>
     </URL>
@@@ -1928,16 -1915,10 +1928,16 @@@ Within the B<URL> block the following o
  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 'curl_xml'.
 +
  =item B<Instance> I<Instance>
  
 -Use I<Instance> as the plugin instance when submitting values. Defaults to an
 -empty string (no plugin instance).
 +Use I<Instance> as the plugin instance when submitting values.
 +May be overridden by B<PluginInstanceFrom> option inside B<XPath> blocks.
 +Defaults to an empty string (no plugin instance).
  
  =item B<Namespace> I<Prefix> I<URL>
  
@@@ -2008,19 -1989,9 +2008,19 @@@ Specifies a XPath expression to use fo
  XPath expression must return exactly one element. The element's value is then
  used as I<type instance>, possibly prefixed with I<InstancePrefix> (see above).
  
 -This value is required. As a special exception, if the "base XPath expression"
 -(the argument to the B<XPath> block) returns exactly one argument, then this
 -option may be omitted.
 +=item B<PluginInstanceFrom> I<PluginInstanceFrom>
 +
 +Specifies a XPath expression to use for determining the I<plugin instance>. The
 +XPath expression must return exactly one element. The element's value is then
 +used as I<plugin instance>.
 +
 +=back
 +
 +If the "base XPath expression" (the argument to the B<XPath> block) returns
 +exactly one argument, then I<InstanceFrom> and I<PluginInstanceFrom> may be omitted.
 +Otherwise, at least one of I<InstanceFrom> or I<PluginInstanceFrom> is required.
 +
 +=over 4
  
  =item B<ValuesFrom> I<ValuesFrom> [I<ValuesFrom> ...]
  
@@@ -2029,7 -2000,6 +2029,7 @@@ number of XPath expressions must match 
  I<type> specified with B<Type> (see above). Each XPath expression must return
  exactly one element. The element's value is then parsed as a number and used as
  value for the appropriate value in the value list dispatched to the daemon.
 +This option is required.
  
  =back
  
@@@ -2060,7 -2030,6 +2060,7 @@@ than those of other plugins. It usuall
        </Result>
      </Query>
      <Database "product_information">
 +      #Plugin "warehouse"
        Driver "mysql"
        Interval 120
        DriverOption "host" "localhost"
@@@ -2242,11 -2211,6 +2242,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 C<dbi>.
 +
  =item B<Interval> I<Interval>
  
  Sets the interval (in seconds) in which the values will be collected from this
@@@ -3381,19 -3345,6 +3381,19 @@@ If a sensor disappears a notification i
  If you have for example dual power supply and one of them is (un)plugged then
  a notification is sent.
  
 +=item B<SELEnabled> I<true>|I<false>
 +
 +If system event log (SEL) is enabled, plugin will listen for sensor threshold
 +and discrete events. When event is received the notification is sent.
 +Defaults to B<false>.
 +
 +=item B<SELClearEvent> I<true>|I<false>
 +
 +If SEL clear event is enabled, plugin will delete event from SEL list after
 +it is received and successfully handled. In this case other tools that are
 +subscribed for SEL events will receive an empty event.
 +Defaults to B<false>.
 +
  =back
  
  =head2 Plugin C<iptables>
@@@ -3722,7 -3673,6 +3722,7 @@@ Synopsis of the configuration
     <Page "plugin_instance">
       Server "localhost"
       Key "page_key"
 +     Plugin "plugin_name"
       <Match>
         Regex "(\\d+) bytes sent"
         DSType CounterAdd
@@@ -3750,11 -3700,6 +3750,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
@@@ -5803,7 -5748,6 +5803,7 @@@ plugin's documentation above for detail
        </Result>
      </Query>
      <Database "product_information">
 +      #Plugin "warehouse"
        ConnectID "db01"
        Username "oracle"
        Password "secret"
@@@ -5826,11 -5770,6 +5826,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 C<oracle>.
 +
  =item B<ConnectID> I<ID>
  
  Defines the "database alias" or "service name" to connect to. Usually, these
@@@ -5886,7 -5825,7 +5886,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>
  
@@@ -5952,7 -5891,7 +5952,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>
  
@@@ -6184,7 -6123,6 +6184,7 @@@ L<http://www.postgresql.org/docs/manual
      </Writer>
  
      <Database foo>
 +      Plugin "kingdom"
        Host "hostname"
        Port "5432"
        User "username"
@@@ -6506,11 -6444,6 +6506,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 C<postgresql>.
 +
  =item B<Instance> I<name>
  
  Specify the plugin instance name that should be used instead of the database
@@@ -6775,7 -6708,6 +6775,7 @@@ collected for these selected processes 
   - number of processes
   - number of threads
   - number of open files (under Linux)
 + - number of memory mapped files (under Linux)
   - io data (where available)
   - context switches (under Linux)
   - minor and major pagefaults.
@@@ -6796,12 -6728,6 +6796,12 @@@ slashes
  
  Collect context switch of the process.
  
 +=item B<CollectMemoryMaps> I<Boolean>
 +
 +Collect the number of memory mapped files of the process.
 +The limit for this number is configured via F</proc/sys/vm/max_map_count> in
 +the Linux kernel.
 +
  =back
  
  =head2 Plugin C<protocols>
@@@ -7777,7 -7703,6 +7777,7 @@@ user using (extended) regular expressio
  
    <Plugin "tail">
      <File "/var/log/exim4/mainlog">
 +      Plugin "mail"
        Instance "exim"
        Interval 60
        <Match>
@@@ -7810,13 -7735,11 +7810,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.
@@@ -8004,8 -7927,7 +8004,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>
@@@ -8057,11 -7979,6 +8057,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.
@@@ -8438,6 -8355,7 +8438,7 @@@ Synopsis
       CollectManagement  false
       CollectSMF         false
       CollectVBE         false
+      CollectMSE         false
     </Instance>
   </Plugin>
  
@@@ -8513,11 -8431,9 +8514,9 @@@ 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.
- Note: SMA and SMF share counters, enable only the one used by the Varnish
- instance.
- Only available with Varnish 2.x. False by
- default.
+ component is Solaris specific. Note: SMA, SMF and MSE 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>
  
@@@ -8565,9 -8481,8 +8564,8 @@@ Backend counters. Only available with V
  =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.
+ Note: SMA, SMF and MSE 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>
  
@@@ -8581,6 -8496,13 +8579,13 @@@ Lock counters. Only available with Varn
  
  Memory pool counters. Only available with Varnish 4.x. False by default.
  
+ =item B<CollectMSE> B<true>|B<false>
+ Varnish Massive Storage Engine 2.0 (MSE2) is an improved storage backend for
+ Varnish, replacing the traditional malloc and file storages. Only available
+ with Varnish-Plus 4.x. Note: SMA, SMF and MSE share counters, enable only the
+ one used by the Varnish instance. False by default.
  =back
  
  =head2 Plugin C<virt>
@@@ -9406,7 -9328,6 +9411,7 @@@ Synopsis
          Prefix "collectd/"
          Database 1
          MaxSetSize -1
 +        MaxSetDuration -1
          StoreRates true
      </Node>
    </Plugin>
@@@ -9469,12 -9390,6 +9474,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/varnish.c
@@@ -88,6 -88,7 +88,7 @@@ struct user_config_s 
    _Bool collect_mgt;
    _Bool collect_smf;
    _Bool collect_vbe;
+   _Bool collect_mse;
  #endif
  };
  typedef struct user_config_s user_config_t; /* }}} */
@@@ -227,6 -228,9 +228,9 @@@ static int varnish_monitor(void *priv
      else if (strcmp(name, "esi_warnings") == 0)
        return varnish_submit_derive(conf->instance, "esi", "total_operations",
                                     "warning", val);
+     else if (strcmp(name, "esi_maxdepth") == 0)
+       return varnish_submit_derive(conf->instance, "esi", "total_operations",
+                                    "max_depth", val);
    }
  
    if (conf->collect_backend) {
                                     "workspace_overflow", val);
  #if HAVE_VARNISH_V4
      else if (strcmp(name, "exp_mailed") == 0)
 -      return varnish_submit_derive(conf->instance, "struct", "objects",
 +      return varnish_submit_gauge(conf->instance, "struct", "objects",
                                    "exp_mailed", val);
      else if (strcmp(name, "exp_received") == 0)
 -      return varnish_submit_derive(conf->instance, "struct", "objects",
 +      return varnish_submit_gauge(conf->instance, "struct", "objects",
                                    "exp_received", val);
  #endif
    }
        return varnish_submit_derive(conf->instance, "ban", "total_operations",
                                     "obj_killed", val);
      else if (strcmp(name, "bans_persisted_bytes") == 0)
 -      return varnish_submit_gauge(conf->instance, "ban", "total_bytes",
 +      return varnish_submit_derive(conf->instance, "ban", "total_bytes",
                                     "persisted_bytes", val);
      else if (strcmp(name, "bans_persisted_fragmentation") == 0)
 -      return varnish_submit_gauge(conf->instance, "ban", "total_bytes",
 +      return varnish_submit_derive(conf->instance, "ban", "total_bytes",
                                     "persisted_fragmentation", val);
      else if (strcmp(name, "bans_tests_tested") == 0)
        return varnish_submit_derive(conf->instance, "ban", "total_operations",
      else if (strcmp(name, "s_req_bodybytes") == 0)
        return varnish_submit_derive(conf->instance, "totals", "total_bytes",
                                     "req_body", val);
+     else if (strcmp(name, "s_req_protobytes") == 0)
+       return varnish_submit_derive(conf->instance, "totals", "total_bytes",
+                                    "req_proto", val);
      else if (strcmp(name, "s_resp_hdrbytes") == 0)
        return varnish_submit_derive(conf->instance, "totals", "total_bytes",
                                     "resp_header", val);
      else if (strcmp(name, "s_resp_bodybytes") == 0)
        return varnish_submit_derive(conf->instance, "totals", "total_bytes",
                                     "resp_body", val);
+     else if (strcmp(name, "s_resp_protobytes") == 0)
+       return varnish_submit_derive(conf->instance, "totals", "total_bytes",
+                                    "resp_proto", val);
      else if (strcmp(name, "s_pipe_hdrbytes") == 0)
        return varnish_submit_derive(conf->instance, "totals", "total_bytes",
                                     "pipe_header", val);
        return varnish_submit_derive(conf->instance, "workers", "total_threads",
                                     "dropped", val);
      else if (strcmp(name, "thread_queue_len") == 0)
 -      return varnish_submit_derive(conf->instance, "workers", "queue_length",
 +      return varnish_submit_gauge(conf->instance, "workers", "queue_length",
                                     "threads", val);
      else if (strcmp(name, "n_wrk") == 0)
        return varnish_submit_gauge(conf->instance, "workers", "threads",
      else if (strcmp(name, "busy_killed") == 0)
        return varnish_submit_derive(conf->instance, "workers", "http_requests",
                                     "busy_killed", val);
  #endif
    }
  
      else if (strcmp(name, "bereq_bodybytes") == 0)
        return varnish_submit_derive(conf->instance, "vbe",
                                     "total_bytes", "bereq_bodybytes", val);
+     else if (strcmp(name, "bereq_protobytes") == 0)
+       return varnish_submit_derive(conf->instance, "vbe",
+                                    "total_bytes", "bereq_protobytes", val);
      else if (strcmp(name, "beresp_hdrbytes") == 0)
        return varnish_submit_derive(conf->instance, "vbe",
                                     "total_bytes", "beresp_hdrbytes", val);
      else if (strcmp(name, "beresp_bodybytes") == 0)
        return varnish_submit_derive(conf->instance, "vbe",
                                     "total_bytes", "beresp_bodybytes", val);
+     else if (strcmp(name, "beresp_protobytes") == 0)
+       return varnish_submit_derive(conf->instance, "vbe",
+                                    "total_bytes", "beresp_protobytes", val);
      else if (strcmp(name, "pipe_hdrbytes") == 0)
        return varnish_submit_derive(conf->instance, "vbe",
                                     "total_bytes", "pipe_hdrbytes", val);
        return varnish_submit_derive(conf->instance, "vbe", "connections",
                                    "c_conns", val);
      else if (strcmp(name, "req") == 0)
 -      return varnish_submit_gauge(conf->instance, "vbe", "http_requests",
 +      return varnish_submit_derive(conf->instance, "vbe", "http_requests",
                                    "b_reqs", val);
    }
  
    /* All Stevedores support these counters */
-   if (conf->collect_sma || conf->collect_smf) {
+   if (conf->collect_sma || conf->collect_smf || conf->collect_mse) {
  
      char category[4];
      if (conf->collect_sma)
        strncpy(category, "sma", 4);
-     else
+     else if (conf->collect_smf)
        strncpy(category, "smf", 4);
+     else
+       strncpy(category, "mse", 4);
  
      if (strcmp(name, "c_req") == 0)
        return varnish_submit_derive(conf->instance, category,
  
    if (conf->collect_lck) {
      if (strcmp(name, "creat") == 0)
 -      return varnish_submit_derive(conf->instance, "lck", "objects",
 +      return varnish_submit_gauge(conf->instance, "lck", "objects",
                                    "created", val);
      else if (strcmp(name, "destroy") == 0)
 -      return varnish_submit_derive(conf->instance, "lck", "objects",
 +      return varnish_submit_gauge(conf->instance, "lck", "objects",
                                    "destroyed", val);
      else if (strcmp(name, "locks") == 0)
        return varnish_submit_derive(conf->instance, "lck", "total_operations",
        return varnish_submit_derive(conf->instance, "mempool",
                                     "total_operations", "frees", val);
      else if (strcmp(name, "recycle") == 0)
 -      return varnish_submit_derive(conf->instance, "mempool",
 +      return varnish_submit_gauge(conf->instance, "mempool",
                                     "objects", "recycled", val);
      else if (strcmp(name, "timeout") == 0)
 -      return varnish_submit_derive(conf->instance, "mempool",
 +      return varnish_submit_gauge(conf->instance, "mempool",
                                     "objects", "timed_out", val);
      else if (strcmp(name, "toosmall") == 0)
 -      return varnish_submit_derive(conf->instance, "mempool",
 +      return varnish_submit_gauge(conf->instance, "mempool",
                                     "objects", "too_small", val);
      else if (strcmp(name, "surplus") == 0)
 -      return varnish_submit_derive(conf->instance, "mempool",
 +      return varnish_submit_gauge(conf->instance, "mempool",
                                     "objects", "surplus", val);
      else if (strcmp(name, "randry") == 0)
 -      return varnish_submit_derive(conf->instance, "mempool",
 +      return varnish_submit_gauge(conf->instance, "mempool",
                                     "objects", "ran_dry", val);
    }
+   if (conf->collect_mse) {
+     if (strcmp(name, "c_full") == 0)
+       return varnish_submit_derive(conf->instance, "mse",
+                                   "total_operations", "full_allocs", val);
+     else if (strcmp(name, "c_truncated") == 0)
+       return varnish_submit_derive(conf->instance, "mse",
+                                   "total_operations", "truncated_allocs", val);
+     else if (strcmp(name, "c_expanded") == 0)
+       return varnish_submit_derive(conf->instance, "mse",
+                                   "total_operations", "expanded_allocs", val);
+     else if (strcmp(name, "c_failed") == 0)
+       return varnish_submit_derive(conf->instance, "mse",
+                                   "total_operations", "failed_allocs", val);
+     else if (strcmp(name, "c_bytes") == 0)
+       return varnish_submit_derive(conf->instance, "mse",
+                                   "total_bytes", "bytes_allocated", val);
+     else if (strcmp(name, "c_freed") == 0)
+       return varnish_submit_derive(conf->instance, "mse",
+                                   "total_bytes", "bytes_freed", val);
+     else if (strcmp(name, "g_fo_alloc") == 0)
+       return varnish_submit_derive(conf->instance, "mse",
+                                   "total_operations", "fo_allocs_outstanding", val);
+     else if (strcmp(name, "g_fo_bytes") == 0)
+       return varnish_submit_gauge(conf->instance, "mse",
+                                   "bytes", "fo_bytes_outstanding", val);
+     else if (strcmp(name, "g_membuf_alloc") == 0)
+       return varnish_submit_gauge(conf->instance, "mse",
+                                   "objects", "membufs_allocated", val);
+     else if (strcmp(name, "g_membuf_inuse") == 0)
+       return varnish_submit_gauge(conf->instance, "mse",
+                                   "objects", "membufs_inuse", val);
+     else if (strcmp(name, "g_bans_bytes") == 0)
+       return varnish_submit_gauge(conf->instance, "mse",
+                                   "bytes", "persisted_banspace_used", val);
+     else if (strcmp(name, "g_bans_space") == 0)
+       return varnish_submit_gauge(conf->instance, "mse",
+                                   "bytes", "persisted_banspace_available", val);
+     else if (strcmp(name, "g_bans_persisted") == 0)
+       return varnish_submit_derive(conf->instance, "mse",
+                                   "total_operations", "bans_persisted", val);
+     else if (strcmp(name, "g_bans_lost") == 0)
+       return varnish_submit_derive(conf->instance, "mse",
+                                   "total_operations", "bans_lost", val);
+      /* mse seg */
+     else if (strcmp(name, "g_journal_bytes") == 0)
+       return varnish_submit_gauge(conf->instance, "mse_reg",
+                                   "bytes", "journal_bytes_used", val);
+     else if (strcmp(name, "g_journal_space") == 0)
+       return varnish_submit_gauge(conf->instance, "mse_reg",
+                                   "bytes", "journal_bytes_free", val);
+     /* mse segagg */
+     else if (strcmp(name, "g_bigspace") == 0)
+       return varnish_submit_gauge(conf->instance, "mse_segagg",
+                                   "bytes", "big_extents_bytes_available", val);
+     else if (strcmp(name, "g_extfree") == 0)
+       return varnish_submit_gauge(conf->instance, "mse_segagg",
+                                   "objects", "free_extents", val);
+     else if (strcmp(name, "g_sparenode") == 0)
+       return varnish_submit_gauge(conf->instance, "mse_segagg",
+                                   "objects", "spare_nodes_available", val);
+     else if (strcmp(name, "g_objnode") == 0)
+       return varnish_submit_gauge(conf->instance, "mse_segagg",
+                                   "objects", "object_nodes_in_use", val);
+     else if (strcmp(name, "g_extnode") == 0)
+       return varnish_submit_gauge(conf->instance, "mse_segagg",
+                                   "objects", "extent_nodes_in_use", val);
+     else if (strcmp(name, "g_bigextfree") == 0)
+       return varnish_submit_gauge(conf->instance, "mse_segagg",
+                                   "objects", "free_big_extents", val);
+     else if (strcmp(name, "c_pruneloop") == 0)
+       return varnish_submit_derive(conf->instance, "mse_segagg",
+                                   "total_operations", "prune_loops", val);
+     else if (strcmp(name, "c_pruned") == 0)
+       return varnish_submit_derive(conf->instance, "mse_segagg",
+                                   "total_objects", "pruned_objects", val);
+     else if (strcmp(name, "c_spared") == 0)
+       return varnish_submit_derive(conf->instance, "mse_segagg",
+                                   "total_operations", "spared_objects", val);
+     else if (strcmp(name, "c_skipped") == 0)
+       return varnish_submit_derive(conf->instance, "mse_segagg",
+                                   "total_operations", "missed_objects", val);
+     else if (strcmp(name, "c_nuked") == 0)
+       return varnish_submit_derive(conf->instance, "mse_segagg",
+                                   "total_operations", "nuked_objects", val);
+     else if (strcmp(name, "c_sniped") == 0)
+       return varnish_submit_derive(conf->instance, "mse_segagg",
+                                   "total_operations", "sniped_objects", val);
+   }
  #endif
  
    return 0;
@@@ -1355,6 -1465,7 +1465,7 @@@ static int varnish_config_apply_default
    conf->collect_mgt = 0;
    conf->collect_smf = 0;
    conf->collect_vbe = 0;
+   conf->collect_mse = 0;
  #endif
  
    return 0;
@@@ -1543,6 -1654,13 +1654,13 @@@ static int varnish_config_instance(cons
        WARNING("Varnish plugin: \"%s\" is available for Varnish %s only.",
                child->key, "v4");
  #endif
+     else if (strcasecmp("CollectMSE", child->key) == 0)
+ #if HAVE_VARNISH_V4
+       cf_util_get_boolean(child, &conf->collect_mse);
+ #else
+       WARNING("Varnish plugin: \"%s\" is available for Varnish %s only.",
+               child->key, "Plus v4");
+ #endif
      else {
        WARNING("Varnish plugin: Ignoring unknown "
                "configuration option: \"%s\". Did "
  #if HAVE_VARNISH_V4
        && !conf->collect_vsm && !conf->collect_vbe && !conf->collect_smf
        && !conf->collect_mgt && !conf->collect_lck && !conf->collect_mempool
+       && !conf->collect_mse
  #endif
        ) {
      WARNING("Varnish plugin: No metric has been configured for "