Subject: Re: Arguslist Digest, Vol 41, Issue 2

From: Jeff Weisberg <[email-masked]>
Date: Thu, 28 Jun 2007 19:00:29 -0400 (EDT)

| Ok, still stuck on this. Relevant scripts and snippit of the config file
| included
| 
| #!/bin/bash
| #send argus notifcations via snmp
| snmptrap -m all -v 2c -c public 192.168.3.56 localhost
| .1.3.6.1.4.1.16839.26  .1.3.6.1.4.1.16389.26.1000.1 s "$*"

your script is expecting something on the command line.

| Method "snmp_trap" {
| 		  command:        /home/testing/sbin/trap_send.sh
| 		  send:     %O %S %M %T %C \n\n
| 		  }

you are telling argus to run the script, and send stuff to its
standard input.

you need to either change the script to read standard input:

	read msg
	snmptrap -m [...] $msg

or change argus to pass stuff on the command line:

	Method "snmp_trap" {
		command:        /home/testing/sbin/trap_send.sh '%O %S %M %T %C'
	}

---

From: "Mark Duling" <[email-masked]>
Date: Thu, 28 Jun 2007 16:12:42 -0700

I've patched the argus Makefile for DESTDIR support and attached it. 
Could you plese include the changes for the next release?

Mark

---

From: "Mark Duling" <[email-masked]>
Date: Thu, 28 Jun 2007 16:22:43 -0700

Discussion about Argus <[email-masked]> on Thursday, June 28, 2007
>Could you plese include the changes for the next release?

I see the list strips attachments.  Here is the raw text of the patch.

--- Makefile.tplt.org	2007-06-01 16:30:47.000000000 -0700
+++ Makefile.tplt	2007-06-20 10:10:59.000000000 -0700
@@ -131,23 +131,23 @@
 	$(INSTALL_DATA)/gdata $(INSTALL_DATA)/perl install-locale install-message
 
 install-lib:
-	-mkdir -p $(INSTALL_LIB)
+	-mkdir -p $(DESTDIR)$(INSTALL_LIB)
 	$(PERL) tools/install_lib -s src -l $(INSTALL_LIB) $(LIBS)
-	cp $(TEXT) $(INSTALL_LIB)/
+	cp $(TEXT) $(DESTDIR)$(INSTALL_LIB)/
 
 install-prog: upgrade-cgi
-	-mkdir -p $(INSTALL_SBIN)
-	-mkdir -p $(INSTALL_BIN)
-	-mkdir -p $(INSTALL_CGI)
-	-mkdir -p $(INSTALL_LIB)
-	cp built/argusd   $(INSTALL_SBIN)/
-	cp built/argusctl $(INSTALL_SBIN)/
-	cp built/arguscgi $(INSTALL_CGI)/
-	cp built/graphd   $(INSTALL_LIB)/
-	cp built/picasso  $(INSTALL_LIB)/
-	cp built/argus-config $(INSTALL_BIN)/
-	cp built/argus-agent  $(INSTALL_SBIN)/
-	cp built/argusvxml    $(INSTALL_CGI)/
+	-mkdir -p $(DESTDIR)$(INSTALL_SBIN)
+	-mkdir -p $(DESTDIR)$(INSTALL_BIN)
+	-mkdir -p $(DESTDIR)$(INSTALL_CGI)
+	-mkdir -p $(DESTDIR)$(INSTALL_LIB)
+	cp built/argusd   $(DESTDIR)$(INSTALL_SBIN)/
+	cp built/argusctl $(DESTDIR)$(INSTALL_SBIN)/
+	cp built/arguscgi $(DESTDIR)$(INSTALL_CGI)/
+	cp built/graphd   $(DESTDIR)$(INSTALL_LIB)/
+	cp built/picasso  $(DESTDIR)$(INSTALL_LIB)/
+	cp built/argus-config $(DESTDIR)$(INSTALL_BIN)/
+	cp built/argus-agent  $(DESTDIR)$(INSTALL_SBIN)/
+	cp built/argusvxml    $(DESTDIR)$(INSTALL_CGI)/
 
 # previously, cgi was installed in sbin with symlink
 # cleanup old the files
@@ -157,23 +157,23 @@
 # in case the format of the auth file has changed
 REMOVEAUTH=1
 remove-auth:
