Difference between revisions of "NeDI: Instalasi di Ubuntu"

From OnnoWiki
Jump to navigation Jump to search
(New page: You can get it running on Debian/Ubuntu within 5 minutes (more details in Generic Installation Procedure): sudo apt-get install apache2 libapache2-mod-php5 mysql-server libnet-snmp-perl ...)
 
 
(5 intermediate revisions by the same user not shown)
Line 1: Line 1:
You can get it running on Debian/Ubuntu within 5 minutes (more details in Generic Installation Procedure):
+
==Install dependency==
  
  sudo apt-get install apache2 libapache2-mod-php5 mysql-server libnet-snmp-perl libcrypt-hcesha-perl \
+
  sudo apt-get install apache2 libapache2-mod-php5 mysql-server libnet-snmp-perl php5-mysql \
  libcrypt-des-perl libdigest-hmac-perl libio-pty-perl libnet-telnet-perl libalgorithm-diff-perl \
+
  libnet-telnet-cisco-perl php5-snmp php5-gd libalgorithm-diff-perl rrdtool librrds-perl
librrds-perl php5-mysql php5-snmp php5-gd php5-mcrypt rrdtool libsocket6-perl
 
  
Optional (read below for details): libweb-simple-perl libnet-ntp-perl libnet-dns-perl
 
  
Then perform the following steps:
+
==Setup SSL di Apache2 webserver==
  
    create a /nedi folder somewhere (preferable in /var) and extract the tarball. Change permission to www-data
+
PENTING _ Sebaiknya anda menggunakan SSL karena NeDi membawa banyak informasi tentang jaringan anda.
    In /etc edit apache2/sites-enabled/000-default.conf and adjust document root to /var/nedi/html
 
    edit apache2/apache2.conf and change /var/www to /var/nedi/html as well
 
    Optionally adjust php5/apache2/php.ini to increase max upload and post size
 
    run nedi -i and you should be able to login with admin/admin
 
    For security reasons, you should at least limit access to SSL and prohibit showing directory indexes…
 
  
  
Generic Installation Procedure
+
==Download NeDi==
  
    Satisfy the dependencies listed below.
+
wget http://www.nedi.ch/pub/nedi-1.0.8.tgz
    Extract the NeDi archive (e.g. to /var/nedi). Move the files in html to your webserver’s document root (e.g. /var/www/htdocs) or adjust the document root.
 
    Edit nedi.conf to fit your needs (Please use the new one as copying your existing config may lead to errors, if new items are missing). If you get ‘Dude, where is nedi.conf?’ link it to /etc.
 
    Cd to /var/nedi (or whatever you chose) and type ./nedi.pl -i to initialize the backend. Starting with NeDi 1.4, you can use -i nodrop for updating an existing DB structure without the need for DB admin credentials. Alternatively -i updatedb will do just that without any loss of data.
 
    The monitoring daemon moni.pl can be started from commandline, startup script or the GUI.
 
    Since syslog.pl requires a priviledged port (514) a simple workaround (to avoid running it as root) would be to forward a high port via system’s FW. This means something like this for Linux: iptables -A PREROUTING -t nat -p udp –dport 514 -j REDIRECT –to-port 1514. Just set $port in syslog.pl to 1514 (or whatever you chose the port to be). Now you can even restart it from the GUI with System-Services.
 
    A similar setup can be implemented for snmptrapd: iptables -A PREROUTING -t nat -p udp –dport 162 -j REDIRECT –to-port 1162.
 
  
 +
==Uncompress dan extract==
  
 +
tar -xzf nedi-1.0-rc6.tgz
  
 +
==Move Nedi ke directory /opt dan perbaiki permissions==
  
Hardware Requirements
+
sudo mv nedi /opt/
 +
sudo chown -R www-data:www-data /opt/nedi
 +
sudo chmod 775 /opt/nedi/html/log/
  
The computer requirements depend on the size of your network (surprised?). A single 2GHz core and 1GB Ram will do fine for networks with 500 devices and 10’000 nodes. You may consider increasing this for larger networks…
+
==Buat link ke webserver root==
  
The NeDi script itself uses up to 150MB of RAM on a discovery run. If you want to include Tobi’s RRDtool, you’ll need ~200KB disk storage per interface (can be adjusted with rrdsize in nedi.conf).
+
sudo ln -s /opt/nedi/html/ /var/www/
  
 +
==Buat link ke file konfigurasi==
  
Software Requirements
+
sudo ln -s /opt/nedi/nedi.conf /etc/nedi.conf
  
The discovery part is programmed in Perl and needs those additional modules:
+
==Buat MySQL database password==
  
    Net::SNMP
+
sudo mysqladmin -u root -p password "YourPasswordGoesHere"
    Net::Telnet
 
    Algorithm::Diff
 
    DBI
 
    DBD::MySQL
 
    RRDs
 
    Socket6
 
    LWP::UserAgent (optional HTTP service monitoring and getting info from Cisco phones)
 
    Net::DNS::Resolver (optional DNS service monitoring)
 
    Net::NTP (optional NTP service monitoring, e.g monitor actual stratum)
 
    IO::Tty (optional SSH support)
 
    libnet (provides Net::SMTP for alerts)
 
  
The frontend requires a webserver providing PHP with the following addons:
+
==Inisialisasi database NeDi==
  
    SQL
+
cd /opt/nedi/
    SNMP
