Linux - SoftwareThis forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
reset
USERS="user1 user2 user3"
VAL(g,c)= (3*(g-1)) + c
plot for [i=1:words(USERS)] "__GCRONDIR__/.data/usrstat.log" \
u 1:VAL(i,3) t word(USERS,i)." cpu:".i __STYLE0__, \
"" u 1:VAL(i,4) t word(USERS,i)." mem:".i __STYLE0__
my problem is that the loop, happens only for the last user,
so if a have 10 users, lets say, this script, will plot 9 cpu's values,
for the first 9 users, and both values for the last one.
... for me make no sense, any one ?
I do not totally understand this , but is it zero based? you maybe missing that 0 = 1, 1 = 2, 2 = 3, etc... in zero based. That maybe why you're only showing 9 out of 10.
I do not totally understand this , but is it zero based? you maybe missing that 0 = 1, 1 = 2, 2 = 3, etc... in zero based. That maybe why you're only showing 9 out of 10.
taking for my example above, gnuplot will plot
Code:
user1 cpu
user2 cpu
user3 cpu
user3 mem
and NOT
Code:
user1 cpu
user1 mem
user2 cpu
user2 mem
user3 cpu
user3 mem
as i expect. I mean, both values plotted only for the last user, in the example 'user3'.
I have the 'same' script for my net interfaces, that plot the IN/OUT traffic. It happens to be 5-7 interfaces, and only to the last one i get what i plan to. .... ?
A plot with filled area between two given curves can be easily obtained using the pseudo file ’+’ with filledcurves closed. The example below demonstrates this for two curves f(x) and g(x):
f(x)=cos(x)
g(x)=sin(x)
xmax=pi/4
set xrange [0:xmax]
plot ’+’ using 1:(f($1)):(g($1)) with filledcurves closed
Code:
USERS="user1 user2 user3"
VAL(g,c)= (3*(g-1)) + c
plot for [i=1:words(USERS)] "__GCRONDIR__/.data/usrstat.log" \
u 1:VAL(i,3) t word(USERS,i)." cpu:".i __STYLE0__, \
"" u 1:VAL(i,4) t word(USERS,i)." mem:".i __STYLE0__
I do not fully understand syntax - which is mem and which is cpu?
Code:
USERS="user1 user2 user3"
g = (3*(g-1) + c
c= (3*(g-1) + c
...
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.