Architecting, installing and maintaining your SAS environment

VIP monitoring script

Posts: 30

VIP monitoring script



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. is the VIP and this reslves to either primary server or secondart (DR) server, I want to be able to have a script which alerts whenever the VIP starts resolving to the unexpected IP/host

Frequent Contributor
Posts: 96

Re: VIP monitoring script

[ Edited ]
Posted in reply to rajeevk241

Hi @rajeevk241;


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 Smiley Happy


Ask a Question
Discussion stats
  • 1 reply
  • 2 in conversation