UbuntuHelp:NediHowTo
来自Ubuntu中文
点击翻译: |
English |
请不要直接编辑翻译本页,本页将定期与来源同步。 |
目录
- 1 0. Enable the extra software repositories:
- 2 1. Install dependencies:
- 3 2. Setup SSL on the Apache2 webserver:
- 4 3. Download Nedi:
- 5 4. Uncompress and extract the archive:
- 6 5. Move Nedi directory to /opt and fix permissions:
- 7 6. Create a link to the webserver root:
- 8 7. Create a link to the configuration file:
- 9 8. Create a MySQL database password:
- 10 9. Initialize the Nedi database:
- 11 10. Answer these prompts:
- 12 11. Edit /opt/nedi/nedi.conf:
- 13 12. Optional - Edit /opt/nedi/seedlist and add your network devices:
- 14 13. Restart the webserver (Apache2):
- 15 14. Run a discovery of your network and gather your device configurations
- 16 15. Login to your Nedi website:
- 17 16. Create a script to start/stop Nedi:
- 18 17. Paste this text into that file:
- 19 18. Make “startnedi.sh” an executable file, and create a directory to hold Nedi log files:
- 20 19. Schedule Nedi to run periodically (every 4 hours) using cron:
0. Enable the extra software repositories:
- Go to: System > Administration > Software Properties
- Click on all the empty checkboxes to enable the additional software repositories
1. Install dependencies:
sudo apt-get install apache2 libapache2-mod-php5 mysql-server libnet-snmp-perl php5-mysql libnet-telnet-cisco-perl php5-snmp php5-gd libalgorithm-diff-perl rrdtool
Note: The command listed above needs to be on one line
2. Setup SSL on the Apache2 webserver:
IMPORTANT – You should always use SSL because Nedi contains a great amount of information about your network. Here is a great step-by-step tutorial on How|to setup SSL in Ubuntu
3. Download Nedi:
wget http://nedi.ch/lib/exe/fetch.php?id=files%3Adownload&cache=cache&media=files:nedi-1.0-rc6.tgz
4. Uncompress and extract the archive:
tar -xzf nedi-1.0-rc6.tgz
5. Move Nedi directory to /opt and fix permissions:
sudo mv nedi /opt/ sudo chgrp www-data /opt/nedi/html/log/ sudo chmod 775 /opt/nedi/html/log/
6. Create a link to the webserver root:
sudo ln -s /opt/nedi/html/ /var/www/
7. Create a link to the configuration file:
sudo ln -s /opt/nedi/nedi.conf /etc/nedi.conf
8. Create a MySQL database password:
sudo mysqladmin -u root password "YourPasswordGoesHere"
9. Initialize the Nedi database:
cd /opt/nedi/ ./nedi.pl -i
10. Answer these prompts:
- MySQL admin user: root
- MySQL admin pass: <enter the password you created in step #8>
11. Edit /opt/nedi/nedi.conf:
- List your SNMP read-only passwords (one per line)
- List your telnet usernames and passwords (one pair per line)
12. Optional - Edit /opt/nedi/seedlist and add your network devices:
List the IP addresses of your devices (one per line)
13. Restart the webserver (Apache2):
sudo /etc/init.d/apache2 restart
14. Run a discovery of your network and gather your device configurations
cd /opt/nedi/ ./nedi.pl -cob
15. Login to your Nedi website:
http://localhost/html/ User: admin Password: admin IMPORTANT - Change the admin password NOW!
16. Create a script to start/stop Nedi:
nano /opt/nedi/startnedi.sh
17. Paste this text into that file:
#!/bin/sh #start nedi from crontab. Creates logfiles opts="-cob" CMD="./nedi.pl $opts" LOGPATH="/var/log/nedi" LOGFILE="$LOGPATH/nedi.log" LASTRUN="$LOGPATH/lastrun.log" cd /opt/nedi now=`date +%Y%m%d:%H%M` echo "#$now start # $CMD" > $LASTRUN echo "#$now start" >> $LOGFILE $($CMD >> $LASTRUN) tail -8 $LASTRUN >> $LOGFILE now=`date +%Y%m%d:%H%M` echo "#$now stop" >> $LOGFILE echo "#$now stop" >> $LASTRUN'
Press “Control-O” and then “Enter” to save these changes.
18. Make “startnedi.sh” an executable file, and create a directory to hold Nedi log files:
chmod +x /opt/nedi/startnedi.sh sudo mkdir /var/log/nedi me=`whoami`;sudo chown $me:$me /var/log/nedi
19. Schedule Nedi to run periodically (every 4 hours) using cron:
crontab -e 15 0,4,8,12,16,20 * * * /opt/nedi/startnedi.sh # Discover and gather device configurations
Press “Control-O” and then “Enter” to save these changes.