-	@if test "$(REMOVEAUTH)" -a -f $(INSTALL_DATA)/auth; then rm
$(INSTALL_DATA)/auth; fi
+	@if test "$(REMOVEAUTH)" -a -f $(INSTALL_DATA)/auth; then rm
$(DESTDIR)$(INSTALL_DATA)/auth; fi
 
 # this only happens if there isn't already a data dir
 # if the user is upgrading, we leave it all alone
 # while a+rwx may be not be optimal security-wise,
 # it reduces the amount of support email the author receives
 $(INSTALL_DATA):
-	mkdir -p $(INSTALL_DATA)/stats $(INSTALL_DATA)/html
$(INSTALL_DATA)/notify
-	touch $(INSTALL_DATA)/log
-	$(PERL) -e 'print getppid, "\n"' > $(INSTALL_DATA)/notno
-	chmod a+rwx $(INSTALL_DATA)
-	chmod a+r $(INSTALL_DATA)/html $(INSTALL_DATA)/log
+	mkdir -p $(DESTDIR)$(INSTALL_DATA)/stats $(DESTDIR)$(INSTALL_DATA)/html
$(DESTDIR)$(INSTALL_DATA)/notify
+	touch $(DESTDIR)$(INSTALL_DATA)/log
+	$(PERL) -e 'print getppid, "\n"' > $(DESTDIR)$(INSTALL_DATA)/notno
+	chmod a+rwx $(DESTDIR)$(INSTALL_DATA)
+	chmod a+r $(DESTDIR)$(INSTALL_DATA)/html $(DESTDIR)$(INSTALL_DATA)/log
 	@echo ''
 	@echo creating example files...
 	@sleep 1
-	@cp examples/users  $(INSTALL_DATA)/users.example
-	@cp examples/config $(INSTALL_DATA)/config.example
+	@cp examples/users  $(DESTDIR)$(INSTALL_DATA)/users.example
+	@cp examples/config $(DESTDIR)$(INSTALL_DATA)/config.example
 	@echo ''
 	@echo '***' you will need to create/edit the files
\'$(INSTALL_DATA)/config\' 
 	@echo '***      ' and \'$(INSTALL_DATA)/users\'
@@ -182,26 +182,26 @@
 
 # if this is an upgrade, gdata might not exist even though data does
 $(INSTALL_DATA)/gdata: $(INSTALL_DATA)
-	if test ! -d $(INSTALL_DATA)/gdata;  then mkdir $(INSTALL_DATA)/gdata;  \
-		chmod a+rwx $(INSTALL_DATA)/gdata;  fi
-	if test ! -d $(INSTALL_DATA)/gcache; then mkdir $(INSTALL_DATA)/gcache; \
-		chmod a+rwx $(INSTALL_DATA)/gcache; fi
+	if test ! -d $(INSTALL_DATA)/gdata;  then mkdir
$(DESTDIR)$(INSTALL_DATA)/gdata;  \
+		chmod a+rwx $(DESTDIR)$(INSTALL_DATA)/gdata;  fi
+	if test ! -d $(INSTALL_DATA)/gcache; then mkdir
$(DESTDIR)$(INSTALL_DATA)/gcache; \
+		chmod a+rwx $(DESTDIR)$(INSTALL_DATA)/gcache; fi
 
 $(INSTALL_DATA)/perl: $(INSTALL_DATA)
 	if test ! -d $(INSTALL_DATA)/perl;  then \
-		mkdir $(INSTALL_DATA)/perl;  \
-		chmod a+rwx $(INSTALL_DATA)/perl;  \
+		mkdir $(DESTDIR)$(INSTALL_DATA)/perl;  \
+		chmod a+rwx $(DESTDIR)$(INSTALL_DATA)/perl;  \
 	fi
 
 install-locale: $(INSTALL_DATA)
 	if test ! -d $(INSTALL_DATA)/locale; then \
-		mkdir $(INSTALL_DATA)/locale; \
-		chmod a+rx $(INSTALL_DATA)/locale;  \
+		mkdir $(DESTDIR)$(INSTALL_DATA)/locale; \
+		chmod a+rx $(DESTDIR)$(INSTALL_DATA)/locale;  \
 	fi
-	-cp locale/* $(INSTALL_DATA)/locale
+	-cp locale/* $(DESTDIR)$(INSTALL_DATA)/locale
 
 install-conf:
-	cp built/conf.pl  $(INSTALL_LIB)
+	cp built/conf.pl  $(DESTDIR)$(INSTALL_LIB)
 
 HTML/config-details.html: $(BUILD)
 	built/argusd -DH > HTML/config-details.html