[mrtg] Re: Try to graph concurrent users on website

Brander, Eric Eric.Brander at ACS-INC.com
Tue Jan 21 14:36:18 MET 2003


Target[chatboy]: `/var/www/www.gay.nl/bin/online.php | /usr/bin/awk '{ print
$1; print $1; print "a high load" ; print "scriptname";}'`

I don't awk, so I'm confused as to what you are trying to accomplish with
this line.

What is the result if you run that entire line (inside the back ticks)
manually?  MRTG expects to get 4 lines from an external program.  I use
external scripts without any hassle, but I haven't tried piping anything
through awk.  You may want to experiment with your PHP script to just place
0's after the reading so that it reads something like this:

112
0
0
0


Oh, also, make sure that the account that MRTG is using has rights to run
your script.

Oh.. and another thing, but I have 0 knowledge on PHP scripts, is that you
may have to `/path/to/interpreter /path/to/script | awk whatever`.  But
again, having no experience with PHP, this may not apply.

Eric Brander
ACS
Texas CHIP Account
Sr. Communications Engineer - Information Systems Department
512.336.3331
Eric dot Brander at acs-inc dot com


-----Original Message-----
From: Bram Heerink [mailto:bram at guts.nl]
Sent: Tuesday, January 21, 2003 7:20 AM
To: mrtg at list.ee.ethz.ch
Subject: [mrtg] Try to graph concurrent users on website



Dear all,

First message on this list so I hope my questions are not to stupid. We have
a complicated website and I want to graph the concurrent loged in users each
5 minutes. There is a mysql table online that keeps the users records. So I
wrote a small php script to output the numbers of records in the table.

Script output of php script:

gay-www# ./online.php
112
gay-www#

But how do i graph this via mrtg?

I tried this but all what I get is zero graphs in my html.

Target[chatboy]: `/var/www/www.gay.nl/bin/online.php | /usr/bin/awk '{ print
$1; print $1; print "a high load" ; print "scriptname";}'`
MaxBytes[chatboy]: 1000
Options[chatboy]: gauge, noinfo, nopercent
Title[chatboy]: load chatboy server: users
YLegend[chatboy]: Users
LegendI[chatboy]:
LegendO[chatboy]: Users
ShortLegend[chatboy]: Users
PageTop[chatboy]: <H1>Concurrent users gay.n</H1>
 <TABLE>
   <TR><TD>Maintainer:</TD><TD>Bram Heerink bram at guts.nl</TD></TR>
   <TR><TD>Interface:</TD><TD>Concurrent users gay.nl</TD></TR>
   <TR><TD>Max:</TD><TD>1000</TD></TR>
  </TABLE>

Why does this not work?

Please help!

Regards,

Bram Heerink


--
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