[mrtg] Re: Need help when running script in crontab (found cause of problem)

Ershad Shafi Chowdhury iru at bol-online.com
Mon Aug 2 12:42:46 MEST 1999


found the following from deja in response to someone else with a similar
problem
>quote<
Telnet was never designed to be used this way.  Use NetCat:
cd /usr/ports/net/netcat
make install clean
(and replace "telnet" with "nc" in your script).

If you really want to know, what makes a difference here when running from
cron vs by hand is that in cron telnet would not be attached to a tty and
would close the connection before data is received.

Hope this helps,  --Stanislav
>end quote<

So i guess this means I need to go get netcat :-) Cheers everyone ...!
----- Original Message -----
From: Ershad Shafi Chowdhury <iru at bol-online.com>
To: <mrtg at list.ee.ethz.ch>
Sent: Monday, August 02, 1999 2:39 PM
Subject: [mrtg] Need help when running script in crontab


> hi! I have script that calculates the total number of users online and
> redirects output to four lines with no problems. But the same script, when
> run from crontab returns a value of "zero". basically the script looks
like
> this :
>
> telnet hostname 987  | grep user  | wc -l  > filename
> ..
> ..
> ..
>
> The output from "telnet" from cron is
>
> Connected to maia.bol-online.com.
> Escape character is '^]'.
> Connection closed by foreign host.
>
> with all the stuff inbetween missing, so obviously "grep" can't find any
> "user" and "wc" counts zero lines!
> I figured someone else here must have faced a similar problem. Any
> suggestions?
>
> TIA!
> EC
>
> --
> * To unsubscribe from the mrtg mailing list, send a message with the
>   subject: unsubscribe to mrtg-request at list.ee.ethz.ch
> * The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg
>
>

--
* To unsubscribe from the mrtg mailing list, send a message with the
  subject: unsubscribe to mrtg-request at list.ee.ethz.ch
* The mailing list archive is at http://www.ee.ethz.ch/~slist/mrtg


More information about the mrtg mailing list