Re: Expect log_file Issue



At 2007-10-31 11:28AM, "monkeytime" wrote:
Hi,

I've designed an Expect script to login to a device and turn on it's
syslog functionality. The syslog only sends to STDOUT, so a log_file
captures all of the output.

Once the syslog data starts streaming to STDOUT, I just want the
log_file to keep capturing data until I terminate the Expect script
manually. The issue that comes up is that after issuing the syslog
"on" command, the Expect script terminates and the log_file only
contains the output up to the last Expect command that was issued.

Is there a way I can leave the Expect script "open-ended" or still
running so that STDOUT data still goes to the logfile? I've tried a
"while" loop, timeout settings, sleep settings and leaveopen settings
and nothing worked. I've added a command at the end of the script to
expect bogus data (eg. jsdf98weeufh983r) that I know would never
appear, but that only logs about 10 lines of syslog data and then
terminates.

You'll have to show us what you've got so far.

--
Glenn Jackman
"You can only be young once. But you can always be immature." -- Dave Barry
.



Relevant Pages

  • Re: Log every access to a file
    ... > bypass syslog entirely, although there are options available to use ... > If you really need to log all accesses to the file, ... I've attached a script statlog.py that will do it ... The second is to use fam. ...
    (freebsd-questions)
  • Re: anyone RSCT savy?
    ... Below 50% utilization I email and syslog, and above 50% I email, syslog and ... slog='PBH Syslog event anytime' ... I would like to run a custom script when a filesystem gets to 75% full. ... I cannot find a response that will fire a script off. ...
    (AIX-L)
  • Re: Expect log_file Issue
    ... I've designed an Expect script to login to a device and turn on it's ... The syslog only sends to STDOUT, ... Once the syslog data starts streaming to STDOUT, ... contains the output up to the last Expect command that was issued. ...
    (comp.lang.tcl)
  • Re: Expect log_file Issue
    ... The syslog only sends to STDOUT, ... log_file to keep capturing data until I terminate the Expect script ... running so that STDOUT data still goes to the logfile? ...
    (comp.lang.tcl)
  • Re: syslog to send msg to last user in printer queue
    ... >So is it HP JetDirect that's catching 'em or is it syslog? ... syslog logging on the printers themselves. ... >I have now written a script that could take the printername as input (as ... invoke external commands) when certain messages appear in a logfile. ...
    (comp.unix.solaris)