I'm running a tf2 server, and I have a simple Perl script I found that pulls back the stats of it. I need to edit the formatting of it so that cacti can read it nice and proper. The script is this:
use Rcon::HL2;
my $rcon = Rcon::HL2->new(
hostname => "myserverhere",
password => "omgawesomepassword",
);
When I run it, it returns:
0CPU In Out Uptime Users FPS Players
0.00 0.00 0.00 514 9 956.02 0
Initially, I'd like for it to just output the numbers - 0.00 0.00 0.00 514 9 956.02 0, perhaps separated by a tab or comma.
Can anyone help me out with this?
I was looking around and messing with cut and sed and such but can't seem to find the right way for me to get it done. Ideally, I'd like to be able to run myscript.perl -cpu, or myscript.pl -in, etc., to return just those bits. I think if someone can show me how to manipulate the output, I can figure out the rest.