# State metric for a Java Tomcat process always reporting as "sleeping"

**URL:** <https://discuss.elastic.co/t/state-metric-for-a-java-tomcat-process-always-reporting-as-sleeping/291077>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [December 6, 2021, 7:43pm UTC](https://discuss.elastic.co/t/state-metric-for-a-java-tomcat-process-always-reporting-as-sleeping/291077 "2021-12-06T19:43:01Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Kevin\_Brunette](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_brunette/32/84375_2.png) [@Kevin\_Brunette](https://discuss.elastic.co/u/Kevin_Brunette)\
**Post date:** [December 6, 2021, 7:43pm UTC](https://discuss.elastic.co/t/state-metric-for-a-java-tomcat-process-always-reporting-as-sleeping/291077/1 "2021-12-06T19:43:01Z")

</div>

I'm running metricbeat oss 7.14.0 on Ubuntu 18.04.6 (Bionic Beaver) LTS and attempting to tell if my Java Tomcat is running or down however; the "state" of the process always reports as "sleeping" regardless of whether the process is running or has been stopped.

My Metricbeat config is the following:

```auto
########################## Metricbeat Configuration ###########################
# This file is a full configuration example documenting all non-deprecated
# options in comments. For a shorter configuration example, that contains only
# the most common options, please see metricbeat.yml in the same directory.
#
# You can find the full configuration reference here:
# https://www.elastic.co/guide/en/beats/metricbeat/index.html
#========================== Modules configuration =============================
metricbeat.modules:
#-------------------------------- System Module --------------------------------
- module: system
  metricsets:
    - cpu # CPU usage
    - load # CPU load averages
    - memory # Memory usage
    - network # Network IO
    - process # Per process metrics
    - process_summary # Process summary
    - uptime # System Uptime
    - socket_summary # Socket summary
    #- core # Per CPU core usage
    - diskio # Disk IO
    - filesystem # File system usage for each mountpoint
    - fsstat # File system summary metrics
    #- raid # Raid
    - socket # Sockets and connection info (linux only)
    - service # systemd service information
  enabled: true
  period: 60s
  processes: ['.*']

  # Configure the mount point of the host's filesystem for use in monitoring a host from within a container
  #system.hostfs: "/hostfs"
  # Configure the metric types that are included by these metricsets.
  cpu.metrics: ["percentages","normalized_percentages"] # The other available option is ticks.
  core.metrics: ["percentages"] # The other available option is ticks.

processors:
  - add_host_metadata:
  - add_cloud_metadata:

setup.dashboards.enabled: false
setup.template.enabled: false
setup.ilm.enabled: false

output.elasticsearch:
  hosts: ["https://myelasticelastic:1000"]
  username: "<omitted>"
  password: "<omitted>"
  compression_level: 4
  slow_start: true

```

I've started and stopped the process and it always reports as "sleeping". Is this a bug? Is there a better way to tell if the process is down or up?

---

<div class="post-metadata">

**Author:** ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)\
**Post date:** [December 7, 2021, 3:32pm UTC](https://discuss.elastic.co/t/state-metric-for-a-java-tomcat-process-always-reporting-as-sleeping/291077/2 "2021-12-07T15:32:24Z")

</div>

Apart from a permissions issue, you can try the Tomcat module [Tomcat module | Metricbeat Reference [7.15] | Elastic](https://www.elastic.co/guide/en/beats/metricbeat/current/metricbeat-module-tomcat.html) in the Xpack release, it's also free if that's your concern.

---

<div class="post-metadata">

**Author:** ![Kevin\_Brunette](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kevin_brunette/32/84375_2.png) [@Kevin\_Brunette](https://discuss.elastic.co/u/Kevin_Brunette)\
**Post date:** [December 10, 2021, 5:50pm UTC](https://discuss.elastic.co/t/state-metric-for-a-java-tomcat-process-always-reporting-as-sleeping/291077/3 "2021-12-10T17:50:20Z")

</div>

Is there a permission that needs to be set on the host in order for the "state" metric to be accurately calculated?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [January 7, 2022, 7:50pm UTC](https://discuss.elastic.co/t/state-metric-for-a-java-tomcat-process-always-reporting-as-sleeping/291077/4 "2022-01-07T19:50:31Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
