typedef struct ProcInfo
{
char name[MAX_PROC_NAME];/*process name*/
int PID; /*process id*/
int PPID; /*parent process id*/
int status; /* sleeping or running*/
struct ProcInfo * Next; /*pointer to next process struct*/
}* ProcList;
typedef struct netCards
{
char name[MAX_NET_CARD_NAME];/*net card name*/
int ByteRcv; /*bytes received*/
int ByteSnd; /*bytes sent*/
}* netCardList;
struct eCop_SM_Object
{
char OsName[MAX_OS_NAME];/*do not alarm*/
int CPU_Percent[MAX_CPUS];/*for example 34 means 0.34%*/
int DiskAvail; /*available disk*/
int MemUsed; /*memory used*/
/*including sending bytes and receiving bytes*/
struct netCards netCard[MAX_NET_CARDS];
struct ProcInfo * PrList;
/*
evaluate the time to it when sampling, if
it is -1,we consider it an invalid object
*/
long TimeStamp;
};
/*get os information and store it in a struct*/
int sample(struct eCop_SM_Object * obj);