How do I specify from an array of grid & LASR unix boxes which one I want to us for an X command

Accepted Solution Solved
Reply
Contributor
Posts: 21
Accepted Solution

How do I specify from an array of grid & LASR unix boxes which one I want to us for an X command

Hello community

 

I'm going to code up something that submits the "ps -ef" command on Unix. In fact, I've already done that and I'm able to read it in quite nicely.

 

The problem is, SAS will determine which Unix server it runs against via the Grid head node. What I'd prefer, is that I am able to forcibly select each specific server n Grid boxes and n LASR boxes so I can run this command on all of them.

 

I suspect I may need to actually create a .sh file in Unix to do this for me and call that via SAS, but if anyone knows how to do this in SAS I'd be greatful for some insight.

 

Here's a snapshot of where I've got to so far.

%macro Zombies(server);

	data _null_;
/*		do i = 1 to countw("&ServerList.",'|');*/
			ps = "ps -efl | sort -k 4n,4 | grep ""defunct"" > /dir/dir/dir/defunct.txt";
			call system (ps);
/*		end;*/
	;run;

%mend;
%Zombies(servername);

Thanks in advance,

 

Dan


Accepted Solutions
Solution
‎12-18-2017 08:32 AM
Contributor
Posts: 21

Re: How do I specify from an array of grid & LASR unix boxes which one I want to us for an X com

Hi there

 

I've ended up coding this up into a macro which ssh's across the LASR nodes from whatever Grid box it's running on. It's driven by a txt file which contains all LASR server names, and ssh's across, submitting the 'ps' command and storing the output into a separate file, suffixed with each server name.

 

It's the most elegant solution I could find, but I'll have a look at these agents. We're on 9.4_M3.

 

 

Cheers,

 

Dan

View solution in original post


All Replies
Super User
Posts: 5,852

Re: How do I specify from an array of grid & LASR unix boxes which one I want to us for an X com

What version are you on?
If 9.3 or above you are most likely to have Environment Manager that via agents can collect this information for you.
Data never sleeps
Solution
‎12-18-2017 08:32 AM
Contributor
Posts: 21

Re: How do I specify from an array of grid & LASR unix boxes which one I want to us for an X com

Hi there

 

I've ended up coding this up into a macro which ssh's across the LASR nodes from whatever Grid box it's running on. It's driven by a txt file which contains all LASR server names, and ssh's across, submitting the 'ps' command and storing the output into a separate file, suffixed with each server name.

 

It's the most elegant solution I could find, but I'll have a look at these agents. We're on 9.4_M3.

 

 

Cheers,

 

Dan

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 2 replies
  • 115 views
  • 0 likes
  • 2 in conversation