Sponsored Content
Top Forums Shell Programming and Scripting Tricky little problem, send signal to other machine without user Post 302478816 by Corona688 on Thursday 9th of December 2010 03:00:54 AM
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...
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
NC(1)							    BSD General Commands Manual 						     NC(1)

NAME
nc -- arbitrary TCP and UDP connections and listens SYNOPSIS
nc [-e command] [-g intermediates] [-G hopcount] [-i interval] [-lnrtuvz] [-o filename] [-p source port] [-s ip address] [-w timeout] [hostname] [port[s...]] DESCRIPTION
The nc (or netcat) utility is used for just about anything under the sun involving TCP or UDP. It can open TCP connections, send UDP pack- ets, listen on arbitrary TCP and UDP ports, do port scanning, and source routing. Unlike telnet(1), nc scripts nicely, and separates error messages onto standard error instead of sending them to standard output, as telnet(1) does with some. Destination ports can be single integers, names as listed in services(5), or ranges. Ranges are in the form nn-mm, and several separate ports and/or ranges may be specified on the command line. Common uses include: o simple TCP proxies o shell-script based HTTP clients and servers o network daemon testing o source routing based connectivity testing o and much, much more The options are as follows: -e command Execute the specified command, using data from the network for stdin, and sending stdout and stderr to the network. This option is only present if nc was compiled with the GAPING_SECURITY_HOLE compile time option, since it allows users to make arbitrary programs available to anyone on the network. -g intermediate-host Specifies a hop along a loose source routed path. Can be used more than once to build a chain of hop points. -G pointer Positions the "hop counter" within the list of machines in the path of a source routed packet. Must be a multiple of 4. -i seconds Specifies a delay time interval between lines of text sent and received. Also causes a delay time between connections to multiple ports. -l Is used to specify that nc should listen for an incoming connection, rather than initiate a connection to a remote host. Any host- name/IP address and port arguments restrict the source of inbound connections to only that address and source port. -n Do not do DNS lookups on any of the specified addresses or hostnames, or names of port numbers from /etc/services. -o filename Create a hexadecimal log of data transferred in the specified file. Each line begins with ``<'' or ``>''. ``<'' means "from the net" and ``>'' means "to the net". -p port Specifies the source port nc should use, subject to privilege restrictions and availability. -r Specifies that source and/or destination ports should be chosen semi-randomly instead of sequentially within a range or in the order that the system assigns. -s hostname/ip-address Specifies the IP of the interface which is used to send the packets. On some platforms, this can be used for UDP spoofing by using ifconfig(8) to bring up a dummy interface with the desired source IP address. -t Causes nc to send RFC854 DON'T and WON'T responses to RFC854 DO and WILL requests. This makes it possible to use nc to script telnet sessions. The presence of this option can be enabled or disabled as a compile-time option. -u Use UDP instead of TCP. On most platforms, nc will behave as if a connection is established until it receives an ICMP packet indi- cating that there is no program listening to what it sends. -v Verbose. Cause nc to display connection information. Using -v more than once will cause nc to become even more verbose. -w timeout Specifies the number of seconds nc should wait before deciding that an attempt to establish a connection is hopeless. Also used to specify how long to wait for more network data after standard input closes. -z Specifies that nc should just scan for listening daemons, without sending any data to them. Diagnostic messages about refused con- nections will not be displayed unless -v is specified twice. EXAMPLES
nc Wait for the user to type what would normally be command-line arguments in at stdin. nc example.host 42 Open a TCP connection to port 42 of example.host. If the connection fails, do not display any error messages, but simply exit. nc -p 31337 example.host 42 Open a TCP connection to port 42 of example.host, and use port 31337 as the source port. nc -w 5 example.host 42 Open a TCP connection to port 42 of example.host, and time out after five seconds while attempting to connect. nc -u example.host 53 Send any data from stdin to UDP port 53 of example.host, and display any data returned. nc -s 10.1.2.3 example.host 42 Open a TCP connection to port 42 of example.host using 10.1.2.3 as the IP for the local end of the connection. nc -v example.host 42 Open a TCP connection to port 42 of example.host, displaying some diagnostic messages on stderr. nc -v -v example.host 42 Open a TCP connection to port 42 of example.host, displaying all diagnostic messages on stderr. nc -v -z example.host 20-30 Attempt to open TCP connections to ports 20 through 30 of example.host, and report which ones nc was able to connect to. nc -v -u -z -w 3 example.host 20-30 Send UDP packets to ports 20-30 of example.host, and report which ones did not respond with an ICMP packet after three seconds. nc -l -p 3000 Listen on TCP port 3000, and once there is a connection, send stdin to the remote host, and send data from the remote host to stdout. echo foobar | nc example.host 1000 Connect to port 1000 of example.host, send the string "foobar" followed by a newline, and move data from port 1000 of example.host to std- out until example.host closes the connection. SEE ALSO
cat(1), telnet(1) The netcat README. AUTHOR
*Hobbit* [hobbit@avian.org] BSD
August 1, 1996 BSD
All times are GMT -4. The time now is 03:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy