| # Gaudi Framework, version v21r7 |

Home |  | Generated: 22 Jan 2010

# mon_constants.cpp File Reference

Here we define the names of the parameters provided by the automatic job and system monitoring. More...

`#include "mon_constants.h"`

Include dependency graph for mon_constants.cpp:

Go to the source code of this file.

## 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

Here we define the names of the parameters provided by the automatic job and system monitoring.

Definition in file mon_constants.cpp.

## 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 }