egghelp.org community Forum Index
[ egghelp.org home | forum home ]
egghelp.org community
Discussion of eggdrop bots, shell accounts and tcl scripts.
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

a "tail -f" output script

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive
View previous topic :: View next topic  
Author Message
vanbee
Voice


Joined: 01 Sep 2005
Posts: 3

PostPosted: Thu Sep 01, 2005 11:16 am    Post subject: a "tail -f" output script Reply with quote

Hi,

I searched the web and the forum without success.
I'm looking for a script that parse the output of my gateway's logfiles (for example syslog or auth.log) and off course print it on a private channel (which is a internal one).
I'd like to do it myself but I know nearly nothing in tcl and right now I haven't the time to do such things.

Maybe one of you, got a script like that and can share it with the rest of the world .. and me Very Happy

Thanks in advance,
Laurent
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Thu Sep 01, 2005 1:00 pm    Post subject: Reply with quote

not too much to share:
Code:

set f [open "|tail -f /var/log/messages"]
fconfigure $f -blocking 0 -buffering line
fileevent $f readable [list foo $f]
proc foo {f} {puthelp "privmsg #chan :[gets $f]"}
Back to top
View user's profile Send private message Visit poster's website
vanbee
Voice


Joined: 01 Sep 2005
Posts: 3

PostPosted: Fri Sep 02, 2005 4:58 am    Post subject: :) Reply with quote

Hi,

Thanks for the quick answer! I just tried your script but I have a problem.
In fact, the egg don't stop sending blank lines every 2 seconds even if there is something something new in my log file.
I just changed the path to correspond to my syslog. But I'm sure I'm doing something wrong, can you help me ?

Thanks Smile
Laurent
Back to top
View user's profile Send private message
demond
Revered One


Joined: 12 Jun 2004
Posts: 3073
Location: San Francisco, CA

PostPosted: Fri Sep 02, 2005 5:33 am    Post subject: Reply with quote

this minimalistic script works fine for me

try with different file, appending to it with echo 'some text' >>file.txt
Back to top
View user's profile Send private message Visit poster's website
vanbee
Voice


Joined: 01 Sep 2005
Posts: 3

PostPosted: Sat Sep 03, 2005 6:07 am    Post subject: :) Reply with quote

I have tried it with another file and indeed it works fine. I can't figure out why it keeps sending blank lines for my syslog, I will try to get the informations I want via another file.
Anyway thanks for the little script Very Happy
Back to top
View user's profile Send private message
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    egghelp.org community Forum Index -> Archive All times are GMT - 4 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Forum hosting provided by Reverse.net

Powered by phpBB © 2001, 2005 phpBB Group
subGreen style by ktauber