Professional Documents
Culture Documents
For
UNIX Procedure Automation
117
DOCUMENT CONTROL
Document Reference
VERSION HISTORY
The Aim for this activity was to automate Operational KPI’S procedures and to send the
required report in email, which was done before manually by team members.
This has reduced lots of Team effort and thus providing an efficient method for the above
activities.
2 Scope
This document is prepared based on Cognizant’s understanding of the project based on the
knowledge gained in past. This document will be a live document and will be continuously
updated.
Technical –This Includes UNIX Scripts which has been developed for achieving the
required goal.
Operational –This includes location, logs, monitoring etc. for all functional and
technical aspects.
Processes and Tools Used – This includes standard processes followed to implement
and deploy the code and various tools used.
3 Target Audience
Target audience for this document is
Data quality team
EDW DQ Team
ODS DQ Team
CLDM DQ validation team
4 Functional Description
Backend Description and Motive
The KPIs implemented are meant to analyze any anomaly in trend of the daily “Stage
Tables Loading” (ICMS/CRM), Revenue reconciliation (IN_SDP Revenue), Stage-target
Consistency and the Target-target Consistency.
If any deviation is found and the predefined threshold is breached then, an email will be
triggered for those KPIs.
Unix Automation
It includes various Unix Scripts for automation of above procedures and email, if any
deviation is found.
5 Technical Description
Windows Base BAT File:-
“KPI_OPS” is a Wrapper BAT file which calls all the Unix Scripts and is scheduled by
Windows Scheduler.
“Wrapper_Deviation_Calculation.bash”
“Check_Threshold.bash”
“Export_Data_Upd.bash”
“File_To_Reports.bash”
“Create_Bat_For_PowerShell.bash”
6 Operational Description:-
All the Logs which are generated from above Scripts can be found in below directory path:-
E:\cygwin\log
Or
In Cygwin Environment:-
Cygdrive/E/Cygwin/Log
Wrapper_Deviation
Argument Passed While Calling:-
_Calculation.bash
Fetch_Deviation_Queries.txt
Check_Threshold.bash
No
Deviation
Deviation STOP
STOP
Found?
Found?
Yes
File_To_Reports.bash Create_Bat_For_Powers
To Generate HTML File for Email hell.bash
Body
THEN AGAIN KPI_OPS CALLS FINALLY CREATED BAT FILE OF POWERSHELL TO SEND AN EMAIL TO
CONCERNED TEAM MEMBERS.
KPI OPS (BAT Dynamically Created
FILE) Bat File for Power
shell
Calls
To Send Email
Wrapper_Deviation_Calculation.Bash:-
This is main Unix Script Which first Calls “Export_Data_Upd.bash” and also Passes Path Of
Fetch_Deviation_Queries.txt, which includes Main Procedures to analyze Deviation in Trend.
Export_Data_Upd.Bash:-
It Fetches the queries from Fetch_Deviation_Queries.txt and creates a BTEQ and executes it.
Check_Threshold.Bash:-
Then After Above Process:-
This script is called by Wrapper Bat file and path of Threshold_Query.txt is passed which includes
query to check whether the threshold is breached or not?
Create_Bat_For_Powershell.bash:-
It creates a bat file for Powershell for the purpose of sending an email.
Again KPI OPS Wrapper Script Calls The above bat file to send an email.
Scripts_Function.xlsx