[Xymon] Include full command line in top output

Mailing Lists lists at dzpconsulting.com
Thu Apr 12 16:28:22 CEST 2012


Excellent! That was exactly what I was looking for. Thanks.


On Apr 11, 2012, at 6:35 PM, Jeremy Laidman wrote:

On my system I can extend the point where top truncates each line, by increasing the value of the "COLUMNS" variable.  For example:

  COLUMNS=120 $TOP -c -b -n 1

Unfortunately, this pads out every line to 120 characters with spaces.  This might not be what you want, because when the spaces wrap, you end up with blank lines.  But give it a try and see how you like it.  You could clean up the trailing blanks with a bit if sed-fu like: sed 's/ *$//'

J


On Thu, Apr 12, 2012 at 8:27 AM, Mailing Lists <lists at dzpconsulting.com> wrote:
Sorry about that. I should have proofread my original post.

The -c argument to top will show the full command line instead of just the process name. I've made this change to hobbit client-linux.sh as shown below.

 $TOP must be set, the install utility should do that for us if it exists.
if test "$TOP" != ""
then
   if test -x "$TOP"
   then
       echo "[top]"
   $TOP -c -b -n 1
   fi
fi

I do see the beginning of the command line as shown in this before and after client data snapshot.

BEFORE:
PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
24525 tomcat    20   0 2805m 958m  11m S   52  1.0  45:03.00 java

AFTER:
 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
31104 tomcat    20   0 2365m 942m  11m S   39  1.0 380:45.86 /var/jdk6/bin/java



My thought is that top truncates based on terminal width because I see more of the command line when I run top -c manually in a fullscreen terminal. Is there anyway to get a wider column width when running top via the xymon client?

By the way, I am running Xymon 4.3.0-0.20101114.beta3.



On Apr 11, 2012, at 1:37 PM, Henrik Størner wrote:

On 11-04-2012 22:07, Mailing Lists wrote:
> I'd like to change the contents of the CPU test details page to
> include the full command line in the top output. As I don't have my
> head wrapped fully around how xymon renders this data, I'm not
> certain where to start. I've modified the client side to include the
> -c option but it still looks like the client data is truncating on
> some default width…

I don't understand - what command is it that you want displayed ?

If it's the command used to run "top", then the easiest way is to just add this to the content of the "[top]" section of the message that the client generates (see the xymon-4.3.7/client/YOUR-OS.sh scripts). The "[top]" section is copied verbatim into the cpu-status text, without being processed in any way.


Regards,
Henrik
_______________________________________________
Xymon mailing list
Xymon at xymon.com
http://lists.xymon.com/mailman/listinfo/xymon

_______________________________________________
Xymon mailing list
Xymon at xymon.com
http://lists.xymon.com/mailman/listinfo/xymon


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.xymon.com/pipermail/xymon/attachments/20120412/71f280ea/attachment.html>


More information about the Xymon mailing list