[mrtg] Re: Strange ??
Soffen, Matthew
msoffen at iso-ne.com
Mon Jun 18 14:43:21 MEST 2001
I use halfd for running my server on Red Hat (http://www.halfd.org/). I
have 2 scripts that just returns the Max players and the current players.
I run tfc1.sh it returns 2 lines.
#!/bin/sh
# tfc1.sh
/bin/su root -c "setenv HLDIR /server/hlds_l; /usr/local/etc/mrtg/tfc.sh";
#!/usr/local/bin/perl
# /usr/local/etc/mrtg/tfc.sh
# This is the line from hlcmd
# players: xx active (yy max)
#
# All we need is this line.
#
$| = 1;
open (HLSTAT, "/usr/local/bin/hlcmd tfc status | grep ^players: | ");
@data = <HLSTAT>;
$data[0] =~ s/\(//g;
$data[0] =~ s/\)//g;
local ($crap, $active, $crap, $max, $crap) = split (' ', $data[0]);
print "$active\n$max\n";
$load = `uptime`;
chop ($load).
$load =~ s/^ //g;
print "$load\n"; # Uptime
system ("hostname");
> -----Original Message-----
> From: Kenneth Due [SMTP:kenneth at computercafeen.dk]
> Sent: Sunday, June 17, 2001 4:19 AM
> To: mrtg at list.ee.ethz.ch
> Subject: [mrtg] Strange ??
>
>
> Hi
>
> I try to monitor number of players on a HLserver
> This is the conf-file
> Workdir: /home/mrtg/public_html
>
>
> MaxBytes[_]: 20
> Unscaled[_]: dwmy
> Withpeak[_]: wmy
> YLegend[_]: Players
> Legend1[_]: Users playing
> Legend2[_]:
> Legend3[_]: Peak users playing
> Legend4[_]:
> LegendI[_]: Users playing :
> LegendO[_]:
> ShortLegend[_]:
>
> Target[play_gs2]: `/home/mrtg/gs2.sh`
> Title[play_gs2]: Antal spillere ...GS2.computercafeen.dk
> Options[play_gs2]: gauge,noo,noinfo,nopercent,integer
> PageTop[play_gs2]: <H1>playerstats for gs2</H1>
> <TABLE>
> <TR><TD>Description:</TD><TD>gs2.computercafeen.dk</TD></TR>
> <TR><TD>CPUType:</TD> <TD>P2 350 / 512 MB Ram</TD></TR>
> <TR><TD>Max Players:</TD> <TD>20 </TD></TR>
> <TR><TD>Ip:</TD> <TD>213.237.61.89:27015 </TD></TR>
> </TABLE>
>
>
> the gs2.sh script outputs two lines of integers, the first is number of
> players, the second is always zero
>
> From earlier versions, I used the 'gauge' option if i had an external
> supplying the value, only this time
> the graphs always stay a zero ??
>
> Can anyone offer an explanation, or did I mis something fundamental ?
>
>
> /kindest
>
> Kenneth Due
>
>
> --
> Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
> Archive http://www.ee.ethz.ch/~slist/mrtg
> FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
> WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
--
Unsubscribe mailto:mrtg-request at list.ee.ethz.ch?subject=unsubscribe
Archive http://www.ee.ethz.ch/~slist/mrtg
FAQ http://faq.mrtg.org Homepage http://www.mrtg.org
WebAdmin http://www.ee.ethz.ch/~slist/lsg2.cgi
More information about the mrtg
mailing list