# Stack Monitoring not working properly

**URL:** https://discuss.elastic.co/t/stack-monitoring-not-working-properly/242516
**Category:** Elastic Cloud on Kubernetes (ECK)
**Created:** [July 24, 2020, 1:25pm UTC](https://discuss.elastic.co/t/stack-monitoring-not-working-properly/242516 "2020-07-24T13:25:31Z")
**Posts on this page:** 4
**Page:** 1

<div class="post-metadata">

### Author: ![raulgs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/raulgs/32/68308_2.png) [@raulgs](https://discuss.elastic.co/u/raulgs)
#### Post date: [July 24, 2020, 1:25pm UTC](https://discuss.elastic.co/t/stack-monitoring-not-working-properly/242516/1 "2020-07-24T13:25:31Z")

</div>

I am working currently on getting the stack monitoring up and running.  
According to what I have read so far, all I need to do for that is set the `xpack.monitoring.collection.enabled` to `true`. So like that:

```auto
apiVersion: elasticsearch.k8s.elastic.co/v1
kind: Elasticsearch
metadata:
  name: elastic
spec:
  version: {{ $.Chart.AppVersion }}
  secureSettings:
  - secretName: elastic-es-gcs-credentials
  nodeSets:
  - name: master
    count: 3
    config:
      node.master: true
      node.data: false
      node.ingest: false
      node.ml: false
      node.store.allow_mmap: false
      xpack.monitoring.collection.enabled: true
....

```

Same is enabled for the data nodes and for kibana.  
On the first run it looked pretty good. However, after a few days I go again the default via:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/b/0/b08de8952b28eaddbbb7869cf09817642a65b79a.png)

I check that the parameters are still in place and the indicies exist:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/2/421c926d4364237a6bc85ff5493958c8ceba3b47.png)

As we can see everything is there. However, Kibana says no monitoring data are there. If I go an delete the monitoring indices of for example today manually, it works again... until it stops in one or two days again...

Any idea what could be going wrong here?

---

<div class="post-metadata">

### Author: ![rugenl](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rugenl/32/12887_2.png) [@rugenl](https://discuss.elastic.co/u/rugenl)
#### Post date: [July 24, 2020, 3:05pm UTC](https://discuss.elastic.co/t/stack-monitoring-not-working-properly/242516/2 "2020-07-24T15:05:04Z")

</div>

Go thru the "self monitoring" setup and see if that fixes it. xpack monitoring is "self monitoring", I think that is being replaced with metricbeat modules for each component. I'm not sure it's "better" yet 🙂

---

<div class="post-metadata">

### Author: ![a-bra](https://avatars.discourse-cdn.com/v4/letter/a/7bcc69/32.png) [@a-bra](https://discuss.elastic.co/u/a-bra)
#### Post date: [August 10, 2020, 12:38pm UTC](https://discuss.elastic.co/t/stack-monitoring-not-working-properly/242516/3 "2020-08-10T12:38:58Z")

</div>

I just had the same problem. My guess is that you have created an index template under the \* pattern that changes the number of shards for all new indices. At least in my case, when either of the monitoring indices had more than 1 shard, it would not appear at all in the monitoring page. To confirm that, I deleted the pattern and the index(make sure you have backups or don't need the data), and as soon as the new index was created with 1 shard/1 replica, the monitoring page works again.  
You can also confirm if this is the issue by increasing the time range until the last time that you remember the monitoring working.  
To solve it, I created a different index template for the monitoring indices with no configuration, and reduced the priority of the one with the \* pattern.

---

<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: [November 4, 2022, 8:07am UTC](https://discuss.elastic.co/t/stack-monitoring-not-working-properly/242516/4 "2022-11-04T08:07:36Z")

</div>


