BookmarkSubscribeRSS Feed
GyaniBaba
Obsidian | Level 7

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

1 REPLY 1
Kalind_Patel
Lapis Lazuli | Level 10

Hi @GyaniBaba;

 

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

 

suga badge.PNGThe SAS Users Group for Administrators (SUGA) is open to all SAS administrators and architects who install, update, manage or maintain a SAS deployment. 

Join SUGA 

CLI in SAS Viya

Learn how to install the SAS Viya CLI and a few commands you may find useful in this video by SAS’ Darrell Barton.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 1 reply
  • 823 views
  • 2 likes
  • 2 in conversation