LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 05-23-2015, 02:11 PM   #1
Mike_Brown
Member
 
Registered: May 2015
Posts: 37

Rep: Reputation: Disabled
How to get the running program information of remote computers?


I am a R user. I want to know whether remote computers are running R or not.
PROBLEM: How to know whether R program is running, and redirect the host which is running R to a file? I want to check the COMMAND column contains R. What should I do?
Here is the picture of "top" when running R programs(parallel).
Attached Thumbnails
Click image for larger version

Name:	hZqP5.jpg
Views:	29
Size:	90.4 KB
ID:	18549  

Last edited by Mike_Brown; 05-23-2015 at 08:40 PM.
 
Old 05-24-2015, 07:41 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 2,404

Rep: Reputation: Disabled
Have you considered using SNMP?

The names of all running processes are exposed as leaves under the hrSWRunName node (numeric OID 1.3.6.1.2.1.25.4.2.1.2). Something as simple as:
Code:
snmpwalk -v 1 -c <community_name> <ip_address> .1.3.6.1.2.1.25.4.2.1.2 | grep STRING:\ \"R\"
...ought to do the trick. When you say:
Quote:
Originally Posted by Mike_Brown View Post
PROBLEM: How to know whether R program is running, and redirect the host which is running R to a file?
...do you mean you want to generate a file containing the hostnames or IP addresses of all hosts running R?
 
Old 05-24-2015, 01:34 PM   #3
Mike_Brown
Member
 
Registered: May 2015
Posts: 37

Original Poster
Rep: Reputation: Disabled
Quote:
Originally Posted by Ser Olmy View Post
Have you considered using SNMP?

The names of all running processes are exposed as leaves under the hrSWRunName node (numeric OID 1.3.6.1.2.1.25.4.2.1.2). Something as simple as:
Code:
snmpwalk -v 1 -c <community_name> <ip_address> .1.3.6.1.2.1.25.4.2.1.2 | grep STRING:\ \"R\"
...ought to do the trick. When you say:

...do you mean you want to generate a file containing the hostnames or IP addresses of all hosts running R?
Thanks. But I am using the computers on campus. They are not allowed to install other software. I wrote a shell script to scan hosts.
Code:
host_list="/home/campus27/zwang10/Desktop/cluster/program/hostlist"
HOSTS=`cat $host_list`
for line in $HOSTS
do 
ssh -f $line "ps -C R | awk '{if(NR>1) print$4}'" > home/campus27/zwang10/Desktop/USED
done
Sometimes, the remote computer is offline or Someone is using Windows (dual system). Then, ssh can will stuck there. So the loop will stuck there. Here is what I want to do, if ssh takes too long time, then stop ssh to that computer and output the hostname of that desktop. Also if there is an R running, output the hostname of that desktop.
I am using tcsh.

Last edited by Mike_Brown; 05-24-2015 at 01:41 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a program on SSH login beskone Linux - General 2 10-26-2008 01:05 PM
ssh-ing into an already running program everyday Linux - Software 4 07-23-2008 05:08 AM
HELP!! running program to ssh bad_jaye Linux - Newbie 4 02-25-2008 08:23 PM
Running Program Through SSH windisch Linux - General 6 10-04-2005 07:10 AM
Running a program in the background - SSH ziggo0 Linux - Newbie 4 03-05-2005 02:30 PM


All times are GMT -5. The time now is 06:28 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration