BookmarkSubscribeRSS Feed
Obsidian | Level 7

Hello everyone,


This video is nice Session Management in SAS® Viya™: Detecting Idle or Runaway Sessions - SAS Video Portal but it's all manual


And in my opinion, it's better to achive this with some automations.


Is there a way to do it with sas-admin CLI or with some REST API endpoint ?


Thank you for reading


Opal | Level 21

Moved post here for better visibility.

You could probably identify and terminate idle sessions with the CAS REST API, detailed here:

I'm not sure if you'd be able to look at resource consumption using the API though.
Greg Wootton | Principal Systems Technical Support Engineer
Obsidian | Level 7

Thank you for your time ^^


I already check the apidoc, there is nothing relevant.


About the CLI, there is a possibility to list the iddle/active sessions. And by saying that, I realise that I was not clear


In gridmon, I see a lot of orphans process that last for severals days. This is mainly due to lost connexions (I believe that dev bugs lead also to that but the users/dev just dont want to wait and time to time, they just leave their web application viya...)


The problem is I want to kill those listed process in gridmon (automatically, not manually).


I should take a look at the OS process, maybe... The question is if there is a way by OS side, how to be sure that I hit the good process listed by gridmon ? =}


Gridmon is nice but too limited, there is no way to search a process of a specific user, or list all the process by conditions etc etc... It just list and we have to parse stuff manually... My source : SAS Help Center: SAS Cloud Analytic Services: How To (,


Even the record function is kinda useless...


For now the best alternatives to flush all those trashy process listed in gridmon is a clean/restart of viya but it's still a frustration to me...


Thx for reading ^^

Opal | Level 21

Interesting challenge. We had a similar issue in our SAS 9.4 installation. We found that stopping and restarting server services every day was the best solution for us. As well as getting rid of orphan SAS processes it also enables the CLEANWORK utility to work successfully to delete SAS WORK folders.


We also do a monthly server reboot and that also helps minimise orphan server processes.

The REST API can do these things.
The endpoint /cas/sessions can be queried to list sessions. This response includes idle time for each session.
You can use /cas/sessions/session_id with the DELETE method to terminate the session.
Greg Wootton | Principal Systems Technical Support Engineer
Community Manager

Hi @k4minou,

Have you been able to try the two APIs suggested by @gwootton?

Join us for SAS Community Trivia
SAS Bowl XXXVI, Data Simulation
Wednesday, December 13, 2023, at 10 a.m. ET | #SASBowl

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
  • 6 replies
  • 4 in conversation