SRCDS Steam group


Player rate tracking system using Linux's firewall (iptables)
#76
I restart my server every morning 06:00 through cron. Now i have noticed that my screen with ratetables dissapear.
Like if i had used:
Code:
--wipe

But since i have not done that it feels strange that my screen is gone.
Reply
#77
How do you start the screen? Doesn't the screen window exit automatically if you've launched the program with a one-liner with the screen command itself.

Try first starting the screen command like this:
Code:
screen -S ratetables

Then inside the screen write:
Code:
while [ 1 ]; do ./ratetables.pl; sleep 5; done
Reply
#78
[quote='css' pid='84291' dateline='1265094364']
How do you start the screen? Doesn't the screen window exit automatically if you've launched the program with a one-liner with the screen command itself.

Try first starting the screen command like this:
Code:
screen -S ratetables

Then inside the screen write:
Code:
while [ 1 ]; do ./ratetables.pl; sleep 5; done






I started my screen with

Code:
screen -A -m -d -S rates ./ratetables.pl

And then i resumed my screen and used

Code:
[code]while [ 1 ]; do ./ratetables.pl; sleep 5; done


Will try your version today. Perhaps there will be a bug or issue with my way of doing it. Should i have the abolute path in my screen session so it can find the file?
Reply
#79
(02-02-2010, 05:31 PM)lhffan Wrote:  I started my screen with

Code:
screen -A -m -d -S rates ./ratetables.pl

And then i resumed my screen and used

Code:
[code]while [ 1 ]; do ./ratetables.pl; sleep 5; done

That's the problem. If you start the screen with the last parameter (ratetables.pl), then the screen exits when the command (ratetables.pl) exits.

I always start my screens with first "screen -S <somename>" and then I write the commands I want inside the screen. Then I detach the window.
Reply
#80
Nice script

Now im trying to fix for both of my servers, whats wrong?

Code:
my %CONF = (
            logpath => "/srcds/std/orangebox/dod/logs/ratetables/",
            sampleinterval => 10,
            bantime => 5,
            htmlfile => "/var/www/server.htm",
            monitoring => 1,
            immunity => [
                         { steamid => 'STEAM_X:Y:Z' },
                         { steamid => 'STEAM_1:2:3', uniqueid => "Admin" },
                         { uniqueid => 'Admin' },
                         { uniqueid => 'Ghost' },
                         { ip => '1.2.3.4' },
                         { ip => '111.222.333.444' },
                         ]
            );

            (
            logpath => "/srcds/war/orangebox/dod/logs/ratetables/",
            sampleinterval => 10,
            bantime => 5,
            htmlfile => "/var/www/server2.htm",
            monitoring => 1,
            immunity => [
                         { steamid => 'STEAM_X:Y:Z' },
                         { steamid => 'STEAM_1:2:3', uniqueid => "Admin" },
                         { uniqueid => 'Admin' },
                         { uniqueid => 'Ghost' },
                         { ip => '1.2.3.4' },
                         { ip => '111.222.333.444' },
                         ]
            );



Code:
my %servers = (
               1 =>
               {
                   name => "public server",
                   ip => "94.255.xxx.xxx",
                   port => 27015,
                   rconpass => "secret",
                   fwchain => "csstracking",
                   ratelimit => 45,
                   onlinetimelimit => 30,
                   samples => 18,
                   loginterval => 1,
                   players => {}
               },
               2 =>
               {
                   name => "match server",
                   ip => "94.255.xxx.xxx",
                   port => 27035,
                   rconpass => "secret",
                   fwchain => "csstracking2",
                   ratelimit => 45,
                   onlinetimelimit => 30,
                   samples => 18,
                   loginterval => 1,
                   players => {}
               }
               );
Reply
#81
(02-11-2010, 09:58 AM)lhffan Wrote:  Nice script

Now im trying to fix for both of my servers, whats wrong?

Watch out the %CONF. There can be only one %CONF variable. You can't have separate %CONF for "war" and "std" server. There can be only one %CONF variable. All the log files go in the same place.

You should define the "htmlfile => ..." in the %servers part. You can't multiply %CONF section. There can be only one %CONF.

So, I think you need to do this:

1. Remove "htmlfile => ..." from %CONF
2. Remove the second copy of %CONF
3. Add "htmlfile => ..." to the %servers part (add "htmlfile => ... " for both servers separately)

This should do it.

If you have good suggestions for the system I'd be happy to hear it. It's probably pretty difficult to configure in the current form. Do you have any ideas that would have made it easier for you to configure it? Did you get the iptables rules set up easy? Were there any other problems?
Reply
#82
No other problem so far... but the config is difficult
I did as you suggested, removed the second copy of my conf, added the html part to my server´s

Added new fw chain, the script is logging but it outputs my html to my old dir.

old dir
var/www

new dirs
var/www/std
var/www/war



my new conf
Code:
my %CONF = (
            logpath => "/srcds/std/orangebox/dod/logs/ratetables/",
            sampleinterval => 10,
            bantime => 5,
            monitoring => 1,
            immunity => [
                         { steamid => 'STEAM_X:Y:Z' },
                         { steamid => 'STEAM_1:2:3', uniqueid => "Admin" },
                         { uniqueid => 'Admin' },
                         { uniqueid => 'Ghost' },
                         { ip => '1.2.3.4' },
                         { ip => '111.222.333.444' },
                         ]
            );


