[csw-devel] SF.net SVN: gar:[4829] csw/mgar/pkg/pnp/trunk

j_arndt at users.sourceforge.net j_arndt at users.sourceforge.net
Wed May 13 11:31:59 CEST 2009


Revision: 4829
          http://gar.svn.sourceforge.net/gar/?rev=4829&view=rev
Author:   j_arndt
Date:     2009-05-13 09:31:59 +0000 (Wed, 13 May 2009)

Log Message:
-----------
pnp: update to 0.4.14, added some patches, corrected start script

Modified Paths:
--------------
    csw/mgar/pkg/pnp/trunk/Makefile
    csw/mgar/pkg/pnp/trunk/checksums
    csw/mgar/pkg/pnp/trunk/files/CSWpnp.prototype
    csw/mgar/pkg/pnp/trunk/files/cswpnp
    csw/mgar/pkg/pnp/trunk/files/makefile.diff

Added Paths:
-----------
    csw/mgar/pkg/pnp/trunk/files/npcd.c.diff
    csw/mgar/pkg/pnp/trunk/files/npcd.cfg-sample.in.diff
    csw/mgar/pkg/pnp/trunk/files/npcdmod.c.diff
    csw/mgar/pkg/pnp/trunk/files/npcdmod.h.diff

Removed Paths:
-------------
    csw/mgar/pkg/pnp/trunk/files/npcd.diff

Modified: csw/mgar/pkg/pnp/trunk/Makefile
===================================================================
--- csw/mgar/pkg/pnp/trunk/Makefile	2009-05-12 21:36:50 UTC (rev 4828)
+++ csw/mgar/pkg/pnp/trunk/Makefile	2009-05-13 09:31:59 UTC (rev 4829)
@@ -1,8 +1,8 @@
 GARNAME = pnp
-GARVERSION = 0.4.13
+GARVERSION = 0.4.14
 CATEGORIES = apps
 
-DESCRIPTION = analyzing nagios performance data with RRD databases.
+DESCRIPTION = visualization of  nagios performance data using RRD databases
 define BLURB
   PNP is an addon to nagios which analyzes performance data provided by plugins and stores them automatically into RRD-databases
 endef
@@ -12,10 +12,12 @@
 DISTFILES  = $(GARNAME)-$(GARVERSION).tar.gz
 DISTFILES += $(call admfiles,CSWpnp, prototype )
 DISTFILES += cswpnp
-#DISTFILES += cswpnp cswpnp.xml svc-cswpnp
 
 PATCHFILES += makefile.diff
-PATCHFILES += npcd.diff
+PATCHFILES += npcd.c.diff
+PATCHFILES += npcdmod.h.diff
+PATCHFILES += npcdmod.c.diff
+PATCHFILES += npcd.cfg-sample.in.diff
 
 # We define upstream file regex so we can be notifed of new upstream software release
 #UFILES_REGEX = -(\d+(?:\.\d+)*).tar.gz
@@ -24,17 +26,15 @@
 # uncomment the next line. Otherwise it is set by default to the value of MASTER_SITES
 # UPSTREAM_MASTER_SITES = 
 
-LDFLAGS += -L/usr/ucblib
-LIBS += -lucb
+NOISALIST = 1
 
 datadir = /opt/csw/nagios/share/pnp
 sysconfdir = $(prefix)/nagios/pnp/etc
-bindir = $(prefix)/nagios/bin
+bindir = $(prefix)/nagios/pnp/bin
 libexecdir = $(prefix)/libexec/nagios-plugins
+localstatedir =$(prefix)/nagios/pnp/var
 
-REQUIRED_PKGS_sparc = SUNWscpux
-REQUIRED_PKGS_i386 = SUNWscpu
-REQUIRED_PKGS = CSWphp5 CSWphp5gd CSWap2modphp5 CSWrrd $(REQUIRED_PKGS_$(GARCH)) CSWcswclassutils
+REQUIRED_PKGS += CSWphp5 CSWphp5gd CSWap2modphp5 CSWrrd  CSWcswclassutils
 SPKG_CLASSES = none cswpreserveconf cswinitsmf
 
 #PROTOTYPE_FILTER  = awk '$$$$3 ~ /\/init.d\/cswpnp$$$$/ { $$$$2 = "cswinitsmf" } { print }'

Modified: csw/mgar/pkg/pnp/trunk/checksums
===================================================================
--- csw/mgar/pkg/pnp/trunk/checksums	2009-05-12 21:36:50 UTC (rev 4828)
+++ csw/mgar/pkg/pnp/trunk/checksums	2009-05-13 09:31:59 UTC (rev 4829)
@@ -1,6 +1,9 @@
-20a96f81edba29dcd21215bde4af8b57  download/pnp-0.4.13.tar.gz
+9dbbf08191a258f6798c9516b3821ff0  download/pnp-0.4.14.tar.gz
 216b8ed50919642c3fae2a6520724dd3  download/CSWpnp.gspec
