11-25-2016 09:49 AM
This is not exactly sas, but we are lokking this for the servers hosting SAS.
I want to develop script in any language which could
1. check if the service is running in DR site.
We have failover mechanish.
for ex. server.mysas.com is the VIP and this reslves to either primary server server1.mysas.com or secondart (DR) server server2.mysas.com, I want to be able to have a script which alerts whenever the VIP starts resolving to the unexpected IP/host
11-26-2016 08:39 AM - edited 11-26-2016 08:41 AM
In Windows, you can create a batch script to check the status of services on remote machine;
You have to add the following codes in .bat file:
net use \\hostname_of_SAS_server Password /User:Windowsuser (Using this command you can connect your local machine to your SAS Server )
STEP 2 (Add the SAS services name):
sc \\hostname_of_SAS_server query "SAS_Service_Name" | FIND "STATE
sc \\hostname_of_SAS_server query "SAS_Service_Name" | FIND "STATE > status.txt (if you want to create the file of all services state information)
After running these two commands,
you will get the information of that service name in cmd like this:
STATE : 4 RUNNING
I hope that with this information you can create your script according to your need