Call me old fashioned, but:

who | wc -l | awk '{print $1}'

strikes me as safer

regard,
richard


-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Martin
Knoblauch
Sent: 25 January 2006 09:25
To: Ben Hartshorne; ganglia-general@lists.sourceforge.net
Subject: Re: [Ganglia-general] intermittent blanks in graphs


> error message:
> 
> Jan 24 17:24:18 localhost /usr/sbin/gmetad[30443]: RRD_update
> (/var/lib/ganglia/rrds/production/raiden-8-db1/users.rrd): conversion 
> of 'min,' to float not complete: tail 'min,'
> 
> This seems to relate to a recent change I made that I had forgotten 
> about.  :)  I added the following line to my crontab:
> 
> */2 * * * * /usr/bin/gmetric --name="users" --value=`w | head -1 | awk

> '{print $6}'` --type=int16
> 
> The purpose of this line is to create a graph representing the number 
> of logged in users to the host.  it seems right to me - do any of you
> see a
> problem with this line?
> 

 actually, on my system (FC4) your command results in:

$ w | head -1 | awk '{print $6}'
users,
$

 which is not really what you want to put into that metric :-)
Apparently yours seem to report "min," which would be "$4" on my
system. The number of users would be "$5". Maybe different versions of
"procps"?

 Hmm. Weird. Just played around with the setting of "LANG" and not the
command reports "load" instead of "users,". Really weird .....

Martin

------------------------------------------------------
Martin Knoblauch
email: k n o b i AT knobisoft DOT de
www:   http://www.knobisoft.de


-------------------------------------------------------
This SF.net email is sponsored by: Splunk Inc. Do you grep through log
files
for problems?  Stop!  Download the new AJAX search engine that makes
searching your log files as easy as surfing the  web.  DOWNLOAD SPLUNK!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=103432&bid=230486&dat=121642
_______________________________________________
Ganglia-general mailing list
Ganglia-general@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ganglia-general


------------------------------------------------------------------------
For more information about Barclays Capital, please
visit our web site at http://www.barcap.com.


Internet communications are not secure and therefore the Barclays 
Group does not accept legal responsibility for the contents of this 
message.  Although the Barclays Group operates anti-virus programmes, 
it does not accept responsibility for any damage whatsoever that is 
caused by viruses being passed.  Any views or opinions presented are 
solely those of the author and do not necessarily represent those of the 
Barclays Group.  Replies to this email may be monitored by the Barclays 
Group for operational or business reasons.

------------------------------------------------------------------------


Reply via email to