Architecting, installing and maintaining your SAS environment

VIP monitoring script

Reply
Contributor
Posts: 23

VIP monitoring script

Hi,

 

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

Frequent Contributor
Posts: 96

Re: VIP monitoring script

[ Edited ]

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:

 

STEP 1:

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

or

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
  • 200 views
  • 2 likes
  • 2 in conversation