diff options
| author | arf20 <aruizfernandez05@gmail.com> | 2025-10-28 13:45:38 +0100 |
|---|---|---|
| committer | arf20 <aruizfernandez05@gmail.com> | 2025-10-28 13:45:38 +0100 |
| commit | 1fa9b6e34e5c92aa7fe492417cda2d21ec067ff8 (patch) | |
| tree | 3d8f8c28cbc0d5d8632c72449a4a45bdab278425 /monitor.h | |
| parent | 52dc621b426fcb55ef3887e67de08a612b15480d (diff) | |
| download | arfnet2-status-1fa9b6e34e5c92aa7fe492417cda2d21ec067ff8.tar.gz arfnet2-status-1fa9b6e34e5c92aa7fe492417cda2d21ec067ff8.zip | |
Diffstat (limited to 'monitor.h')
| -rw-r--r-- | monitor.h | 35 |
1 files changed, 34 insertions, 1 deletions
@@ -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(); |
