diff options
| author | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-10-27 14:53:50 +0000 |
|---|---|---|
| committer | osmiy <osmiy@97f52cf1-0a1b-0410-bd0e-c28be96e8082> | 2005-10-27 14:53:50 +0000 |
| commit | 6428289e52e3d49d04f46440334becdb4dd50eb7 (patch) | |
| tree | 76c5bd74e671b0951fac6850cebbd67da6866e6c /src/libs/zbxsysinfo/linux/linux.c | |
| parent | bf1417f0196f1ada1616e1e53e04a55117dc06d4 (diff) | |
| download | zabbix-6428289e52e3d49d04f46440334becdb4dd50eb7.tar.gz zabbix-6428289e52e3d49d04f46440334becdb4dd50eb7.tar.xz zabbix-6428289e52e3d49d04f46440334becdb4dd50eb7.zip | |
- developed new interface for test functions. Result returns with srtuct. (Eugene)
- recreated process() function. (Eugene)
git-svn-id: svn://svn.zabbix.com/trunk@2227 97f52cf1-0a1b-0410-bd0e-c28be96e8082
Diffstat (limited to 'src/libs/zbxsysinfo/linux/linux.c')
| -rw-r--r-- | src/libs/zbxsysinfo/linux/linux.c | 535 |
1 files changed, 284 insertions, 251 deletions
diff --git a/src/libs/zbxsysinfo/linux/linux.c b/src/libs/zbxsysinfo/linux/linux.c index e04ef0e7..96ff647a 100644 --- a/src/libs/zbxsysinfo/linux/linux.c +++ b/src/libs/zbxsysinfo/linux/linux.c @@ -18,254 +18,305 @@ **/ #include "config.h" +#include "common.h" #include "sysinfo.h" -int VM_MEMORY_BUFFERS(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int VM_MEMORY_CACHED(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); - -int SYSTEM_CPU_IDLE1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_IDLE5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_IDLE15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_USER1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_USER5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_USER15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_NICE1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_NICE5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_NICE15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_SYS1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_SYS5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_SYS15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); - -int VFS_FS_TOTAL(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max); -int VFS_FS_FREE(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max); -int VFS_FS_USED(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max); -int VFS_FS_PFREE(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max); -int VFS_FS_PUSED(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max); - -int DISK_IO(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISK_RIO(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISK_WIO(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISK_RBLK(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISK_WBLK(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int VM_MEMORY_FREE(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); - -int VFS_FILE_ATIME(const char *cmd, const char *filename,double *value, const char *msg, int mlen_max); -int VFS_FILE_CKSUM(const char *cmd, const char *filename,double *value, const char *msg, int mlen_max); -int VFS_FILE_CTIME(const char *cmd, const char *filename,double *value, const char *msg, int mlen_max); -int VFS_FILE_MD5SUM(const char *cmd, const char *filename, char **value, const char *msg, int mlen_max); -int VFS_FILE_MTIME(const char *cmd, const char *filename,double *value, const char *msg, int mlen_max); -int VFS_FILE_REGEXP(const char *cmd, const char *filename, char **value, const char *msg, int mlen_max); -int VFS_FILE_REGMATCH(const char *cmd, const char *filename,double *value, const char *msg, int mlen_max); -int VFS_FILE_SIZE(const char *cmd, const char *filename,double *value, const char *msg, int mlen_max); -int VFS_FILE_EXISTS(const char *cmd, const char *filename,double *value, const char *msg, int mlen_max); - -int VFS_FS_INODE_FREE(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max); -int VFS_FS_INODE_PFREE(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max); -int VFS_FS_INODE_TOTAL(const char *cmd, const char *mountPoint,double *value, const char *msg, int mlen_max); - - -int KERNEL_MAXFILES(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int KERNEL_MAXPROC(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); - -int NET_IF_IBYTES1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int NET_IF_IBYTES5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int NET_IF_IBYTES15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); - -int NET_IF_OBYTES1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int NET_IF_OBYTES5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int NET_IF_OBYTES15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); - -int DISKREADOPS1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKREADOPS5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKREADOPS15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKREADBLKS1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKREADBLKS5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKREADBLKS15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKWRITEOPS1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKWRITEOPS5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKWRITEOPS15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKWRITEBLKS1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKWRITEBLKS5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int DISKWRITEBLKS15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int AGENT_PING(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int VM_MEMORY_SHARED(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int VM_MEMORY_TOTAL(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); - -int PROC_NUM(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); +int VM_MEMORY_BUFFERS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VM_MEMORY_CACHED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + +int SYSTEM_CPU_IDLE1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_IDLE5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_IDLE15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_USER1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_USER5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_USER15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_NICE1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_NICE5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_NICE15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_SYS1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_SYS5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_SYS15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + +int VFS_FS_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FS_FREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FS_USED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FS_PFREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FS_PUSED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + +int DISK_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISK_RIO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISK_WIO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISK_RBLK(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISK_WBLK(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VM_MEMORY_FREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + +int VFS_FILE_ATIME(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FILE_CKSUM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FILE_CTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FILE_MD5SUM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FILE_MTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FILE_REGEXP(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FILE_REGMATCH(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FILE_SIZE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FILE_EXISTS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + +int VFS_FS_INODE_FREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FS_INODE_PFREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VFS_FS_INODE_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + + +int KERNEL_MAXFILES(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int KERNEL_MAXPROC(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + +int NET_IF_IBYTES1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int NET_IF_IBYTES5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int NET_IF_IBYTES15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + +int NET_IF_OBYTES1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int NET_IF_OBYTES5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int NET_IF_OBYTES15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + +int DISKREADOPS1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKREADOPS5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKREADOPS15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKREADBLKS1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKREADBLKS5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKREADBLKS15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKWRITEOPS1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKWRITEOPS5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKWRITEOPS15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKWRITEBLKS1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKWRITEBLKS5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int DISKWRITEBLKS15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int AGENT_PING(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VM_MEMORY_SHARED(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int VM_MEMORY_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + +int PROC_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); int PROC_MEMORY(const char *cmd, const char *param, double *value, const char *msg, int mlen_max); -int PROCCOUNT(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); +int PROCCOUNT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); -int SYSTEM_CPU_LOAD1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_LOAD5(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_CPU_LOAD15(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); +int SYSTEM_CPU_LOAD1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_LOAD5(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_CPU_LOAD15(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); -int SENSOR_TEMP1(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SENSOR_TEMP2(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SENSOR_TEMP3(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); +int SENSOR_TEMP1(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SENSOR_TEMP2(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SENSOR_TEMP3(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); -int SYSTEM_UPTIME(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); +int SYSTEM_UPTIME(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); -int SYSTEM_SWAP_FREE(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); -int SYSTEM_SWAP_TOTAL(const char *cmd, const char *parameter,double *value, const char *msg, int mlen_max); +int SYSTEM_HOSTNAME(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_UNAME(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_UNUM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); -int TCP_LISTEN(const char *cmd, const char *porthex,double *value, const char *msg, int mlen_max); +int SYSTEM_SWAP_FREE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int SYSTEM_SWAP_TOTAL(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); -int EXECUTE(const char *cmd, const char *command,double *value, const char *msg, int mlen_max); -int EXECUTE_STR(const char *cmd, const char *command, const char *parameter, char **value, const char *msg, int mlen_max); -int AGENT_VERSION(const char *cmd, const char *command,char **value, const char *msg, int mlen_max); +int TCP_LISTEN(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int AGENT_VERSION(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); -int CHECK_SERVICE(const char *cmd, const char *service,double *value, const char *msg, int mlen_max); -int CHECK_SERVICE_PERF(const char *cmd, const char *service,double *value, const char *msg, int mlen_max); -int CHECK_PORT(const char *cmd, const char *ip_and_port,double *value, const char *msg, int mlen_max); -int CHECK_DNS(const char *cmd, const char *service,double *value, const char *msg, int mlen_max); +int CHECK_SERVICE(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int CHECK_SERVICE_PERF(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int CHECK_PORT(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int CHECK_DNS(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); + +int OLD_CPU(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int OLD_IO(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int OLD_KERNEL(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int OLD_MEMORY(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int OLD_SYSTEM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int OLD_SWAP(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); +int OLD_VERSION(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result); ZBX_METRIC parameters_specific[]= -/* KEY FUNCTION (if double) FUNCTION (if string) PARAM*/ +/* KEY FLAG FUNCTION ADD_PARAM TEST_PARAM */ { /* Outdated */ - - {"cksum[*]" ,VFS_FILE_CKSUM, 0, "/etc/services"}, - {"cpu[idle1]" ,SYSTEM_CPU_IDLE1, 0, 0}, - {"cpu[idle5]" ,SYSTEM_CPU_IDLE5, 0, 0}, - {"cpu[idle15]" ,SYSTEM_CPU_IDLE15, 0, 0}, - {"cpu[nice1]" ,SYSTEM_CPU_NICE1, 0, 0}, - {"cpu[nice5]" ,SYSTEM_CPU_NICE5, 0, 0}, - {"cpu[nice15]" ,SYSTEM_CPU_NICE15, 0, 0}, - {"cpu[system1]" ,SYSTEM_CPU_SYS1, 0, 0}, - {"cpu[system5]" ,SYSTEM_CPU_SYS5, 0, 0}, - {"cpu[system15]" ,SYSTEM_CPU_SYS15, 0, 0}, - {"cpu[user1]" ,SYSTEM_CPU_USER1, 0, 0}, - {"cpu[user5]" ,SYSTEM_CPU_USER5, 0, 0}, - {"cpu[user15]" ,SYSTEM_CPU_USER15, 0, 0}, - {"diskfree[*]" ,VFS_FS_FREE, 0, "/"}, - {"disktotal[*]" ,VFS_FS_TOTAL, 0, "/"}, - {"diskused[*]" ,VFS_FS_USED, 0, "/"}, - {"diskfree_perc[*]" ,VFS_FS_PFREE, 0, "/"}, - {"diskused_perc[*]" ,VFS_FS_PUSED, 0, "/"}, - {"file[*]" ,VFS_FILE_EXISTS, 0, "/etc/passwd"}, - {"filesize[*]" ,VFS_FILE_SIZE, 0, "/etc/passwd"}, - {"inodefree[*]" ,VFS_FS_INODE_FREE, 0, "/"}, - {"inodetotal[*]" ,VFS_FS_INODE_TOTAL, 0, "/"}, - {"inodefree_perc[*]" ,VFS_FS_INODE_PFREE, 0, "/"}, - {"kern[maxfiles]" ,KERNEL_MAXFILES, 0, 0}, - {"kern[maxproc]" ,KERNEL_MAXPROC, 0, 0}, - {"md5sum[*]" ,0, VFS_FILE_MD5SUM, "/etc/services"}, - {"memory[buffers]" ,VM_MEMORY_BUFFERS, 0, 0}, - {"memory[cached]" ,VM_MEMORY_CACHED, 0, 0}, - {"memory[free]" ,VM_MEMORY_FREE, 0, 0}, - {"memory[shared]" ,VM_MEMORY_SHARED, 0, 0}, - {"memory[total]" ,VM_MEMORY_TOTAL, 0, 0}, - {"netloadin1[*]" ,NET_IF_IBYTES1, 0, "lo"}, - {"netloadin5[*]" ,NET_IF_IBYTES5, 0, "lo"}, - {"netloadin15[*]" ,NET_IF_IBYTES15, 0, "lo"}, - {"netloadout1[*]" ,NET_IF_OBYTES1, 0, "lo"}, - {"netloadout5[*]" ,NET_IF_OBYTES5, 0, "lo"}, - {"netloadout15[*]" ,NET_IF_OBYTES15, 0, "lo"}, - {"ping" ,AGENT_PING, 0, 0}, - {"proc_cnt[*]" ,PROC_NUM, 0, "inetd"}, - {"swap[free]" ,SYSTEM_SWAP_FREE, 0, 0}, - {"swap[total]" ,SYSTEM_SWAP_TOTAL, 0, 0}, - {"system[procload]" ,SYSTEM_CPU_LOAD1, 0, 0}, - {"system[procload5]" ,SYSTEM_CPU_LOAD5, 0, 0}, - {"system[procload15]" ,SYSTEM_CPU_LOAD15, 0, 0}, - {"system[hostname]" ,0, EXECUTE_STR, "hostname"}, - {"system[uname]" ,0, EXECUTE_STR, "uname -a"}, - {"system[uptime]" ,SYSTEM_UPTIME, 0, 0}, - {"system[users]" ,EXECUTE, 0,"who|wc -l"}, - {"version[zabbix_agent]", 0, AGENT_VERSION, 0}, +/* incorrect OLD naming */ + {"cpu", CF_USEUPARAM, OLD_CPU, 0, "idle1"}, +/* + {"cpu[idle1]", 0, OLD_CPU, 0, 0}, + {"cpu[idle5]", 0, OLD_CPU, 0, 0}, + {"cpu[idle15]", 0, OLD_CPU, 0, 0}, + {"cpu[nice1]", 0, OLD_CPU, 0, 0}, + {"cpu[nice5]", 0, OLD_CPU, 0, 0}, + {"cpu[nice15]", 0, OLD_CPU, 0, 0}, + {"cpu[system1]", 0, OLD_CPU, 0, 0}, + {"cpu[system5]", 0, OLD_CPU, 0, 0}, + {"cpu[system15]", 0, OLD_CPU, 0, 0}, + {"cpu[user1]", 0, OLD_CPU, 0, 0}, + {"cpu[user5]", 0, OLD_CPU, 0, 0}, + {"cpu[user15]", 0, OLD_CPU, 0, 0}, +*/ + {"io", CF_USEUPARAM, OLD_IO, 0, "disk_io"}, +/* + {"io[disk_io]", 0, OLD_IO, 0, 0}, + {"io[disk_rio]", 0, OLD_IO, 0, 0}, + {"io[disk_wio]", 0, OLD_IO, 0, 0}, + {"io[disk_rblk]", 0, OLD_IO, 0, 0}, + {"io[disk_wblk]", 0, OLD_IO, 0, 0}, +*/ + {"kern", CF_USEUPARAM, OLD_KERNEL, 0, "maxfiles"}, +/* + {"kern[maxfiles]", 0, OLD_KERNEL, 0, 0}, + {"kern[maxproc]", 0, OLD_KERNEL, 0, 0}, +*/ + {"memory", CF_USEUPARAM, OLD_MEMORY, 0, "buffers"}, +/* + {"memory[buffers]", 0, OLD_MEMORY, 0, 0}, + {"memory[cached]", 0, OLD_MEMORY, 0, 0}, + {"memory[free]", 0, OLD_MEMORY, 0, 0}, + {"memory[shared]", 0, OLD_MEMORY, 0, 0}, + {"memory[total]", 0, OLD_MEMORY, 0, 0}, +*/ + {"system", CF_USEUPARAM, OLD_SYSTEM, 0, "uname"}, +/* + {"system[proccount]", 0, OLD_SYSTEM, 0, 0}, + + {"system[procload]", 0, OLD_SYSTEM, 0, 0}, + {"system[procload5]", 0, OLD_SYSTEM, 0, 0}, + {"system[procload15]", 0, OLD_SYSTEM, 0, 0}, + {"system[hostname]", 0, OLD_SYSTEM, 0, 0}, + {"system[uname]", 0, OLD_SYSTEM, 0, 0}, + {"system[uptime]", 0, OLD_SYSTEM, 0, 0}, + {"system[users]", 0, OLD_SYSTEM, 0, 0}, + + {"system[procrunning]", 0, OLD_SYSTEM, 0, 0}, +*/ + {"sensor", CF_USEUPARAM, OLD_SENSOR, 0, "temp1"}, +/* + {"sensor[temp1]", 0, OLD_SENSOR, 0, 0}, + {"sensor[temp2]", 0, OLD_SENSOR, 0, 0}, + {"sensor[temp3]", 0, OLD_SENSOR, 0, 0}, +*/ + {"swap", CF_USEUPARAM, OLD_SWAP, 0, "total"}, +/* + {"swap[free]", 0, OLD_SWAP, 0, 0}, + {"swap[total]", 0, OLD_SWAP, 0, 0}, +*/ + {"version", CF_USEUPARAM, OLD_VERSION, 0, "zabbix_agent"}, +/* + {"version[zabbix_agent]", 0, OLD_VERSION, 0, 0}, +*/ +/* correct OLD naming */ + {"cksum", CF_USEUPARAM, VFS_FILE_CKSUM, 0, "/etc/services"}, + + {"diskfree", CF_USEUPARAM, VFS_FS_FREE, 0, "/"}, + {"disktotal", CF_USEUPARAM, VFS_FS_TOTAL, 0, "/"}, + {"diskused", CF_USEUPARAM, VFS_FS_USED, 0, "/"}, + {"diskfree_perc", CF_USEUPARAM, VFS_FS_PFREE, 0, "/"}, + {"diskused_perc", CF_USEUPARAM, VFS_FS_PUSED, 0, "/"}, + + {"file", CF_USEUPARAM, VFS_FILE_EXISTS, 0, "/etc/passwd"}, + {"filesize", CF_USEUPARAM, VFS_FILE_SIZE, 0, "/etc/passwd"}, + + {"inodefree", CF_USEUPARAM, VFS_FS_INODE_FREE, 0, "/"}, + {"inodetotal", CF_USEUPARAM, VFS_FS_INODE_TOTAL, 0, "/"}, + {"inodefree_perc", CF_USEUPARAM, VFS_FS_INODE_PFREE, 0, "/"}, + + {"md5sum", CF_USEUPARAM, VFS_FILE_MD5SUM, 0, "/etc/services"}, + + {"netloadin1", CF_USEUPARAM, NET_IF_IBYTES1, 0, "lo"}, + {"netloadin5", CF_USEUPARAM, NET_IF_IBYTES5, 0, "lo"}, + {"netloadin15", CF_USEUPARAM, NET_IF_IBYTES15, 0, "lo"}, + {"netloadout1", CF_USEUPARAM, NET_IF_OBYTES1, 0, "lo"}, + {"netloadout5", CF_USEUPARAM, NET_IF_OBYTES5, 0, "lo"}, + {"netloadout15", CF_USEUPARAM, NET_IF_OBYTES15, 0, "lo"}, + + {"ping", 0, AGENT_PING, 0, 0}, + + {"proc_cnt", CF_USEUPARAM, PROC_NUM, 0, "inetd"}, /* New naming */ - {"agent.ping" ,AGENT_PING, 0, 0}, - {"agent.version", 0, AGENT_VERSION, 0}, - - {"kernel.maxfiles]" ,KERNEL_MAXFILES, 0, 0}, - {"kernel.maxproc" ,KERNEL_MAXPROC, 0, 0}, - - {"proc.num[*]" ,PROC_NUM, 0, "inetd"}, - {"proc.mem[*]" ,PROC_MEMORY, 0, "inetd"}, - - {"vm.memory.total" ,VM_MEMORY_TOTAL, 0, 0}, - {"vm.memory.shared" ,VM_MEMORY_SHARED, 0, 0}, - {"vm.memory.buffers" ,VM_MEMORY_BUFFERS, 0, 0}, - {"vm.memory.cached" ,VM_MEMORY_CACHED, 0, 0}, - {"vm.memory.free" ,VM_MEMORY_FREE, 0, 0}, - - {"vfs.fs.free[*]" ,VFS_FS_FREE, 0, "/"}, - {"vfs.fs.total[*]" ,VFS_FS_TOTAL, 0, "/"}, - {"vfs.fs.used[*]" ,VFS_FS_USED, 0, "/"}, - - {"vfs.fs.pfree[*]" ,VFS_FS_PFREE, 0, "/"}, - {"vfs.fs.pused[*]" ,VFS_FS_PUSED, 0, "/"}, - - {"vfs.fs.inode.free[*]" ,VFS_FS_INODE_FREE, 0, "/"}, - {"vfs.fs.inode.total[*]",VFS_FS_INODE_TOTAL, 0, "/"}, - {"vfs.fs.inode.pfree[*]",VFS_FS_INODE_PFREE, 0, "/"}, - - {"vfs.file.atime[*]" ,VFS_FILE_ATIME, 0, "/etc/passwd"}, - {"vfs.file.cksum[*]" ,VFS_FILE_CKSUM, 0, "/etc/services"}, - {"vfs.file.ctime[*]" ,VFS_FILE_CTIME, 0, "/etc/passwd"}, - {"vfs.file.exists[*]" ,VFS_FILE_EXISTS, 0, "/etc/passwd"}, - {"vfs.file.md5sum[*]" ,0, VFS_FILE_MD5SUM, "/etc/services"}, - {"vfs.file.mtime[*]" ,VFS_FILE_MTIME, 0, "/etc/passwd"}, - {"vfs.file.regexp[*]" ,0, VFS_FILE_REGEXP, "/etc/passwd,root"}, - {"vfs.file.regmatch[*]" ,VFS_FILE_REGMATCH, 0, "/etc/passwd,root"}, - {"vfs.file.size[*]" ,VFS_FILE_SIZE, 0, "/etc/passwd"}, - - {"system.cpu.idle1" ,SYSTEM_CPU_IDLE1, 0, 0}, - {"system.cpu.idle5" ,SYSTEM_CPU_IDLE5, 0, 0}, - {"system.cpu.idle15" ,SYSTEM_CPU_IDLE15, 0, 0}, - {"system.cpu.nice1" ,SYSTEM_CPU_NICE1, 0, 0}, - {"system.cpu.nice5" ,SYSTEM_CPU_NICE5, 0, 0}, - {"system.cpu.nice15" ,SYSTEM_CPU_NICE15, 0, 0}, - {"system.cpu.sys1" ,SYSTEM_CPU_SYS1, 0, 0}, - {"system.cpu.sys5" ,SYSTEM_CPU_SYS5, 0, 0}, - {"system.cpu.sys15" ,SYSTEM_CPU_SYS15, 0, 0}, - {"system.cpu.user1" ,SYSTEM_CPU_USER1, 0, 0}, - {"system.cpu.user5" ,SYSTEM_CPU_USER5, 0, 0}, - {"system.cpu.user15" ,SYSTEM_CPU_USER15, 0, 0}, - - {"net.if.ibytes1[*]" ,NET_IF_IBYTES1, 0, "lo"}, - {"net.if.ibytes5[*]" ,NET_IF_IBYTES5, 0, "lo"}, - {"net.if.ibytes15[*]" ,NET_IF_IBYTES15, 0, "lo"}, - {"net.if.obytes1[*]" ,NET_IF_OBYTES1, 0, "lo"}, - {"net.if.obytes5[*]" ,NET_IF_OBYTES5, 0, "lo"}, - {"net.if.obytes15[*]" ,NET_IF_OBYTES15, 0, "lo"}, - - {"disk_read_ops1[*]" ,DISKREADOPS1, 0, "hda"}, - {"disk_read_ops5[*]" ,DISKREADOPS5, 0, "hda"}, - {"disk_read_ops15[*]" ,DISKREADOPS15, 0, "hda"}, - - {"disk_read_blks1[*]" ,DISKREADBLKS1, 0, "hda"}, - {"disk_read_blks5[*]" ,DISKREADBLKS5, 0, "hda"}, - {"disk_read_blks15[*]" ,DISKREADBLKS15, 0, "hda"}, - - {"disk_write_ops1[*]" ,DISKWRITEOPS1, 0, "hda"}, - {"disk_write_ops5[*]" ,DISKWRITEOPS5, 0, "hda"}, - {"disk_write_ops15[*]" ,DISKWRITEOPS15, 0, "hda"}, - - {"disk_write_blks1[*]" ,DISKWRITEBLKS1, 0, "hda"}, - {"disk_write_blks5[*]" ,DISKWRITEBLKS5, 0, "hda"}, - {"disk_write_blks15[*]" ,DISKWRITEBLKS15, 0, "hda"}, - - {"sensor[temp1]" ,SENSOR_TEMP1, 0, 0}, - {"sensor[temp2]" ,SENSOR_TEMP2, 0, 0}, - {"sensor[temp3]" ,SENSOR_TEMP3, 0, 0}, - - {"system.cpu.load1" ,SYSTEM_CPU_LOAD1, 0, 0}, - {"system.cpu.load5" ,SYSTEM_CPU_LOAD5, 0, 0}, - {"system.cpu.load15" ,SYSTEM_CPU_LOAD15, 0, 0}, - - {"system.hostname" ,0, EXECUTE_STR, "hostname"}, - - {"system.swap.free" ,SYSTEM_SWAP_FREE, 0, 0}, - {"system.swap.total" ,SYSTEM_SWAP_TOTAL, 0, 0}, - - {"system.uname" ,0, EXECUTE_STR, "uname -a"}, - {"system.uptime" ,SYSTEM_UPTIME, 0, 0}, - {"system.users.num" ,EXECUTE, 0,"who|wc -l"}, + {"agent.ping", 0, AGENT_PING, 0, 0}, + {"agent.version", 0, AGENT_VERSION, 0, 0}, + + {"kernel.maxfiles", 0, KERNEL_MAXFILES, 0, 0}, + {"kernel.maxproc", 0, KERNEL_MAXPROC, 0, 0}, + + {"proc.num", CF_USEUPARAM, PROC_NUM, 0, "inetd"}, + {"proc.mem", CF_USEUPARAM, PROC_MEMORY, 0, "inetd"}, + + {"vm.memory.total", 0, VM_MEMORY_TOTAL, 0, 0}, + {"vm.memory.shared", 0, VM_MEMORY_SHARED, 0, 0}, + {"vm.memory.buffers", 0, VM_MEMORY_BUFFERS, 0, 0}, + {"vm.memory.cached", 0, VM_MEMORY_CACHED, 0, 0}, + {"vm.memory.free", 0, VM_MEMORY_FREE, 0, 0}, + + {"vfs.fs.free", CF_USEUPARAM, VFS_FS_FREE, 0, "/"}, + {"vfs.fs.total", CF_USEUPARAM, VFS_FS_TOTAL, 0, "/"}, + {"vfs.fs.used", CF_USEUPARAM, VFS_FS_USED, 0, "/"}, + {"vfs.fs.pfree", CF_USEUPARAM, VFS_FS_PFREE, 0, "/"}, + {"vfs.fs.pused", CF_USEUPARAM, VFS_FS_PUSED, 0, "/"}, + + {"vfs.fs.inode.free", CF_USEUPARAM, VFS_FS_INODE_FREE, 0, "/"}, + {"vfs.fs.inode.total", CF_USEUPARAM, VFS_FS_INODE_TOTAL, 0, "/"}, + {"vfs.fs.inode.pfree", CF_USEUPARAM, VFS_FS_INODE_PFREE, 0, "/"}, + + {"vfs.file.atime", CF_USEUPARAM, VFS_FILE_ATIME, 0, "/etc/passwd"}, + {"vfs.file.cksum", CF_USEUPARAM, VFS_FILE_CKSUM, 0, "/etc/services"}, + {"vfs.file.ctime", CF_USEUPARAM, VFS_FILE_CTIME, 0, "/etc/passwd"}, + {"vfs.file.exists", CF_USEUPARAM, VFS_FILE_EXISTS, 0, "/etc/passwd"}, + {"vfs.file.md5sum", CF_USEUPARAM, VFS_FILE_MD5SUM, 0, "/etc/services"}, + {"vfs.file.mtime", CF_USEUPARAM, VFS_FILE_MTIME, 0, "/etc/passwd"}, + {"vfs.file.regexp", CF_USEUPARAM, VFS_FILE_REGEXP, 0, "/etc/passwd,root"}, + {"vfs.file.regmatch", CF_USEUPARAM, VFS_FILE_REGMATCH, 0, "/etc/passwd,root"}, + {"vfs.file.size", CF_USEUPARAM, VFS_FILE_SIZE, 0, "/etc/passwd"}, + + {"system.cpu.idle1", 0, SYSTEM_CPU_IDLE1, 0, 0}, + {"system.cpu.idle5", 0, SYSTEM_CPU_IDLE5, 0, 0}, + {"system.cpu.idle15", 0, SYSTEM_CPU_IDLE15, 0, 0}, + {"system.cpu.nice1", 0, SYSTEM_CPU_NICE1, 0, 0}, + {"system.cpu.nice5", 0, SYSTEM_CPU_NICE5, 0, 0}, + {"system.cpu.nice15", 0, SYSTEM_CPU_NICE15, 0, 0}, + {"system.cpu.sys1", 0, SYSTEM_CPU_SYS1, 0, 0}, + {"system.cpu.sys5", 0, SYSTEM_CPU_SYS5, 0, 0}, + {"system.cpu.sys15", 0, SYSTEM_CPU_SYS15, 0, 0}, + {"system.cpu.user1", 0, SYSTEM_CPU_USER1, 0, 0}, + {"system.cpu.user5", 0, SYSTEM_CPU_USER5, 0, 0}, + {"system.cpu.user15", 0, SYSTEM_CPU_USER15, 0, 0}, + + {"net.if.ibytes1", CF_USEUPARAM, NET_IF_IBYTES1, 0, "lo"}, + {"net.if.ibytes5", CF_USEUPARAM, NET_IF_IBYTES5, 0, "lo"}, + {"net.if.ibytes15", CF_USEUPARAM, NET_IF_IBYTES15,0, "lo"}, + {"net.if.obytes1", CF_USEUPARAM, NET_IF_OBYTES1, 0, "lo"}, + {"net.if.obytes5", CF_USEUPARAM, NET_IF_OBYTES5, 0, "lo"}, + {"net.if.obytes15", CF_USEUPARAM, NET_IF_OBYTES15,0, "lo"}, + + {"disk_read_ops1", CF_USEUPARAM, DISKREADOPS1, 0, "hda"}, + {"disk_read_ops5", CF_USEUPARAM, DISKREADOPS5, 0, "hda"}, + {"disk_read_ops15", CF_USEUPARAM, DISKREADOPS15, 0, "hda"}, + + {"disk_read_blks1", CF_USEUPARAM, DISKREADBLKS1, 0, "hda"}, + {"disk_read_blks5", CF_USEUPARAM, DISKREADBLKS5, 0, "hda"}, + {"disk_read_blks15", CF_USEUPARAM, DISKREADBLKS15, 0, "hda"}, + + {"disk_write_ops1", CF_USEUPARAM, DISKWRITEOPS1, 0, "hda"}, + {"disk_write_ops5", CF_USEUPARAM, DISKWRITEOPS5, 0, "hda"}, + {"disk_write_ops15", CF_USEUPARAM, DISKWRITEOPS15, 0, "hda"}, + + {"disk_write_blks1", CF_USEUPARAM, DISKWRITEBLKS1, 0, "hda"}, + {"disk_write_blks5", CF_USEUPARAM, DISKWRITEBLKS5, 0, "hda"}, + {"disk_write_blks15", CF_USEUPARAM, DISKWRITEBLKS15,0, "hda"}, + + {"system.cpu.load1", 0, SYSTEM_CPU_LOAD1, 0, 0}, + {"system.cpu.load5", 0, SYSTEM_CPU_LOAD5, 0, 0}, + {"system.cpu.load15", 0, SYSTEM_CPU_LOAD15, 0, 0}, + + {"system.hostname", 0, SYSTEM_HOSTNAME, 0, 0}, + + {"system.swap.free", 0, SYSTEM_SWAP_FREE, 0, 0}, + {"system.swap.total", 0, SYSTEM_SWAP_TOTAL, 0, 0}, + + + {"system.uname", 0, SYSTEM_UNAME, 0, 0}, + {"system.uptime", 0, SYSTEM_UPTIME, 0, 0}, + {"system.users.num", 0, SYSTEM_UNUM, 0, 0}, /**************************************** All these perameters require more than 1 second to retrieve. @@ -277,30 +328,12 @@ ZBX_METRIC parameters_specific[]= {"system[switches]" ,EXECUTE, 0, "vmstat -n 1 2|tail -1|cut -b62-67"}, ***************************************/ - {"io[disk_io]" ,DISK_IO, 0, 0}, - {"io[disk_rio]" ,DISK_RIO, 0, 0}, - {"io[disk_wio]" ,DISK_WIO, 0, 0}, - {"io[disk_rblk]" ,DISK_RBLK, 0, 0}, - {"io[disk_wblk]" ,DISK_WBLK, 0, 0}, - - - - {"system[proccount]" ,PROCCOUNT, 0, 0}, - -#ifdef HAVE_PROC_LOADAVG - {"system[procrunning]" ,EXECUTE, 0, "cat /proc/loadavg|cut -f1 -d'/'|cut -f4 -d' '"}, -#endif - /* {"tcp_count" ,EXECUTE, 0, "netstat -tn|grep EST|wc -l"}, */ - {"net[listen_23]" ,TCP_LISTEN, 0, "0017"}, - {"net[listen_80]" ,TCP_LISTEN, 0, "0050"}, - - {"check_port[*]" ,CHECK_PORT, 0, "80"}, - - {"check_service[*]" ,CHECK_SERVICE, 0, "ssh,127.0.0.1,22"}, - {"dns[*]" ,CHECK_DNS, 0, "127.0.0.1,localhost"}, - {"check_service_perf[*]",CHECK_SERVICE_PERF, 0, "ssh,127.0.0.1,22"}, + {"check_port", CF_USEUPARAM, CHECK_PORT, 0, "80"}, + {"check_service", CF_USEUPARAM, CHECK_SERVICE, 0, "ssh,127.0.0.1,22"}, + {"check_service_perf", CF_USEUPARAM, CHECK_SERVICE_PERF, 0, "ssh,127.0.0.1,22"}, + {"dns", CF_USEUPARAM, CHECK_DNS, 0, "127.0.0.1,localhost"}, {0} }; |
