NAME

Master Slave

DESCRIPTION

Master Slave is a method of operating multiple NMIS servers in a master slave arrangment so as to spread the collection load over a 1 or more slave server, and then summarise all the network statistics into one global view, on the master server.

For instance, you could run 1 or more NMIS servers in a datacentre, and spread polled devices by group across them to ease the collection load on each server. One master server can then be used to collect stats from each slave server and display a summary network health status and events view. Also it is possible to generate summary statisical reports over the whole network.

Another approach is to geographically split NMIS servers around the world to collect and display device stats on a regional basis and then display a summary network view in one location for management overview.

Note that the master slave implementation does not copy complete rrd between servers, and should not be seen as a redundant server architecture. The only stats that are copied up are those required to support a global health and events display (i.e.) the files and statistics required to populate the NMIS front page and the 'all device' dashboard view ( 'large dash' ). The amount of information transferred is not large and is done by use of http(s) on initiation from the master.

The master slave displays the top dashboard view and the device summary view, as normally seen at the 'large dash' view. All other views, reports, menubar items such as syslog etc, are http redirected to the slave server.

Any additional stats obtained by drilldown into device views or graphs are obtained by http request from the slave server.

Howto:

Each master and slave server should be installed first as a standalone server, polling its own groups of devices and completely functional in all respects. Group names need not be unique - in fact my global implementation I use the same group names across all server, so a concatenated group view with summary health statistics is available on the master.

The master may also poll its own set of configured devices, I usually configure the master to collect the slave servers from the master, so any issues with the slave servers are reported by the master. At least one device is required to be collected locally on the master, to avoid errors with empty node files.

Multiple nested configurations are possible, and two or more masters could be set-up if required. Also it is possible that a master is the slave of the another, however I cannot vouch for system integrity in a nested envrionment.

Files required at the slave

	cgi-bin/connect.pl

	conf/nmis.conf
		Slave_community=secret
	

Files required at the master

	conf/slaves.csv
		# THE FIRST LINE NON COMMENT IS THE HEADER LINE AND REQUIRED
		# I could derive these from nmis.conf - maybe later...
		# Name is unique id of slave NMIS server
		# Host is IP address of slave NMIS server
		# Port is http port number of the slave
		# Conf is filename of NMIS configuration file at slave
		# Community string must be equal to parameter Slave_community at slave
		# Secure true|false use of SSL (require IO::Socket::SSL from CPAN)
		#
		Name	Host	Port	Conf	Community	Secure
		nmis1	192.168.1.1	80	nmis.conf	secret	false

	conf/nmis.conf
		master_dash=true|false
		master_report=true|false
		Slaves_Table=<nmis_conf>/slaves.csv
		Slaves_Title=Slave Poll Table
		Slaves_Key=Name
		

Operation

To enable master/slave communications you must edit conf/nmis.conf and conf/slaves.cvs on the master and set the community string at the slave for security.

The master nmis.pl is run every 5 minute and makes a connection by http(s) with every slave through the script connect.pl at the slave. The master is requesting the local node table of the slave and some other relevant information. Also the files var/summary8.nmis and var/summary16.nmis are copied to the master. These files are necessary for speeding up the display of large dashboard ( these are a file cache of the last 5min reachability stats) . Only the master initiate the connection with a slave.

If you set master_report=true then the master will poll the slaves realtime for generation reports. This may take some time.

connect.pl program

The master requests the program connect.pl at the slave to send the necessary information. This request is based on URL syntax. By use of this syntax it is possible to use a web browser (for debug) for request info of the slave. For example to request the systemTable of node node1: http://nmis_server/cgi-nmis/collect.pl?file=nmis.conf&type=send&func=loadsystemfile&node=node1&com=secret connect.pl send the systemTable as a hash in printable format.

Another use of connect.pl is to run bin/nmis.pl at the slave. This can be done with the next URL: http://nmis_server/cgi-nmis/collect.pl?file=nmis.conf&type=collect&debug=true&node=node1&com=secret

I would recommend that you secure this access by using the Apache server features to only allow access from the master to the slave collect.pl

Use of SSL

For use of https (SSL) you must install IO::Socket::SSL from CPAN at the master only. This include also an upgrade of OpenSSL (www.openssl.org) and Net::SSLeay. It is possible to use SSL without configuring the Apache server at the slave.

Debug info

Running bin/nmis.pl type=collect debug=true the next debug info will be typed, depending on your configuration.

	19:21:31 NMIS version 4.2.2
	19:21:32 Kernel name is linux
	19:21:32 loadSlave: loaded /usr/local/nmis/conf/slaves.csv
	...
	19:23:10 nmisSummary: Calculating NMIS network stats for cgi cache
	19:23:10 writeHashtoVar: write data to /usr/local/nmis/var/summary8.nmis
	19:23:10 writeHashtoVar: write data to /usr/local/nmis/var/summary16.nmis
	19:23:10 nmisSummary: Finished calculating NMIS network stats for cgi cache - wrote 8 nodes
	19:23:10 httpMaster: Started
	19:23:10 slaveConnect: GET /cgi-nmis/connect.pl?file=nmis.conf&com=secret&type=send&func=sumnodeTable
	19:23:10 slaveConnect: call to nmis1 (192.168.1.1:80)
	19:23:13 httpMaster: node table from nmis1 contains 3 keys
	19:23:13 slaveConnect: GET /cgi-nmis/connect.pl?file=nmis.conf&com=secret&type=send&func=summary8
	19:23:13 slaveConnect: call to nmis1 (192.168.1.1:80)
	19:23:15 httpMaster: summary8 from nmis1 contains 3 keys
	19:23:15 slaveConnect: GET /cgi-nmis/connect.pl?file=nmis.conf&com=secret&type=send&func=summary16
	19:23:15 slaveConnect: call to nmis1 (192.168.1.1:80)
	19:23:18 httpMaster: summary16 from nmis1 contains 3 keys
	19:23:18 writeHashtoVar: write data to /usr/local/nmis/var/nmis1-nodes.nmis
	19:23:18 writeHashtoVar: write data to /usr/local/nmis/var/nmis1-summary8.nmis
	19:23:18 writeHashtoVar: write data to /usr/local/nmis/var/nmis1-summary16.nmis
	19:23:18 httpMaster: Finished
	...

Thats all. Have fun :-).