summaryrefslogtreecommitdiffstats
path: root/net/hawk
diff options
context:
space:
mode:
authordougb <dougb@FreeBSD.org>2003-02-13 11:20:38 +0000
committerdougb <dougb@FreeBSD.org>2003-02-13 11:20:38 +0000
commit966e32f767dead4d2be5a45f2bfdfb7f74c9b161 (patch)
tree437218fb7b43c415f993652ebdb3cc5754758cab /net/hawk
parent4b94c1697e0c16eca1947ca81f803bb28db58b31 (diff)
downloadFreeBSD-ports-966e32f767dead4d2be5a45f2bfdfb7f74c9b161.zip
FreeBSD-ports-966e32f767dead4d2be5a45f2bfdfb7f74c9b161.tar.gz
New port of a nifty utilty that uses perl to ping the networks you
specify, mysql to save the data, and php to display it. Fairly configurable, and easy to set up.
Diffstat (limited to 'net/hawk')
-rw-r--r--net/hawk/Makefile60
-rw-r--r--net/hawk/distinfo1
-rw-r--r--net/hawk/files/create_hawk_db.sql13
-rw-r--r--net/hawk/files/create_hawk_user.sql8
-rw-r--r--net/hawk/files/hawk.sh34
-rw-r--r--net/hawk/pkg-descr16
-rw-r--r--net/hawk/pkg-message4
-rw-r--r--net/hawk/pkg-plist20
8 files changed, 156 insertions, 0 deletions
diff --git a/net/hawk/Makefile b/net/hawk/Makefile
new file mode 100644
index 0000000..74c0974
--- /dev/null
+++ b/net/hawk/Makefile
@@ -0,0 +1,60 @@
+# New ports collection makefile for: hawk
+# Date created: 12 February 2003
+# Whom: dougb
+#
+# $FreeBSD$
+#
+
+PORTNAME= hawk
+PORTVERSION= 0.6
+CATEGORIES= net
+MASTER_SITES= http://umn.dl.sourceforge.net/sourceforge/iphawk/ \
+ http://unc.dl.sourceforge.net/sourceforge/iphawk/
+
+MAINTAINER= DougB@FreeBSD.org
+COMMENT= Track uptime and DNS status for machines on your networks
+
+RUN_DEPENDS= php-config:${PORTSDIR}/www/mod_php4 \
+ safe_mysqld:${PORTSDIR}/databases/mysql323-server \
+ ${LOCALBASE}/lib/perl5/site_perl/${PERL_VER}/Net/Netmask.pm:${PORTSDIR}/net/p5-Net-Netmask
+
+do-patch:
+ @${SED} -e 's#dirname.*"/hawk#"${PREFIX}/etc/hawk/daemon#' \
+ ${WRKSRC}/daemon/hawk > ${WRKSRC}/daemon/hawk.sed
+ @${MV} ${WRKSRC}/daemon/hawk.sed ${WRKSRC}/daemon/hawk
+ @${SED} -e 's#hawk.conf#daemon.conf#' \
+ ${WRKSRC}/php/hawk.conf.inc > ${WRKSRC}/php/hawk.conf.inc.sed
+ @${MV} ${WRKSRC}/php/hawk.conf.inc.sed ${WRKSRC}/php/hawk.conf.inc
+ @${SED} -e 's#hawk.conf.inc#${PREFIX}/etc/hawk/php.conf#' \
+ ${WRKSRC}/php/hawk.php > ${WRKSRC}/php/hawk.php.sed
+ @${MV} ${WRKSRC}/php/hawk.php.sed ${WRKSRC}/php/hawk.php
+
+do-build:
+# Empty target, nothing to build
+
+do-install:
+ ${MKDIR} ${PREFIX}/etc/hawk
+ ${INSTALL_DATA} ${WRKSRC}/daemon/hawk.conf ${PREFIX}/etc/hawk/daemon.conf.sample
+ ${INSTALL_SCRIPT} ${WRKSRC}/daemon/hawk ${PREFIX}/sbin
+ ${MKDIR} ${PREFIX}/www/data-dist/hawk/images
+ (for file in ${WRKSRC}/php/images/*; do \
+ ${INSTALL_DATA} $$file ${PREFIX}/www/data-dist/hawk/images; \
+ done)
+ ${INSTALL_DATA} ${WRKSRC}/php/hawk.php ${PREFIX}/www/data-dist/hawk
+ ${INSTALL_DATA} ${WRKSRC}/php/hawk.css ${PREFIX}/www/data-dist/hawk
+ ${INSTALL_DATA} ${WRKSRC}/php/hawk.conf.inc \
+ ${PREFIX}/etc/hawk/php.conf.sample
+ ${SED} -e 's#%%PREFIX%%#${PREFIX}#' ${FILESDIR}/hawk.sh > \
+ ${WRKDIR}/hawk.sh.sample
+ ${INSTALL_SCRIPT} ${WRKDIR}/hawk.sh.sample ${PREFIX}/etc/rc.d
+.if !defined(NOPORTDOCS)
+ @${MKDIR} ${DOCSDIR}
+ ${INSTALL_DATA} ${WRKSRC}/README ${DOCSDIR}
+ ${INSTALL_DATA} ${FILESDIR}/create_hawk_db.sql ${DOCSDIR}
+ ${INSTALL_DATA} ${FILESDIR}/create_hawk_user.sql ${DOCSDIR}
+.endif
+
+post-install:
+ @${CAT} ${PKGMESSAGE}
+
+.include <bsd.port.mk>
diff --git a/net/hawk/distinfo b/net/hawk/distinfo
new file mode 100644
index 0000000..6c85e96
--- /dev/null
+++ b/net/hawk/distinfo
@@ -0,0 +1 @@
+MD5 (hawk-0.6.tar.gz) = 0126343848ebed9a5d62292e3fd603a1
diff --git a/net/hawk/files/create_hawk_db.sql b/net/hawk/files/create_hawk_db.sql
new file mode 100644
index 0000000..6d4aefe
--- /dev/null
+++ b/net/hawk/files/create_hawk_db.sql
@@ -0,0 +1,13 @@
+# Feed this file to mysql, e.g.,
+# mysql -v < create_hawk_db.sql
+
+create database hawk;
+use hawk;
+create table ip (
+ ip char(16) NOT NULL default '0',
+ hostname char(255) default NULL,
+ lastping int(10) default NULL,
+ primary key (ip),
+ unique key ip (ip),
+ key ip_2 (ip)
+) type=MyISAM comment='Table for last ping time of hosts';
diff --git a/net/hawk/files/create_hawk_user.sql b/net/hawk/files/create_hawk_user.sql
new file mode 100644
index 0000000..594447c
--- /dev/null
+++ b/net/hawk/files/create_hawk_user.sql
@@ -0,0 +1,8 @@
+# Feed this file to mysql, e.g.,
+# mysql -v < create_hawk_user.sql
+
+grant select,insert,update,delete
+ on hawk.*
+ to hawk@localhost
+ identified by 'YOUR_PASSWORD_HERE';
+flush privileges;
diff --git a/net/hawk/files/hawk.sh b/net/hawk/files/hawk.sh
new file mode 100644
index 0000000..4285b34
--- /dev/null
+++ b/net/hawk/files/hawk.sh
@@ -0,0 +1,34 @@
+#!/bin/sh
+
+PATH=/bin:/usr/bin
+export PATH
+
+stop_hawk () {
+ if [ -f /var/run/hawk.pid ];then
+ kill `cat /var/run/hawk.pid`
+ else
+ ps -ax | awk '/[h]awk$/ {print $1}' | xargs kill
+ fi
+}
+
+case "${1}" in
+start)
+ echo 'Starting hawk'
+ %%PREFIX%%/sbin/hawk &
+ ;;
+stop)
+ echo 'Stopping hawk'
+ stop_hawk
+ ;;
+restart)
+ echo 'Restarting hawk'
+ stop_hawk
+ %%PREFIX%%/sbin/hawk &
+ ;;
+*)
+ echo "Usage: $0 {start|stop|restart}"
+ exit 1
+ ;;
+esac
+
+exit 0
diff --git a/net/hawk/pkg-descr b/net/hawk/pkg-descr
new file mode 100644
index 0000000..46c7b1e
--- /dev/null
+++ b/net/hawk/pkg-descr
@@ -0,0 +1,16 @@
+Hawk is a web based utility for monitoring and comparing hosts
+on your network with what's in DNS. Hosts that are answering
+pings but are not in dns may be unauthorized, and hosts that are
+in DNS, but are not answering may be able to be reclaimed. Hawk
+monitors all hosts on the networks you specify and lets you view
+them via a web page.
+
+Hawk consists of a backend written in perl that monitors hosts by
+icmp pings and writes the status to a mysql database. The frontend
+is in php and lets you select which network to view, and how to view
+it.
+
+WWW: http://sourceforge.net/projects/iphawk/
+
+- Doug Barton
+DougB@FreeBSD.org
diff --git a/net/hawk/pkg-message b/net/hawk/pkg-message
new file mode 100644
index 0000000..c491139
--- /dev/null
+++ b/net/hawk/pkg-message
@@ -0,0 +1,4 @@
+
+See PREFIX/share/doc/hawk/create_hawk* for instructions on creating
+the database and user that the php code expects.
+
diff --git a/net/hawk/pkg-plist b/net/hawk/pkg-plist
new file mode 100644
index 0000000..83d4017
--- /dev/null
+++ b/net/hawk/pkg-plist
@@ -0,0 +1,20 @@
+etc/hawk/daemon.conf.sample
+etc/hawk/php.conf.sample
+etc/rc.d/hawk.sh.sample
+sbin/hawk
+www/data-dist/hawk/images/bluesphere.png
+www/data-dist/hawk/images/greensphere.png
+www/data-dist/hawk/images/hawk.jpg
+www/data-dist/hawk/images/purplesphere.png
+www/data-dist/hawk/images/questionsphere.png
+www/data-dist/hawk/images/redsphere.png
+www/data-dist/hawk/images/yellowsphere.png
+www/data-dist/hawk/hawk.php
+www/data-dist/hawk/hawk.css
+%%PORTDOCS%%share/doc/hawk/README
+%%PORTDOCS%%share/doc/hawk/create_hawk_db.sql
+%%PORTDOCS%%share/doc/hawk/create_hawk_user.sql
+%%PORTDOCS%%@dirrm share/doc/hawk
+@unexec rmdir %D/etc/hawk 2>/dev/null || true
+@dirrm www/data-dist/hawk/images
+@dirrm www/data-dist/hawk
OpenPOWER on IntegriCloud