~ubuntu-branches/ubuntu/vivid/monit/vivid-proposed

« back to all changes in this revision

Viewing changes to src/monit.h

  • Committer: Package Import Robot
  • Author(s): Sergey B Kirpichev
  • Date: 2014-12-28 17:32:53 UTC
  • mfrom: (1.1.25)
  • Revision ID: package-import@ubuntu.com-20141228173253-mxmq0pc92jzcyjv2
Tags: 1:5.11-1
* Imported Upstream version 5.11
* Refresh patches
* Comment for rsyslog plugin (Closes: #771322).

Show diffs side-by-side

added added

removed removed

Lines of Context:
85
85
#include "system/Process.h"
86
86
#include "util/Str.h"
87
87
#include "util/StringBuffer.h"
 
88
#include "system/NetStatistics.h"
88
89
 
89
90
 
90
91
#define MONITRC            "monitrc"
116
117
 
117
118
#define START_DELAY        0
118
119
#define EXEC_TIMEOUT       30
119
 
#define PROGRAM_TIMEOUT    600
 
120
#define PROGRAM_TIMEOUT    300
120
121
 
121
122
#define START_HTTP         1
122
123
#define STOP_HTTP          2
156
157
#define TIME_MINUTE        60
157
158
#define TIME_HOUR          3600
158
159
#define TIME_DAY           86400
 
160
#define TIME_MONTH         2678400
159
161
 
160
162
#define ACTION_IGNORE      0
161
163
#define ACTION_ALERT       1
174
176
#define TYPE_SYSTEM        5
175
177
#define TYPE_FIFO          6
176
178
#define TYPE_PROGRAM       7
 
179
#define TYPE_NET           8
177
180
 
178
181
#define RESOURCE_ID_CPU_PERCENT       1
179
182
#define RESOURCE_ID_MEM_PERCENT       2
200
203
 
201
204
#define UNIT_BYTE          1
202
205
#define UNIT_KILOBYTE      1024
203
 
#define UNIT_MEGABYTE      1048580
204
 
#define UNIT_GIGABYTE      1073740000
 
206
#define UNIT_MEGABYTE      1048576
 
207
#define UNIT_GIGABYTE      1073741824
205
208
 
206
209
#define HASH_UNKNOWN       0
207
210
#define HASH_MD5           1
648
651
} *Uptime_T;
649
652
 
650
653
 
 
654
typedef struct mynetlinkstatus {
 
655
        EventAction_T action;  /**< Description of the action upon event occurence */
 
656
 
 
657
        /** For internal use */
 
658
        struct mynetlinkstatus *next;                      /**< next link in chain */
 
659
} *NetLinkStatus_T;
 
660
 
 
661
 
 
662
typedef struct mynetlinkspeed {
 
663
        int duplex;                                        /**< Last duplex status */
 
664
        long long speed;                                     /**< Last speed [bps] */
 
665
        EventAction_T action;  /**< Description of the action upon event occurence */
 
666
 
 
667
        /** For internal use */
 
668
        struct mynetlinkspeed *next;                       /**< next link in chain */
 
669
} *NetLinkSpeed_T;
 
670
 
 
671
 
 
672
typedef struct mynetlinksaturation {
 
673
        Operator_Type operator;                           /**< Comparison operator */
 
674
        float limit;                                     /**< Saturation limit [%] */
 
675
        EventAction_T action;  /**< Description of the action upon event occurence */
 
676
 
 
677
        /** For internal use */
 
678
        struct mynetlinksaturation *next;                  /**< next link in chain */
 
679
} *NetLinkSaturation_T;
 
680
 
 
681
 
 
682
typedef struct mybandwidth {
 
683
        Operator_Type operator;                           /**< Comparison operator */
 
684
        unsigned long long limit;                              /**< Data watermark */
 
685
        int rangecount;                            /**< Time range to watch: count */
 
686
        int range;                                  /**< Time range to watch: unit */
 
687
        EventAction_T action;  /**< Description of the action upon event occurence */
 
688
 
 
689
        /** For internal use */
 
690
        struct mybandwidth *next;                     /**< next bandwidth in chain */
 
691
} *Bandwidth_T;
 
692
 
 
693
 
651
694
/** Defines checksum object */
652
695
typedef struct mychecksum {
653
696
        MD_T  hash;                     /**< A checksum hash computed for the path */
696
739
} *Gid_T;
697
740
 
698
741
 
 
742
/** Defines pid object */
 
743
typedef struct mypid {
 
744
        EventAction_T action;  /**< Description of the action upon event occurence */
 
745
 
 
746
        /** For internal use */
 
747
        struct mypid *next;                                 /**< next pid in chain */
 
748
} *Pid_T;
 
749
 
 
750
 
699
751
/** Defines filesystem configuration */
700
752
typedef struct myfilesystem {
701
753
        int  resource;                        /**< Whether to check inode or space */
759
811
                        int    total_cpu_percent;                         /**< percentage * 10 */
760
812
                        time_t uptime;                                     /**< Process uptime */
761
813
                } process;
 
814
 
 
815
                struct {
 
816
                        NetStatistics_T stats;
 
817
                } net;
762
818
        } priv;
763
819
} *Info_T;
764
820
 
798
854
        Match_T     matchlist;                             /**< Content Match list */
799
855
        Match_T     matchignorelist;                /**< Content Match ignore list */
800
856
        Timestamp_T timestamplist;                       /**< Timestamp check list */
 
857
        Pid_T       pidlist;                                   /**< Pid check list */
 
858
        Pid_T       ppidlist;                                 /**< PPid check list */
 
859
        Status_T    statuslist;           /**< Program execution status check list */
801
860
        Uid_T       uid;                                            /**< Uid check */
802
861
        Uid_T       euid;                                 /**< Effective Uid check */
803
862
        Gid_T       gid;                                            /**< Gid check */
804
 
        Status_T    statuslist;           /**< Program execution status check list */
805
 
 
806
 
 
807
 
        EventAction_T action_PID;                      /**< Action upon pid change */
808
 
        EventAction_T action_PPID;                    /**< Action upon ppid change */
 
863
        NetLinkStatus_T netlinkstatuslist;           /**< Network link status list */
 
864
        NetLinkSpeed_T netlinkspeedlist;              /**< Network link speed list */
 
865
        NetLinkSaturation_T netlinksaturationlist;  /**< Net. link saturation list */
 
866
        Bandwidth_T uploadbyteslist;                  /**< Upload bytes check list */
 
867
        Bandwidth_T uploadpacketslist;              /**< Upload packets check list */
 
868
        Bandwidth_T downloadbyteslist;              /**< Download bytes check list */
 
869
        Bandwidth_T downloadpacketslist;          /**< Download packets check list */
 
870
 
809
871
        EventAction_T action_FSFLAG;      /**< Action upon filesystem flags change */
810
872
 
811
873
        /** General event handlers */
1021
1083
int  check_system(Service_T);
1022
1084
int  check_fifo(Service_T);
1023
1085
int  check_program(Service_T);
 
1086
int  check_net(Service_T);
1024
1087
int  check_URL(Service_T s);
1025
1088
int  sha_md5_stream (FILE *, void *, void *);
1026
1089
void reset_procinfo(Service_T);