monit_process.h File Reference

Go to the source code of this file.

Defines

#define PROCESS_ZOMBIE   1
#define RESOURCE_ID_CPU_PERCENT   1
#define RESOURCE_ID_MEM_PERCENT   2
#define RESOURCE_ID_MEM_KBYTE   3
#define RESOURCE_ID_LOAD1   4
#define RESOURCE_ID_LOAD5   5
#define RESOURCE_ID_LOAD15   6
#define RESOURCE_ACTION_ALERT   1
#define RESOURCE_ACTION_RESTART   2
#define RESOURCE_ACTION_STOP   3
#define RESOURCE_OPERATOR_GREATER   0
#define RESOURCE_OPERATOR_LESS   1
#define RESOURCE_OPERATOR_EQUAL   2
#define RESOURCE_OPERATOR_NOTEQUAL   3

Functions

int update_process_data (Process_T p, pid_t pid)
 Get the proc infomation (CPU percentage, MEM in MByte and percent, status), enduser version. More...

int init_process_info (void)
 Initilize the proc information code. More...

int compare_resource (int, Resource_T)
 Compare a value within a resource list member. More...

int update_loadavg (void)
 Updates the loadavg list. More...


Variables

int include_children
char actionnames [][STRLEN]
char operatornames [][STRLEN]
char operatorshortnames [][3]


Define Documentation

#define PROCESS_ZOMBIE   1
 

Definition at line 31 of file monit_process.h.

#define RESOURCE_ACTION_ALERT   1
 

Definition at line 45 of file monit_process.h.

#define RESOURCE_ACTION_RESTART   2
 

Definition at line 46 of file monit_process.h.

#define RESOURCE_ACTION_STOP   3
 

Definition at line 47 of file monit_process.h.

#define RESOURCE_ID_CPU_PERCENT   1
 

Definition at line 38 of file monit_process.h.

Referenced by printprocess().

#define RESOURCE_ID_LOAD1   4
 

Definition at line 41 of file monit_process.h.

Referenced by printprocess().

#define RESOURCE_ID_LOAD15   6
 

Definition at line 43 of file monit_process.h.

Referenced by printprocess().

#define RESOURCE_ID_LOAD5   5
 

Definition at line 42 of file monit_process.h.

Referenced by printprocess().

#define RESOURCE_ID_MEM_KBYTE   3
 

Definition at line 40 of file monit_process.h.

Referenced by printprocess().

#define RESOURCE_ID_MEM_PERCENT   2
 

Definition at line 39 of file monit_process.h.

Referenced by printprocess().

#define RESOURCE_OPERATOR_EQUAL   2
 

Definition at line 51 of file monit_process.h.

Referenced by compare_resource().

#define RESOURCE_OPERATOR_GREATER   0
 

Definition at line 49 of file monit_process.h.

Referenced by compare_resource().

#define RESOURCE_OPERATOR_LESS   1
 

Definition at line 50 of file monit_process.h.

Referenced by compare_resource().

#define RESOURCE_OPERATOR_NOTEQUAL   3
 

Definition at line 52 of file monit_process.h.

Referenced by compare_resource().


Function Documentation

int compare_resource int    value,
Resource_T    q
 

Compare a value within a resource list member.

Parameters:
value  the value to compare
q  resouce list member
Returns:
result of comparison, either TRUE or FALSE

Definition at line 124 of file monit_process.c.

References myresource::limit, log(), myresource::operator, RESOURCE_OPERATOR_EQUAL, RESOURCE_OPERATOR_GREATER, RESOURCE_OPERATOR_LESS, and RESOURCE_OPERATOR_NOTEQUAL.

int init_process_info void   
 

Initilize the proc information code.

Returns:
TRUE if succeeded otherwise FALSE.

Definition at line 88 of file monit_process.c.

References init_process_info_sysdep().

int update_loadavg void   
 

Updates the loadavg list.

Returns:
TRUE if successful, otherwise FALSE

Definition at line 189 of file monit_process.c.

References myrun::loadavg, and Run.

Referenced by validate().

int update_process_data Process_T    p,
pid_t    pid
 

Get the proc infomation (CPU percentage, MEM in MByte and percent, status), enduser version.

Parameters:
p  A Process object
pid  The process id
Returns:
TRUE if succeeded otherwise FALSE.

Definition at line 102 of file monit_process.c.

References get_process_info(), myprocinfo::pid, and myprocess::procinfo.


Variable Documentation

char actionnames[][STRLEN]
 

Definition at line 34 of file monit_process.h.

int include_children
 

Definition at line 33 of file monit_process.h.

char operatornames[][STRLEN]
 

Definition at line 35 of file monit_process.h.

char operatorshortnames[][3]
 

Definition at line 36 of file monit_process.h.