rpms/netdisco/F-11 import.log, NONE, 1.1 netdisco.init, NONE, 1.1 netdisco.spec, NONE, 1.1 netdisco_config, NONE, 1.1 .cvsignore, 1.1, 1.2 sources, 1.1, 1.2

gouldwp gouldwp at fedoraproject.org
Tue Jul 28 05:27:19 UTC 2009


Author: gouldwp

Update of /cvs/pkgs/rpms/netdisco/F-11
In directory cvs1.fedora.phx.redhat.com:/tmp/cvs-serv21750/F-11

Modified Files:
	.cvsignore sources 
Added Files:
	import.log netdisco.init netdisco.spec netdisco_config 
Log Message:



--- NEW FILE import.log ---
netdisco-0_95-2_fc11:F-11:netdisco-0.95-2.fc11.src.rpm:1248758778


--- NEW FILE netdisco.init ---
#!/bin/bash
#
# Startup script for the netdisco daemon
#
# chkconfig: - 345 95 5
# description: Startup/shutdown script for the Netdisco Admin Daemon
# processname: netdisco
# pidfile: /var/run/netdisco/netdisco.pid
# config: /etc/netdisco.conf

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

RETVAL=0

# See how we were called.
case "$1" in
  start)
        echo -n "Starting netdisco admin daemon:"
        su -l netdisco -c "/usr/sbin/netdisco -p start"
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && touch /var/lock/subsys/netdisco /var/run/netdisco/netdisco.pid
	;;
  stop)
        echo -n "Stopping netdisco admin daemon:"
        su -l netdisco -c "/usr/sbin/netdisco -p stop"
	RETVAL=$?
	echo
	[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/netdisco /var/run/netdisco/netdisco.pid
	;;
  restart|reload)
        echo -n "Restarting netdisco admin daemon:"
        su -l netdisco -c "/usr/sbin/netdisco -p restart"
	RETVAL=$?
	;;
  status)
	status netdisco
        su -l netdisco -c "/usr/sbin/netdisco -p status"
	RETVAL=$?
	;;
  *)
	echo "Usage: $0 {start|stop|restart|reload|status}"
	exit 1
esac

exit $RETVAL


--- NEW FILE netdisco.spec ---
%define mibs_version 0.7

Name:           netdisco 
Version:        0.95 
Release:        2%{?dist}
Summary:        A web-based network management tool 
License:        BSD
Group:          Applications/Internet 
URL:            http://netdisco.org/ 
Source0:        http://downloads.sourceforge.net/project/%{name}/%{name}/%{version}/%{name}-%{version}.tar.gz
Source1:        http://downloads.sourceforge.net/project/%{name}/%{name}-mibs/%{mibs_version}/%{name}-mibs-%{mibs_version}.tar.gz
Source2:        netdisco.init
Source3:        netdisco_config
BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildArch:      noarch
Requires:       httpd
Requires:       postgresql postgresql-server
Requires:       net-snmp net-snmp-perl
Requires:       mod_perl mod_ssl
Requires:       graphviz 
Requires:       perl(DBI) 
Requires:       perl(Apache::DBI)
Requires:       perl(DBD::Pg)
Requires:       perl(Apache::Session)
Requires:       perl(HTML::Parser)  
Requires:       perl(HTML::Mason)
Requires:       perl(MasonX::Request::WithApacheSession)
Requires:       perl(Graph) 
Requires:       perl(GraphViz)
Requires:       perl(Compress::Zlib) 
Requires:       perl(Net::NBName) 
Requires:       perl-libapreq2 
Requires:       perl(SNMP::Info) 
Requires:       perl(Parallel::ForkManager) 
Requires:       perl(Net::LDAP) 
Requires:       perl(Net::SSLeay) 
Requires:       perl(IO::Socket::SSL) 
Requires(pre):  /usr/sbin/useradd

%description
Netdisco is a network management application targeted at large
corporate and university networks. Data is collected into a Postgres
database using SNMP and presented with a clean web interface using Mason.

Designed for moderate to large networks, configuration information
and connection data for network devices are retrieved by SNMP.
With Netdisco you can locate the switch port of an end-user system
by IP or MAC address. Data is stored using a SQL database for scalability
and speed. Layer-2 topology protocols such as CDP (Cisco Discovery Protocol)
optionally provides automatic discovery of the network topology.


%prep
%setup -q -n %{name}-%{version} -a1
/usr/bin/iconv -f iso8859-1 -t utf-8 ChangeLog > ChangeLog.conv && /bin/mv -f ChangeLog.conv ChangeLog
%define debug_package %{nil}

cp %{SOURCE2} netdisco.init
cp %{SOURCE3} netdisco_config

