Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Labels in /etc/sensu/agent.yml not reflected in Sensu UI #5059

Open
amitbasuri opened this issue Apr 3, 2024 · 1 comment
Open

Labels in /etc/sensu/agent.yml not reflected in Sensu UI #5059

amitbasuri opened this issue Apr 3, 2024 · 1 comment

Comments

@amitbasuri
Copy link

Expected Behavior

Labels defined in the /etc/sensu/agent.yml should appear in the Sensu UI for the respective agent.

Current Behavior

The Sensu UI does not display the labels defined in the agent.yml file. When the Sensu agent is started with the --label flag, labels appear in the UI, but not when they're configured directly in the agent.yml.

Possible Solution

A potential cause might be the Sensu UI not reloading or recognizing updates made to the agent.yml configuration file.

Steps to Reproduce (for bugs)

  1. Configure labels in /etc/sensu/agent.yml.
  2. Restart sensu-agent using systemctl.
  3. Observe that labels do not appear in the Sensu UI.
  4. Stop the agent and restart with the --labels flag, noting that labels now appear in the UI.

Context

This issue is causing difficulties in dynamically managing labels through configuration management tools like Ansible. My objective is to manage agent configuration solely through Ansible without needing additional flags at startup.

Your Environment

My Setup

sudo cat  /etc/sensu/agent.yml
---
#
# Managed by Ansible - do NOT edit this file manually!
#

##
# Sensu agent configuration
##
backend-url:
- ws://<sensu-backend>:8081

keepalive-interval: 5
keepalive-timeout: 10
labels:
    node_tag: mix-node-0
name: my-agent

Ansible

- name: Install, configure and run Sensu agents
  hosts: agents
  become: true
  tasks:
    - name: Install agent
      include_role:
        name: sensu.sensu_go.agent
      vars:
        agent_config:
          name: my-agent
          keepalive-interval: 5
          keepalive-timeout: 10
          labels:
            node_tag: "{{ node_tag }}"
@elfranne
Copy link

(not very familiar with Ansible)
I would try with the official module for Ansible: https://github.com/sensu/sensu-go-ansible

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants