Browse Source

freeipmi: add availability status chart and alarm (#15151)

Ilya Mashchenko 1 year ago
parent
commit
892255b237
3 changed files with 27 additions and 0 deletions
  1. 15 0
      collectors/freeipmi.plugin/freeipmi_plugin.c
  2. 1 0
      health/Makefile.am
  3. 11 0
      health/health.d/plugin.conf

+ 15 - 0
collectors/freeipmi.plugin/freeipmi_plugin.c

@@ -1833,6 +1833,21 @@ int main (int argc, char **argv) {
     for(iteration = 0; 1 ; iteration++) {
         usec_t dt = heartbeat_next(&hb, step);
 
+        if (iteration) {
+            if (iteration == 1) {
+                fprintf(
+                    stdout,
+                    "CHART netdata.freeipmi_availability_status '' 'Plugin availability status' 'status' plugins netdata.plugin_availability_status line 146000 %d\n"
+                    "DIMENSION available '' absolute 1 1\n",
+                    netdata_update_every);
+            }
+            fprintf(
+                stdout,
+                "BEGIN netdata.freeipmi_availability_status\n"
+                "SET available = 1\n"
+                "END\n");
+        }
+
         if(debug && iteration)
             fprintf(stderr, "freeipmi.plugin: iteration %zu, dt %llu usec, sensors collected %zu, sensors sent to netdata %zu \n"
                     , iteration

+ 1 - 0
health/Makefile.am

@@ -69,6 +69,7 @@ dist_healthconfig_DATA = \
     health.d/nvme.conf \
     health.d/nut.conf \
     health.d/pihole.conf \
+    health.d/plugin.conf \
     health.d/ping.conf \
     health.d/postgres.conf \
     health.d/portcheck.conf \

+ 11 - 0
health/health.d/plugin.conf

@@ -0,0 +1,11 @@
+ template: plugin_availability_status
+       on: netdata.plugin_availability_status
+    class: Errors
+     type: Netdata
+     calc: $now - $last_collected_t
+    units: seconds ago
+    every: 10s
+     warn: $this > (($status >= $WARNING)  ? ($update_every) : (20 * $update_every))
+    delay: down 5m multiplier 1.5 max 1h
+     info: the amount of time that ${label:_collect_plugin} did not report its availability status
+       to: sysadmin