-c3cee9b1ce8286d553735d2bbde151e0  download/CSWpnp.prototype
-40b1d1489a41475ff6cddf441b18316a  download/cswpnp
-30e8699531bb0249542b3012a00a73b1  download/makefile.diff
-b1229d599c2ce12c3aacf0a44e1588d6  download/npcd.diff
+fc763dd71049d4c06f10b8898fa3c1bb  download/CSWpnp.prototype
+fec420cb27af9cbd0daba28f04500f8c  download/cswpnp
+80c06e6426497ed3fa96c0e77aff613d  download/makefile.diff
+db6af87968e9b29272d387033f09acba  download/npcd.c.diff
+65d971cd9983aef7f069c7976424eb99  download/npcdmod.h.diff
+8380996936f96669d8abe25dd8faf392  download/npcdmod.c.diff
+01c0965ea1bdd26e4f0fdbc51640dfce  download/npcd.cfg-sample.in.diff

Modified: csw/mgar/pkg/pnp/trunk/files/CSWpnp.prototype
===================================================================
--- csw/mgar/pkg/pnp/trunk/files/CSWpnp.prototype	2009-05-12 21:36:50 UTC (rev 4828)
+++ csw/mgar/pkg/pnp/trunk/files/CSWpnp.prototype	2009-05-13 09:31:59 UTC (rev 4829)
@@ -4,9 +4,9 @@
 d none /opt/csw/libexec/nagios-plugins 0755 root bin
 f none /opt/csw/libexec/nagios-plugins/process_perfdata.pl 0755 root bin
 d none /opt/csw/nagios 0755 root bin
-d none /opt/csw/nagios/bin 0755 nagios nagios
-f none /opt/csw/nagios/bin/npcd 0754 nagios nagios
-f none /opt/csw/nagios/bin/npcdmod 0754 nagios nagios
+d none /opt/csw/nagios/pnp/bin 0755 nagios nagios
+f none /opt/csw/nagios/pnp/bin/npcd 0754 nagios nagios
+f none /opt/csw/nagios/pnp/bin/npcdmod 0754 nagios nagios
 d none /opt/csw/nagios/pnp 0755 nagios nagios
 d none /opt/csw/nagios/pnp/etc 0755 nagios nagios
 f none /opt/csw/nagios/pnp/etc/background.pdf 0644 nagios nagios

Modified: csw/mgar/pkg/pnp/trunk/files/cswpnp
===================================================================
--- csw/mgar/pkg/pnp/trunk/files/cswpnp	2009-05-12 21:36:50 UTC (rev 4828)
+++ csw/mgar/pkg/pnp/trunk/files/cswpnp	2009-05-13 09:31:59 UTC (rev 4829)
@@ -26,7 +26,7 @@
 	exit $SMF_EXIT_ERR_CONFIG
 fi
 
-BIN_FILE="/opt/csw/nagios/bin/npcd"
+BIN_FILE="/opt/csw/nagios/pnp/bin/npcd"
 pidfile=`grep '^pid_file' $CONFIG_FILE |awk '{ FS = "=" } {print $2;}'`
 PNP_USER=`awk '/^user/ { print $NF }' $CONFIG_FILE`
 
@@ -45,7 +45,7 @@
 
 'start')
         if [ -f $CONFIG_FILE ]; then
-            $BIN_FILE -c $CONFIG_FILE -d
+            $BIN_FILE -d -f $CONFIG_FILE
         fi
         ;;
 

Modified: csw/mgar/pkg/pnp/trunk/files/makefile.diff
===================================================================
--- csw/mgar/pkg/pnp/trunk/files/makefile.diff	2009-05-12 21:36:50 UTC (rev 4828)
+++ csw/mgar/pkg/pnp/trunk/files/makefile.diff	2009-05-13 09:31:59 UTC (rev 4829)
@@ -1,15 +1,6 @@
 diff --speed-large-files --minimal -Nru pnp-0.4.13.orig/src/Makefile.in pnp-0.4.13/src/Makefile.in
 --- pnp-0.4.13.orig/src/Makefile.in	2009-02-19 18:28:41.000000000 +0100
 +++ pnp-0.4.13/src/Makefile.in	2009-03-04 20:55:35.296449068 +0100
