| # Gaudi Framework, version v21r10p1 |

Home |  | Generated: 29 Jul 2010

# mon_constants.h File Reference

Definitions of the constants associated with the parameters from job and system monitoring. More...

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

## Defines
#define | SYS_LOAD1 0
#define | SYS_LOAD5 1
#define | SYS_LOAD15 2
#define | SYS_CPU_USR 3
#define | SYS_CPU_SYS 4
#define | SYS_CPU_IDLE 5
#define | SYS_CPU_NICE 6
#define | SYS_CPU_USAGE 7
#define | SYS_MEM_FREE 8
#define | SYS_MEM_USED 9
#define | SYS_MEM_USAGE 10
#define | SYS_PAGES_IN 11
#define | SYS_PAGES_OUT 12
#define | SYS_NET_IN 13
#define | SYS_NET_OUT 14
#define | SYS_NET_ERRS 15
#define | SYS_SWAP_FREE 16
#define | SYS_SWAP_USED 17
#define | SYS_SWAP_USAGE 18
#define | SYS_SWAP_IN 19
#define | SYS_SWAP_OUT 20
#define | SYS_PROCESSES 21
#define | SYS_UPTIME 22
#define | SYS_NET_SOCKETS 23
#define | SYS_NET_TCP_DETAILS 24
#define | GEN_HOSTNAME 0
#define | GEN_IP 1
#define | GEN_CPU_MHZ 2
#define | GEN_NO_CPUS 3
#define | GEN_TOTAL_MEM 4
#define | GEN_TOTAL_SWAP 5
#define | GEN_CPU_VENDOR_ID 6
#define | GEN_CPU_FAMILY 7
#define | GEN_CPU_MODEL 8
#define | GEN_CPU_MODEL_NAME 9
#define | GEN_BOGOMIPS 10
#define | JOB_RUN_TIME 0
#define | JOB_CPU_TIME 1
#define | JOB_CPU_USAGE 2
#define | JOB_MEM_USAGE 3
#define | JOB_WORKDIR_SIZE 4
#define | JOB_DISK_TOTAL 5
#define | JOB_DISK_USED 6
#define | JOB_DISK_FREE 7
#define | JOB_DISK_USAGE 8
#define | JOB_VIRTUALMEM 9
#define | JOB_RSS 10
#define | JOB_OPEN_FILES 11
#define | SOCK_TCP 0
#define | SOCK_UDP 1
#define | SOCK_ICM 2
#define | SOCK_UNIX 3
#define | STATE_ESTABLISHED 0
#define | STATE_SYN_SENT 1
#define | STATE_SYN_RECV 2
#define | STATE_FIN_WAIT1 3
#define | STATE_FIN_WAIT2 4
#define | STATE_TIME_WAIT 5
#define | STATE_CLOSED 6
#define | STATE_CLOSE_WAIT 7
#define | STATE_LAST_ACK 8
#define | STATE_LISTEN 9
#define | STATE_CLOSING 10
#define | STATE_UNKNOWN 11
#define | N_TCP_STATES 12
## Functions
int | initSysParams (char *sysMonitorParams[])
| Fills the array given as argument with the names of the system parameters.
int | initGenParams (char *genMonitorParams[])
| Fills the array given as argument with the names of the general system parameters.
int | initJobParams (char *jobMonitorParams[])
| Fills the array given as argument with the names of the job parameters.
void | initSocketStatesMapTCP (char *socketStatesMapTCP[])
| Fills the table that associates the TCP socket state names with the symbolic constants.

## Detailed Description

Definitions of the constants associated with the parameters from job and system monitoring.

Definition in file mon_constants.h.

## Define Documentation

#define GEN_BOGOMIPS 10

Definition at line 81 of file mon_constants.h.

#define GEN_CPU_FAMILY 7

Definition at line 78 of file mon_constants.h.

#define GEN_CPU_MHZ 2

Definition at line 73 of file mon_constants.h.

#define GEN_CPU_MODEL 8

Definition at line 79 of file mon_constants.h.

#define GEN_CPU_MODEL_NAME 9

Definition at line 80 of file mon_constants.h.

#define GEN_CPU_VENDOR_ID 6

Definition at line 77 of file mon_constants.h.

#define GEN_HOSTNAME 0

Definition at line 71 of file mon_constants.h.

#define GEN_IP 1

Definition at line 72 of file mon_constants.h.

#define GEN_NO_CPUS 3

Definition at line 74 of file mon_constants.h.

#define GEN_TOTAL_MEM 4

Definition at line 75 of file mon_constants.h.

