- Update to 0.95

- Convert old style rc script to new style

PR:		ports/119296
Submitted by:	valerio.daelli at gmail.com (maintainer)
This commit is contained in:
Rong-En Fan 2008-01-05 14:35:25 +00:00
parent 6c1dea85e0
commit b2ac137617
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=205068
9 changed files with 503 additions and 227 deletions

View File

@ -6,8 +6,7 @@
#
PORTNAME= netdisco
PORTVERSION= 0.94
PORTREVISION= 1
PORTVERSION= 0.95
CATEGORIES= net-mgmt www
MASTER_SITES= ${MASTER_SITE_SOURCEFORGE}
MASTER_SITE_SUBDIR= ${PORTNAME}
@ -36,7 +35,7 @@ USE_PERL5= yes
USE_PGSQL= yes
USE_APACHE= 1.3+
USE_RC_SUBR= netdisco.sh
USE_RC_SUBR= netdisco
NO_BUILD= yes
@ -117,10 +116,8 @@ do-install:
${MKDIR} ${DATADIR}/sql
${INSTALL_DATA} ${WRKSRC}/oui.txt ${DATADIR}
cd ${WRKSRC}/sql && \
${INSTALL_DATA} *.sql pg_all pg_back pg_init pg_run ${DATADIR}/sql
${INSTALL_DATA} *.sql pg ${DATADIR}/sql
${MKDIR} ${DATADIR}/mibs

View File

@ -1,3 +1,3 @@
MD5 (netdisco-0.94_with_mibs.tar.gz) = 295a48cea4278042ce3e653974c3fa1e
SHA256 (netdisco-0.94_with_mibs.tar.gz) = 64969678f8b660d569bfb6fba19165df21b80f0f32dd4ee3f032e505da787997
SIZE (netdisco-0.94_with_mibs.tar.gz) = 6903970
MD5 (netdisco-0.95_with_mibs.tar.gz) = 7cca1eb52203a0fa7b9bb65727b86d00
SHA256 (netdisco-0.95_with_mibs.tar.gz) = d7a48dba471d683b0be470c1f82d2b5fa9f396deb914b7171774d0a3137e0745
SIZE (netdisco-0.95_with_mibs.tar.gz) = 8318725

View File

@ -24,19 +24,19 @@ command="%%PREFIX%%/bin/netdisco"
required_files="%%PREFIX%%/etc/netdisco.conf"
netdisco_start() {
%%PREFIX%%/bin/netdisco -p start
$command -p start
}
netdisco_stop() {
%%PREFIX%%/bin/netdisco -p stop
$command -p stop
}
netdisco_restart() {
%%PREFIX%%/bin/netdisco -p restart
$command -p restart
}
netdisco_status() {
%%PREFIX%%/bin/netdisco -p status
$command -p status
}
run_rc_command "$1"

View File

