bizarre dial out issue - cant just dial a number then quit
First, yes, I am a noob. I touched on Linux a little over the years.I rencently got LFS 6.3 to fully go on a laptop (I even wrote scripts for the process), and I know some of the basic commands. For a new project, I used net-install Debian and got Nagios up and running.
What I am trying to accomplish as part of Nagios' notification process is to have the server simply dial a phone number, wait 30 seconds, then hang up (and exit the command invoking that process). The reason for this is so my boss and I wake up during the night to a ringing phone. It seems as though every program I have got to successfully call out (wvdial, cu, pon) takes far too long to timeout and exit. I do not want any extra waiting or attempting ppp connections, so that Nagios can move on to the next notification command. From what I can figure, those programs I mentioned previously all call to CHAT to actually dial. For the life of me, I cannot make CHAT dial the modem from the command line. I cannot figure out where to put ttyS0 in the command, or if it even uses it. Also, I attempted to use a chatscript and reference chat to it, but there is no details on where/how/if you add the port. Does anyone have any ideas, or know how to make CHAT work from the command line? Any help is appreciated. If you need any more details, I will gladly provide them as best I can. Thank you, Darrell |
Quote:
Code:
# "wvdial-a-manager" command definition |
As this seems to be the problem:
"takes far too long to timeout and exit" I can think of a couple of solutions. In bash, you put the phone cmd into the background # Phone_and_terminate script #!/bin/bash phone_script & #$! is last background cmd pid sleep 30 kill -9 $! In Perl, you'd use wrap a SIGALRM around it To interrupt a long-running operation, set a SIGALRM handler to call die. Set an alarm with alarm, then eval your code: Code:
$SIG{ALRM} = sub { die "timeout" }; |
Well, I have found that I can set the S7 register to a lower time in wvdial.conf and the modem will just give up and exit the program. I appreciate the help.
|
All times are GMT -5. The time now is 10:45 PM. |