Tom Lynn <to*******@hotmail.com> writes:
I'm considering using a PHP command line script to retrieve reports from a
Linux system. My only source for the report is via telnet.
Do you mean that you telnet to the system, get a shell, and generate
the report by executing a command or sequence of commands? Or do
you mean that you use the telnet client to connect to a certain
port and the report is generated automatically?
Has anybody here used fsockopen() to interactively script a telnet session
in PHP?
If so, what problems did you have to overcome. If not, does this sound
do-able?
Depending on what you're doing, you might need to implement the
TELNET protocol, which might involve more than you care to do.
Is there a reason for using PHP? If you need to mimic an interactive
shell session, then consider using expect, which was designed for
exactly that sort of thing.
--
Michael Fuhr
http://www.fuhr.org/~mfuhr/