aboutsummaryrefslogtreecommitdiff
path: root/monitor.h
diff options
context:
space:
mode:
authorarf20 <aruizfernandez05@gmail.com>2025-10-28 13:45:38 +0100
committerarf20 <aruizfernandez05@gmail.com>2025-10-28 13:45:38 +0100
commit1fa9b6e34e5c92aa7fe492417cda2d21ec067ff8 (patch)
tree3d8f8c28cbc0d5d8632c72449a4a45bdab278425 /monitor.h
parent52dc621b426fcb55ef3887e67de08a612b15480d (diff)
downloadarfnet2-status-1fa9b6e34e5c92aa7fe492417cda2d21ec067ff8.tar.gz
arfnet2-status-1fa9b6e34e5c92aa7fe492417cda2d21ec067ff8.zip
unified config, refactor, for alertsHEADmaster
Diffstat (limited to 'monitor.h')
-rw-r--r--monitor.h35
1 files changed, 34 insertions, 1 deletions
diff --git a/monitor.h b/monitor.h
index f9b1af3..35844cc 100644
--- a/monitor.h
+++ b/monitor.h
@@ -1,7 +1,40 @@
#ifndef _MONITOR_H
#define _MONITOR_H
-int monitor_init(const char *cfg_file, const char *log_file);
+#include <time.h>
+
+typedef enum {
+ TYPE_REACH,
+ TYPE_DNS,
+ TYPE_WEB
+} type_t;
+
+typedef enum {
+ STATUS_DOWN,
+ STATUS_UP
+} status_t;
+
+typedef struct {
+ time_t time;
+ status_t status;
+} event_t;
+
+typedef struct {
+ type_t type;
+ char *name;
+ char *target;
+
+ status_t status, status_1;
+
+ event_t *events;
+ size_t events_size, events_capacity;
+} target_t;
+
+
+extern target_t *targets;
+extern size_t targets_size;
+
+int monitor_init();
const char *monitor_generate_status_html();
const char *monitor_generate_incidents_html();
void monitor_check();