Covex
Dalsi
Seznam
Predchozi
Autor: #Feed# (on behalf of Covex) on 'Covex'
Cas: Pa 04.06.2010 17:24.00
Titulek: How to install and run NeDi on Fedora

                                                                                 
Feed:      lowlevel
Post-URL:  http://www.lowlevel.cz/log/pivot/entry.php?id=176
 
 
NeDi is a fairly good tool for monitoring large networks. It has only one
"disadvantage" - it is mainly aimed at networks based on Cisco, HP Procuve,
Juniper and many other professional grade switches and routers.
 
It is not packaged for Fedora and may cause some troubles to install and
run. I tried also other monitoring systems like Nagios (mainly for server
monitoring) and Zabbix. Zabbix is maybe more complex, but I was not able to
get insight into it quickly. Nagios has plugins which is fine, but has too
complex configuration, and its SNMP support is rather poor. Therefore I
decided to try NeDi even thou I am going to use it for a network based on
small linux routers.
 
NeDis' history is probably quite wild as you can find many site over the
net with NeDi sources while beeing marked as Obsolete. At the moment the
prime site is [http://www.nedi.ch/][1] which is based on dokuwiki and is
quite OK, but almost lacks any usefull documentation and also it is often
outdated. You can collect various pieces of info around the net, but it is
quite difficult. You can also hardly find a link to [nedi forums][2] there.
 
   [1]: http://www.nedi.ch/
 
   [2]: http://forum.nedi.ch/
 
Therefore I'd like to note here my way of making it work.
 
NeDi consist of several parts
 
  1. Perl based NetworkDiscovery script, Monitoring script, Syslog
collection script, Trapd script to catch SNMP traps.
 
  2. PHP based web interface
 
  3. MySQL database structures
 
This link was very usefull http://notes.ozmonet.com/NeDi
 
However I am using SELinux, and I need to be more carefull when installing
NeDi.
 
 
 
    # Install all packages (separated for accounting purposes)
 
    yum -y install httpd php php-mysql mysql-server php-snmp php-gd
 
    yum -y install perl-Net-Telnet-Cisco perl-Algorithm-Diff \
 
    perl-Net-Telnet perl-Net-SNMP net-snmp rrdtool
 
 
    # Restart up services
 
    service httpd restart
 
    service mysqld restart
 
 
    # Download and install NeDi
 
    wget http://www.nedi.ch/_media/files:nedi-1.0.5.tgz
 
    tar -xzvf nedi-1.0.5.tgz
 
    mv nedi /usr/local/nedi
 
    useradd -l nedi -g apache -s /bin/bash -d /usr/local/nedi/
 
    mkdir /usr/local/nedi/log
 
    mv /usr/local/nedi/html /var/www/html/nedi
 
    mv /usr/local/nedi/nedi.conf /var/www/html/nedi/
 
    ln -s /var/www/html/nedi/nedi.conf /usr/local/nedi/nedi.conf
 
    ln -s /var/www/html/nedi /usr/local/nedi/html
 
    chown nedi:apache -R /usr/local/nedi
 
    chgrp nedi:apache -R /var/www/html/nedi
 
 
    # Edit nedi.conf with your settings
 
    vi nedi.conf
 
    # set at least mailfrom, smtpserver,nedipath,rrdstep
 
 
    vi /var/www/html/nedi/inc/libmisc.php
 
    # Right at the begining change the path
 
    # php searches for nedi.conf, change it to look like this
 
    #  if (file_exists('/var/www/html/nedi/nedi.conf')) {
 
    #    $conf = file('/var/www/html/nedi/nedi.conf');
 
 
    #Now you need to setup MySQL
 
    #(NeDi compared to zabbix has a quick script for it!)
 
    #setup mysql root account
 
    /usr/bin/mysqladmin -u root -h hostname password 'Yourpassword'
 
    cd /usr/local/nedi/
 
    ./nedi.pl -i
 
 
    # Set NeDi to run every half-hour
 
    su nedi -
 
    crontab -e
 
 
    0 0 * * * /usr/local/nedi/nedi.pl -b > /usr/local/nedi/log/nedi-
backup.lastrun 2>&1
 
    30 0 * * * /usr/local/nedi/nedi.pl > /usr/local/nedi/log/nedi.lastrun
2>&1
 
    */30 1-23 * * * /usr/local/nedi/nedi.pl >
/usr/local/nedi/log/nedi.lastrun 2>&1
 
 
    #Head your browser to http://hostname/nedi/
 
    #Login with Admin/Admin
 
 
Now you may or may not have NeDi running (depends on wherether I forgot
some setup steps as I am writing them down after I made it thru all the
stuff till the end).
 
One more sympatic thing on NeDi is it has a console output. You can run
./nedi.pl -h to view the options, then you can start nedi to seed and
discover your network.
 
If your network is not having CDP (cisco discovery protocol) or LLDP (some
other discovery), you'll have almost nothing in the lists, except you
gateway. To make NeDi usefull in your network of linux routers you need
setup at least two things
 
seedlist - populate it with all the router IPs you have
 
All your linux routers will be identified as IOLAN, it is probably some
kind of fallback device. You can find its definition under
 
sysobj/1.3.6.1.4.1.8072.3.2.10.def
 
I made same small modifications to it to at least give some info for Linux
routers:
 
 
 
    Serial  .1.3.6.1.2.1.25.3.2.1.3.768
 
    Bimage  .1.3.6.1.2.1.25.1.4.0
 
    CPUutl  .1.3.6.1.4.1.2021.11.9.0
 
    MemCPU  .1.3.6.1.4.1.2021.4.11.0
 
 
Again this may or may not be suitable for your network. If you would like
to know what those values are use
 
 
 
    snmptranslate  .1.3.6.1.2.1.25.3.2.1.3.768
 
    snmpwalk -v 1 -c public router_hosname .1.3.6.1.2.1.25.3.2.1.3.768
 
 
To see a comlete list of your linux based snmp output you can walk a
complete list
 
 
 
    snmpwalk -v 1 -c public router
 
    snmpwalk -v 2c -c public router
 
    snmpwalk -v 2c -c public router enterprise
 
 
    # To find a numbered representation for interesting value
 
    snmptranslate -Td HOST-RESOURCES-MIB::hrDeviceDescr.768
 
 
While NeDi is very helpfull to find and display vairous stuff about your
network, there is still a space for you to add some value. Mainly under
Topology Links and Map. While adding links is mostly clear to me, I did not
discovered yet the magic of creating map.
 
To get at least basic location info and capability to send email with
warnings you have to setup /etc/snmp/snmpd.local.conf with two values:
 
 
 
    syslocation RouterLocation
 
    syscontact Admins
 
 
NeDi is capable of visualizing your network automatically. In order to do
that, NeDi needs a certain format in the SNMP location string (separator
can be set in nedi.conf with locsep):
 
Region;City;Building;Floor;[Room;][Place within room;][Whatever additional
info you want]
 
Do not forget to restart your snmpd for changes to take effect.
 
Also check this link about [NeDi installation on MAC][3]. It is for older
version and for MAC, but you can find there pictures and some useful info.
 
   [3]: http://homepage.mac.com/duling/halfdozen/NeDi-Howto.html
 
Some NeDi terminlogy:
 
 
 
    Device: Router, Switch
 
    Node: End user stations
 
    Modules: Modular parts in Devices
 
    Interfaces: Well ... interfaces
 
    Vlans: VLANs identified by name for a specific device family (base on
def file, hardly usable for linux)
 
    Wlans: Cisco etc. specific wireless interfaces
 
    Incidents: SNMP trap events (need addition specific SNMP configuration)
 
URL: http://www.lowlevel.cz/log/pivot/entry.php?id=176

Dalsi Seznam Predchozi


[ Domu | Prstik | O Piskovisti | Deticky | Nastenky | Koutky ]