@ -1,6 +1,6 @@
--- netdisco.orig Mon Dec 6 23:45:47 2004
+++ netdisco Sun Apr 9 23:45:16 2006
@@ -114,7 +114,7 @@
--- netdisco.orig Wed Mar 7 10:09:23 2007
+++ netdisco Wed Mar 7 10:18:23 2007
@@ -113,7 +113,7 @@
&header if (grep(/^([aABdeEFgIikKmMOprRTu]|expire-nodes-subnet)$/,keys %args) and !$BatchMode);
# Parse Config File - Check for -C, then in current dir, then in default dir.
@ -9,27 +9,21 @@
if (defined $c and -r $c){
$configfile = $c;
print "Using Config File : $configfile\n" if $DEBUG;
@@ -600,9 +600,9 @@
@@ -629,7 +629,7 @@
my ($file_name,$want_time,$no_header) = @_;
- my $file_path = $CONFIG{datadir} || 'data';
- my $home = $CONFIG{home} || '/usr/local/netdisco';
- $file_path = "$home/$file_path";
+ my $file_path = $CONFIG{datadir} || '%%DBDIR%%/netdisco';
+ my $home = $CONFIG{home} || '%%DATADIR%%';
+# $file_path = "$home/$file_path";
- my $file_path = homepath('datadir','data');
+ my $file_path = homepath('datadir','%%DBDIR%%/netdisco');
my $extension = defined $CONFIG{logextension} ? $CONFIG{logextension} : 'log';
@@ -3328,8 +3328,8 @@
=cut
@@ -3597,7 +3597,7 @@
sub admin_daemon_pid {
my $pid = shift;
- my $pid_file = $CONFIG{daemon_pid} || 'netdisco_daemon.pid';
- $pid_file = "$CONFIG{home}/$pid_file";
+ my $pid_file = $CONFIG{daemon_pid} || '%%RUNDIR%%/netdisco_daemon.pid';
+# $pid_file = "$CONFIG{home}/$pid_file";
- my $pid_file = homepath('daemon_pid', 'netdisco_daemon.pid');
+ my $pid_file = homepath('daemon_pid','%%RUNDIR%%/netdisco_daemon.pid');
if (defined $pid) {
print "Writing pid:$pid to $pid_file\n" if $DEBUG;

View File

@ -1,6 +1,6 @@
--- netdisco.conf.orig Tue Nov 16 19:18:10 2004
+++ netdisco.conf Sat Apr 8 22:53:52 2006
@@ -12,8 +12,8 @@
--- netdisco.conf.orig Wed Mar 7 10:26:11 2007
+++ netdisco.conf Wed Mar 7 10:50:53 2007
@@ -13,8 +13,8 @@
# ---- General Settings ----
domain = .mycompany.com
@ -11,15 +11,16 @@
timeout = 90
macsuck_timeout = 90
#macsuck_all_vlans = true
@@ -21,6 +21,7 @@
#macsuck_no =
#discover_no =
@@ -25,6 +25,8 @@
#discover_only =
#arpnip_no = 192.168.5.5,192.168.0.0/24,192.168.2.1,192.168.5.0/26
#arpnip_only =
+mibshome = %%DATADIR%%/mibs
+
# -- Database Maintenance and Data Removal --
expire_devices = 60
@@ -29,7 +30,7 @@
@@ -33,7 +35,7 @@
# ---- Admin Panel Daemon Settings ----
daemon_bg = true
@ -28,7 +29,7 @@
daemon_poll = 2
# ---- Port Control Settings ---
@@ -44,7 +45,7 @@
@@ -49,7 +51,7 @@
# Data Archiving and Logging
compresslogs = true
compress = /usr/bin/gzip -f
@ -37,23 +38,36 @@
logextension = txt
#nmis_dump = netdisco_nmis
@@ -77,24 +78,24 @@
@@ -83,11 +85,12 @@
snmptimeout = 1000000
snmpretries = 3
snmpver = 2
# remove any vendors not in use on your network from below line. Do not remove rfc or net-snmp.
-mibdirs = $home/mibs/allied,$home/mibs/asante,$home/mibs/cisco,$home/mibs/hp,$home/mibs/nortel,$home/mibs/rfc,$home/mibs/net-snmp
+mibdirs = $mibshome/mibs/allied,$mibshome/mibs/asante,$mibshome/mibs/cisco,$mibshome/mibs/hp,$mibshome/mibs/nortel,$mibshome/mibs/rfc,$mibshome/mibs/net-snmp
-mibdirs = $home/mibs/allied, $home/mibs/asante, $home/mibs/cisco, \
- $home/mibs/foundry, $home/mibs/hp, $home/mibs/nortel, \
- $home/mibs/extreme, \
+mibdirs = $mibshome/mibs/allied, $mibshome/mibs/asante, $mibshome/mibs/cisco, \
+ $mibshome/mibs/foundry, $mibshome/mibs/hp, $mibshome/mibs/nortel, \
+ $mibshome/mibs/extreme, \
# Do not remove rfc or net-snmp. \
- $home/mibs/rfc, $home/mibs/net-snmp
+ $mibshome/mibs/rfc, $mibshome/mibs/net-snmp
+
#bulkwalk_no = vendor:foundry,model:blah,127.0.0.1/32,myswitch
#bulkwalk_off = true
@@ -96,7 +99,7 @@
# ---- Graph Settings ----
edge_color = wheat
-graph = html/netmap.gif
+graph = netmap.gif
graph_bg = black
graph_color = white
# If you'd rather use PNG, comment out the above and
# uncomment this.
#graph_png = html/netmap.png
@@ -106,13 +109,13 @@
#graph_dir = net_dir.gif
graph_epsilon = 6
graph_layout = twopi # try neato too
graph_layout = twopi # try neato or fdp too
-graph_map = html/netmap.map
+graph_map = netmap.map
graph_overlap = scale
@ -62,7 +76,7 @@
#graph_raw = graph_raw.dot
graph_splines = false
-#graph_svg = html/netmap.svg
+#graph_svg = netmap.svg
+graph_svg = netmap.svg
graph_timeout = 90
graph_x = 30
graph_y = 30

View File

@ -43,17 +43,3 @@
}
# Setup Mason and Session Handler
@@ -30,10 +40,11 @@
use strict;
my $ah = new HTML::Mason::ApacheHandler(
- comp_root => '/usr/local/netdisco/html',
- data_dir => '/usr/local/netdisco/mason',
+ comp_root => '%%WWWDIR%%',
+ data_dir => '%%WWWDIR%%/mason',
request_class => 'MasonX::Request::WithApacheSession',
session_class => 'Apache::Session::Postgres',
+%%APACHE2%% args_method => 'mod_perl',
session_commit => 1,
session_use_cookie => 1,
session_cookie_expires => '+1y',

View File

@ -1,15 +0,0 @@
--- sql/pg_init.orig Sat Apr 8 23:07:02 2006
+++ sql/pg_init Sat Apr 8 23:06:21 2006
@@ -5,10 +5,10 @@
# Change these to match your setup
# Linux Default
-SYSDBUSER=postgres
+# SYSDBUSER=postgres
# BSD Default
-# SYSDBUSER=pgsql
+SYSDBUSER=pgsql
DB=netdisco

View File

@ -3,27 +3,30 @@ Netdisco has been installed.
In order to get up and running, there are a few more steps to complete:
1) Run the following to create and initialise the netdisco database:
1) fetch http://standards.ieee.org/regauth/oui/oui.txt
and copy the file oui.txt to %%DATADIR%%
2) Run the following to create and initialise the netdisco database:
sh %%DATADIR%%/sql/pg_init
sh %%DATADIR%%/sql/pg_run
sh %%DATADIR%%/sql/pg_all
2) Examine all the configuration files in %%PREFIX%%/etc/netdisco,
3) Examine all the configuration files in %%PREFIX%%/etc/netdisco,
and modify them to suit your needs.
3) Add an initial admin user by running 'netdisco -u'
4) Add an initial admin user by running 'netdisco -u'
4) Import the OUI database: netdisco -o
5) Import the OUI database: netdisco -o
5) Edit %%PREFIX%%/etc/netdisco/netdisco.crontab and change
6) Edit %%PREFIX%%/etc/netdisco/netdisco.crontab and change
center_network_device to one of your core routers/switches. Then
install the crontab:
crontab -u netdisco %%PREFIX%%/etc/netdisco/netdisco.crontab
6) Add netdisco_enable="YES" to /etc/rc.conf, and then run
7) Add netdisco_enable="YES" to /etc/rc.conf, and then run
%%PREFIX%%/etc/rc.d/netdisco to start the admin daemon.
7) Apache must be stopped/started (a graceful restart won't work)
8) Apache must be stopped/started (a graceful restart won't work)
------------------------------------------------------------------------

File diff suppressed because it is too large Load Diff