+
./nedi.pl -i
    SESSION
 
    GD (for Topology-Map)
 
    MCRYPT for SHA256 password encryption
 
  
 +
==Jawab prompts berikut==
  
 +
MySQL admin user: root
 +
MySQL admin pass: <masukan password di step #8>
  
 +
==Edit /opt/nedi/nedi.conf==
  
 +
List your SNMP read-only passwords (one per line)
 +
List your telnet usernames and passwords (one pair per line)
  
 +
==Optional - Edit /opt/nedi/seedlist dan tambahkan network device anda==
  
 +
List the IP addresses of your devices (one per line)
 +
 +
==Restart webserver (Apache2)==
 +
 +
sudo /etc/init.d/apache2 restart
 +
 +
==Run discovery dari network anda dan kumpulkan konfigurasi device==
 +
 +
cd /opt/nedi/
 +
./nedi.pl -pob
 +
 +
==Login ke NeDi website==
 +
 +
http://localhost/html/
 +
User: admin
 +
Password: admin
 +
PENTING - ubah admin password SEKARANG JUGA!
 +
 +
==Buat script untuk start/stop Nedi:
 +
 +
nano /opt/nedi/startnedi.sh
 +
 +
Masukan
 +
 +
#start nedi from crontab. Creates logfiles
 +
opts="-pob"
 +
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'
 +
 +
Tekan “Control-O” dan “Enter” simpan perubahan
 +
 +
==Buat “startnedi.sh” dan directory Nedi log==
 +
 +
chmod +x /opt/nedi/startnedi.sh
 +
sudo mkdir /var/log/nedi
 +
me=`whoami`;sudo chown $me:$me /var/log/nedi
 +
 +
==Jadwalkan Nedi untuk jalan secara periodik (setiap 4 jam) menggunakan cron:==
 +
 +
crontab -e
 +
15 */4 * * * /opt/nedi/startnedi.sh  # Discover and gather device configurations
 +
 +
Tekan “Control-O” dan “Enter” untuk menyimpan.
 +
 +
-atau-
 +
 +
Buat sebuah file di /etc/cron.d/ berisi informasi berikut:
 +
 +
15 */4 * * *    root  /opt/nedi/startnedi.sh  # Discover and gather device configurations
 +
 +
Kedua cara ini akan menyebabkan script di jalankan setiap 4 hour pada menit ke :15 mulai jam 4:00 pagi.
  
 
==Referensi==
 
==Referensi==
  
 
* http://www.nedi.ch/installation/
 
* http://www.nedi.ch/installation/
 +
* https://help.ubuntu.com/community/NediHowTo

Latest revision as of 07:03, 27 July 2015

Install dependency

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 librrds-perl


Setup SSL di Apache2 webserver

PENTING _ Sebaiknya anda menggunakan SSL karena NeDi membawa banyak informasi tentang jaringan anda.


Download NeDi

wget http://www.nedi.ch/pub/nedi-1.0.8.tgz

Uncompress dan extract

tar -xzf nedi-1.0-rc6.tgz

Move Nedi ke directory /opt dan perbaiki permissions

sudo mv nedi /opt/
sudo chown -R www-data:www-data /opt/nedi
sudo chmod 775 /opt/nedi/html/log/

Buat link ke webserver root

sudo ln -s /opt/nedi/html/ /var/www/

Buat link ke file konfigurasi

sudo ln -s /opt/nedi/nedi.conf /etc/nedi.conf

Buat MySQL database password

sudo mysqladmin -u root -p password "YourPasswordGoesHere"

Inisialisasi database NeDi

cd /opt/nedi/
./nedi.pl -i

Jawab prompts berikut

MySQL admin user: root
MySQL admin pass: <masukan password di step #8> 

Edit /opt/nedi/nedi.conf

List your SNMP read-only passwords (one per line)
List your telnet usernames and passwords (one pair per line) 

Optional - Edit /opt/nedi/seedlist dan tambahkan network device anda

List the IP addresses of your devices (one per line)

Restart webserver (Apache2)

sudo /etc/init.d/apache2 restart

Run discovery dari network anda dan kumpulkan konfigurasi device

cd /opt/nedi/
./nedi.pl -pob

Login ke NeDi website

http://localhost/html/
User: admin
Password: admin
PENTING - ubah admin password SEKARANG JUGA!

==Buat script untuk start/stop Nedi:

nano /opt/nedi/startnedi.sh

Masukan

#start nedi from crontab. Creates logfiles
opts="-pob"
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'

Tekan “Control-O” dan “Enter” simpan perubahan

Buat “startnedi.sh” dan directory Nedi log

chmod +x /opt/nedi/startnedi.sh
sudo mkdir /var/log/nedi
me=`whoami`;sudo chown $me:$me /var/log/nedi

Jadwalkan Nedi untuk jalan secara periodik (setiap 4 jam) menggunakan cron:

crontab -e
15 */4 * * * /opt/nedi/startnedi.sh  # Discover and gather device configurations

Tekan “Control-O” dan “Enter” untuk menyimpan.

-atau-

Buat sebuah file di /etc/cron.d/ berisi informasi berikut:

15 */4 * * *    root   /opt/nedi/startnedi.sh  # Discover and gather device configurations

Kedua cara ini akan menyebabkan script di jalankan setiap 4 hour pada menit ke :15 mulai jam 4:00 pagi.

Referensi