root/src/noit_poller.h

Revision 80235b3f11f72d0a54a7ae6df1139d23ed59e2ac, 1.7 kB (checked in by Theo Schlossnagle <jesus@omniti.com>, 6 years ago)

checkers

  • Property mode set to 100644
Line 
1 /*
2  * Copyright (c) 2007, OmniTI Computer Consulting, Inc.
3  * All rights reserved.
4  */
5
6 #ifndef _NOIT_POLLER_H
7 #define _NOIT_POLLER_H
8
9 #include "noit_defines.h"
10
11 #include <uuid/uuid.h>
12 #include <netinet/in.h>
13
14 #include "eventer/eventer.h"
15 #include "utils/noit_hash.h"
16
17 /*
18  * Checks:
19  *  attrs:
20  *   UUID
21  *   host (target)
22  *   check (module)
23  *   name (identifying the check to the user if
24  *         multiple checks of the same module are specified)
25  *   config (params for the module)
26  *   period (ms)
27  *   timeout (ms)
28  *  transient:
29  *   eventer_t (fire)
30  *   stats_t [inprogress, last]
31  *   closure
32  */
33
34 #define NP_RUNNING  0x00000001
35 #define NP_KILLED   0x00000002
36 #define NP_DISABLED 0x00000004
37
38 typedef struct {
39   struct timeval whence;
40   u_int32_t duration;
41   char *status;
42 } stats_t;
43
44 typedef struct {
45   uuid_t checkid;
46   int8_t target_family;
47   union {
48     struct in_addr addr;
49     struct in6_addr addr6;
50   } target_addr;
51   char *target;
52   char *module;
53   char *name;
54   noit_hash_table *config;
55   u_int32_t period;
56   u_int32_t timeout;
57   u_int32_t flags;             /* NP_KILLED, NP_RUNNING */
58
59   eventer_t fire_event;
60   struct {
61     stats_t in_progress;
62     stats_t last;
63   } stats;
64   void *closure;
65 } * noit_check_t;
66
67 API_EXPORT(void) noit_poller_init();
68 API_EXPORT(void) noit_poller_load_checks();
69
70 API_EXPORT(int)
71   noit_poller_schedule(const char *target,
72                        const char *module,
73                        const char *name,
74                        noit_hash_table *config,
75                        u_int32_t period,
76                        u_int32_t timeout,
77                        uuid_t in,
78                        uuid_t out);
79
80 API_EXPORT(int)
81   noit_poller_deschedule(uuid_t in);
82
83 #endif
Note: See TracBrowser for help on using the browser.