| View previous topic :: View next topic |
| Author |
Message |
wiak Voice
Joined: 23 Dec 2006 Posts: 5
|
Posted: Sat Dec 23, 2006 2:24 am Post subject: MRTG Eggdrop Channel Count v1.0 TEST by wiak & Rats |
|
|
ps: sorry i triple posted earlier
| Code: | ------------------------------------------------------------------------------------------------
# MRTG Eggdrop Channel Count v1.0
# by wiak <tommarnk@gmail.com> & Rats
# Only Tested on FreeBSD 6.0-RELEASE
------------------------------------------------------------------------------------------------
|
this tcl script outputs a readable format for mrtg so it can make a graph of total users in a channel using eggdrop,tcl,shell script & mrtg
| Code: | | channel user count > eggdrop > tcl script > count.log > shell script that reads count.log > mrtg > ircusers.html with stats! |
this is how it looks like
Download:
http://nwgat.net/mrtg-irccount/
PS: i need someone to test this _________________ woot
Last edited by wiak on Sat Dec 23, 2006 9:47 am; edited 3 times in total |
|
| Back to top |
|
 |
Alchera Revered One

Joined: 11 Aug 2003 Posts: 3344 Location: Ballarat Victoria, Australia
|
Posted: Sat Dec 23, 2006 2:43 am Post subject: |
|
|
This looks very interesting and no doubt will be useful to many. _________________ Add [SOLVED] to the thread title if your issue has been.
Search | FAQ | RTM |
|
| Back to top |
|
 |
rosc2112 Revered One

Joined: 19 Feb 2006 Posts: 1454 Location: Northeast Pennsylvania
|
Posted: Sat Dec 23, 2006 4:06 am Post subject: |
|
|
| Neat.. Just a couple of questions for ya. Why use open r+ instead of a(ppend) for logging in the tcl script, and is it really supposed to log 2 lines of the same data? There's 2 puts' in the tcl file (I'm not familiar with mrtg, so maybe it does need 2 lines for comparing..) |
|
| Back to top |
|
 |
wiak Voice
Joined: 23 Dec 2006 Posts: 5
|
Posted: Sat Dec 23, 2006 4:28 am Post subject: |
|
|
170
170
25 days, 3 mins
nwgat.net
gives the shell script ^^
so it needs only 2 lines
but the other are good to have
the uptime & domain will give this output from mrtg on a webpage
IRC Users @ HDBits
The statistics were last updated Saturday, 23 December 2006 at 9:26,
at which time 'nwgat.net' had been up for 25 days, 5 mins.
`Daily' Graph (5 Minute Average)
ps: rats did tcl i did the rest  _________________ woot |
|
| Back to top |
|
 |
smash Halfop
Joined: 31 Jul 2006 Posts: 45
|
Posted: Sat Dec 23, 2006 6:31 am Post subject: |
|
|
| I take it this wont work with windrop ..? |
|
| Back to top |
|
 |
wiak Voice
Joined: 23 Dec 2006 Posts: 5
|
Posted: Sat Dec 23, 2006 9:16 am Post subject: |
|
|
| smash wrote: | | I take it this wont work with windrop ..? |
it might as you can use .bat file (win) insted of .sh file (unix)
but i havent tested it
this might work
download http://unxutils.sourceforge.net/ and get cat.exe put that in system32 folder and then use this bat
| Code: | | cat C:\path\to\mrtg.log |
ps: you wont get uptime + domain but atleast it works
=)
the code isnt 100% working, as it wont update at the same time as mrtg, do anyone know howto get it to update using a trigger? from shell script ?
mrtg > .sh script sends cmd to get count> tcl > eggdrop > <returns's count back< #channel count
or something like that  _________________ woot |
|
| Back to top |
|
 |
__henke Voice
Joined: 10 Nov 2006 Posts: 8
|
Posted: Tue Mar 06, 2007 8:41 am Post subject: |
|
|
Hey!
Nice script. Is there any way to use this thing with multiple channels? _________________ //henke |
|
| Back to top |
|
 |
TMM Voice
Joined: 07 Apr 2007 Posts: 1
|
Posted: Sat Apr 07, 2007 7:47 am Post subject: |
|
|
| __henke wrote: | Hey!
Nice script. Is there any way to use this thing with multiple channels? |
By using arrays instead of the current method, that would be possible, yes. But there's another problems with this tcl since it only loads the function one time, and then stops update the log, and I presume that it's real purpose is to log the channel all the time, to the logfile?
This is what I changed, to make it work:
At the top of the tcl:
| Code: | # Seconds to loop before next update (instead of the regular timer)
set mrtglooptimer 60
|
In the end of proc LogUsers:
| Code: | # Clean up duplicates
foreach tmr [utimers] {if {[lindex $tmr 1]=="LogUsers"} {killutimer [lindex $tmr 2]}}
# Reload timer
utimer 1 reloadLogUsers
|
Added this
| Code: | # Fixing some visual bugs for utimer, like this (when a timer expires during the cleanup):
# [13:41] <BotNick> [13:41] Tcl error in script for 'timer2985':
proc reloadLogUsers { } {
global mrtglooptimer
utimer $mrtglooptimer LogUsers
}
|
And finally
Replace ...
... with ...
| Code: | ## Initialize Logger
utimer $mrtglooptimer LogUsers
|
_________________ --- |
|
| Back to top |
|
 |
|