Giter Club home page Giter Club logo

nms-on-rails's Introduction

NMS on Rails

A basic Network Management System built with Ruby on Rails, React and material-ui in early stage.

Provides basic integration to:

and gives simple web interface to manage informations about your network ips and to connect to clients using ssh/rdp/http.

Getting started

Clone the repository, "bundle install" everything and configure the database (config/database.yml, for example copy from doc/database.yml) as for a common rails project.

Copy the example configuration file doc/nms-on-rails.rb to config/initializers/nms-on-rails.rb, edit it and then

bin/setup

When you connect for the first time you are asked for a network (name, description) and then for a range of ips for the new network.

To use some tasks you may need to install:

apt-get install dnsutils snmp-mibs-downloader snmp

Configuring browser for remote connections

In order to connect to clients with ssh or rdesktop you have to associate .ssh and .rdp downloads to scripts like doc/connect_rdp.rb doc/connect_ssh.rb (see your client browser file associations).

Editing

Double click on the name/description opens a window for editing.

Click on the icon opens a submenu for choosing system (linux/windows/ios/printer)

Click on the action icon open a menu.

Rake

 bundle exec rake -T nms

shows all the possible tasks.

The database can be populated with data from arpwatch and salt. Usually with cron jobs.

Arpwatch

bundle exec rake nms-on-rails:arpwatch

reads arpwatch data (directly from arpwatch files as listed in config/initializers/nms-on-rails.rb) and updates the database. Accordingly the web interface shows how many days ago the ip was seen and the last mac address.

Bind

bundle exec rake nms-on-rails:dns:update

reads domain records with axfr query (the dns server has to answer dig axfr, for example in bind your rails server should be in allow-recursion hosts).

Snmp

bundle exec rake nms-on-rails:snmp:snmpwalk

updates mac-address with port on the switch (uses snmpwalk -On -v 2c -c #{community} #{clean_ip} .1.3.6.1.2.1.1.5.0)

(On debian apt-get install libsnmp-base libsnmp-mib-compiler-perl snmp-mibs-downloader to have correct mibs)

Salt

bundle exec rake nms-on-rails:facts:load

reads salt (salt stack) data (facts in puppet language) and updates the database. Provides information about the hardware and operating system of the computers managed with salt.

Snmp for printers

bundle exec rake nms-on-rails:snmp:printers

Nmap

bundle exec rake nms-on-rails:nmap:system

uses /usr/bin/sudo /usr/bin/nmap -F --max-os-tries 1 -n -O to read operating system from the pcs. The user should have sudo privileges.

Database structure

Ips

  • ip: address (unique, for rails simplicity the key is id)
  • last_arp_id: is the association to the last arp address seen with the ip (usually discovered by arpwatch)
  • last_info_id: is the association to the last info (name, dns...). Some fields in infos table are set by user.
  • conn_proto: can be ssh/rdp/http (used to connect to the pc with a click)
  • notify: boolean you set when you whant to be notified when the pc in reachable.
  • network_inms-on-rails

Ips has one_to_many relation with the arps, infos, systems and facts tables.

id ip last_arp_id last_info_id notify network_id last_system_id
1 192.168.1.1 4238 1 0 1 40
2 192.168.1.2 2633 2 0 1 41
3 192.168.1.3 4253 3 0 1 83

Arps

The arps table collects data from arpwatch (date and ip/mac-address association). In this table you find the last time a ip/mac-address couple has been seen in network.

id ip_id mac date
1405 1 00:09:3d:14:c5:2f 2012-01-24 14:29:03
1407 1 00:13:21:6b:a9:05 2012-03-29 13:32:20
1406 1 00:13:21:6b:ad:99 2009-10-07 08:44:57

means that at 2012-01-24 the pc with mac address 00:09:3d:14:c5:2f had the ip addrees 192.168.1.1.

Infos

Are the information you give to the ip. You can update or reset when the ip is associated to other informations.

  • date
  • name: supplied by user
  • dnsname: read from a dns server
  • comment: supplied by user
  • user_id: TODO
  • dhcp: boolean (FIXME)
id ip_id date name dnsname comment dhcp
1 1 2014-04-10 07:26:29 mypc mail.mydomain.it Server mail / dns / ldap NULL
2 2 2014-04-10 07:26:29 mypc2 www.mydomain.it Server WEB NULL

Facts

Facts come from pc controlled by puppet (https://github.com/puppetlabs/puppet) and are gathered by facter (https://http://puppetlabs.com/puppet/related-projects/facter/).

Systems

OS

Ports

Information for switch/port and mac address association.

id switch_id port mac last start
706 1 15 0:0:74:90:a9:a6 2014-04-11 15:17:06 2013-12-18 08:36:47
707 1 10 0:c:76:e:f9:28 2014-04-10 15:17:07 2013-12-18 08:36:47

keeps the first and the last time the mac address 0:0:74:90:a9:a6 was on seen on port 15 of the first switch.

=======

Licence

NMS on Rails is released under the MIT License.

nms-on-rails's People

Contributors

donapieppo avatar

Stargazers

 avatar Ole J. Rosendahl avatar Khairi Adnan avatar Erol Guzoğlu avatar Michael Fairchild avatar

Watchers

edlai avatar  avatar James Cloos avatar  avatar

nms-on-rails's Issues

Licence Details Missing

Hi Donapieppo,

Could you please provide the LICENCE details to use your application?
Is it BSD/MIT/something else?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.