Profile Image
Jose Antonio Medrano

Issue with Tomcat and ycrash

I want to setup a ycrash monitoring on a server that has multiple Java standalone applications, and also it has a Tomcat server.

I have been playing with different options, but none of those is helping to capture the metrics from tomcat.

If I do a ps -ef | grep tomcat, this is what I get:

 

tomcat      5612     1 26 01:31 ?        05:08:35 /usr/java/bin/java -Djava.util.logging.config.file=/usr/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Dorg.apache.catalina.connector.CoyoteAdapter.ALLOW_BACKSLASH=true

-XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps  

-Dignore.endorsed.dirs= -classpath {bootstrap_jar_localtion}:{tomcat_julijar_location} -Dcatalina.base={tomcat_home} -Dcatalina.home={tomcat_home} -Djava.io.tmpdir={tomcat_home}/temp org.apache.catalina.startup.Bootstrap start

 

yc-agent.yaml file:

version: '1'
options:
   k: 
   s: 
   j: /usr/java/
   port: 
   address: 
   m3Frequency: 3m
   hd: true
   gcPath: /usr/tomcat/logs
   processTokens:
     - /usr/java/bin/java

 

I have tried:

Run the yc command: 

     yc -p tomcat -c yc-agent.yaml

     yc -p 5612 -c yc-agent.yaml

 

If I run any of those, I got a message saying:

 

./yc -c yc-agent.yaml -a tomcat
Wed Oct  4 15:05:45 EDT 2023 INF yc agent version: yc_agent_2.16.1
Wed Oct  4 15:05:45 EDT 2023 INF yc script starting...
Wed Oct  4 15:05:46 EDT 2023 INF startup attendance task
Is completed: true
Resp: 
status code 200
true

--------------------------------

Wed Oct  4 15:05:46 EDT 2023 INF WARNING: nothing can be done

 

Or

Ignored errors: osVersion err: fork/exec /usr/bin/{randomFolder}/uname: exec format error, previous err: <nil>

 

Running:

nohup yc -m3 -c yc-agent.yaml > /tmp/yc_agent.log 2>&1

 

Returns a message:

process failed, fork/exec /usr/bin/{randomFolder}/ps: exec format error

 

Something that I could be missing?

 

 

  • ycrash

  • tomcat

Please Sign In or to post your comment or answer

Profile Image

Sandeep Sudheer

 

Please make the following modifications to the yc-agent.yaml file:
version: '1'
options:
   k:
   s:
   j: /usr/java/
   port:
   address:
   m3: true
   m3Frequency: 3m
   hd: true
   gcPath: /usr/tomcat/logs
   processTokens:
   - tomcat_home$TOMCAT

 

I've updated the processTokens section to search for a unique string related to the Tomcat process, namely 'tomcat_home'. Additionally, I've included an application name 'TOMCAT' for identification purposes. The M3 mode has also been enabled by setting it to 'true' in the configuration file.

When you execute the yc agent file, if you specify the processTokens, there is no need to pass the '-p' argument in the command line.

To run the command, use the following:

yc -c yc-agent.yaml

Got something else on mind? Post Your Question

Not the answer you're looking for? Browse other questions tagged
  • ycrash

  • tomcat