Git Product home page Git Product logo

Comments (4)

cdenneen avatar cdenneen commented on September 26, 2024

@treydock I think docs will help but what’s the exact purpose of these parameters? Are the eventually going to populate metadata?

from puppet-module-sensuclassic.

treydock avatar treydock commented on September 26, 2024

They populate /etc/sensu/conf.d/client.json, is there something else they should be doing? The values are passed to sensu_client_config type which just manages the client.json file.

The vagrant tests in this module use this:

$client_ec2 = {
    'instance-id' => 'i-2102113',
  }
  $client_puppet = {
    'nodename' => $::fqdn,
  }
  $client_chef = {
    'nodename' => $::fqdn,
  }
  $client_servicenow = {
    'configuration_item' => {
      'name' => 'ServiceNow test',
      'os_version' => '16.04',
    },
  }
  class { 'sensuclassic':
    rabbitmq_password => 'correct-horse-battery-staple',
    rabbitmq_host     => '192.168.156.10',
    rabbitmq_vhost    => '/sensu',
    subscriptions     => 'all',
    client_address    => $ip,
    client_ec2        => $client_ec2,
    client_chef       => $client_chef,
    client_puppet     => $client_puppet,
    client_servicenow => $client_servicenow,
    filters           => $filters,
    filter_defaults   => $filter_defaults,
    version           => 'latest',
  }

And generates this:

{
  "client": {
    "address": "192.168.156.11",
    "chef": {
      "nodename": "el7-client.example.com"
    },
    "ec2": {
      "instance-id": "i-2102113"
    },
    "http_socket": {
    },
    "keepalive": {
    },
    "name": "el7-client.example.com",
    "puppet": {
      "nodename": "el7-client.example.com"
    },
    "safe_mode": false,
    "servicenow": {
      "configuration_item": {
        "name": "ServiceNow test",
        "os_version": "16.04"
      }
    },
    "socket": {
      "bind": "127.0.0.1",
      "port": 3030
    },
    "subscriptions": [
      "all"
    ]
  }
}

Per the docs this seems to be the behavior that should be happening:

https://docs.sensu.io/sensu-core/1.7/reference/clients/#ec2-attributes

Are you seeing something different?

from puppet-module-sensuclassic.

cdenneen avatar cdenneen commented on September 26, 2024

That is the exact behavior I’m seeing but it’s the same behavior I saw before with

$client_custom = {
  ‘ec2’ => {
    'instance-id' => 'i-2102113',
  },
  ‘puppet’ => {
    'nodename' => $::fqdn,
  },
  ‘chef’ => {
    'nodename' => $::fqdn,
  },
  ‘servicenow’ => {
    'configuration_item' => {
      'name' => 'ServiceNow test',
      'os_version' => '16.04',
    },
  },
}

Producing the same client.json

from puppet-module-sensuclassic.

treydock avatar treydock commented on September 26, 2024

Then what you're seeing exactly what I'd expect given the design of the Puppet code. Your ec2 in client_custom should behave the same before as using client_ec2 after the change to Puppet module. Because client_custom is a "catch all" for anything not defined as a valid property, it has to exclude keys that map to valid properties otherwise custom would end up being populated with data that would conflict with properties.

If you'd expect to see something different let me know. So far I think the only change to this module I am seeing being needed is to update documentation to reflect the behavior of client_custom with regard to filtering out keys.

from puppet-module-sensuclassic.

Related Issues (9)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.