# prefix fix
find -type f | xargs perl -pi -e "s|/usr/local/netdisco|/usr/share/netdisco|g"
# perl path fix 
find -type f | xargs perl -pi -e "s|/usr/local/bin/perl|/usr/bin/perl|g"
# shebang fix
find -type f | xargs perl -pi -e "s|#/bin/sh|#!/bin/sh|g"

# config file path fix
perl -pi -e "s|\"\\\$Dir/netdisco\.conf\"\;|\'%{_sysconfdir}/netdisco\.conf\'\;|" sql/pg


%build


# make some man pages too :)
pod2man netdisco > netdisco.1
pod2man netdisco.pm > netdisco.pm.1

%install
rm -rf %{buildroot}

install -d %{buildroot}%{_initrddir}
install -d %{buildroot}%{_sysconfdir}/httpd/conf.d
install -d %{buildroot}%{_sysconfdir}/logrotate.d
install -d %{buildroot}%{_sysconfdir}/sysconfig
install -d %{buildroot}%{_sbindir}
install -d %{buildroot}%{_mandir}/man1
install -d %{buildroot}%_datadir/%{name}/switch
install -d %{buildroot}%_datadir/%{name}/data/logs
install -d %{buildroot}/var/run/netdisco
install -d %{buildroot}%perl_vendorlib

install -m0644 netdisco.conf %{buildroot}%{_sysconfdir}/
install -m0644 netdisco_apache.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/
install -m0644 netdisco_apache_dir.conf %{buildroot}%{_sysconfdir}/httpd/conf.d/
install -m0755 netdisco %{buildroot}%{_sbindir}/

install -m0644 netdisco.1 %{buildroot}%{_mandir}/man1/
install -m0644 netdisco.pm.1 %{buildroot}%{_mandir}/man1/

install -m0755 netdisco.init %{buildroot}%{_initrddir}/netdisco
install -m0755 netdisco_config %{buildroot}%{_sbindir}/netdisco_config
install -m0644 netdisco.pm %{buildroot}/%perl_vendorlib/ 

%__cp -aRf * %{buildroot}%_datadir/%{name}/
%__mv %{buildroot}%_datadir/%{name}/%{name}-mibs-%{mibs_version} %{buildroot}%_datadir/%{name}/mibs/
%__rm -rf %{buildroot}%_datadir/%{name}/netdisco.conf
%__ln_s %{_sysconfdir}/netdisco.conf %{buildroot}%_datadir/%{name}/netdisco.conf

%__chmod 0644 %{buildroot}%_datadir/%{name}/mibs/cisco/CISCO-VSAN-MIB.my


%pre
%__mkdir %_datadir/%{name}
/usr/sbin/useradd %{name} -d %_datadir/%{name}/ -s /bin/sh  1>&2 > /dev/null
# apache needs to read /etc/netdisco.conf, but it contains a plain
# text password to the postgresql netdisco database, so the file
# requires stricter file permissions...
/usr/bin/gpasswd -a apache netdisco 1>&2 > /dev/null


%post
if [ "$1" = "0" ]; then
   /sbin/chkconfig --add %{name}
fi


%preun
if [ "$1" = "0" ]; then
   /sbin/service netdisco stop > /dev/null 2>&1
   /sbin/chkconfig --del %{name}
fi


%clean
%__rm -rf %{buildroot}

