aboutsummaryrefslogtreecommitdiff
path: root/monitor.h
diff options
context:
space:
mode:
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();