monit_process.h

Go to the documentation of this file.
00001 /*
00002  * Copyright (C), 2000-2002 by Contributors to the monit codebase. 
00003  * All Rights Reserved.
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License as
00007  * published by the Free Software Foundation; either version 2 of the
00008  * License, or (at your option) any later version.
00009  *
00010  * This program is distributed in the hope that it will be useful, but
00011  * WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00013  * General Public License for more details.
00014  * 
00015  * You should have received a copy of the GNU General Public License
00016  * along with this program; if not, write to the Free Software Foundation,
00017  * Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
00018  */
00019 
00020 #ifndef MONIT_PROCESS_H
00021 #define MONIT_PROCESS_H
00022 
00023 #include <config.h>
00024 
00025 #ifdef HAVE_UNISTD_H
00026 #include <unistd.h>
00027 #endif
00028 
00029 #include "monitor.h"
00030 
00031 #define PROCESS_ZOMBIE        1
00032 
00033 extern int include_children;
00034 extern char actionnames[][STRLEN];
00035 extern char operatornames[][STRLEN];
00036 extern char operatorshortnames[][3];
00037 
00038 #define RESOURCE_ID_CPU_PERCENT 1
00039 #define RESOURCE_ID_MEM_PERCENT 2
00040 #define RESOURCE_ID_MEM_KBYTE   3
00041 #define RESOURCE_ID_LOAD1   4
00042 #define RESOURCE_ID_LOAD5   5
00043 #define RESOURCE_ID_LOAD15  6
00044 
00045 #define RESOURCE_ACTION_ALERT   1 
00046 #define RESOURCE_ACTION_RESTART 2 
00047 #define RESOURCE_ACTION_STOP    3
00048 
00049 #define RESOURCE_OPERATOR_GREATER  0
00050 #define RESOURCE_OPERATOR_LESS     1
00051 #define RESOURCE_OPERATOR_EQUAL    2
00052 #define RESOURCE_OPERATOR_NOTEQUAL 3
00053 
00054 int update_process_data(Process_T p, pid_t pid);
00055 int init_process_info(void);
00056 int compare_resource(int, Resource_T);
00057 int update_loadavg(void);
00058 
00059 #endif
00060