################################################################
A- RBS/RNC Healthcheck (Before Upgrade)
################################################################

Purpose: checks for a number of prerequisites (eg: faults, hw compatibility, cell availability, etc.) in a number of nodes, eg, prior to doing a system upgrade.

----------------------------------------------------------------
1- Make sure the ipdatabase is up to date.
----------------------------------------------------------------
The ipdatabase is located in the file moshell/sitefiles/ipdatabase.
It contains ipaddress and password for all nodes.
Example can be found in moshell/examples/ipdatabase/ipdatabase_password


----------------------------------------------------------------
2- Take moshell dumps from all nodes
----------------------------------------------------------------
Prepare a sitefile containing all names (as per the first field of ipdatabase) of the nodes to be "dumped".
Note: Instead of the node names, it is also possible to directly specify DNS hostnames or ipaddresses of the nodes.
Example of a sitefile can be found in moshell/examples/sitefiles/east1

The moshell dumps shall be taken with mobatch.pl.
Mobatch.pl can be run using two options: 
	-p specifies the maximum number of processes to run in parallell (to avoid too high load on the workstation).
	-t specifies the timeout before a process will be killed (to avoid hanging processes).
Default values are 5 for -p and 5 for -t. Type "mobatch.pl" for more info. A timeout of 0 means no timeout.	
The command file to be used for the healthcheck of the RBSs is located in moshell/examples/mobatch_cmdfiles/netcheck_rbs.mos
The command file to be used for the healthcheck of the RNCs is located in moshell/examples/mobatch_cmdfiles/netcheck_rnc.mos
Once all is ready, run mobatch.pl using command: 
	mobatch.pl <sitefile> <cmdfile>
Example: mobatch.pl -p 10 moshell/sitefiles/RbsCluster1 moshell/cmdfiles/netcheck_rbs.mos
         mobatch    -t 0  moshell/sitefiles/Rnc_all     moshell/cmdfiles/netcheck_rnc.mos
The logfiles will end up in a directory under moshell/logfiles/logs_mobatch/date/sitefile/time/

----------------------------------------------------------------
3- Prepare the reference file.
----------------------------------------------------------------
The reference file is used by netcheck to compare against the moshell dumps.
It specifies things such as allowed HW, required Disk Space, allowed Alarms, etc.
An example of a reference file can be found under moshell/examples/netcheck_files/RefList_rbs.txt
There is a detailed explanation within the example file on how to edit this file.
Two reference files should be prepared, one for the RNCs and one for the RBSs.

----------------------------------------------------------------
4- Run netcheck
----------------------------------------------------------------
For healtcheck, the netcheck syntax is:
   netcheck <Reference-File> <Directory-containing-the-moshell-dumps>
The same netcheck script is used for both RNC and RBS but different Reference Files shall be used.
Example: 
	netcheck moshell/compfiles/RefList_rbs.txt moshell/logfiles/logs_mobatch/2003-10-12/centralregion/15-22
	netcheck moshell/compfiles/RefList_rnc.txt moshell/logfiles/logs_mobatch/2003-10-12/all_rncs/15-45
A separate result file is generated for each comparison case and stored under moshell/logfiles/logs_netcheck/date_time_logdir.
For instance, a logfile for the HW check (hwCheck.txt), a logfile for the LED check (redLed.txt), etc.
Note that the result file "unavailableCells.txt" is not applicable to RBS and the result files "missingIp.txt" and "noTma.txt" are not applicable to RNC. Make sure to check in the result file "noContact.txt" to check which RBS's were unreachable at the time of the mobatch check. 

----------------------------------------------------------------
5- Lock MOs that are in state Unlocked-Disabled (RBS mainly)
----------------------------------------------------------------
In the result directory generated in step A-4 above, a subdirectory called "mobatch_cmdfiles" has been created, containing an mobatch commandfile for each site containing MOs in state Unlocked-Disabled.
Have a check through each of these files to see that it looks ok.
A quick way of doing this is to run the following commands at the unix prompt:
	bash
	cd <netcheck-result-directory>
	cd mobatch_cmdfiles
	(for file in * ; do echo $file ; echo "---------" ; cat $file ; echo "" ; done) |less
This will show all the files on the screen.
If all the command files for locking MOs look ok, then run them using command:
	mobatch.pl <sitefile> <netcheck-result-directory>/mobatch_cmdfiles/
Mobatch.pl will then run a separate command file for each site, based on the name of the command file and the name of the site.

----------------------------------------------------------------
6- Rename property management file (only for upgrade P2.0 --> P2.1)
----------------------------------------------------------------
This can be done through the telbatch utility:
	telbatch -f <sitefile> 'mv /c/java/SecurityManagement.prp /c/java/old_SecurityManagement.prp'
By using the option "-f" assumes that the passwords have been set in ipdatabase.
If not, and all nodes use same password, then it's possible to specify the password from command line, eg:
	telbatch -p <password> <sitefile> 'mv /c/java/SecurityManagement.prp /c/java/old_SecurityManagement.prp'
	

################################################################
B- RBS/RNC pre/post comparison (After Upgrade)
################################################################
Purpose: to check that the nodes have not deteriorated after the system upgrade.

Prerequisite: moshell dumps should have been taken prior to the upgrade. These will be used as a comparison reference.

----------------------------------------------------------------
1- Take moshell dumps from all nodes
----------------------------------------------------------------
Refer to chapters A-1 and A-2.
Take a note of where the logfiles are stored.

----------------------------------------------------------------
2- Run netcheck 
----------------------------------------------------------------
For pre/post comparison, the syntax is:
netcheck -b <LogDirectory-Before> -a <LogDirectory-After>
Where logdirectory is the path to the moshell dumps, taken before and after the upgrade.
Following will be checked:
 - alarms that have raised or ceased after the upgrade
 - MOs that have changed state after the upgrade
 - Iub/Cells that have changed state after the upgrade

################################################################
C- Resetting passwords after upgrade P2.0 --> P2.1
################################################################

After the upgrade to P2.1, all passwords are set to "ericsson".
The password can be changed back to its original value with help of the telbatch utility.

If all nodes shall have the same password, then it is possible to run the same command file for all nodes. Eg:
	telbatch -p ericsson <sitefile> cmdfiles/change_pw.cmd
The command file will look like:
	passwd
	ericsson
	rbs
	rbs
Where ericsson is the current password and rbs is the new password (for example).

If all nodes should have different passwords, then a separate command file should be created for each node.
This can be done with the netcheck utility, provided that the passwords are set in the ipdatabase discussed in step A-1.
	netcheck -p <ipdatabase> <sitefile>
The command files are saved in a directory: <resultdirectory>/telbatch_cmdfiles
To run the command files, use telbatch by giving the command file directory as last argument.
	telbatch -p ericsson <sitefile> <resultdir>/telbatch_cmdfiles/
	
	