From 1fa9b6e34e5c92aa7fe492417cda2d21ec067ff8 Mon Sep 17 00:00:00 2001 From: arf20 Date: Tue, 28 Oct 2025 13:45:38 +0100 Subject: unified config, refactor, for alerts --- monitor.h | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) (limited to 'monitor.h') 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 + +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(); -- cgit v1.2.3