1 #
   2 # Copyright (c) 2015, 2020, Oracle and/or its affiliates. All rights reserved.
   3 # DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
   4 #
   5 # This code is free software; you can redistribute it and/or modify it
   6 # under the terms of the GNU General Public License version 2 only, as
   7 # published by the Free Software Foundation.
   8 #
   9 # This code is distributed in the hope that it will be useful, but WITHOUT
  10 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
  11 # FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
  12 # version 2 for more details (a copy is included in the LICENSE file that
  13 # accompanied this code).
  14 #
  15 # You should have received a copy of the GNU General Public License version
  16 # 2 along with this work; if not, write to the Free Software Foundation,
  17 # Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
  18 #
  19 # Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
  20 # or visit www.oracle.com if you need additional information or have any
  21 # questions.
  22 #
  23 
  24 config.execSuffix=
  25 # pattern will be replaced with the PID
  26 config.getChildren.pattern=%p
  27 config.getChildren.app=pgrep
  28 config.getChildren.args=-P %p
  29 ################################################################################
  30 # prepareProcess info to gather
  31 ################################################################################
  32 onTimeout=\
  33   native.pmap \
  34   native.pfiles \
  35   native.stack native.core
  36 ################################################################################
  37 # solaris specific
  38 ################################################################################
  39 native.pattern=%p
  40 native.javaOnly=false
  41 
  42 native.pmap.app=pmap
  43 native.pmap.args=-F %p
  44 
  45 native.pfiles.app=pfiles
  46 native.pfiles.args=-F %p
  47 
  48 # native.locks  TODO find 'analog for solaris' for Linux lslocks
  49 
  50 native.stack.app=pstack
  51 native.stack.args=-F %p
  52 native.stack.params.repeat=6
  53 
  54 # has to be the last command
  55 native.core.app=kill
  56 native.core.args=-ABRT %p
  57 ################################################################################
  58 # environment info to gather
  59 ################################################################################
  60 environment=\
  61   users.current users.logged users.last \
  62   disk \
  63   env \
  64   system.dmesg system.prtconf system.sysdef \
  65   process.ps process.top \
  66   memory.swap memory.vmstat.default memory.vmstat.statistics memory.pagesize \
  67   net.netstat.av net.netstat.m net.netstat.s net.netstat.i net.ifconfig \
  68   screenshot
  69 ################################################################################
  70 # common unix
  71 ################################################################################
  72 users.current.app=id
  73 users.current.args=-a
  74 users.logged.app=who
  75 users.logged.args=-a
  76 users.last.app=last
  77 users.last.args=-10
  78 
  79 disk.app=df
  80 disk.args=-h
  81 
  82 env.app=env
  83 
  84 system.dmesg.app=dmesg
  85 system.prtconf.app=prtconf
  86 system.sysdef.app=sysdef
  87 
  88 memory.swap.app=swap
  89 memory.swap.args=-l
  90 
  91 process.ps.app=ps
  92 process.ps.args=-Leo pid,lwp,ppid,tty,s,wchan,pcpu,time,stime,pmem,vsz,osz,rss,args
  93 
  94 process.top.app=top
  95 process.top.args=-b -n
  96 
  97 memory.vmstat.app=vmstat
  98 memory.vmstat.default.args=3 3
  99 memory.vmstat.statistics.args=-s
 100 
 101 memory.pagesize.app=pagesize
 102 
 103 # TODO: how to start prstat to show statistics and exit?
 104 # prstat.app=prstat
 105 # prstat.args=-a
 106 
 107 net.netstat.app=netstat
 108 net.netstat.av.args=-av
 109 net.netstat.m.args=-m
 110 net.netstat.s.args=-s
 111 net.netstat.i.args=-i 1 5
 112 net.ifconfig.app=/sbin/ifconfig
 113 net.ifconfig.args=-a
 114 
 115 # var robot = new new java.awt.Robot();
 116 # var ge = java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment();
 117 # var bounds = ge.getDefaultScreenDevice().getDefaultConfiguration().getBounds();
 118 # var file = new java.io.File("screen.png");
 119 # javax.imageio.ImageIO.write(robot.createScreenCapture(bounds, "png", file);
 120 screenshot.app=bash
 121 screenshot.args=-c\0echo 'javax.imageio.ImageIO.write(new java.awt.Robot().createScreenCapture(java.awt.GraphicsEnvironment.getLocalGraphicsEnvironment().getDefaultScreenDevice().getDefaultConfiguration().getBounds()), "png", new File("screen.png"));' | jshell -
 122 screenshot.args.delimiter=\0
 123 ################################################################################