#define GEN_TOTAL_SWAP 5

Definition at line 76 of file mon_constants.h.

#define JOB_CPU_TIME 1

Definition at line 85 of file mon_constants.h.

#define JOB_CPU_USAGE 2

Definition at line 86 of file mon_constants.h.

#define JOB_DISK_FREE 7

Definition at line 91 of file mon_constants.h.

#define JOB_DISK_TOTAL 5

Definition at line 89 of file mon_constants.h.

#define JOB_DISK_USAGE 8

Definition at line 92 of file mon_constants.h.

#define JOB_DISK_USED 6

Definition at line 90 of file mon_constants.h.

#define JOB_MEM_USAGE 3

Definition at line 87 of file mon_constants.h.

#define JOB_OPEN_FILES 11

Definition at line 95 of file mon_constants.h.

#define JOB_RSS 10

Definition at line 94 of file mon_constants.h.

#define JOB_RUN_TIME 0

Definition at line 84 of file mon_constants.h.

#define JOB_VIRTUALMEM 9

Definition at line 93 of file mon_constants.h.

#define JOB_WORKDIR_SIZE 4

Definition at line 88 of file mon_constants.h.

#define N_TCP_STATES 12

Definition at line 118 of file mon_constants.h.

#define SOCK_ICM 2

Definition at line 101 of file mon_constants.h.

#define SOCK_TCP 0

Definition at line 99 of file mon_constants.h.

#define SOCK_UDP 1

Definition at line 100 of file mon_constants.h.

#define SOCK_UNIX 3

Definition at line 102 of file mon_constants.h.

#define STATE_CLOSE_WAIT 7

Definition at line 112 of file mon_constants.h.

#define STATE_CLOSED 6

Definition at line 111 of file mon_constants.h.

#define STATE_CLOSING 10

Definition at line 115 of file mon_constants.h.

#define STATE_ESTABLISHED 0

Definition at line 105 of file mon_constants.h.

#define STATE_FIN_WAIT1 3

Definition at line 108 of file mon_constants.h.

#define STATE_FIN_WAIT2 4

Definition at line 109 of file mon_constants.h.

#define STATE_LAST_ACK 8

Definition at line 113 of file mon_constants.h.

#define STATE_LISTEN 9

Definition at line 114 of file mon_constants.h.

#define STATE_SYN_RECV 2

Definition at line 107 of file mon_constants.h.

#define STATE_SYN_SENT 1

Definition at line 106 of file mon_constants.h.

#define STATE_TIME_WAIT 5

Definition at line 110 of file mon_constants.h.

#define STATE_UNKNOWN 11

Definition at line 116 of file mon_constants.h.

#define SYS_CPU_IDLE 5

Definition at line 49 of file mon_constants.h.

#define SYS_CPU_NICE 6

Definition at line 50 of file mon_constants.h.

#define SYS_CPU_SYS 4

Definition at line 48 of file mon_constants.h.

#define SYS_CPU_USAGE 7

Definition at line 51 of file mon_constants.h.

#define SYS_CPU_USR 3

Definition at line 47 of file mon_constants.h.

#define SYS_LOAD1 0

Definition at line 44 of file mon_constants.h.

#define SYS_LOAD15 2

Definition at line 46 of file mon_constants.h.

#define SYS_LOAD5 1

Definition at line 45 of file mon_constants.h.

#define SYS_MEM_FREE 8

Definition at line 52 of file mon_constants.h.

#define SYS_MEM_USAGE 10

Definition at line 54 of file mon_constants.h.

#define SYS_MEM_USED 9

Definition at line 53 of file mon_constants.h.

#define SYS_NET_ERRS 15

Definition at line 59 of file mon_constants.h.

#define SYS_NET_IN 13

Definition at line 57 of file mon_constants.h.

#define SYS_NET_OUT 14

Definition at line 58 of file mon_constants.h.

#define SYS_NET_SOCKETS 23

Definition at line 67 of file mon_constants.h.

#define SYS_NET_TCP_DETAILS 24

Definition at line 68 of file mon_constants.h.

#define SYS_PAGES_IN 11

Definition at line 55 of file mon_constants.h.

#define SYS_PAGES_OUT 12

Definition at line 56 of file mon_constants.h.

#define SYS_PROCESSES 21

Definition at line 65 of file mon_constants.h.

#define SYS_SWAP_FREE 16

Definition at line 60 of file mon_constants.h.

#define SYS_SWAP_IN 19

Definition at line 63 of file mon_constants.h.

#define SYS_SWAP_OUT 20

Definition at line 64 of file mon_constants.h.