my new serverlist
Code:
my %servers = (
               1 =>
               {
                   name => "public server",
                   ip => "94.255.xxx.xxx",
                   port => 27015,
                   rconpass => "secret",
                   fwchain => "csstracking",
                   ratelimit => 45,
                   onlinetimelimit => 30,
                   samples => 18,
                   htmlfile => "/var/www/std/server.htm",
                   loginterval => 1,
                   players => {}
               },
               2 =>
               {
                   name => "match server",
                   ip => "94.255.xxx.xxx",
                   port => 27035,
                   rconpass => "secret",
                   fwchain => "csstracking2",
                   ratelimit => 45,
                   onlinetimelimit => 30,
                   samples => 18,
                   htmlfile => "/var/www/war/server.htm",
                   loginterval => 1,
                   players => {}
               }
               );


will trye to change this to

open (OUT, ">$server->{htmlfile}");

no luck it still writes one html file in /var/www
Reply
#83
The %CONF and %servers seem to be correct now.

The htmlfiles should go to the according %server{ htmlfile => ... } locations if you've modified the $server->{htmlfile} line. Note that there is the %CONF{ logpath => ... }, but it's not related to the html files.

I'm planning on releasing new version in few days. The new version has more verifications that the iptables rules are correct and logfiles are writable. There is also "logic" for identifying players who have alt-tabbed to Windows. That way they don't get kicked for low rates while they're looking their stats or something. The code needs to be commented and cleaned, so it probably takes few days.

In the meantime I think it's possible for you to get the separate html files working with the instructions in the previous posts and with little patience Smile I don't see any problems in your current %CONF and %servers values, so it should be working. Double verify where the files are written. For example delete the current log files and start the system again. That's probably easier than looking at the time stamps and trying to figure what's happening.
Reply
#84
(02-11-2010, 08:04 PM)css Wrote:  I'm planning on releasing new version in few days. The new version has more verifications that the iptables rules are correct and logfiles are writable. There is also "logic" for identifying players who have alt-tabbed to Windows. That way they don't get kicked for low rates while they're looking their stats or something. The code needs to be commented and cleaned, so it probably takes few days.

I've released new version. Check the download link from the first post.

New stuff in this release is probably easier first time experience. Then there are also server specific HTML statistics for WWW publishing and better detection for low rate players.

Feedback is welcome. Especially if you've got war server and you're using this with high rate (over 66 pkt / seconds) server, then I'd be happy to see some stats. Clan players should have very good rates.

@lhffan
Try the new release if you still have problems.
Reply
#85
(02-15-2010, 11:29 PM)css Wrote:  
(02-11-2010, 08:04 PM)css Wrote:  I'm planning on releasing new version in few days. The new version has more verifications that the iptables rules are correct and logfiles are writable. There is also "logic" for identifying players who have alt-tabbed to Windows. That way they don't get kicked for low rates while they're looking their stats or something. The code needs to be commented and cleaned, so it probably takes few days.

I've released new version. Check the download link from the first post.

New stuff in this release is probably easier first time experience. Then there are also server specific HTML statistics for WWW publishing and better detection for low rate players.

Feedback is welcome. Especially if you've got war server and you're using this with high rate (over 66 pkt / seconds) server, then I'd be happy to see some stats. Clan players should have very good rates.

@lhffan
Try the new release if you still have problems.

great il will look at it in a few days
Reply
#86
Hello,

I just adapt my version for L4D2 to this new version and I have a problem.

Code:
root@ubuntu:~$ while [ 1 ]; do perl ratetables.pl; sleep 5; done;
[17 Feb 2010 05:13:32]:                          
[17 Feb 2010 05:13:32]:         === Ratetables ===
[17 Feb 2010 05:13:32]:                          
[17 Feb 2010 05:13:32]: Author:  Ghost
[17 Feb 2010 05:13:32]: Website: http://css.setti.info/
[17 Feb 2010 05:13:32]:
[17 Feb 2010 05:13:32]: Ratetables started
[17 Feb 2010 05:13:32]: Verifying iptables settings
iptables v1.3.8: Unknown arg `-S'
Try `iptables -h' or 'iptables --help' for more information.
[17 Feb 2010 05:13:32]: You have errors in iptables rules
[17 Feb 2010 05:13:32]: You must create new chain l4dtracking: iptables -N l4dtracking
[17 Feb 2010 05:13:32]: You must create new rule for server L4D2 server: iptables -I INPUT -p udp --dport 27015 -j l4dtracking

The command iptables -S does not exist on my ubuntu
I comment this line #verify_settings(); and it works now.
Reply
#87
(02-17-2010, 02:20 PM)fugitif Wrote:  The command iptables -S does not exist on my ubuntu
I comment this line #verify_settings(); and it works now.

Well, of course, it was too easy. Maybe I'll just check if the iptables version is new enough for the verifications. It's easier than using some super rare perl iptables rules module or trying to parse "iptables-save" output. Admins with too old version just have to follow the instructions carefully Smile

Thanks for pointing this out. It could've caused lots of confusion for other server admins.
Reply
#88
(02-17-2010, 05:29 PM)css Wrote:  
(02-17-2010, 02:20 PM)fugitif Wrote:  The command iptables -S does not exist on my ubuntu
I comment this line #verify_settings(); and it works now.

It's easier than using some super rare perl iptables rules module or trying to parse "iptables-save" output.

It seems the iptables-save output wasn't so different from "-S" option. Now the system should work with the verifications with old iptables version.
Reply
#89
Today I test this new version with 6 servers l4d2, and apparently it kick / ban anyone.
Yet there are players that are lower than the limit I set.
I set the limit at 18 fps on the 30 maximum l4d2 game.
Which calculation you use to kick players? The rate_median, rate_avg, rate_max?
I reinstall the old version because I have players outside Europe which have a dismal rate.
Reply
#90
It kicks based on median.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)