Explorar el Código

- config file update
- only count actual requests not all packets

Tobias Begalke hace 7 años
padre
commit
89da62fd68
Se han modificado 3 ficheros con 7 adiciones y 2 borrados
  1. 4 1
      build-rpm.sh
  2. 2 1
      main.go
  3. 1 0
      munchclient.toml

+ 4 - 1
build-rpm.sh

@@ -13,13 +13,16 @@ RPM_DIR=/opt/rpm.scraperwall.com/centos6
 
 
 rm -rf $DESTDIR
-install -d $DESTDIR/{usr/bin,etc/init.d,etc/default,etc/logrotate.d}
+install -d $DESTDIR/{usr/bin,etc/init.d,etc/default,etc/logrotate.d,usr/share/munchclient}
 make
 
 install -v -m 755 $BINARY $DESTDIR/usr/bin/
 install -v -m 644 defaults/$DEFAULTS_FILE $DESTDIR/etc/default/
 install -v -m 644 logrotate.d/munchclient $DESTDIR/etc/logrotate.d/
 install -v -m 644 munchclient.toml $DESTDIR/etc/
+install -v -m 644 munchclient.toml $DESTDIR/usr/share/munchclient/
+install -v -m 644 defaults/$DEFAULTS_FILE $DESTDIR/usr/share/munchclient/$DEFAULTS_FILE.defaults
+
 
 
 fpm -s dir -t $PKG_TYPE -C $DESTDIR --name $BINARY \

+ 2 - 1
main.go

@@ -175,7 +175,6 @@ func liveCapture() {
 
 // processPacket receives a raw packet from pcap, builds a Request item from it and sends it to the queue
 func processPacket(packet gopacket.Packet) {
-	count++
 
 	hasIPv4 := false
 	var ipSrc, ipDst string
@@ -214,6 +213,8 @@ func processPacket(packet gopacket.Packet) {
 		return
 	}
 
+	count++
+
 	if len(applicationLayer.Payload()) < 50 {
 		log.Println("application layer too small!")
 		return

+ 1 - 0
munchclient.toml

@@ -11,3 +11,4 @@
 # RequestsFile = requests.csv
 # Protocol = http
 # Protocol = ajp13
+# Trace = false