06359df6bd9c1a687a392213158053c3554c3b07
[openafs.git] / src / afsmonitor / afsmonitor.h
1 /*
2  * Copyright 2000, International Business Machines Corporation and others.
3  * All Rights Reserved.
4  * 
5  * This software has been released under the terms of the IBM Public
6  * License.  For details, see the LICENSE file in the top-level source
7  * directory or online at http://www.openafs.org/dl/license10.html
8  */
9
10 /* include file for afsmonitor */
11
12
13 #define HOST_NAME_LEN   80      /* length of server/cm names */
14
15 #define XSTAT_FS_FULLPERF_RESULTS_LEN 424       /* value of xstat_fs_Results.data.AFS_COllData_len. We use this value before making any xstat calls and hence need this definition. Remember to change this value appropriately if the size of any of the fs related data structures change. Need to find a better way of doing this */
16
17 #define XSTAT_CM_FULLPERF_RESULTS_LEN 740       /* value of xstat_cm_Results.data.AFS_COllData_len. We use this value before making any xstat calls and hence need this definition. Remember to change this value appropriately if the size of any of the cm related data structures change. Need to find a better way of doing this */
18
19 /* THRESHOLD STRUCTURE DEFINITIONS */
20
21 #define THRESH_VAR_NAME_LEN 80
22 #define THRESH_VAR_LEN 16
23
24 /* structure of each threshold item */
25 struct Threshold {
26     char itemName[THRESH_VAR_NAME_LEN]; /* field name */
27     int index;                  /* positional index */
28     char threshVal[THRESH_VAR_LEN];     /* user provided threshold value */
29     char handler[256];          /* user provided ovf handler */
30 };
31
32
33 /* structures to store info of hosts to be monitored */
34 struct afsmon_hostEntry {
35     char hostName[HOST_NAME_LEN];       /* fs or cm host name */
36     int numThresh;              /* number of thresholds for this host */
37     struct Threshold *thresh;   /* ptr to threshold entries */
38     struct afsmon_hostEntry *next;
39 };
40
41
42 #define NUM_FS_STAT_ENTRIES 271 /* number of file server statistics
43                                  * entries to display */
44 #define FS_STAT_STRING_LEN 14   /* max length of each string above */
45 #define NUM_CM_STAT_ENTRIES 571 /* number of cache manager statistics
46                                  * entries to display */
47 #define CM_STAT_STRING_LEN 14   /* max length of each string above */
48
49 /* structures to store statistics in a format convenient to dump to the 
50 screen */
51 /* for file servers */
52 struct fs_Display_Data {
53     char hostName[HOST_NAME_LEN];
54     int probeOK;                /* 0 => probe failed */
55     char data[NUM_FS_STAT_ENTRIES][FS_STAT_STRING_LEN];
56     short threshOvf[NUM_FS_STAT_ENTRIES];       /* overflow flags */
57     int ovfCount;               /* overflow count */
58 };
59
60 /* for cache managers */
61 struct cm_Display_Data {
62     char hostName[HOST_NAME_LEN];
63     int probeOK;                /* 0 => probe failed */
64     char data[NUM_CM_STAT_ENTRIES][CM_STAT_STRING_LEN];
65     short threshOvf[NUM_CM_STAT_ENTRIES];       /* overflow flags */
66     int ovfCount;               /* overflow count */
67 };
68
69 /* GTX related definitions */
70
71 /* when an FS or CM probe cycle completes the ovw_refresh() routine is called
72 to update the overview screen. The FS & CM probes are independent of each
73 other. Hence we should update only the one that completed. */
74
75 #define OVW_UPDATE_FS   1
76 #define OVW_UPDATE_CM   2
77 #define OVW_UPDATE_BOTH 3
78
79 /* Data is categorized into sections and groups to enable to user to choose
80 what he wants displayed. */
81 #define FS_NUM_DATA_CATEGORIES 9        /* # of fs categories */
82 #define CM_NUM_DATA_CATEGORIES 16       /* # of cm categories */
83
84 /* Set this  enable detailed debugging with the -debug switch */
85 #define DETAILED_DEBUG 0
86
87 /* afsmon-output.c */
88   
89 extern int afsmon_fsOutput(char *, int);
90 extern int afsmon_cmOutput(char *, int);
91
92 /* afsmon-win.c */
93  
94 extern int ovw_refresh(int, int);
95 extern int fs_refresh(int, int);
96 extern int cm_refresh(int, int);
97 extern int gtx_initialize(void);
98