A new user interface for you! Read more...

File zabbix-1.8.3-ZBX-282.patch of Package zabbix

diff -ru zabbix-1.8.3.zbx282/include/sysinfo.h zabbix-1.8.3/include/sysinfo.h
--- zabbix-1.8.3.zbx282/include/sysinfo.h	2010-08-16 01:19:31.000000000 -0700
+++ zabbix-1.8.3/include/sysinfo.h	2010-09-03 09:35:31.190717053 -0700
@@ -241,6 +241,8 @@
 int	SYSTEM_CPU_INTR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result);
 int	SYSTEM_CPU_NUM(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result);
 int	NET_TCP_LISTEN(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);
+
 
 #if defined(_WINDOWS)
 int	USER_PERFCOUNTER(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result);
Only in zabbix-1.8.3/include: sysinfo.h.orig
diff -ru zabbix-1.8.3.zbx282/src/libs/zbxsysinfo/common/common.c zabbix-1.8.3/src/libs/zbxsysinfo/common/common.c
--- zabbix-1.8.3.zbx282/src/libs/zbxsysinfo/common/common.c	2010-08-16 01:19:32.000000000 -0700
+++ zabbix-1.8.3/src/libs/zbxsysinfo/common/common.c	2010-09-03 09:35:31.190717053 -0700
@@ -72,7 +72,7 @@
 	{"log",			CF_USEUPARAM,	ONLY_ACTIVE, 		0,	"logfile"},
 	{"logrt",		CF_USEUPARAM,	ONLY_ACTIVE,		0,	"logfile"},
 	{"eventlog",		CF_USEUPARAM,	ONLY_ACTIVE, 		0,	"system"},
-
+//	{"sensor",		CF_USEUPARAM,	OLD_SENSOR,		0,	"temp1"},	
 	{0}
 	};
 
diff -ru zabbix-1.8.3.zbx282/src/libs/zbxsysinfo/linux/linux.c zabbix-1.8.3/src/libs/zbxsysinfo/linux/linux.c
--- zabbix-1.8.3.zbx282/src/libs/zbxsysinfo/linux/linux.c	2010-08-16 01:19:32.000000000 -0700
+++ zabbix-1.8.3/src/libs/zbxsysinfo/linux/linux.c	2010-09-03 09:35:31.191717195 -0700
@@ -57,6 +57,6 @@
 
 	{"system.uptime",	0,		SYSTEM_UPTIME,		0,	0},
 	{"system.boottime",	0,		SYSTEM_BOOTTIME,	0,	0},
-
+ 	{"sensor",		CF_USEUPARAM,	OLD_SENSOR,		0,	"temp1"},	
 	{0}
 	};
diff -ru zabbix-1.8.3.zbx282/src/libs/zbxsysinfo/linux/sensors.c zabbix-1.8.3/src/libs/zbxsysinfo/linux/sensors.c
--- zabbix-1.8.3.zbx282/src/libs/zbxsysinfo/linux/sensors.c	2010-08-16 01:19:32.000000000 -0700
+++ zabbix-1.8.3/src/libs/zbxsysinfo/linux/sensors.c	2010-09-03 09:35:31.191717195 -0700
@@ -20,9 +20,9 @@
 #include "common.h"
 
 #include "sysinfo.h"
-
 #include "md5.h"
 
+
 static int	get_sensor(const char *name, unsigned flags, AGENT_RESULT *result)
 {
 	DIR	*dir;
@@ -30,15 +30,15 @@
 	struct	stat buf;
 	char	filename[MAX_STRING_LEN];
 	char	line[MAX_STRING_LEN];
-	double	d1,d2,d3;
+ 	double	stemp;	
 
 	FILE	*f;
 
 	assert(result);
 
 	init_result(result);
-
-	dir=opendir("/proc/sys/dev/sensors");
+ 
+ 	dir=opendir("/sys/bus/i2c/devices");
 	if(NULL == dir)
 	{
 		return SYSINFO_RET_FAIL;
@@ -46,8 +46,9 @@
 
 	while((entries=readdir(dir))!=NULL)
 	{
-		strscpy(filename,"/proc/sys/dev/sensors/");
+ 		strscpy(filename,"/sys/bus/i2c/devices/");     
 		zbx_strlcat(filename,entries->d_name,MAX_STRING_LEN);
+ 		zbx_strlcat(filename,"/",MAX_STRING_LEN);
 		zbx_strlcat(filename,name,MAX_STRING_LEN);
 
 		if(stat(filename,&buf)==0)
@@ -63,10 +64,13 @@
 			}
 			zbx_fclose(f);
 
-			if(sscanf(line,"%lf\t%lf\t%lf\n",&d1, &d2, &d3) == 3)
+			if(sscanf(line,"%lf\n",&stemp) == 1)
 			{
+
 				closedir(dir);
-				SET_DBL_RESULT(result, d3);
+				SET_DBL_RESULT(result, stemp);
+
+
 				return  SYSINFO_RET_OK;
 			}
 			else
@@ -78,6 +82,7 @@
 	}
 	closedir(dir);
 	return	SYSINFO_RET_FAIL;
+
 }
 
 int     OLD_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result)
@@ -101,15 +106,15 @@
 
 	if(strcmp(key,"temp1") == 0)
 	{
-	ret = get_sensor("temp1", flags, result);
+                 ret = get_sensor("temp1_input", flags, result);
 	}
 	else if(strcmp(key,"temp2") == 0)
 	{
-	ret = get_sensor("temp2", flags, result);
+                 ret = get_sensor("temp2_input", flags, result);
 	}
 	else if(strcmp(key,"temp3") == 0)
 	{
-	ret = get_sensor("temp3", flags, result);
+                 ret = get_sensor("temp3_input", flags, result);
 	}
 	else
 	{