Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature request: GECOS -> GECOS and Group #299

Open
stetner opened this issue Jun 29, 2017 · 7 comments
Open

Feature request: GECOS -> GECOS and Group #299

stetner opened this issue Jun 29, 2017 · 7 comments
Assignees
Milestone

Comments

@stetner
Copy link

stetner commented Jun 29, 2017

Hi Sotiris,

Lately I have been adding this to my qtop.py:

d.stetner 18619 $ diff qtopnew/qtop.py  qtopdgs/qtop.py
1536c1536
<               '      GECOS field or Grid certificate DN |'}
---
>               '      GECOS field        |               Group |'}
1546a1547,1550
>             dgs_cmd = "id -nG " + str(user) + " | awk '{print $1}'"
>             _command = subprocess.Popen(dgs_cmd, stdout=subprocess.PIPE, stderr=subprocess.PIPE, shell=True)
>             dgs_name, dgs_err = _command.communicate()
>
1551c1555
<                             '{5:<{width40}} {sep}').format(
---
>                             '{5:<{width25}}{sep}{7:>{width20}} {sep}').format(
1558a1563
>                 colorize(dgs_name.strip(), pattern=userid_pat),
1565a1571,1572
>                 width25=25 + conditional_width,
>                 width20=20 + conditional_width,

Which splits the GECOS field into a GECOS and Group field and gives me this output (qtop -aGF) that I find useful to see what group is dominating the cluster.

Any chance of getting something similar added into the official line? There is probably a more efficient way of doing it...

Doug

screen shot 2017-06-29 at 11 18 50

@sfranky
Copy link
Collaborator

sfranky commented Jun 29, 2017

nice!! I'll discuss with Fotis, but I think we could add that!

@fgeorgatos
Copy link
Collaborator

fgeorgatos commented Jun 30, 2017 via email

@sfranky
Copy link
Collaborator

sfranky commented Aug 26, 2017

@stetner @fgeorgatos fixed in experimental branch.
I'd appreciate some feedback on the group feature, I'm not 100% sure it works.

@stetner
Copy link
Author

stetner commented Aug 29, 2017

I am getting 0 for all groups:

===> User accounts information <=== (sorting according to total nr. of jobs)
[id] unix account      |jobs >=  R +  C +  Q|GECOS field or Grid certificate DN      |Nodes|Group             |
[ 0] d.stetner         |  15     2    0    0|                                        |    2|0                 |
[ 1] c.simons          |   9     5    0    0|                                        |    3|0                 |
[ 2] timothy.stephens  |   6     6    0    0|                                        |    5|0                 |
[ 3] e.undheim         |   6     6    0    0|                                        |    4|0                 |
[ 4] r.gonzalezpech    |   5     5    0    0|                                        |    5|0                 |
[ 5] t.qi              |   4     2    0    1|                                        |   32|0                 |
[ 6] ying.wang         |   3     2    0    0|                                        |    9|0                 |
[ 7] xiaosa.wu         |   3     3    0    0|                                        |    3|0                 |
[ 8] dilys.li          |   3     3    0    0|                                        |    3|0                 |
[ 9] z.zhu             |   2     2    0    0|                                        |    2|0                 |
[ A] yang.wu           |   2     2    0    0|                                        |    2|0                 |
[ B] s.bent            |   2     2    0    0|                                        |    2|0                 |
[ C] h.liu             |   2     1    0    0|                                        |   11|0                 |
[ D] tian.lin          |   1     1    0    0|                                        |    1|0                 |
[ E] huanwei.wang      |   1     1    0    0|                                        |    1|0                 |
[ F] a.senabouth       |   1     1    0    0|                                        |    1|0                 |

Other than that it looks good - the colors with background are now displaying properly as well!

What can I do to get you some data on why the group os not working?

BTW I will be away Sept 4-15th so will not update in that period.

Thanks,
Doug

@stetner
Copy link
Author

stetner commented Aug 30, 2017

Oh, and also no GECOS name with or without a

~/.local/qtop/getent_passwd.txt

file

@stetner
Copy link
Author

stetner commented Aug 30, 2017

BTW - since my environment is LDAP across a university, if we do an id -nG on every user, it will take 3+ minutes to return all groups. I think it would be better to iterate over the userids that are running/queueing jobs only.

@qtop qtop deleted a comment from fgeorgatos Sep 2, 2017
@sfranky
Copy link
Collaborator

sfranky commented Sep 2, 2017

@stetner the branch is highly experimental, so it's far from being stable yet. Unfortunately, I don't have a lot of time to work on it anymore. I made some changes, if you're willing to test it it would be great! No hurry, after you get back. Concerning the LDAP thing, I'll implement it as suggested, makes sense.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants