Agent Arguments

Here is the complete list of arguments that you can pass to the yCrash agent: 

ArgumentDescription
-a stringThe APP Name of the target
-c stringThe config file path to load
-caCertPath string If you would like to configure separate CA certificates location, you can specify it in this property. 
-cmd valueThe command to be executed, should be paired with ‘-urlParams’ together
-dDelete logs folder created during analyse, default is false
-gcPath stringAgent by default captures the GC logs from the JVM directly. When you pass this argument, the agent will not capture GC log from the JVM, rather it will read the gc log file given in the path and transmit it to the yCrash server.
If you already have a home grown script (or a mechanism) through which you are capturing GC log and doesn’t want agent to capture the GC log, you can use this argument. You can continue to use your home-grown script to capture the GC log and pass the location of the captured GC log file through this -gcPath argument. example: -gcPath /opt/server1/myGCLog.gc
-hdWhen this argument is passed heap dump is captured. Capturing heap dumps are intrusive operations, it will pause the JVM momentarily. So you want to capture heap dumps only if there are memory related problems. Default value is ‘false’.
-hdPath stringAgent by captures the heap dump from the JVM directly when ‘-hd’ argument is passed. When you pass this argument, the agent will not capture heap dump from the JVM, rather it will read the heap dump file given in the path and transmit it to the yCrash server.
If you already have a home grown script (or a mechanism) through which you are capturing heap dump and doesn’t want agent to capture the heap dump, you can use this argument. You can continue to use your home-grown script to capture the heap dump and pass the location of the captured heap dump file through this -hdPath argument. example: -hdPath /opt/server1/myhd.hprof
-j stringThe java home path to be used. Default will try to use os env ‘JAVA_HOME’ if ‘JAVA_HOME’ is not empty, for example: /usr/lib/jvm/java-8-openjdk-amd64
-k stringThe API Key that will be used to make API requests, for example: tier1app@12312-12233-1442134-112
-p intThe process Id of the target, for example: 3121
-s stringThe server url that will be used to upload data, for example: https://ycrash.companyname.com
-tdPath stringAgent by default captures the thread dump from the JVM directly. When you pass this argument, the agent will not capture heap dump from the JVM, rather it will read the thread dump file given in the path and transmit it to the yCrash server.
If you already have a home grown script (or a mechanism) through which you are capturing thread dump and doesn’t want agent to capture the thread dump, you can use this argument. You can continue to use your home-grown script to capture the thread dump and pass the location of the captured thread dump file through this -tdPath argument. example: -tdPath /opt/server1/myThreadDump.txt
-urlParams valueThe params to be added at the end of upload request url, should be paired with ‘-cmd’ together
-verifySSL boolean yCrash agent validates the SSL certificate presented by the yCrash server. Sometimes for testing purposes, you might use self-signed certificates in the yCrash server. In those circumstances SSL validation will fail in the yCrash agent. In those cases you can set this value to tbe ‘false’. Default value is ‘true’.
-versionShow the version of this program

Example:

yc -k buggycompany@e0941234-c3eb-1234-8234-f0dd10567890 -s http://ycrash.yourcompany.com/ -a aps -p 15936

Any arguments that you pass in command prompt can be passed through config file as well. So it’s recommended to pass the arguments that don’t change across your servers/environment in the YAML config file. Example -k, -j, -d… And keep only the arguments that change in the command prompt. Example -p

Here is how you pass YAML config file to the yCrash agent:

yc -c C:\workspace\tmp\yc-config.yaml -p 1456

The name of the option keys in the YAML config file is same as the name of argument options. Here is an example for YAML config file:

version: "1"
options:
  a: name
  d: false
  hd: false
  j: /usr/lib/jvm/java-8-openjdk-amd64
  k: tier1app@12312-12233-1442134-112
  s: https://ycrash.ourcompany.io
tier1appteam

One thought on “Agent Arguments

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s