summaryrefslogtreecommitdiff
path: root/net
diff options
context:
space:
mode:
authorcube <cube>2004-02-24 23:34:11 +0000
committercube <cube>2004-02-24 23:34:11 +0000
commitcffdbe2b3f3bdf46e05c5b55d9f94eb1e53c1f3a (patch)
treeb97b6d1165122ef0a3573345546ec5192a2a8974 /net
parent284565c8d5c91f7580302fa8f9c17cc0bad4a237 (diff)
downloadpkgsrc-cffdbe2b3f3bdf46e05c5b55d9f94eb1e53c1f3a.tar.gz
Update to version 0.21. This is the GKrellM-2 port of the snmp plugin. It
also includes a few new features, such as a grapher and support for tcp transport.
Diffstat (limited to 'net')
-rw-r--r--net/gkrellm-snmp/Makefile29
-rw-r--r--net/gkrellm-snmp/PLIST4
-rw-r--r--net/gkrellm-snmp/distinfo10
-rw-r--r--net/gkrellm-snmp/patches/patch-aa44
-rw-r--r--net/gkrellm-snmp/patches/patch-ab109
5 files changed, 152 insertions, 44 deletions
diff --git a/net/gkrellm-snmp/Makefile b/net/gkrellm-snmp/Makefile
index a5180b92d1a..a3cf6533a80 100644
--- a/net/gkrellm-snmp/Makefile
+++ b/net/gkrellm-snmp/Makefile
@@ -1,25 +1,18 @@
-# $NetBSD: Makefile,v 1.11 2004/01/24 14:50:05 grant Exp $
+# $NetBSD: Makefile,v 1.12 2004/02/24 23:34:11 cube Exp $
+#
-DISTNAME= gkrellm_snmp-0.18
-PKGNAME= gkrellm-snmp-0.18
-PKGREVISION= 6
-CATEGORIES= net sysutils
-MASTER_SITES= http://triq.net/gkrellm/
+DISTNAME= gkrellm_snmp-0.21
+PKGNAME= ${DISTNAME:S/_/-/}
+CATEGORIES= net
+MASTER_SITES= http://triq.net/gkrellm/
-MAINTAINER= jasper@pointless.net
-HOMEPAGE= http://triq.net/gkrellm.html
-COMMENT= Simple SNMP monitor for gkrellm
+MAINTAINER= cube@NetBSD.org
+HOMEPAGE= http://triq.net/gkrellm_snmp.html
+COMMENT= GKrellM plugin to display values collected from a SNMP agent
-USE_BUILDLINK2= # defined
-USE_GNU_TOOLS+= make
+USE_BUILDLINK2= YES
-do-install:
- ${INSTALL_DATA_DIR} ${PREFIX}/lib/gkrellm/plugins
- ${INSTALL_PROGRAM} ${WRKSRC}/gkrellm_snmp.so ${PREFIX}/lib/gkrellm/plugins/
-
-.include "../../graphics/imlib/buildlink2.mk"
-.include "../../net/ucd-snmp/buildlink2.mk"
.include "../../security/openssl/buildlink2.mk"
.include "../../sysutils/gkrellm/buildlink2.mk"
-.include "../../x11/gtk/buildlink2.mk"
+.include "../../net/net-snmp/buildlink2.mk"
.include "../../mk/bsd.pkg.mk"
diff --git a/net/gkrellm-snmp/PLIST b/net/gkrellm-snmp/PLIST
index c31f529b427..1fd39191033 100644
--- a/net/gkrellm-snmp/PLIST
+++ b/net/gkrellm-snmp/PLIST
@@ -1,2 +1,2 @@
-@comment $NetBSD: PLIST,v 1.1 2001/10/31 22:55:27 zuntum Exp $
-lib/gkrellm/plugins/gkrellm_snmp.so
+@comment $NetBSD: PLIST,v 1.2 2004/02/24 23:34:11 cube Exp $
+lib/gkrellm2/plugins/gkrellm_snmp.so
diff --git a/net/gkrellm-snmp/distinfo b/net/gkrellm-snmp/distinfo
index b38742f6eb4..0e746ad41b5 100644
--- a/net/gkrellm-snmp/distinfo
+++ b/net/gkrellm-snmp/distinfo
@@ -1,6 +1,6 @@
-$NetBSD: distinfo,v 1.1.1.1 2001/10/31 00:28:26 damon Exp $
+$NetBSD: distinfo,v 1.2 2004/02/24 23:34:11 cube Exp $
-SHA1 (gkrellm_snmp-0.18.tar.gz) = c1aa5edf8e86aedb377c454cf1f249d956ec8a67
-Size (gkrellm_snmp-0.18.tar.gz) = 15450 bytes
-SHA1 (patch-aa) = b8c84280e496febff37579914d700b4980f8cc37
-SHA1 (patch-ab) = caa2acd64e3a58596b599fb22d72df69effbbc05
+SHA1 (gkrellm_snmp-0.21.tar.gz) = 7f8dc2eb754da769414a6c64c06d7903e45f3fc5
+Size (gkrellm_snmp-0.21.tar.gz) = 17034 bytes
+SHA1 (patch-aa) = b767ba4d279f2cf51417d0528a2f6dee6e114b03
+SHA1 (patch-ab) = d136139689fd2971f5b596db2184e46b20f6bb76
diff --git a/net/gkrellm-snmp/patches/patch-aa b/net/gkrellm-snmp/patches/patch-aa
index 7c0f6ebb586..7bc23af8bac 100644
--- a/net/gkrellm-snmp/patches/patch-aa
+++ b/net/gkrellm-snmp/patches/patch-aa
@@ -1,24 +1,46 @@
-$NetBSD: patch-aa,v 1.1.1.1 2001/10/31 00:28:26 damon Exp $
+$NetBSD: patch-aa,v 1.2 2004/02/24 23:34:11 cube Exp $
---- Makefile.orig Tue Apr 3 09:25:07 2001
+--- Makefile.orig 2003-09-21 14:47:38.000000000 +0200
+++ Makefile
-@@ -5,7 +5,7 @@
- IMLIB_CONFIG = imlib-config
+@@ -4,7 +4,7 @@
+ GTK_CONFIG = pkg-config gtk+-2.0
SYSLIB = -lsnmp
# we need lib crypto if libsnmp has privacy support.
-SYSLIB += -lcrypto -L/usr/local/ssl/lib -L/usr/ssl/lib
-+SYSLIB += -lcrypto
++SYSLIB += -lcrypto -L$(BUILDLINK_DIR)/lib
# FreeBSD
#GTK_CONFIG = gtk12-config
-@@ -14,8 +14,8 @@
+@@ -12,17 +12,17 @@ SYSLIB += -lcrypto -L/usr/local/ssl/lib
#PLUGIN_DIR = /usr/X11R6/libexec/gkrellm/plugins/
- USER_PLUGIN_DIR = $(HOME)/.gkrellm/plugins
--PLUGIN_DIR = /usr/share/gkrellm/plugins
--GKRELLM_INCLUDE = -I/usr/local/include
-+PLUGIN_DIR = ${PREFIX}/lib/gkrellm/plugins
-+GKRELLM_INCLUDE = -I${PREFIX}/include
+ USER_PLUGIN_DIR = $(HOME)/.gkrellm2/plugins
+-PLUGIN_DIR = /usr/lib/gkrellm2/plugins
+-GKRELLM_INCLUDE = -I/usr/X11R6/include
++PLUGIN_DIR = $(PREFIX)/lib/gkrellm2/plugins
++GKRELLM_INCLUDE = -I$(BUILDLINK_DIR)/include
GTK_INCLUDE = `$(GTK_CONFIG) --cflags`
GTK_LIB = `$(GTK_CONFIG) --libs`
+
+-FLAGS = -Wall -fPIC $(GTK_INCLUDE) $(GKRELLM_INCLUDE)
++FLAGS = $(CFLAGS) -Wall -fPIC $(GTK_INCLUDE) $(GKRELLM_INCLUDE) -DNETSNMP
+ LIBS = $(GTK_LIB) $(SYSLIB)
+ LFLAGS = -shared
+
+-CC = gcc $(CFLAGS) $(FLAGS)
++#CC = gcc $(CFLAGS) $(FLAGS)
+
+ INSTALL = install -c
+ INSTALL_PROGRAM = $(INSTALL) -s
+@@ -47,8 +47,8 @@ install-user: gkrellm_snmp.so
+ make PLUGIN_DIR=$(USER_PLUGIN_DIR) install
+
+ install: gkrellm_snmp.so
+- $(INSTALL) -m 755 -d $(PLUGIN_DIR)
++# $(INSTALL) -m 755 -d $(PLUGIN_DIR)
+ $(INSTALL_PROGRAM) -m 755 gkrellm_snmp.so $(PLUGIN_DIR)
+
+ gkrellm_snmp.o: gkrellm_snmp.c
+-
++ $(CC) $(FLAGS) -c -o $(.TARGET) $(.ALLSRC)
diff --git a/net/gkrellm-snmp/patches/patch-ab b/net/gkrellm-snmp/patches/patch-ab
index 8293ef1016e..505070eeeef 100644
--- a/net/gkrellm-snmp/patches/patch-ab
+++ b/net/gkrellm-snmp/patches/patch-ab
@@ -1,12 +1,105 @@
-$NetBSD: patch-ab,v 1.1.1.1 2001/10/31 00:28:26 damon Exp $
+$NetBSD: patch-ab,v 1.2 2004/02/24 23:34:11 cube Exp $
---- gkrellm_snmp.c.orig Thu Sep 6 22:15:30 2001
+--- gkrellm_snmp.c.orig 2003-09-21 14:49:36.000000000 +0200
+++ gkrellm_snmp.c
-@@ -88,6 +88,7 @@
- GtkTooltips *tooltip;
- };
+@@ -59,7 +59,7 @@
-+oid *snmp_parse_oid(const char *argv, oid *root, size_t *rootlen);
+ #include <gkrellm2/gkrellm.h>
- /*
- * caller needs to free the returned gchar*
+-/* #define STREAM /* test for Lou Cephyr */
++/* #define STREAM -- test for Lou Cephyr */
+
+
+ #define SNMP_PLUGIN_MAJOR_VERSION 0
+@@ -67,6 +67,7 @@
+
+ #define PLUGIN_CONFIG_NAME "SNMP"
+ #define PLUGIN_CONFIG_KEYWORD "snmp_monitor"
++#define PLUGIN_MONITOR_KEYWORD "monitor"
+
+
+ typedef struct Reader Reader;
+@@ -967,13 +968,16 @@ save_plugin_config(FILE *f)
+ unit = g_strdelimit(g_strdup(reader->unit), STR_DELIMITERS, '_');
+ if (label[0] == '\0') label = strdup("_");
+ if (unit[0] == '\0') unit = strdup("_");
+- fprintf(f, "%s %s snmp://%s@%s:%d/%s %s %d %d %d %d\n",
++ fprintf(f, "%s %s %s snmp://%s@%s:%d/%s %s %d %d %d %d\n",
+ PLUGIN_CONFIG_KEYWORD,
++ PLUGIN_MONITOR_KEYWORD,
+ label, reader->community,
+ reader->peer, reader->port,
+ reader->oid_str, unit,
+ reader->delay, reader->delta,
+ reader->divisor, reader->scale);
++ gkrellm_save_chartconfig(f, reader->chart_config, PLUGIN_CONFIG_KEYWORD,
++ label);
+ g_free(label);
+ g_free(unit);
+ }
+@@ -984,19 +988,43 @@ load_plugin_config(gchar *arg)
+ {
+ Reader *reader, *nreader;
+
++ gchar config[32], item[CFG_BUFSIZE];
+ gchar proto[CFG_BUFSIZE], bufl[CFG_BUFSIZE];
+ gchar bufc[CFG_BUFSIZE], bufp[CFG_BUFSIZE];
+ gchar bufo[CFG_BUFSIZE], bufu[CFG_BUFSIZE];
++ gchar bufpr[CFG_BUFSIZE], bufpeer[CFG_BUFSIZE];
+ gint n;
+
++ n = sscanf(arg, "%31s %s %[^\n]", config, bufl, item);
++ if (n != 3)
++ return;
++
++ if (!strcmp(config, GKRELLM_CHARTCONFIG_KEYWORD))
++ {
++ for (nreader = readers; nreader; nreader = nreader->next)
++ {
++ if (!strcmp(bufl, nreader->label))
++ {
++ gkrellm_load_chartconfig(&nreader->chart_config, item, 1);
++ break;
++ }
++ }
++ return;
++ }
++
++ if (strcmp(config, PLUGIN_MONITOR_KEYWORD))
++ return;
++
+ reader = g_new0(Reader, 1);
+
+- n = sscanf(arg, "%s %[^:]://%[^@]@%[^:]:%d/%s %s %d %d %d %d",
+- bufl, proto, bufc, bufp, &reader->port, bufo, bufu,
++ n = sscanf(item, "%[^:]://%[^@]@%[^:]:%[^:]:%d/%s %s %d %d %d %d",
++ proto, bufc, bufpr, bufpeer, &reader->port, bufo, bufu,
+ &reader->delay, &reader->delta,
+ &reader->divisor, &reader->scale);
+ if (n >= 6)
+ {
++ g_snprintf(bufp, CFG_BUFSIZE, "%s:%s", bufpr, bufpeer);
++ bufp[CFG_BUFSIZE-1] = '\0';
+ if (g_strcasecmp(proto, "snmp") == 0) {
+ gkrellm_dup_string(&reader->label, bufl);
+ gkrellm_dup_string(&reader->community, bufc);
+@@ -1055,6 +1083,7 @@ apply_plugin_config()
+ for (row = 0; row < GTK_CLIST(reader_clist)->rows; ++row)
+ {
+ gint i;
++ gchar peername[MAXHOSTNAMELEN+1];
+ i = 0;
+ reader = g_new0(Reader, 1);
+
+@@ -1062,6 +1091,11 @@ apply_plugin_config()
+ gkrellm_dup_string(&reader->label, name);
+
+ gtk_clist_get_text(GTK_CLIST(reader_clist), row, i++, &name);
++ if (strncasecmp(name, "tcp:", 4) && strncasecmp(name, "udp:", 4))
++ {
++ g_snprintf(peername, MAXHOSTNAMELEN, "udp:%s", name);
++ name = peername;
++ }
+ gkrellm_dup_string(&reader->peer, name);
+
+ gtk_clist_get_text(GTK_CLIST(reader_clist), row, i++, &name);