How to obtain system information in a Java environment

How to obtain system information in a Java environment

  

Hello,


Sometimes during the course of troubleshooting a support case, one of our support engineers might ask you to obtain system information. This post explains how.


  1. download the script here (*)
  2. as root, run it (you may need to chmod it to 700 first)
  3. if a heap dump is required, the support engineer will let you know.
  4. send Support the resulting file


The output of the script should look something like this:



Any errors that occurred will be displayed after this, and if this happens you should contact support to overcome these errors.


This script collects outsystems platform logs, application server logs, some system information (Java version being used, memory, etc), application server configuration and other useful data for troubleshooting problems in a java installation.


Best regards,

Ricardo Silva


* alternatively, run the following commands (if you have internet access):


wget -O collect_stats.sh https://outsystemssupport.s3.amazonaws.com/public/collect_stats.sh ; chmod +x collect_stats.sh ; dos2unix collect_stats.sh
How about a full description of all files generated with this script? It would be helpfull when explaining to a Datacenter.
This will obtain general machine information like CPU info, memory, which java is installed, iptables rules.

It will also fetch application server and outsystems platform logs, status and configuration (thread dumps, configuration files). Optionally it can take a heap dump of the application server.

Further information can be added as additional information is identified as relevant to troubleshoot issues.
Thank you Ricardo. Could you please tell me what are the names of the files for thread dump and memory dump?
The heap dump for jboss will be called heap.hprof . There will be several thread dumps, all started with thread_ and then the name of where the thread dump relates to.

For example, threads_JBoss.log or threads_outsystems.hubedition.scheduler.Service.log

Best regards,
Ricardo Silva

Hi

When we are running collect_stats.sh file, it throwing error "This account is currently not available." and no dump is generated. what could be the reason for this?

Collect_stats.sh execution log..

Gathering JBoss (Process 29787) info...

* CPU statistics

* Thread Stacks

This account is currently not available.

This account is currently not available.

* Configurations

Gathering OutSystems Services info ...

Include JBoss Memory Dump? [n] y

Gathering JBoss (Process 29787) memory dump...

This account is currently not available.

This account is currently not available.


Hi Chetan,


It looks like that your JBoss user is not allowed to login and run the required commands ( a shell is required).


Could you check in your /etc/passwd file if jboss user is being denied to login? e.g.
jboss:x:501:501:JBoss user account, created by OutSystems:/home/jboss:/bin/nologin


Granting a shell to jboss user should fix your issue. e.g.

jboss:x:501:501:JBoss user account, created by OutSystems:/home/jboss:/bin/bash


Kind regards,

IG



Hi IG,

passwd file is showing these two entries, could you please let me know should be done to fix the issue?

jboss:x:185:185:JBoss:/var/lib/jbossas:/sbin/nologin
outsystems:x:500:500:OutSystems Platform account:/home/outsystems:/bin/bash

Regards

Chetan



Ivo Gonçalves wrote:

Hi Chetan,


It looks like that your JBoss user is not allowed to login and run the required commands ( a shell is required).


Could you check in your /etc/passwd file if jboss user is being denied to login? e.g.
jboss:x:501:501:JBoss user account, created by OutSystems:/home/jboss:/bin/nologin


Granting a shell to jboss user should fix your issue. e.g.

jboss:x:501:501:JBoss user account, created by OutSystems:/home/jboss:/bin/bash


Kind regards,

IG





Hi Chetan,


Updating jboss:x:185:185:JBoss:/var/lib/jbossas:/sbin/nologin to jboss:x:185:185:JBoss:/var/lib/jbossas:/bin/bash should fix your error.


Kind regards,

IG