summaryrefslogtreecommitdiffstats
path: root/src/zabbix_agent/sysinfo.h
blob: e563a2d68cae4270d355bdbbe893601beb469f26 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
/* 
** Zabbix
** Copyright (C) 2000,2001,2002,2003,2004 Alexei Vladishev
**
** This program is free software; you can redistribute it and/or modify
** it under the terms of the GNU General Public License as published by
** the Free Software Foundation; either version 2 of the License, or
** (at your option) any later version.
**
** This program is distributed in the hope that it will be useful,
** but WITHOUT ANY WARRANTY; without even the implied warranty of
** MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
** GNU General Public License for more details.
**
** You should have received a copy of the GNU General Public License
** along with this program; if not, write to the Free Software
** Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
**/


#ifndef ZABBIX_SYSINFO_H
#define ZABBIX_SYSINFO_H

/* #define TEST_PARAMETERS */

#define	SYSINFO_RET_OK		0
#define	SYSINFO_RET_FAIL	1
#define	SYSINFO_RET_TIMEOUT	2
 
void	process(char *command, char *value);

void    add_user_parameter(char *key,char *command);
void	test_parameters(void);
int	getPROC(char *file,int lineno,int fieldno, double *value);

int	BUFFERSMEM(const char *cmd, const char *parameter,double  *value);
int	CACHEDMEM(const char *cmd, const char *parameter,double  *value);
int	CKSUM(const char *cmd, const char *filename,double  *value);
int	FILESIZE(const char *cmd, const char *filename,double  *value);
int	DISKTOTAL(const char *cmd, const char *mountPoint,double  *value);
int	DISKFREE(const char *cmd, const char *mountPoint,double  *value);
int	DISKUSED(const char *cmd, const char *mountPoint,double  *value);
int	DISKFREE_PERC(const char *cmd, const char *mountPoint,double  *value);
int	DISKUSED_PERC(const char *cmd, const char *mountPoint,double  *value);

int	DISK_IO(const char *cmd, const char *parameter,double  *value);
int	DISK_RIO(const char *cmd, const char *parameter,double  *value);
int	DISK_WIO(const char *cmd, const char *parameter,double  *value);
int	DISK_RBLK(const char *cmd, const char *parameter,double  *value);
int	DISK_WBLK(const char *cmd, const char *parameter,double  *value);
int	FREEMEM(const char *cmd, const char *parameter,double  *value);

int	INODEFREE(const char *cmd, const char *mountPoint,double  *value);
int	INODEFREE_PERC(const char *cmd, const char *mountPoint,double  *value);
int	INODETOTAL(const char *cmd, const char *mountPoint,double  *value);

int	KERNEL_MAXFILES(const char *cmd, const char *parameter,double  *value);
int	KERNEL_MAXPROC(const char *cmd, const char *parameter,double  *value);
int	NETLOADIN1(const char *cmd, const char *interface,double  *value);
int	NETLOADIN5(const char *cmd, const char *interface,double  *value);
int	NETLOADIN15(const char *cmd, const char *interface,double  *value);
int	NETLOADOUT1(const char *cmd, const char *interface,double  *value);
int	NETLOADOUT5(const char *cmd, const char *interface,double  *value);
int	NETLOADOUT15(const char *cmd, const char *interface,double  *value);
int	DISKREADOPS1(const char *cmd, const char *interface,double  *value);
int	DISKREADOPS5(const char *cmd, const char *interface,double  *value);
int	DISKREADOPS15(const char *cmd, const char *interface,double  *value);
int	DISKREADBLKS1(const char *cmd, const char *interface,double  *value);
int	DISKREADBLKS5(const char *cmd, const char *interface,double  *value);
int	DISKREADBLKS15(const char *cmd, const char *interface,double  *value);
int	DISKWRITEOPS1(const char *cmd, const char *interface,double  *value);
int	DISKWRITEOPS5(const char *cmd, const char *interface,double  *value);
int	DISKWRITEOPS15(const char *cmd, const char *interface,double  *value);
int	DISKWRITEBLKS1(const char *cmd, const char *interface,double  *value);
int	DISKWRITEBLKS5(const char *cmd, const char *interface,double  *value);
int	DISKWRITEBLKS15(const char *cmd, const char *interface,double  *value);
int	PING(const char *cmd, const char *parameter,double  *value);
int	SHAREDMEM(const char *cmd, const char *parameter,double  *value);
int	TOTALMEM(const char *cmd, const char *parameter,double  *value);
int	PROCCNT(const char *cmd, const char *parameter,double  *value);
int	PROCCOUNT(const char *cmd, const char *parameter,double  *value);
int	PROCLOAD(const char *cmd, const char *parameter,double  *value);
int	PROCLOAD5(const char *cmd, const char *parameter,double  *value);
int	PROCLOAD15(const char *cmd, const char *parameter,double  *value);

int	SENSOR_TEMP1(const char *cmd, const char *parameter,double  *value);
int	SENSOR_TEMP2(const char *cmd, const char *parameter,double  *value);
int	SENSOR_TEMP3(const char *cmd, const char *parameter,double  *value);

int	SWAPFREE(const char *cmd, const char *parameter,double  *value);
int	SWAPTOTAL(const char *cmd, const char *parameter,double  *value);
int	UPTIME(const char *cmd, const char *parameter,double  *value);

int	TCP_LISTEN(const char *cmd, const char *porthex,double  *value);

int	EXECUTE(const char *cmd, const char *command,double  *value);
int	EXECUTE_STR(const char *cmd, const char *command,char **value);
int	VERSION(const char *cmd, const char *command,char **value);

int	MD5SUM(const char *cmd, const char *filename, char **value);

int	CHECK_SERVICE(const char *cmd, const char *service,double  *value);
int	CHECK_SERVICE_PERF(const char *cmd, const char *service,double  *value);
int	CHECK_PORT(const char *cmd, const char *ip_and_port,double  *value);

#define COMMAND struct command_type
COMMAND
{
	char	*key;
	int	(*function)();
        int	(*function_str)();
	char	*parameter;
};


#endif