#define SYS_SWAP_USAGE 18

Definition at line 62 of file mon_constants.h.

#define SYS_SWAP_USED 17

Definition at line 61 of file mon_constants.h.

#define SYS_UPTIME 22

Definition at line 66 of file mon_constants.h.

## Function Documentation

int initGenParams | ( | char * | genMonitorParams[] | ) |

Fills the array given as argument with the names of the general system parameters.

Definition at line 97 of file mon_constants.cpp.

    00098 {
    00099   genMonitorParams[GEN_HOSTNAME] = (char *)"hostname";
    00100   genMonitorParams[GEN_IP] = (char *)"ip";
    00101   genMonitorParams[GEN_CPU_MHZ] = (char *)"cpu_MHz";
    00102   genMonitorParams[GEN_NO_CPUS] = (char *)"no_CPUs";
    00103   /* total amount of system memory in MB */
    00104   genMonitorParams[GEN_TOTAL_MEM] = (char *)"total_mem";
    00105   /* total amount of swap in MB */
    00106   genMonitorParams[GEN_TOTAL_SWAP] = (char *)"total_swap";
    00107   genMonitorParams[GEN_CPU_VENDOR_ID] = (char *)"cpu_vendor_id";
    00108   genMonitorParams[GEN_CPU_FAMILY] = (char *)"cpu_family";
    00109   genMonitorParams[GEN_CPU_MODEL] = (char *)"cpu_model";
    00110   genMonitorParams[GEN_CPU_MODEL_NAME] = (char *)"cpu_model_name";
    00111   genMonitorParams[GEN_BOGOMIPS] = (char *)"bogomips";
    00112
    00113   return 11;
    00114 }

int initJobParams | ( | char * | jobMonitorParams[] | ) |

Fills the array given as argument with the names of the job parameters.

Definition at line 116 of file mon_constants.cpp.

    00117 {
    00118
    00119   /* elapsed time from the start of this job in seconds */
    00120   jobMonitorParams[JOB_RUN_TIME] = (char *)"run_time";
    00121   /* processor time spent running this job in seconds */
    00122   jobMonitorParams[JOB_CPU_TIME] = (char *)"cpu_time";
    00123   /* current percent of the processor used for this job, as reported by ps */
    00124   jobMonitorParams[JOB_CPU_USAGE] = (char *)"cpu_usage";
    00125   /* percent of the memory occupied by the job, as reported by ps */
    00126   jobMonitorParams[JOB_MEM_USAGE] = (char *)"mem_usage";
    00127   /* size in KB of the resident image size of the job, as reported by ps */
    00128   jobMonitorParams[JOB_RSS] = (char *)"rss";
    00129   /* size in KB of the virtual memory occupied by the job, as reported by ps */
    00130   jobMonitorParams[JOB_VIRTUALMEM] = (char *)"virtualmem";
    00131   /* size in MB of the working directory of the job (including the files
    00132      referenced by symbolic links) */
    00133   jobMonitorParams[JOB_WORKDIR_SIZE] = (char *)"workdir_size";
    00134   /* size in MB of the disk partition containing the
    00135      working directory */
    00136   jobMonitorParams[JOB_DISK_TOTAL] = (char *)"disk_total";
    00137   /* size in MB of the used disk space on the  partition containing the working directory */
    00138   jobMonitorParams[JOB_DISK_USED] = (char *)"disk_used";
    00139   /* size in MB of the free disk space on the partition containing the working directory */
    00140   jobMonitorParams[JOB_DISK_FREE] = (char *)"disk_free";
    00141   /* percent of the used disk on the partition containing the working directory */
    00142   jobMonitorParams[JOB_DISK_USAGE] = (char *)"disk_usage";
    00143
    00144   /* number of opened file descriptors */
    00145   jobMonitorParams[JOB_OPEN_FILES] = (char *)"open_files";
    00146   return 12;
    00147 }

void initSocketStatesMapTCP | ( | char * | socketStatesMapTCP[] | ) |

Fills the table that associates the TCP socket state names with the symbolic constants.

