Merge branch 'master' into connectivity
authorAndrew Bays <andrew.bays@gmail.com>
Wed, 18 Sep 2019 12:31:32 +0000 (08:31 -0400)
committerGitHub <noreply@github.com>
Wed, 18 Sep 2019 12:31:32 +0000 (08:31 -0400)
1  2 
Makefile.am
configure.ac
src/collectd.conf.in
src/collectd.conf.pod

diff --combined Makefile.am
@@@ -768,15 -768,12 +768,21 @@@ chrony_la_LDFLAGS = $(PLUGIN_LDFLAGS
  chrony_la_LIBADD = -lm
  endif
  
+ if BUILD_PLUGIN_CHECK_UPTIME
+ pkglib_LTLIBRARIES += check_uptime.la
+ check_uptime_la_SOURCES = src/check_uptime.c
+ check_uptime_la_LDFLAGS = $(PLUGIN_LDFLAGS)
+ endif
 +if BUILD_PLUGIN_CONNECTIVITY
 +pkglib_LTLIBRARIES += connectivity.la
 +connectivity_la_SOURCES = src/connectivity.c
 +connectivity_la_CFLAGS = $(AM_CFLAGS) $(BUILD_WITH_LIBMNL_CFLAGS)
 +connectivity_la_CPPFLAGS = $(AM_CPPFLAGS) $(BUILD_WITH_LIBYAJL_CPPFLAGS)
 +connectivity_la_LDFLAGS = $(PLUGIN_LDFLAGS) $(BUILD_WITH_LIBYAJL_LDFLAGS)
 +connectivity_la_LIBADD = $(BUILD_WITH_LIBYAJL_LIBS) $(BUILD_WITH_LIBMNL_LIBS) libignorelist.la
 +endif
 +
  if BUILD_PLUGIN_CONNTRACK
  pkglib_LTLIBRARIES += conntrack.la
  conntrack_la_SOURCES = src/conntrack.c
diff --combined configure.ac
@@@ -6362,7 -6362,6 +6362,7 @@@ plugin_battery="no
  plugin_bind="no"
  plugin_ceph="no"
  plugin_cgroups="no"
 +plugin_connectivity="no"
  plugin_conntrack="no"
  plugin_contextswitch="no"
  plugin_cpu="no"
@@@ -6481,10 -6480,6 +6481,10 @@@ if test "x$ac_system" = "xLinux"; the
      plugin_ovs_events="yes"
      plugin_ovs_stats="yes"
      plugin_procevent="yes"
 +
 +    if test "x$with_libmnl" = "xyes"; then
 +      plugin_connectivity="yes"
 +    fi
    fi
  
    if test "x$have_pci_regs_h" = "xyes"; then
@@@ -6795,7 -6790,7 +6795,8 @@@ AC_PLUGIN([bind],                [$plug
  AC_PLUGIN([ceph],                [$plugin_ceph],              [Ceph daemon statistics])
  AC_PLUGIN([cgroups],             [$plugin_cgroups],           [CGroups CPU usage accounting])
  AC_PLUGIN([chrony],              [yes],                       [Chrony statistics])
+ AC_PLUGIN([check_uptime],        [yes],                       [Notify about uptime reset])
 +AC_PLUGIN([connectivity],        [$plugin_connectivity],      [Network interface up/down events])
  AC_PLUGIN([conntrack],           [$plugin_conntrack],         [nf_conntrack statistics])
  AC_PLUGIN([contextswitch],       [$plugin_contextswitch],     [context switch statistics])
  AC_PLUGIN([cpu],                 [$plugin_cpu],               [CPU usage statistics])
@@@ -7227,7 -7222,7 +7228,8 @@@ AC_MSG_RESULT([    bind  . . . . . . . 
  AC_MSG_RESULT([    ceph  . . . . . . . . $enable_ceph])
  AC_MSG_RESULT([    cgroups . . . . . . . $enable_cgroups])
  AC_MSG_RESULT([    chrony. . . . . . . . $enable_chrony])
+ AC_MSG_RESULT([    check_uptime. . . . . $enable_check_uptime])
 +AC_MSG_RESULT([    connectivity. . . . . $enable_connectivity])
  AC_MSG_RESULT([    conntrack . . . . . . $enable_conntrack])
  AC_MSG_RESULT([    contextswitch . . . . $enable_contextswitch])
  AC_MSG_RESULT([    cpu . . . . . . . . . $enable_cpu])
diff --combined src/collectd.conf.in
  #@BUILD_PLUGIN_CEPH_TRUE@LoadPlugin ceph
  #@BUILD_PLUGIN_CGROUPS_TRUE@LoadPlugin cgroups
  #@BUILD_PLUGIN_CHRONY_TRUE@LoadPlugin chrony
+ #@BUILD_PLUGIN_CHECK_UPTIME_TRUE@LoadPlugin check_uptime
 +#@BUILD_PLUGIN_CONNECTIVITY_TRUE@LoadPlugin connectivity
  #@BUILD_PLUGIN_CONNTRACK_TRUE@LoadPlugin conntrack
  #@BUILD_PLUGIN_CONTEXTSWITCH_TRUE@LoadPlugin contextswitch
  @BUILD_PLUGIN_CPU_TRUE@@BUILD_PLUGIN_CPU_TRUE@LoadPlugin cpu
  #     Timeout "2"
  #</Plugin>
  
 +#<Plugin connectivity>
 +#  Interface eth0
 +#</Plugin>
 +
  #<Plugin cgroups>
  #  CGroup "libvirt"
  #  IgnoreSelected false
diff --combined src/collectd.conf.pod
@@@ -1548,6 -1548,35 +1548,35 @@@ at all, B<all> cgroups are selected
  
  =back
  
+ =head2 Plugin C<check_uptime>
+ The I<check_uptime plugin> designed to check and notify about host or service
+ status based on I<uptime> metric.
+ When new metric of I<uptime> type appears in cache, OK notification is sent.
+ When new value for metric is less than previous value, WARNING notification is
+ sent about host/service restart.
+ When no new updates comes for metric and cache entry expires, then FAILURE
+ notification is sent about unreachable host or service.
+ By default (when no explicit configuration), plugin checks for I<uptime> metric.
+ B<Synopsis:>
+  <Plugin "check_uptime">
+    Type "uptime"
+    Type "my_uptime_type"
+  </Plugin>
+ =over 4
+ =item B<Type> I<Type>
+ Metric type to check for status/values. The type should consist single GAUGE
+ data source.
+ =back
  =head2 Plugin C<chrony>
  
  The C<chrony> plugin collects ntp data from a B<chronyd> server, such as clock
@@@ -1574,47 -1603,6 +1603,47 @@@ Connection timeout in seconds. Default
  
  =back
  
 +=head2 Plugin Connectivity
 +
 +connectivity - Documentation of collectd's C<connectivity plugin>
 +
 +
 +  LoadPlugin connectivity
 +  # ...
 +  <Plugin connectivity>
 +    Interface eth0
 +  </Plugin>
 +
 +The C<connectivity plugin> queries interface status using netlink (man 7 netlink) which provides information about network interfaces via the NETLINK_ROUTE family (man 7 rtnetlink). The plugin translates the value it receives to collectd's internal format and, depending on the write plugins you have loaded, it may be written to disk or submitted to another instance.
 +The plugin listens to interfaces enumerated within the plugin configuration (see below).  If no interfaces are listed, then the default is for all interfaces to be monitored.
 +
 +This example shows C<connectivity plugin> monitoring all interfaces.
 +LoadPlugin connectivity
 +<Plugin connectivity>
 +</Plugin>
 +
 +This example shows C<connectivity plugin> monitoring 2 interfaces, "eth0" and "eth1".
 +LoadPlugin connectivity
 +<Plugin connectivity>
 +  Interface eth0
 +  Interface eth1
 +</Plugin>
 +
 +This example shows C<connectivity plugin> monitoring all interfaces except "eth1".
 +LoadPlugin connectivity
 +<Plugin connectivity>
 +  Interface eth1
 +  IgnoreSelected true
 +</Plugin>
 + 
 +=over 4
 +
 +=item B<Interface> I<interface_name>
 +
 +interface(s) to monitor connect to. 
 +
 +=back
 +
  =head2 Plugin C<conntrack>
  
  This plugin collects IP conntrack statistics.