More styling + ignorelist create check
authorAndrew Bays <abays@redhat.com>
Mon, 5 Nov 2018 15:17:20 +0000 (10:17 -0500)
committerAndrew Bays <andrew.bays@gmail.com>
Thu, 5 Sep 2019 13:21:22 +0000 (09:21 -0400)
src/collectd.conf.pod
src/connectivity.c

index 102955a..00328be 100644 (file)
@@ -1613,11 +1613,6 @@ LoadPlugin connectivity
 
 interface(s) to monitor connect to. 
 
-=item I<Status>
-
-If I<Status> is greater than or equal to zero the message indicates interface is up,
-if I<Status> is less than zero the message indicates interface is down. 
-
 =back
 
 =head2 Plugin C<conntrack>
index c470c99..f9edece 100644 (file)
@@ -558,8 +558,7 @@ static int read_event(int nl, int (*msg_handler)(struct nlmsghdr *)) {
         continue;
       }
 
-      if (errno == EINTR)
-      {
+      if (errno == EINTR) {
         // Interrupt, so just return
         return 0;
       }
@@ -614,13 +613,9 @@ static void send_interface_status() {
   for (interface_list_t *il = interface_list_head; il != NULL;
        il = il->next) /* {{{ */
   {
-    uint32_t status;
-    uint32_t prev_status;
-    uint32_t sent;
-
-    status = il->status;
-    prev_status = il->prev_status;
-    sent = il->sent;
+    uint32_t status = il->status;
+    uint32_t prev_status = il->prev_status;
+    uint32_t sent = il->sent;
 
     if (status != prev_status && sent == 0) {
       connectivity_dispatch_notification(il->interface, "gauge", status,
@@ -945,6 +940,9 @@ static int connectivity_config(const char *key, const char *value) /* {{{ */
 {
   if (ignorelist == NULL) {
     ignorelist = ignorelist_create(/* invert = */ 1);
+
+    if (ignorelist == NULL)
+      return -1;
   }
 
   if (strcasecmp(key, "Interface") == 0) {