From 7eff8f0801900934223d3c7cf0ddf2e42e9720e4 Mon Sep 17 00:00:00 2001 From: Digimer Date: Tue, 2 Aug 2022 20:26:54 -0400 Subject: [PATCH] * Added the man page for anvil-check-memory Signed-off-by: Digimer --- man/anvil-check-memory.8 | 34 ++++++++++++++++++++++++++++++++++ tools/anvil-check-memory | 7 ++----- 2 files changed, 36 insertions(+), 5 deletions(-) create mode 100644 man/anvil-check-memory.8 diff --git a/man/anvil-check-memory.8 b/man/anvil-check-memory.8 new file mode 100644 index 00000000..b464946f --- /dev/null +++ b/man/anvil-check-memory.8 @@ -0,0 +1,34 @@ +.\" Manpage for the Anvil! server boot program +.\" Contact mkelly@alteeve.com to report issues, concerns or suggestions. +.TH anvil-check-memory "8" "August 02 2022" "Anvil! Intelligent Availability™ Platform" +.SH NAME +anvil-check-memory \- This reports the total memory used by all processes with to passed-in program name. +.SH SYNOPSIS +.B alteeve-repo-setup +\fI\, \/\fR[\fI\,options\/\fR] +.SH DESCRIPTION +anvil-check-memory \- This reports the total memory used by all processes with to passed-in program name. It can be an Anvil! or Striker program, or any other program running on the system. +.TP +This looks in 'ps' and finds pids for the given program name, then parses the '/proc//smaps' kernel file to calculate the memory use. This will include shared memory space! Ending the program won't necessarily release the reported amount of RAM. +.TP +The output will be in the format: ' = # +.TP +.SH OPTIONS +.TP +\-?, \-h, \fB\-\-help\fR +Show this man page. +.TP +\fB\-\-log-secure\fR +When logging, record sensitive data, like passwords. +.TP +\-v, \-vv, \-vvv +Set the log level to 1, 2 or 3 respectively. Be aware that level 3 generates a significant amount of log data. +.SS "Commands:" +.TP +\fB\-\-program\fR +This is the name of the program to report memory usage of. +.IP +.SH AUTHOR +Written by Madison Kelly, Alteeve staff and the Anvil! project contributors. +.SH "REPORTING BUGS" +Report bugs to users@clusterlabs.org diff --git a/tools/anvil-check-memory b/tools/anvil-check-memory index b6fc0ef6..971ade0a 100755 --- a/tools/anvil-check-memory +++ b/tools/anvil-check-memory @@ -32,11 +32,8 @@ $| = 1; my $anvil = Anvil::Tools->new(); -$anvil->data->{switches}{program} = ""; -$anvil->Get->switches; -$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => { - 'switches::program' => $anvil->data->{switches}{program}, -}}); +$anvil->Get->switches({list => ["program"], man => $THIS_FILE}); +$anvil->Log->variables({source => $THIS_FILE, line => __LINE__, level => 2, list => $anvil->data->{switches}}); $anvil->data->{memory}{total} = 0;