Tricky little problem, send signal to other machine without user


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Tricky little problem, send signal to other machine without user
# 1  
Old 12-07-2010
Tricky little problem, send signal to other machine without user

Hi everyone! I want to be able to send a signal to another machine on the same network, and have it trigger a script on that machine. Here's the reason why I can't just ssh: I don't have a username on that machine, but there is a user that is always logged on that I can do stuff on.

So, I want to have a script constantly running in the background on that machine, and from mine, essentially ping it, and have it run another script. I'm not really sure how to do this...I know the IP address of the machine I want the script on, so I was looking into using something called netcat (man nc).

Does anyone have any advice or suggestions?

Thanks!
# 2  
Old 12-08-2010
So why not have the script on the machine that actually runs it check on the first machine for the existence of a file. That way you don't have to push data, the second machine can pull the data. You only have to give the second machine permission to read files on your system.
# 3  
Old 12-09-2010
Quote:
Originally Posted by jgt
So why not have the script on the machine that actually runs it check on the first machine for the existence of a file. That way you don't have to push data, the second machine can pull the data. You only have to give the second machine permission to read files on your system.
Hmmm, that's not a bad idea. But I'd like a fast response time. Would it be hard to make it check about once a second?

That would work pretty well because I have a user on this machine.
# 4  
Old 12-09-2010
Quote:
Originally Posted by declannalced
Hmmm, that's not a bad idea. But I'd like a fast response time. Would it be hard to make it check about once a second?
Once a second is a bit much. It's easy to say a server can handle one connection per second but that doesn't mean it completes them always within that one second. When the network works well, it might work fine, but TCP connections can take a highly variable amount of time to connect.

I'd try to build something that watches for UDP packets, but I don't know a common convenient commandline tool for that. netcat doesn't deal with packets in a way that lets you see them, and tries way too hard to be telnet...
# 5  
Old 12-10-2010
Quote:
Originally Posted by Corona688
Once a second is a bit much. It's easy to say a server can handle one connection per second but that doesn't mean it completes them always within that one second. When the network works well, it might work fine, but TCP connections can take a highly variable amount of time to connect.

I'd try to build something that watches for UDP packets, but I don't know a common convenient commandline tool for that. netcat doesn't deal with packets in a way that lets you see them, and tries way too hard to be telnet...
Wait...so why wouldn't my netcat idea work? It seems like it could send something to the machine, and on that machine pick it up and run a script, right?
# 6  
Old 12-10-2010
It might be made to work. I'm not sure how you'd manage connections though.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Send ctrl-C signal using bash script.

declare -a array=( "LLC-load-misses" "LLC-loads" "LLC-store-misses" "LLC-stores" "branch-load-misses" "branch-loads" "dTLB-load-misses" "dTLB-loads" "dTLB-store-misses" "dTLB-stores" "iTLB-load-misses" "iTLB-loads" "branch-instructions" "branch-misses" "bus-cycles" "cache-misses" "cache-references"... (2 Replies)
Discussion started by: BHASKAR JUPUDI
2 Replies

2. Shell Programming and Scripting

Vi : Is it possible to send ctrl + d signal from a file made with vi and executing it.

Hi Experts, Is it possible to send ctrl + d signal from a inside a file made with vi, using Ctrl V , Esc and 004 , escape sequence. Since : 004 should exit the script if executed. Is this something possible. I am trying with vi , I put this code ^ , and trying to execute it but... (4 Replies)
Discussion started by: rveri
4 Replies

3. UNIX for Dummies Questions & Answers

How to send xterm to another machine

The scenario is like this: I don't have access permission to linux server A, but my colleague has. So I installed xwindow server (xming or cygwin), then gave him my ip address, then he sent xterm to my machine, the xterm already connected to A with his account. My question is how he did it? (2 Replies)
Discussion started by: humbug
2 Replies

4. Programming

how can i make that a process child send a signal?

I'm trying to do a program that makes activate an signal (SINGALARM) when the next child of a son appears but this not works. I have to caught the next child o the other (pid), to send a singnal which inform a menssage. It's anything worng in the code? thanks. the code: #include... (2 Replies)
Discussion started by: marmaster
2 Replies

5. UNIX for Dummies Questions & Answers

Send email with attachment and body : mailx , waiting for input , signal Control D

Hi, I am trying to send email with attacment and body using "mailx" (cat body.txt; uuencode attach.txt) | mailx -s "Attachment" abc@xyz.com When i type this command, the shell is still waiting for me to enter something in standard input and press control D before it sends a mail and... (2 Replies)
Discussion started by: aliaszero
2 Replies

6. Shell Programming and Scripting

sed tricky problem

Hi, I have a file which contains two strings: AAAAA and BBBBB I have two variables in my script: DATE="03/21/2010" aDate="20100321" I need to replace string AAAAA with variable $DATE and BBBBB with $aDate. Here is what I do sed "s/AAAAA/$DATE/" $BASIC_TMPLT | sed "s/BBBBB/$aDate/" >... (4 Replies)
Discussion started by: axed
4 Replies

7. UNIX for Advanced & Expert Users

need more user signal

Hi In my program I have already used both SIGUSR1 SIGUSR2 user signals. I need another one. How can I do that? Thank you Naama (1 Reply)
Discussion started by: naamabm
1 Replies

8. Shell Programming and Scripting

How to send SIGNAL to the thread?

Hello, I have to send SIGSEGV to the thread. What is the simplest and efficient way to do that? (6 Replies)
Discussion started by: Rahulpict
6 Replies

9. UNIX for Advanced & Expert Users

scp from user A in machine 1 to user B in machine 2

Hi all, would like to find out how can i scp a file from user A in one host to user B in another host? i know how to get it done if its from user A in machine 1 to user A in machine 2. 1)on machine 1, generate a key pair. put the private key in the .ssh directory. 2)put the public key in... (2 Replies)
Discussion started by: new2ss
2 Replies

10. AIX

User defined signal 1

Hi, I am just running a incremental back-up on one of my server. But these days It abrubtly fails with below error. ========== User defined signal 1 =========== When I rerun the back-up, It completed successfully.Earlier this was not happening. Any Idea, what could be the problem... (0 Replies)
Discussion started by: nitesh_raj
0 Replies
Login or Register to Ask a Question