Browse Source

Add ./tarball_archive/symon-2.75.tar.gz

Wictor Lund 3 years ago
parent
commit
3a17e131bf

+ 6 - 0
symon/CHANGELOG

@@ -1,3 +1,9 @@
+13/02/2007 - 2.75
+
+   - OpenBSD sensors missed includes (Constantine A. Murenin)
+
+   - NetBSD now checks if pf is installed (Jean-Yves Moulin)
+
 11/02/2007 - 2.74
 
    - symon can be told what local interface to send data from (Henning Brauer)

+ 1 - 1
symon/Makefile.inc

@@ -1,6 +1,6 @@
 # $Id: Makefile.inc,v 1.34 2007/02/11 20:07:31 dijkstra Exp $
 
-V=2.74
+V=2.75
 OS!=uname -s
 
 AR?=	ar

+ 1 - 1
symon/platform/FreeBSD/sm_mbuf.c

@@ -73,7 +73,7 @@ get_mbuf(char *symon_buf, int maxlen, struct stream *st)
     int totmem, totused, totmbufs, totpct;
     u_int32_t stats[15];
 
-    if (!mbstat_len)
+    if (mbstat_len == 0)
         return 0;
 
     size = sizeof(mbstat);

+ 5 - 0
symon/platform/NetBSD/conf.sh

@@ -0,0 +1,5 @@
+if [ -f /usr/include/net/pfvar.h ]; then
+    echo "#define HAS_PFVAR_H	1"
+else
+    echo "#undef HAS_PFVAR_H"
+fi

+ 0 - 4
symon/platform/OpenBSD/conf.sh

@@ -6,10 +6,6 @@ case `grep -csq KERN_CPTIME2 /usr/include/sys/sysctl.h` in
 1)	echo "#define HAS_KERN_CPTIME2	1" ;;
 0)	echo "#undef HAS_KERN_CPTIME2" ;;
 esac;
-case `grep -csq "struct sensor" /usr/include/sys/sensors.h` in
-1)	echo "#define HAS_SENSORS_H	1" ;;
-0)	echo "#undef HAS_SENSORS_H" ;;
-esac
 case `grep -csq "struct sensordev" /usr/include/sys/sensors.h` in
 1)	echo "#define HAS_SENSORDEV	1" ;;
 0)	echo "#undef HAS_SENSORDEV" ;;

+ 1 - 2
symon/platform/OpenBSD/platform.h

@@ -1,4 +1,4 @@
-/* $Id: platform.h,v 1.5 2007/01/19 21:37:27 dijkstra Exp $ */
+/* $Id: platform.h,v 1.6 2007/02/13 19:12:26 dijkstra Exp $ */
 
 #ifndef _CONF_OPENBSD_H
 #define _CONF_OPENBSD_H
@@ -8,7 +8,6 @@
 #include <sys/dkstat.h>
 #include <sys/queue.h>
 #include <sys/types.h>
-#include <sys/sensors.h>
 #include <sys/socket.h>
 #include <net/if.h>
 

+ 8 - 31
symon/platform/OpenBSD/sm_sensor.c

@@ -1,8 +1,8 @@
-/* $Id: sm_sensor.c,v 1.10 2007/02/11 20:26:56 dijkstra Exp $ */
+/* $Id: sm_sensor.c,v 1.11 2007/02/13 19:12:26 dijkstra Exp $ */
 
 /*
  * Copyright (c) 2001-2005 Willem Dijkstra
- * Copyright (c) 2006-2007 Constantine A. Murenin
+ * Copyright (c) 2006/2007 Constantine A. Murenin
  *                         <cnst+symon@bugmail.mojo.ru>
  * All rights reserved.
  *
@@ -42,6 +42,7 @@
 #include "conf.h"
 
 #include <sys/param.h>
+#include <sys/sensors.h>
 #include <sys/sysctl.h>
 
 #include <errno.h>
@@ -52,31 +53,11 @@
 
 #include "error.h"
 #include "symon.h"
+#include "xmalloc.h"
 
 /* Globals for this module start with sn_ */
 static struct sensor sn_sensor;
 
-#ifndef HAS_SENSORS_H
-void
-privinit_sensor()
-{
-    fatal("sensor support not available");
-}
-void
-init_sensor(struct stream *st)
-{
-    fatal("sensor support not available");
-}
-int
-get_sensor(char *symon_buf, int maxlen, struct stream *st)
-{
-    fatal("sensor support not available");
-    return 0;
-}
-
-#else
-
-#include <sys/sensors.h>
 void
 privinit_sensor()
 {
@@ -108,7 +89,8 @@ init_sensor(struct stream *st)
     bufp = bufpo;
 
     if ((devname = strsep(&bufp, ".")) == NULL)
-        fatal("sensor(%.200s): incomplete specification", st->arg);
+        fatal("%s:%d: sensor(%.200s): incomplete specification",
+              __FILE__, __LINE__, st->arg);
 
     /* convert sensor device string to an integer */
     for (dev = 0; dev < MAXSENSORDEVICES; dev++) {
@@ -124,8 +106,8 @@ init_sensor(struct stream *st)
 
     /* convert sensor_type string to an integer */
     if ((typename = strsep(&bufp, ".")) == NULL)
-        fatal("sensor(%.200s): incomplete specification", st->arg);
-
+        fatal("%s:%d: sensor(%.200s): incomplete specification",
+              __FILE__, __LINE__, st->arg);
     numt = -1;
     for (i = 0; typename[i] != '\0'; i++)
         if (isdigit(typename[i])) {
@@ -139,11 +121,9 @@ init_sensor(struct stream *st)
     if (type == SENSOR_MAX_TYPES)
         fatal("sensor(%.200s): sensor type not recognised: %.200s",
               st->arg, typename);
-
     if (sensordev.maxnumt[type] == 0)
         fatal("sensor(%.200s): no sensors of such type on this device: %.200s",
               st->arg, typename);
-
     st->parg.sn.mib[3] = type;
 
     if (numt == -1) {
@@ -154,7 +134,6 @@ init_sensor(struct stream *st)
     if (!(numt < sensordev.maxnumt[type]))
         fatal("sensor(%.200s): no such sensor attached to this device: %.200s%i",
               st->arg, typename, numt);
-
     st->parg.sn.mib[4] = numt;
 
     xfree(bufpo);
@@ -199,5 +178,3 @@ get_sensor(char *symon_buf, int maxlen, struct stream *st)
         return snpack(symon_buf, maxlen, st->arg, MT_SENSOR, t);
     }
 }
-
-#endif /* HAS_SENSORS_H */

+ 0 - 1
symon/symon/symon.c

@@ -259,7 +259,6 @@ main(int argc, char *argv[])
             (streamfunc[stream->type].init) (stream);
         }
     }
-    set_stream_use(&mul);
 
     /* setup alarm */
     timerclear(&alarminterval.it_interval);