# $Id: Portfile,v 1.1 2005/09/18 23:28:22 markd Exp $ PortSystem 1.0 name nedi version 1.0.v categories net maintainers markd@opendarwin.org platforms darwin description Network Discovery Suite long_description A low noise network discovery, management, and inventory \ system for Cisco networks with a user friendly web interface. homepage http://nedi.web.psi.ch/ master_sites http://nedi.web.psi.ch/ distname ${name}-${version} extract.suffix .tgz checksums md5 4759ab5f93008f583a42e8354fafcb2d depends_lib port:perl5.8 \ port:p5-net-snmp \ port:p5-net-telnet \ port:p5-net-telnet-cisco \ port:p5-algorithm-diff \ port:p5-dbi \ port:p5-dbd-mysql worksrcdir ${name}-${version} use_configure no build {} extract {} patch {} destroot { xinstall -d ${worksrcpath} xinstall -d ${destroot}${prefix}/var system "cd ${destroot}${prefix}/var && gzip -dc ${distpath}/${distname}.tgz | \ /usr/bin/gnutar --no-same-owner -xf -" # Keep nedi.conf from prying eyes because it has passwords! system "chmod 600 ${destroot}${prefix}/var/${name}/nedi.conf" } post-destroot { # Fix paths eval reinplace "s|/usr/bin/perl|/opt/local/bin/perl|g" \ [glob ${destroot}${prefix}/var/${name}/*.pl] \ [glob ${destroot}${prefix}/var/${name}/inc/*.pl] \ [glob ${destroot}${prefix}/var/${name}/html/inc/*.pl] reinplace "s|netstat|/usr/sbin/netstat|g" \ ${destroot}${prefix}/var/${name}/inc/libmisc.pl # Keep these empty directories destroot.keepdirs \ ${destroot}${prefix}/var/${name}/db/cfg \ ${destroot}${prefix}/var/${name}/html/log } post-activate { ui_msg "\n#### To complete the NeDi OS X installation #### 1) Download Applications ------------------------------------------------ -Download Complete Apache 2, Complete PHP, and Complete MySQL http://www.serverlogistics.com/downloads.php Notes about Apache, PHP, and MySQL ---------------------------------- NeDi requires PHP with SNMP support enabled, which is a non-default option and extremely challenging to compile into PHP. Complete PHP is the only PHP binary installer that has it -Complete PHP requires Complete Apache 2. NeDi requires the MySQL 4.0.x series -the easiest way to install that is with Complete MySQL. All this entails using packages from Server Logistics for Apache, PHP, and MySQL in combination to run NeDi. 2) Create an OS X nedi user (or choose an existing one) using the Accounts pane in System Preferences 3) Install Complete Apache 2 (version 2.0.52) ------------------------------------------------ -Turn off Personal Web Sharing -Run Apache2.pkg installer -Drag Apache2.prefPane to /Library/PreferencePanes Create this folder if it does not exist -Edit httpd.conf: pico /Library/Apache2/conf/httpd.conf User Group -Start Apache 2 via System Preferences pane 4) Install Complete PHP 4 (version 4.3.9) ------------------------------------------------ -Run PHP4.pkg installer -Drag test.php to /Library/Apache2/htdocs -Start Apache via the Apache 2 System Preferences pane -Test PHP with this link: http://localhost/test.php 5) Install Complete MySQL (version 4.0.21) ------------------------------------------------ -Run MySQL.pkg installer -Drag MySQL.prefPane to /Library/PreferencePanes -Add /Library/MySQL/bin to the *front* of your path statement in ~/.bash_profile -Use the MySQL Pane in System Preferences to initialize, set a root password, & start MySQL NOTE: A copy of MySQL 4.1.x is installed automatically during the NeDi DarwinPorts install (below) because NeDi requires a MySQL Perl module, the installation of which triggers a DarwinPorts MySQL install. That version won't run if we just ignore it, and we'll do that because NeDi does not work with MySQL 4.1.x. 6) Configure, and Login to NeDi ----------------------------------------------- -Set NeDi owner: sudo chown -R : ${prefix}/var/${name}/ -Apache symlink: ln -s ${prefix}/var/${name}/html/ /Library/Apache2/htdocs/nedi -MySQL symlink: ln -s /tmp/mysql.sock /opt/local/var/run/mysqld/mysqld.sock -Edit nedi.conf Backend/Authen. vars: sudo pico ${prefix}/var/${name}/nedi.conf Leave nedi.conf permissions at 600 to protect your network passwords! backend MSQ dbpass authuser mysql -Initialize the NeDi database: ${prefix}/var/${name}/nedi.pl -i Enter 'root' and the MySQL root password when prompted -Login to the NeDi web interface: http://localhost/nedi/index.php Initial user/pass is 'admin'/'admin' 7) Discover Your Network with NeDi ----------------------------------------------- -Edit the seedlist file: pico ${prefix}/var/${name}/seedlist -Edit nedi.conf Device Acc. variables: sudo pico ${prefix}/var/${name}/nedi.conf comm -Make any other desired changes in nedi.conf -Start NeDi data collect.: sudo -u ${prefix}/var/${name}/nedi.pl -c Use -d for debug output until you know NeDi is running properly. -Put a command in the crontab to discover your network at regular intervals. For example, to run NeDi every day at 11:00 and 3:00: 1 11,15 * * * cd ${prefix}/var/${name} ; ./nedi.pl -c >> /dev/null 2>&1 \n" }