- Fix for updated sensors API, borrowed from systat(1).

Reported/tested by "Tasmanian Devil" and myself.

- Adjust sample configs to use the sensor name format we have been
using for the last few releases.
This commit is contained in:
sthen 2010-04-26 09:44:24 +00:00
parent ae3e0d5800
commit c82ffd07a1
4 changed files with 50 additions and 3 deletions

View File

@ -1,10 +1,10 @@
# $OpenBSD: Makefile,v 1.38 2010/04/15 14:29:16 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.39 2010/04/26 09:44:24 sthen Exp $
COMMENT-main= active monitoring tool
V= 2.79
DISTNAME= symon-${V}
PKGNAME-main= ${DISTNAME}p2
FULLPKGNAME-mon= symon-mon-${V}p2
PKGNAME-main= ${DISTNAME}p3
FULLPKGNAME-mon= symon-mon-${V}p3
FULLPKGNAME-mux= symon-mux-${V}p0
CATEGORIES= sysutils net

View File

@ -0,0 +1,23 @@
$OpenBSD: patch-platform_OpenBSD_sm_sensor_c,v 1.1 2010/04/26 09:44:24 sthen Exp $
--- platform/OpenBSD/sm_sensor.c.orig Mon Apr 26 09:52:18 2010
+++ platform/OpenBSD/sm_sensor.c Mon Apr 26 09:57:30 2010
@@ -93,10 +93,16 @@ init_sensor(struct stream *st)
__FILE__, __LINE__, st->arg);
/* convert sensor device string to an integer */
- for (dev = 0; dev < MAXSENSORDEVICES; dev++) {
+#define SYMON_MAXSENSORDEVICES 1024
+ for (dev = 0; dev < SYMON_MAXSENSORDEVICES; dev++) {
st->parg.sn.mib[2] = dev;
- if (sysctl(st->parg.sn.mib, 3, &sensordev, &sdlen, NULL, 0) == -1)
- continue;
+ if (sysctl(st->parg.sn.mib, 3, &sensordev, &sdlen, NULL, 0) == -1) {
+ if (errno == ENOENT)
+ break;
+ if (errno == ENXIO)
+ continue;
+ fatal("sensor sysctl: %s", strerror(errno));
+ }
if (strcmp(devname, sensordev.xname) == 0)
break;
}

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-symon_symon_conf,v 1.1 2010/04/26 09:44:24 sthen Exp $
--- symon/symon.conf.orig Mon Apr 26 10:03:44 2010
+++ symon/symon.conf Mon Apr 26 10:04:09 2010
@@ -7,7 +7,7 @@ monitor { cpu(0), mem,
if(lo0),
# pf,
# mbuf,
-# sensor(0),
+# sensor(cpu0.temp0),
# proc(httpd),
# if(xl0), if(de0), if(wi0),
# io(wd1), io(wd2), io(wd3), io(cd0)

View File

@ -0,0 +1,12 @@
$OpenBSD: patch-symux_symux_conf,v 1.1 2010/04/26 09:44:24 sthen Exp $
--- symux/symux.conf.orig Mon Apr 26 10:04:16 2010
+++ symux/symux.conf Mon Apr 26 10:04:28 2010
@@ -10,7 +10,7 @@ source 127.0.0.1 {
if(lo0),
# pf,
# mbuf,
-# sensor(0),
+# sensor(cpu0.temp0),
# proc(httpd),
# if(xl0), if(de0), if(wi0),
# io(wd1), io(wd2), io(wd3), io(cd0)