-@@ -9,7 +9,7 @@
- SRC_INCLUDE=../include
- 
- CC=@CC@
--CFLAGS=@CFLAGS@ @DEFS@ -DNSCORE
-+CFLAGS=@CFLAGS@ @DEFS@ -DNSCORE -L/usr/ucblib -R/usr/ucblib -lucb
- 
- # Compiler flags for use with Valgrind
- #CFLAGS=-O0 -g -DHAVE_CONFIG_H -DNSCORE
 @@ -52,7 +52,7 @@
  
  OBJDEPS=
@@ -26,7 +17,7 @@
 -npcdmod.o: npcdmod.c
 -	$(CC) $(MOD_CFLAGS) $(CFLAGS) -o npcdmod.o npcdmod.c $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS) -fPIC
 +npcdmod: npcdmod.c
-+	$(CC) $(MOD_CFLAGS) $(CFLAGS) -o npcdmod npcdmod.c $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS) -fPIC
++	$(CC) $(MOD_CFLAGS) $(CFLAGS) -o npcdmod npcdmod.c $(MOD_LDFLAGS) $(LDFLAGS) $(LIBS)
  
  ###############################
  #

Added: csw/mgar/pkg/pnp/trunk/files/npcd.c.diff
===================================================================
--- csw/mgar/pkg/pnp/trunk/files/npcd.c.diff	                        (rev 0)
+++ csw/mgar/pkg/pnp/trunk/files/npcd.c.diff	2009-05-13 09:31:59 UTC (rev 4829)
@@ -0,0 +1,103 @@
+diff --speed-large-files --minimal -Nru pnp-0.4.14.orig/src/npcd.c pnp-0.4.14/src/npcd.c
+--- pnp-0.4.14.orig/src/npcd.c	2009-05-02 11:25:23.000000000 +0200
++++ pnp-0.4.14/src/npcd.c	2009-05-10 20:57:26.766575641 +0200
+@@ -56,6 +56,99 @@
+ const char *directory = NULL;
+ const char progname[5] = "npcd";
+ 
++int
++scandir(const char *dirname, struct dirent *(*namelist[]),
++    int (*select)(const struct dirent *),
++    int (*dcomp)(const struct dirent **, const struct dirent **))
++{
++	struct dirent	*d, *p, **names = NULL;
++	size_t	nitems = 0;
++	size_t	arraysz, entlen;
++	struct stat64	stb;
++	DIR	*dirp;
++	u_longlong_t	tmp_arraysz;
++
++	if ((dirp = opendir(dirname)) == NULL)
++		return (-1);
++	if (fstat64(dirp->dd_fd, &stb) < 0)
++		goto fail;
++
++	/*
++ * 	 * estimate the array size by taking the size of the directory file
++ * 	 	 * and dividing it by a multiple of the minimum size entry.
++ * 	 	 	 */
++	tmp_arraysz = stb.st_size / 24;	/* 24 bytes on a 64-bit system */
++	if (tmp_arraysz > INT_MAX)
++		arraysz = INT_MAX;
++	else
++		arraysz = (size_t)tmp_arraysz;
++	names = malloc(arraysz * sizeof (struct dirent *));
++	if (names == NULL)
++		goto fail;
++
++	while ((d = readdir(dirp)) != NULL) {
++		if (select != NULL && !(*select)(d))
++			continue;	/* just selected names */
++
++		entlen = d->d_reclen;
++		/*
++ * 		 * Make a minimum size copy of the data
++ * 		 		 */
++		p = malloc(entlen);
++		if (p == NULL)
++			goto fail;
++		(void) memcpy(p, d, entlen);
++		/*
++ * 		 * Check to make sure the array has space left and
++ * 		 		 * realloc the maximum size.
++ * 		 		 		 */
++		if (nitems >= arraysz) {
++			struct dirent **tmp;
++			if (nitems == INT_MAX) {
++				/* overflow */
++				free(p);
++				errno = EOVERFLOW;
++				goto fail;
++			}
++			arraysz += 512;		/* no science here */
++			tmp = realloc(names,
++			    arraysz * sizeof (struct dirent *));
++			if (tmp == NULL) {
++				free(p);
++				goto fail;
++			}
++			names = tmp;
++		}
++		names[nitems++] = p;
++	}
++	(void) closedir(dirp);
++	if (nitems && dcomp != NULL)
++		qsort(names, nitems, sizeof (struct dirent *),
++		    (int(*)(const void *, const void *))dcomp);
++	*namelist = names;
++
++	return ((int)nitems);
++
++fail:
++	while (nitems != 0) {
++		free(names[--nitems]);
++	}
++	if (names)
++		free(names);
++	(void) closedir(dirp);
++	return (-1);
++}
++
++/*
++ *  * Alphabetic order comparison routine for those who want it.
++ *   */
++int
++alphasort(const struct dirent **d1, const struct dirent **d2)
++{
++	return (strcoll((*d1)->d_name,
++	    (*d2)->d_name));
++}
++
+ static void start_daemon(const char *log_name, int facility) {
+ 	int i;
+ 	pid_t pid;

Added: csw/mgar/pkg/pnp/trunk/files/npcd.cfg-sample.in.diff
===================================================================
--- csw/mgar/pkg/pnp/trunk/files/npcd.cfg-sample.in.diff	                        (rev 0)
+++ csw/mgar/pkg/pnp/trunk/files/npcd.cfg-sample.in.diff	2009-05-13 09:31:59 UTC (rev 4829)
@@ -0,0 +1,14 @@
+diff --speed-large-files --minimal -Nru pnp-0.4.14.orig/sample-config/pnp/npcd.cfg-sample.in pnp-0.4.14/sample-config/pnp/npcd.cfg-sample.in
+--- pnp-0.4.14.orig/sample-config/pnp/npcd.cfg-sample.in	2009-05-02 11:25:23.000000000 +0200
++++ pnp-0.4.14/sample-config/pnp/npcd.cfg-sample.in	2009-05-12 18:38:17.625341221 +0200
+@@ -32,8 +32,8 @@
+ # log_type = <value>
+ #
+ 
+-#log_type = file
+-log_type = syslog
++log_type = file
++#log_type = syslog
+ 
+ 
+ # log_file - define a path to your logfile

Deleted: csw/mgar/pkg/pnp/trunk/files/npcd.diff
===================================================================
--- csw/mgar/pkg/pnp/trunk/files/npcd.diff	2009-05-12 21:36:50 UTC (rev 4828)
+++ csw/mgar/pkg/pnp/trunk/files/npcd.diff	2009-05-13 09:31:59 UTC (rev 4829)
@@ -1,15 +0,0 @@
-diff --speed-large-files --minimal -Nru pnp-0.4.13.orig/src/npcd.c pnp-0.4.13/src/npcd.c
---- pnp-0.4.13.orig/src/npcd.c	2009-02-19 18:28:41.000000000 +0100
-+++ pnp-0.4.13/src/npcd.c	2009-03-04 20:39:15.803376720 +0100
-@@ -56,6 +56,11 @@
- const char *directory = NULL;
- const char progname[5] = "npcd";
- 
-+int alphasort(const struct dirent **a, const struct dirent **b)
-+{
-+  return(strcmp((*a)->d_name, (*b)->d_name));
-+}
-+
- static void start_daemon(const char *log_name, int facility) {
- 	int i;
- 	pid_t pid;

Added: csw/mgar/pkg/pnp/trunk/files/npcdmod.c.diff
===================================================================
--- csw/mgar/pkg/pnp/trunk/files/npcdmod.c.diff	                        (rev 0)
+++ csw/mgar/pkg/pnp/trunk/files/npcdmod.c.diff	2009-05-13 09:31:59 UTC (rev 4829)
@@ -0,0 +1,12 @@
+diff --speed-large-files --minimal -Nru pnp-0.4.14.orig/src/npcdmod.c pnp-0.4.14/src/npcdmod.c
+--- pnp-0.4.14.orig/src/npcdmod.c	2009-05-02 11:25:23.000000000 +0200
++++ pnp-0.4.14/src/npcdmod.c	2009-05-11 08:08:15.406159492 +0200
+@@ -53,6 +53,8 @@
+ 
+ void npcdmod_file_roller();
+ int npcdmod_handle_data(int, void *);
++int npcdmod_process_module_args(char *);
++int npcdmod_process_config_var(char *);
+ 
+ /* this function gets called when the module is loaded by the event broker */
+ int nebmodule_init(int flags, char *args, nebmodule *handle) {

Added: csw/mgar/pkg/pnp/trunk/files/npcdmod.h.diff
===================================================================
--- csw/mgar/pkg/pnp/trunk/files/npcdmod.h.diff	                        (rev 0)
+++ csw/mgar/pkg/pnp/trunk/files/npcdmod.h.diff	2009-05-13 09:31:59 UTC (rev 4829)
@@ -0,0 +1,9 @@
+diff --speed-large-files --minimal -Nru pnp-0.4.14.orig/include/npcdmod.h pnp-0.4.14/include/npcdmod.h
+--- pnp-0.4.14.orig/include/npcdmod.h	2009-05-02 11:25:23.000000000 +0200
++++ pnp-0.4.14/include/npcdmod.h	2009-05-10 19:54:45.629418467 +0200
+@@ -38,4 +38,4 @@
+ char *pnp_mmap_fgets(pnp_mmapfile *);
+ char *pnp_mmap_fgets_multiline(pnp_mmapfile *);
+ 
+-extern pnp_strip(char *);
++extern void pnp_strip(char *);


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.



More information about the devel mailing list