Definition at line 149 of file mon_constants.cpp.

    00150 {
    00151   socketStatesMapTCP[STATE_ESTABLISHED] = (char *)"ESTABLISHED";
    00152   socketStatesMapTCP[STATE_SYN_SENT] = (char *)"SYN_SENT";
    00153   socketStatesMapTCP[STATE_SYN_RECV] = (char *)"SYN_RECV";
    00154   socketStatesMapTCP[STATE_FIN_WAIT1] = (char *)"FIN_WAIT1";
    00155   socketStatesMapTCP[STATE_FIN_WAIT2] = (char *)"FIN_WAIT2";
    00156   socketStatesMapTCP[STATE_TIME_WAIT] = (char *)"TIME_WAIT";
    00157   socketStatesMapTCP[STATE_CLOSED] = (char *)"CLOSED";
    00158   socketStatesMapTCP[STATE_CLOSE_WAIT] = (char *)"CLOSE_WAIT";
    00159   socketStatesMapTCP[STATE_LAST_ACK] = (char *)"LAST_ACK";
    00160   socketStatesMapTCP[STATE_LISTEN] = (char *)"LISTEN";
    00161   socketStatesMapTCP[STATE_CLOSING] = (char *)"CLOSING";
    00162   socketStatesMapTCP[STATE_UNKNOWN] = (char *)"UNKNOWN";
    00163
    00164 }

int initSysParams | ( | char * | sysMonitorParams[] | ) |

Fills the array given as argument with the names of the system parameters.

Definition at line 41 of file mon_constants.cpp.

    00042 {
    00043   /* percent of the time spent by the CPU in user mode */
    00044   sysMonitorParams[SYS_CPU_USR] = (char *)"cpu_usr";
    00045   /* percent of the time spent by the CPU in system mode */
    00046   sysMonitorParams[SYS_CPU_SYS] = (char *)"cpu_sys";
    00047   /* percent of the CPU idle time */
    00048   sysMonitorParams[SYS_CPU_IDLE] = (char *)"cpu_idle";
    00049   /* percent of the time spent by the CPU in nice mode */
    00050   sysMonitorParams[SYS_CPU_NICE] = (char *)"cpu_nice";
    00051   /* CPU usage percent */
    00052   sysMonitorParams[SYS_CPU_USAGE] = (char *)"cpu_usage";
    00053   /* number of pages paged in (in the last interval) */
    00054   sysMonitorParams[SYS_PAGES_IN] = (char *)"pages_in";
    00055   /* number of pages paged out (in the last interval) */
    00056   sysMonitorParams[SYS_PAGES_OUT] = (char *)"pages_out";
    00057   /* number of swap pages brought in (in the last interval) */;
    00058   sysMonitorParams[SYS_SWAP_IN] = (char *)"swap_in";
    00059   /* number of swap pages brought out (in the last interval) */;
    00060   sysMonitorParams[SYS_SWAP_OUT] = (char *)"swap_out";
    00061   /* average system load over the last minute */
    00062   sysMonitorParams[SYS_LOAD1] = (char *)"load1";
    00063   /* average system load over the last 5 min */
    00064   sysMonitorParams[SYS_LOAD5] = (char *)"load5";
    00065   /* average system load over the last 15 min */;
    00066   sysMonitorParams[SYS_LOAD15] = (char *)"load15";
    00067   /* amount of currently used memory, in MB */
    00068   sysMonitorParams[SYS_MEM_USED] = (char *)"mem_used";
    00069   /* amount of free memory, in MB */
    00070   sysMonitorParams[SYS_MEM_FREE] = (char *)"mem_free";
    00071   /* used system memory in percent */
    00072   sysMonitorParams[SYS_MEM_USAGE] = (char *)"mem_usage";
    00073   /* amount of currently used swap, in MB */
    00074   sysMonitorParams[SYS_SWAP_USED] = (char *)"swap_used";
    00075   /* amount of free swap, in MB */
    00076   sysMonitorParams[SYS_SWAP_FREE] = (char *)"swap_free";
    00077   /* swap usage in percent */
    00078   sysMonitorParams[SYS_SWAP_USAGE] = (char *)"swap_usage";
    00079   /* network (input) transfer in KBps */
    00080   sysMonitorParams[SYS_NET_IN] = (char *)"net_in";
    00081   /* network (output) transfer in KBps */
    00082   sysMonitorParams[SYS_NET_OUT] = (char *)"net_out";
    00083   /* number of network errors */
    00084   sysMonitorParams[SYS_NET_ERRS] = (char *)"net_errs";
    00085   /* number of processes in the  system */
    00086   sysMonitorParams[SYS_PROCESSES] = (char *)"processes";
    00087   /* system uptime in days */
    00088   sysMonitorParams[SYS_UPTIME] = (char *)"uptime";
    00089   /* number of sockets */
    00090   sysMonitorParams[SYS_NET_SOCKETS] = (char *)"net_sockets";
    00091   /* number of TCP sockets in different states */
    00092   sysMonitorParams[SYS_NET_TCP_DETAILS] = (char *)"net_tcp_details";
    00093
    00094   return 25;
    00095 }