Scheduling and running summaries

The data availability report is based on daily summary and hourly drill-down result is calculated during reporting. It is important that these summaries are executed periodically. A cron job can be set up to run the summaries as required. For performance reasons, the frequency of this run must be monitored.

Procedure

Note: Create the script DA_summary_cron and copy it to /appl/virtuo/admin/common/cron location.
Daily summaries can be run via the scheduler. Alternatively, the daily summary can be included in a script that is executed from crontab if the current day data availability is needed. However, the vendor_cleanup.ksh must remain in the script to filter the data availability result to a specific vendor and technology. The following line is added to the crontab:
05 * * * * WMCROOT=/appl/virtuo;export WMCROOT;/appl/virtuo/admin/common/cron/DA_summary_cron 
	> /dev/null 2>&1
#Example Script - DA_summary_cron
###########################################################
#!/bin/sh
# sdate: A Bourne shell script that
# prints the date n days ago.
# Set the current month day and year.
month=`date +%m`
day=`date +%d`
year=`date +%Y`
daysbefore=0
# Add 0 to month. This is a
# trick to make month an unpadded integer.
month=`expr $month + 0`
# Subtrace n from the current day.
day=`expr $day - $daysbefore`
# While the day is less than or equal to
# 0, deincrement the month.
while [ $day -le 0 ]
do
	month=`expr $month - 1`
	# If month is 0 then it is Dec of last year.
	if [ $month -eq 0 ]; then
		year=`expr $year - 1`
		month=12
	fi
	# Add the number of days appropriate to the
	# month.
	case $month in
		1|3|5|7|8|10|12) day=`expr $day + 31`;;
		4|6|9|11) day=`expr $day + 30`;;
		2)
		if [ `expr $year % 4` -eq 0 ]; then
			if [ `expr $year % 400` -eq 0 ]; then
				day=`expr $day + 29`
			elif [ `expr $year % 100` -eq 0 ]; then
				day=`expr $day + 28`
			else
				day=`expr $day + 29`
			fi
		else
			day=`expr $day + 28`
		fi
		;;
	esac
done
# Print the month day and year.
#echo $month $day $year
DAY_S=$day-$month-$year
DAY_E=$day-$month-$year
#echo $DAYS
#echo $DAYE
#Uncomment the next two lines to force a date
#DAYS="24-03-2008"
#DAYE="24-03-2008"
echo `date`
### Run summaries
# Motorola BSS Summaries
/appl/virtuo/bin/summary_admin -r BSC_DA -ir daily -fr $DAY_S -er $DAY_E
/appl/virtuo/bin/summary_admin -r Cell_DA -ir daily -fr $DAY_S -er $DAY_E
/appl/virtuo/bin/summary_admin -r Ethernet_link_mo_DA -ir daily -fr $DAY_S -er $DAY_E
/appl/virtuo/bin/summary_admin -r Gb_DA -ir daily -fr $DAY_S -er $DAY_E
/appl/virtuo/bin/summary_admin -r LAPD_DA -ir daily -fr $DAY_S -er $DAY_E
/appl/virtuo/bin/summary_admin -r PCU_DA -ir daily -fr $DAY_S -er $DAY_E
/appl/virtuo/bin/summary_admin -r Processor_DA -ir daily -fr $DAY_S -er $DAY_E
/appl/virtuo/bin/summary_admin -r Signalling_Link_DA -ir daily -fr $DAY_S -er $DAY_E
/appl/virtuo/bin/summary_admin -r X25_DA -ir daily -fr $DAY_S -er $DAY_E
# Huawei BSS Summaries
/appl/virtuo/bin/summary_admin -r BSC_DA_Huawei -ir daily -fr $DAY_S -er $DAY_E
/appl/virtuo/bin/summary_admin -r M3UA_link_utilisation_DA -ir daily -fr $DAY_S -er $DAY_E
/appl/virtuo/bin/summary_admin -r SCTP_Link_DA -ir daily -fr $DAY_S -er $DAY_E

DB_USERNAME=`$WMCROOT/bin/conf_read dbconnection vtdb|grep \.user=|sed -e ’s/.*=//g’`
export DB_USERNAME
ORACLE_SID=`$WMCROOT/bin/conf_read dbconnection vtdb|grep \.sid=|sed -e ’s/.*=//g’`
export ORACLE_SID
DB_PASSWORD=`$WMCROOT/bin/conf_read dbconnection vtdb|grep \.password=|sed -e ’s/.*=//g’`
export DB_PASSWORD

# Need to call the vendor_cleanup for EACH summary.
# Parameters:
# 1. Do not filter for vendor neutral data coverage summary tables
# 2. The vendor you want to KEEP. All other vendors entities will be removed
# 3. The name of the DSM table
# 4. The identifier field that is being removed
# 5. The nc table to use
# e.g: /appl/virtuo/admin/common/cron/vendor_cleanup.ksh Huawei Gb_DA gb_id nc_gb
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Huawei GSM BSC_DA_HUAWEI_DSM BSC_ID nc_bsc
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Motorola GSM BSC_DA_DSM BSC_ID nc_bsc
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Motorola GSM Cell_DA_DSM CELL_ID nc_cell
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Motorola GSM 
	Ethernet_link_mo_DA_DSM ETHERNET_LINK_ID 	nc_ethernet_link_mo
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Motorola GSM Gb_DA_DSM GB_ID nc_gb
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Motorola GSM LAPD_DA_DSM LAPD_ID nc_lapd
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Motorola GSM PCU_DA_DSM PCU_ID nc_pcu
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Motorola GSM Processor_DA_DSM Processor_ID nc_processor
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Motorola GSM GSM 
	Signalling_Link_DA_DSM ss7_point_id nc_ss7_point
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Motorola GSM X25_DA_DSM X25_ID nc_x25
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Huawei GSM 
	M3UA_link_utilisation_DA_DSM M3UA_LINK_ID nc_m3ua_link
/appl/virtuo/admin/common/cron/vendor_cleanup.ksh Huawei GSM 
	SCTP_Link_DA_DSM SCTP_LINK_ID nc_sctp_link
echo `date`
Note: You do not have to run the summary_admin part from the script if you do not need daily summaries. You can comment this part from the script.