%files
%defattr(-,root,root,-)
%doc ChangeLog INSTALL README* UPGRADE
%{_initrddir}/netdisco
%config(noreplace) %{_sysconfdir}/netdisco.conf
%config(noreplace) %{_sysconfdir}/httpd/conf.d/netdisco_apache.conf
%config(noreplace) %{_sysconfdir}/httpd/conf.d/netdisco_apache_dir.conf
%{_sbindir}/netdisco
%{_sbindir}/netdisco_config
%dir /var/run/netdisco
%perl_vendorlib/netdisco.pm
%dir %_datadir/netdisco
%_datadir/netdisco/*
%{_mandir}/man1/*
 

%changelog
* Sun Jul 26 2009 <gouldwp at fedoraproject.org> 0.95-2
- Netdisco network management software.
- Changed %%defattr(-,root,root) to %%defattr(-,root,root,-) in files section
- Changed /usr/share/ to %%_datadir in the %%files section
- Removed patches, substituted with find/perl/xargs replace lines 
- Removed explicit %%attr lines in %%files



--- NEW FILE netdisco_config ---
#!/bin/bash


if [ "x`whoami`" != "xroot" ]; then
    echo 'You must be root to run this.'
    exit
fi

echo ""
echo "[ netdisco_config ] Configuration Script for Netdicso"
echo ""
echo "   * This script will configure Netdisco on a stock Fedora installation"
echo ""
echo ""
echo "UNSUPPORTED -  Please use at your own risk.   "
echo "               This script was contributed by Kaven Rousseau and is untested."
echo "               This script was modified by Oden Eriksson <oeriksson at mandriva.com>"
echo "               This script was modified by Walter Gould <gouldwp at fedoraproject.org> for Fedora install"
echo ""
echo -n "Hit Return to continue or Ctrl-C to exit : "
read foo


# start postgresql
echo ""
echo ""
echo "Starting postgresql......."
echo ""
echo ""
/sbin/service postgresql initdb
/etc/init.d/postgresql start
sleep 3


# Edit pg_hba.conf file
echo ""
echo ""
echo "Backing up and editing postgresql files......."
echo ""
echo ""
cp /var/lib/pgsql/data/pg_hba.conf /var/lib/pgsql/data/pg_hba.conf.orig
echo "# TYPE DATABASE USER IP-ADDRESS IP-MASK METHOD" > /var/lib/pgsql/data/pg_hba.conf
echo "local all all trust" >> /var/lib/pgsql/data/pg_hba.conf
echo "host all all 127.0.0.1 255.255.255.255 trust" >> /var/lib/pgsql/data/pg_hba.conf
/etc/init.d/postgresql restart
sleep 3


# netdisco config file
echo ""
echo ""
echo "About to edit the netdisco config files.........."
echo ""
echo ""
stty -echo
echo -n "Enter Netdisco Database password: "
read netdisco_passwd
echo ""
stty echo
cat /etc/netdisco.conf | sed "s/dbpassword/$netdisco_passwd/g" > /tmp/netdisco.conf.$$
mv -f /tmp/netdisco.conf.$$ /etc/netdisco.conf
cat /etc/httpd/conf.d/netdisco_apache.conf | sed "s/PASSWORDHERE/$netdisco_passwd/g" > /tmp/netdisco_apache.conf.$$
mv -f /tmp/netdisco_apache.conf.$$ /etc/httpd/conf.d/netdisco_apache.conf
#
echo -n "Enter domain name: "
read domain_read
echo ""
cat /etc/netdisco.conf | sed "s/mycompany\.com/$domain_read/g" > /tmp/netdisco.conf.$$
mv -f /tmp/netdisco.conf.$$ /etc/netdisco.conf
#
echo -n "Enter SNMP read string: "
read snmp_read
echo ""
cat /etc/netdisco.conf | sed "s/public/$snmp_read/g" > /tmp/netdisco.conf.$$
mv -f /tmp/netdisco.conf.$$ /etc/netdisco.conf
#
echo -n "Enter SNMP write string: "
read snmp_write
echo ""
cat /etc/netdisco.conf | sed "s/private/$snmp_write/g" > /tmp/netdisco.conf.$$
mv -f /tmp/netdisco.conf.$$ /etc/netdisco.conf
#
#


# Making Apache2 - Modperl2 changes
cat /etc/httpd/conf.d/netdisco_apache.conf | sed 's/#LoadModule perl_module  libexec\/apache2\/mod_perl.so/LoadModule perl_module  \/usr\/lib\/httpd\/modules\/mod_perl.so/' > /tmp/netdisco_apache.conf.$$
mv -f /tmp/netdisco_apache.conf.$$ /etc/httpd/conf.d/netdisco_apache.conf
#
cat /etc/httpd/conf.d/netdisco_apache.conf | sed 's/#LoadModule apreq_module libexec\/apache2\/mod_apreq2.so/LoadModule apreq_module \/usr\/lib\/httpd\/modules\/mod_apreq2.so/' > /tmp/netdisco_apache.conf.$$
mv -f /tmp/netdisco_apache.conf.$$ /etc/httpd/conf.d/netdisco_apache.conf
#
cat /etc/httpd/conf.d/netdisco_apache.conf | sed 's/#PerlModule/PerlModule/' > /tmp/netdisco_apache.conf.$$
mv -f /tmp/netdisco_apache.conf.$$ /etc/httpd/conf.d/netdisco_apache.conf
#
# Stop apache errors at startup
mv -f /etc/httpd/conf.d/apreq.conf /etc/httpd/conf.d/apreq.conf.orig
mv -f /etc/httpd/conf.d/perl.conf /etc/httpd/conf.d/perl.conf.orig
#
cat /etc/httpd/conf.d/netdisco_apache_dir.conf | sed 's/Alias \/netdisco\//#Alias \/netdisco\//' > /tmp/netdisco_apache_dir.conf.$$
mv -f /tmp/netdisco_apache_dir.conf.$$ /etc/httpd/conf.d/netdisco_apache_dir.conf


echo ""
echo ""
echo "Creating Netdisco database tables........"
echo ""
echo ""
cd /usr/share/netdisco/sql 
./pg --init > /dev/null 2>&1
#
echo ""
echo ""
echo ""
echo "Finished creating Netdisco database tables........"
echo ""
echo ""
cd $curdir
sleep 3




# oui database
echo "Populating the OUI database for Netdisco........"
cd /usr/share/netdisco
/usr/bin/wget -q http://standards.ieee.org/regauth/oui/oui.txt
/usr/sbin/netdisco -O > /dev/null 2>&1
echo ""
echo ""
echo ""
echo "Finished installing OUI database........"
echo ""
echo ""
sleep 3


# crontab
echo ""
echo ""
echo "About to setup netdisco crontab........"
echo ""
echo ""
echo -n "Enter center CDP device for network discovery: "
read center_dev
cat /usr/share/netdisco/netdisco.crontab | sed "s/center_network_device/$center_dev/g" > /tmp/netdisco.crontab.$$
mv -f /tmp/netdisco.crontab.$$ /usr/share/netdisco/netdisco.crontab
crontab -u netdisco /usr/share/netdisco/netdisco.crontab
sleep 3
echo ""
echo ""
echo "Finished setting up netdisco crontab........"
echo ""
echo ""
sleep 3

# fix permissions
chown -R netdisco.netdisco /usr/share/netdisco
chcon system_u:object_r:etc_t:s0 /etc/netdisco.conf
chcon system_u:object_r:httpd_config_t:s0 /etc/httpd/conf.d/netdisco_apache.conf
chcon system_u:object_r:httpd_config_t:s0 /etc/httpd/conf.d/netdisco_apache_dir.conf
mkdir /usr/share/netdisco/mason/
chcon -R system_u:object_r:httpd_sys_content_t:s0 /usr/share/netdisco/mason/
#
touch /usr/share/netdisco/html/netmap.map /usr/share/netdisco/html/netmap.gif
chcon system_u:object_r:usr_t:s0 /usr/share/netdisco/html/netmap.map /usr/share/netdisco/html/netmap.gif
chmod 644 /usr/share/netdisco/html/netmap.map /usr/share/netdisco/html/netmap.gif
chown netdisco:netdisco /usr/share/netdisco/html/netmap.map /usr/share/netdisco/html/netmap.gif

/etc/init.d/postgresql start
/etc/init.d/httpd start

# Start postgres and httpd at system startup
/sbin/chkconfig postgresql on
/sbin/chkconfig httpd on

# create netdisco user - and start netdisco
echo ""
echo ""
echo "About to create netdisco admin user........"
echo ""
echo ""
echo ""
/usr/sbin/netdisco -u admin


# Discover, macsuck and graph process
echo ""
echo ""
echo ""
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo "Netdisco is about to discover your network, perform a macsuck on each device, and"
echo "setup your network graph."
echo ""
echo "This portion of the install process may take some time, depending on the size of your"
echo "network.  Please be patient and don't cancel out of it.  This would be a good time"
echo "to get up and take a break, get a drink or go to lunch...."
echo "!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!"
echo ""
echo ""
echo ""
sleep 10
/usr/sbin/netdisco -r $center_dev
/usr/sbin/netdisco -m
/usr/sbin/netdisco -g > /dev/null 2>&1
echo ""
echo ""
echo " Starting up Netdisco front-end........"
echo ""
echo ""
/etc/init.d/netdisco start
echo ""
echo ""
echo ""
echo "Netdisco Installation completed!!!!"
echo ""
echo ""
ipaddress=`/sbin/ifconfig eth0 | grep "inet addr:" | cut -c21-36 | cut -d' ' -f1`
echo "Login via https://$ipaddress/netdisco/"
echo ""
echo ""
echo "Enjoy!!!"


Index: .cvsignore
===================================================================
RCS file: /cvs/pkgs/rpms/netdisco/F-11/.cvsignore,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- .cvsignore	28 Jul 2009 04:42:54 -0000	1.1
+++ .cvsignore	28 Jul 2009 05:27:18 -0000	1.2
@@ -0,0 +1,2 @@
+netdisco-0.95.tar.gz
+netdisco-mibs-0.7.tar.gz


Index: sources
===================================================================
RCS file: /cvs/pkgs/rpms/netdisco/F-11/sources,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -p -r1.1 -r1.2
--- sources	28 Jul 2009 04:42:54 -0000	1.1
+++ sources	28 Jul 2009 05:27:19 -0000	1.2
@@ -0,0 +1,2 @@
+24ff61ee909fcdb47eb837967dbb67be  netdisco-0.95.tar.gz
+35b656bdb8506f0b413c4abab44523e6  netdisco-mibs-0.7.tar.gz




More information about the fedora-extras-commits mailing list