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

add option to remove verbose header and footer (need this for batch scripting) #55

Closed
cypa opened this issue Mar 8, 2020 · 4 comments
Closed

Comments

@cypa
Copy link

cypa commented Mar 8, 2020

again apache + php

for PID in $(pgrep -f php-cgi | tr '\n' ' '); do ps_mem --show-cmdline -p $PID; done

I do not need all these captions and sums for all 100 php processes

...

 Private  +   Shared  =  RAM used	Program 

  8.8 MiB + 215.5 KiB =   9.0 MiB	/opt/php73/bin/php-cgi php
---------------------------------
                          9.0 MiB
=================================
 Private  +   Shared  =  RAM used	Program 

  9.9 MiB + 217.5 KiB =  10.1 MiB	/opt/php73/bin/php-cgi php
---------------------------------
                         10.1 MiB
=================================
 Private  +   Shared  =  RAM used	Program 

  8.8 MiB + 215.5 KiB =   9.0 MiB	/opt/php73/bin/php-cgi php
---------------------------------
                          9.0 MiB
=================================
 Private  +   Shared  =  RAM used	Program 

 10.8 MiB + 216.0 KiB =  11.0 MiB	/opt/php73/bin/php-cgi php
---------------------------------
                         11.0 MiB
=================================
@pixelb
Copy link
Owner

pixelb commented Mar 9, 2020

ps_mem --show-cmdline -p $(pgrep -d, -f php-cgi)

@pixelb pixelb closed this as completed Mar 9, 2020
@cypa
Copy link
Author

cypa commented Mar 9, 2020

excuse me, what I'm about is something like this

[root@dokonlin ~]# ps_mem --no-headers-footers --show-cmdline -p $(pgrep -d, -f php)
332.0 KiB + 936.0 KiB =   1.2 MiB	php-fpm: master process (/etc/php-fpm.conf)
660.0 KiB +   4.3 MiB =   4.9 MiB	php-fpm: pool www               (5)
 34.5 MiB +   1.9 MiB =  36.4 MiB	php-fpm: pool apache            (3)

@pixelb
Copy link
Owner

pixelb commented Mar 9, 2020

The closest you can get currently I think is:
ps_mem -s -p $(pgrep -d, -f php) | tail -n+3 | head -n-3

@cypa
Copy link
Author

cypa commented Mar 9, 2020

indeed, thanks

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

No branches or pull requests

2 participants