Mackerel blog #mackerelio

The Official Blog of Mackerel

Environment variables can now be specified for command execution via plugin etc.

Hello! Mackerel team CRE Inoue (id:a-know) here.

Only half a month left in 2017 and I’m sure everyone’s busy with work and year-end parties. The Mackerel team is keeping busy as we continue with our consecutive weekly releases. Next week will be our last update of this year.

Let's survive this home stretch of 2017 so that we can relax and enjoy the end of the year.

Now on to this week’s update information.

Environment variables can now be specified for command execution via plugin

Mackerel plugins can be used by adding the following configuration to the conf file.

[plugin.metrics.mysql]
command = "ruby /path/to/mysql.rb --username user --password password"

The agent executes the character array specified in command, and a post is made to Mackerel based on the resulting stdout (or exit code). This is a very useful mechanism.

With this week's update, you can now specify environment variables for command execution with this plugin mechanism. Below is the specification method.

[plugin.metrics.mysql]
command = "ruby /path/to/mysql.rb"
env = { "MYSQL_USERNAME" = "user", "MYSQL_PASSWORD" = "password" }

We will be making updates, even for the official plugins that are currently provided, so that password configuration and such for middleware can be performed via environment variables.

This feature can be used with check plugins and metadata plugins as well!

The password strength policy was reviewed and now passwords with weak security strength can be used

With this week’s release, updates were made for the following two points.

  • The strength policy for password configuration was reviewed
  • Although it was previously impossible to set a password with weak security strength, this can now be ignored

Additionally, it’s currently possible to remove password authentication in Mackerel if configured with GitHub or Google. Hopefully you can utilize this in combination with the option to ignore the password strength check.

Updates for Mackerel related OSS

Updates for various Mackerel related OSS were made this week and the details follow below. As always, thank you to everyone who contributed!

mackerel-agent v0.48.1

  • Environment variables can now be specified for command execution via plugin (described above)
  • The cloud_platform option was added to select targets for gathering laaS meta information and obtaining custom_identifier

mackerel-agent-plugins v0.40.0

  • mackerel-plugin-h2o was added
  • [redis] The CONFIG command that is internally used by the plugin is now available even if it can not be used as is.
    • Configured with the -config-command option
  • [redis] Replication delay metrics are now obtainable

mkr v0.24.1