pkgsrc-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[pkgsrc/trunk]: pkgsrc/net/gkrellm-snmp Update to version 0.21. This is the ...



details:   https://anonhg.NetBSD.org/pkgsrc/rev/6ae576036c37
branches:  trunk
changeset: 469551:6ae576036c37
user:      cube <cube%pkgsrc.org@localhost>
date:      Tue Feb 24 23:34:11 2004 +0000

description:
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:

 net/gkrellm-snmp/Makefile         |   31 ++++------
 net/gkrellm-snmp/PLIST            |    4 +-
 net/gkrellm-snmp/distinfo         |   10 +-
 net/gkrellm-snmp/patches/patch-aa |   44 +++++++++++---
 net/gkrellm-snmp/patches/patch-ab |  109 +++++++++++++++++++++++++++++++++++--
 5 files changed, 153 insertions(+), 45 deletions(-)

diffs (242 lines):

diff -r a33902141617 -r 6ae576036c37 net/gkrellm-snmp/Makefile
--- a/net/gkrellm-snmp/Makefile Tue Feb 24 23:28:35 2004 +0000
+++ b/net/gkrellm-snmp/Makefile Tue Feb 24 23:34:11 2004 +0000
@@ -1,25 +1,18 @@
-# $NetBSD: Makefile,v 1.11 2004/01/24 14:50:05 grant Exp $
-
-DISTNAME=              gkrellm_snmp-0.18
-PKGNAME=               gkrellm-snmp-0.18
-PKGREVISION=           6
-CATEGORIES=            net sysutils
-MASTER_SITES=          http://triq.net/gkrellm/
+# $NetBSD: Makefile,v 1.12 2004/02/24 23:34:11 cube Exp $
+#
 
-MAINTAINER=            jasper%pointless.net@localhost
-HOMEPAGE=              http://triq.net/gkrellm.html
-COMMENT=               Simple SNMP monitor for gkrellm
-
-USE_BUILDLINK2=                # defined
-USE_GNU_TOOLS+=                make
+DISTNAME=      gkrellm_snmp-0.21
+PKGNAME=       ${DISTNAME:S/_/-/}
+CATEGORIES=    net
+MASTER_SITES=  http://triq.net/gkrellm/
 
-do-install:
-       ${INSTALL_DATA_DIR} ${PREFIX}/lib/gkrellm/plugins
-       ${INSTALL_PROGRAM} ${WRKSRC}/gkrellm_snmp.so ${PREFIX}/lib/gkrellm/plugins/
+MAINTAINER=    cube%NetBSD.org@localhost
+HOMEPAGE=      http://triq.net/gkrellm_snmp.html
+COMMENT=       GKrellM plugin to display values collected from a SNMP agent
 
-.include "../../graphics/imlib/buildlink2.mk"
-.include "../../net/ucd-snmp/buildlink2.mk"
+USE_BUILDLINK2=        YES
+
 .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 -r a33902141617 -r 6ae576036c37 net/gkrellm-snmp/PLIST
--- a/net/gkrellm-snmp/PLIST    Tue Feb 24 23:28:35 2004 +0000
+++ b/net/gkrellm-snmp/PLIST    Tue Feb 24 23:34:11 2004 +0000
@@ -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 -r a33902141617 -r 6ae576036c37 net/gkrellm-snmp/distinfo
--- a/net/gkrellm-snmp/distinfo Tue Feb 24 23:28:35 2004 +0000
+++ b/net/gkrellm-snmp/distinfo Tue Feb 24 23:34:11 2004 +0000
@@ -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 -r a33902141617 -r 6ae576036c37 net/gkrellm-snmp/patches/patch-aa
--- a/net/gkrellm-snmp/patches/patch-aa Tue Feb 24 23:28:35 2004 +0000
+++ b/net/gkrellm-snmp/patches/patch-aa Tue Feb 24 23:34:11 2004 +0000
@@ -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 -r a33902141617 -r 6ae576036c37 net/gkrellm-snmp/patches/patch-ab
--- a/net/gkrellm-snmp/patches/patch-ab Tue Feb 24 23:28:35 2004 +0000
+++ b/net/gkrellm-snmp/patches/patch-ab Tue Feb 24 23:34:11 2004 +0000
@@ -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 @@
+ 
+ #include <gkrellm2/gkrellm.h>
+ 
+-/* #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;
  
-+oid *snmp_parse_oid(const char *argv, oid *root, size_t *rootlen);
++  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); 
  
- /*
-  * caller needs to free the returned gchar*
+-  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);



Home | Main Index | Thread Index | Old Index