Re: Event Trigger

2002-10-06 Thread Dan Nelson

In the last episode (Oct 06), Lord Raiden said:
>   Hi.  I'm looking for a simple way to implement a trap and
> trigger so to speak.  I'm wanting to setup the system so that the
> moment it detects a certain event in the system, it immediately
> executes another script or program to do something else, but not
> before, not after.  I thought about Cron, but the thing is, I don't
> know when these events will happen so since they're so random, I need
> something to identify them then immediately run another script or
> program at that exact moment.  Any suggestions?

It depends on what the event is.  With kqueue, you can be notified when
a file is changed or a process exits, and you can use those two events
to detect just about anything.  For example, if you're talking FTP
uploads, you can ask to be notified whenever /var/log/xferlog (or
whatever file your ftpd uses to log transfers) changes, then process
any files that were added since the last time your scanner looked at
the logfile.

-- 
Dan Nelson
[EMAIL PROTECTED]

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Re: Event Trigger

2002-10-06 Thread Dru



On Sun, 6 Oct 2002, Lord Raiden wrote:

>   Hi.  I'm looking for a simple way to implement a trap and trigger so to
> speak.  I'm wanting to setup the system so that the moment it detects a
> certain event in the system, it immediately executes another script or
> program to do something else, but not before, not after.  I thought about
> Cron, but the thing is, I don't know when these events will happen so since
> they're so random, I need something to identify them then immediately run
> another script or program at that exact moment.  Any suggestions?

I haven't used it myself, but this was what the Expect language was
designed for. You'll find it in /usr/ports/devel/expect. These will also
get you started if you decide to give it a go:

http://expect.nist.gov
http://www.samag.com/documents/s=7237/sam0207a/0207a.htm

Dru


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message



Event Trigger

2002-10-05 Thread Lord Raiden

Hi.  I'm looking for a simple way to implement a trap and trigger so to 
speak.  I'm wanting to setup the system so that the moment it detects a 
certain event in the system, it immediately executes another script or 
program to do something else, but not before, not after.  I thought about 
Cron, but the thing is, I don't know when these events will happen so since 
they're so random, I need something to identify them then immediately run 
another script or program at that exact moment.  Any suggestions?


To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message