monit_process.c File Reference

General purpose /proc methods. More...

Go to the source code of this file.

Functions

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

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 compare_resource (int value, Resource_T q)
 Compare a value within a resource list member. More...

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


Variables

int include_children = TRUE
char actionnames [][STRLEN] = {"ignore", "alert", "restart", "stop"}
char operatornames [][STRLEN]
char operatorshortnames [][3] = {">", "<", "=", "!="}


Detailed Description

General purpose /proc methods.

Author:
Jan-Henrik Haukeland, <hauk@tildeslash.com> , Christian Hopp <chopp@iei.tu-clausthal.de>
Version:
$Id: monit_process.c,v 1.4 2002/09/13 01:32:26 hauk Exp $

Definition in file monit_process.c.


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] = {"ignore", "alert", "restart", "stop"}
 

Definition at line 78 of file monit_process.c.

int include_children = TRUE
 

Definition at line 77 of file monit_process.c.

char operatornames[][STRLEN]
 

Initial value:

{"greater than", "less than",
                  "equal to", "not equal to"}

Definition at line 79 of file monit_process.c.

char operatorshortnames[][3] = {">", "<", "=", "!="}
 

Definition at line 81 of file monit_process.c.