A basic Network Management System built with Ruby on Rails, React and material-ui in early stage.
Provides basic integration to:
- arpwatch (http://ee.lbl.gov/)
- salt (https://github.com/saltstack/salt)
- wakeonlan
- bind (reads domain with dig domani.net axfr)
- snmp
and gives simple web interface to manage informations about your network ips and to connect to clients using ssh/rdp/http.
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
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).
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.
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.
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.
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).
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)
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.
bundle exec rake nms-on-rails:snmp:printers
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.
- 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 |
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.
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 come from pc controlled by puppet (https://github.com/puppetlabs/puppet) and are gathered by facter (https://http://puppetlabs.com/puppet/related-projects/facter/).
OS
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.
=======
NMS on Rails is released under the MIT License.