adspace
Set up a Sev 2 alert when the Primary WA service fails. A
windows batch script needs to be created that will monitor
the WA service on the Primary and when the service
stops/fails a Sev 2 TT is generated for a particular team ?
Answer Posted / Pranav Kumar Ojha
To set up a Sev 2 alert when the Primary WA service fails, you can create a Windows batch script that uses the 'net' command to check the status of the service and sends an email notification if it stops or fails. Here is a basic example:nn```batchn@echo offnsetlocal enabledelayedexpansionnset SERVICE=Primary WAnset EMAIL=team@example.comnfor /f "skip=1" %%a in ('net start ^| findstr /c:"Started" ^| findstr /v /c:": %SERVICE:>"') do (if "!%%a:~2,3!" == " 800" (echo The Primary WA service has started. > nul) else (echo The Primary WA service has failed. Sending Sev 2 alert. > nul & net send %EMAIL% Sev 2 Alert: Primary WA Service Failure))n```nThis script checks the status of the Primary WA service, and if it fails, it sends a Sev 2 email notification to the specified team.
| Is This Answer Correct ? | 0 Yes | 0 No |
Post New Answer View All Answers
Hello all, This is my assignment on shell scripting, can anyone help me regarding this ? Create a shell script which connects to the database In second shell script include the first script for the DB connection Create a table (PRADEEP_DATA) with 2 columns (name, value) In Third shell script include the first script for the DB connection And insert/delete the values from the Table, by accepting input from the user This functionality should be a menu driven Program: 1) Insert to the database a. Name b. value 2)Delete from the database a.Name b.value Exception handling needs to be taken care.