Skip to content

Commit

Permalink
git subrepo pull public
Browse files Browse the repository at this point in the history
subrepo:
  subdir:   "public"
  merged:   "0b1e85e4"
upstream:
  origin:   "git@github.com:mackerelio/documents.git"
  branch:   "master"
  commit:   "0b1e85e4"
git-subrepo:
  version:  "0.4.0"
  origin:   "???"
  commit:   "???"
  • Loading branch information
tukaelu committed Aug 20, 2019
2 parents 025d48c + 0b1e85e commit 3ee6a56
Show file tree
Hide file tree
Showing 18 changed files with 434 additions and 42 deletions.
4 changes: 2 additions & 2 deletions content/api-docs/entry/alerts.md
Expand Up @@ -56,8 +56,8 @@ Alerts will be in chronological order of when they were generated from newest to
| `id` | *string* | alert's ID |
| `status` | *string* | alert's current status: `"OK"`, `"CRITICAL"`, `"WARNING"`, or `"UNKNOWN"` |
| `monitorId` | *string* | ID of the monitor that generated the alert |
| `type` | *string* | the type of monitor: connectivity (`"connectivity"`), host metric (`"host"`), service metric (`"service"`), external monitor (`"external"`), check monitor (`"check"`) or expression monitor (`"expression"`) |
| `hostId` | *string* | [optional] the associated host ID. only exists when the type of monitor is either `"connectivity"`, `"host"`, or `"check"` |
| `type` | *string* | the type of monitor: connectivity (`"connectivity"`), host metric (`"host"`), service metric (`"service"`), external monitor (`"external"`), check monitor (`"check"`), expression monitor (`"expression"`), or anomaly detection for roles (`"anomalyDetection"`) |
| `hostId` | *string* | [optional] the associated host ID. only exists when the type of monitor is either `"connectivity"`, `"host"`, `"check"`, or `"anomalyDetection"` |
| `value` | *number* | [optional] value of the monitoring target. only exists when the type of monitor is `"host"`, or `"service"` or when there is a reponse time configuration in `"external"` |
| `message` | *string* | [optional] monitoring target's message. only exists when the type of monitor is either `"check"` or `"external"` |
| `reason` | *string* | [optional] reason that the alert was closed. does not exist if the alert is unresolved. |
Expand Down
108 changes: 103 additions & 5 deletions content/api-docs/entry/monitors.md
Expand Up @@ -37,6 +37,7 @@ The input procedure varies depending on the monitoring target.
<li><a href="#create-service-metric-monitoring">Service metric monitoring</a></li>
<li><a href="#create-external-monitoring">External monitoring</a></li>
<li><a href="#create-expression-monitoring">Expression monitoring</a></li>
<li><a href="#create-anomaly-detection-monitoring">Monitoring with Anomaly Detection for Roles</a></li>
</ul>

<h3 id="create-host-metric-monitoring">Host metric monitoring</h3>
Expand All @@ -46,7 +47,7 @@ The input procedure varies depending on the monitoring target.
| KEY | TYPE | DESCRIPTION |
| ------------ | -------- | -------------------------------- |
| `type` | *string* | constant string `"host"` |
| `name` | *string* | arbitrary name that can be seen in the list of monitors and elsewhere |
| `name` | *string* | arbitrary name that can be referenced from the monitors list, etc. |
| `memo` | *string* | [optional] notes for the monitoring configuration |
| `duration` | *number* | average value of the designated interval (in minutes) will be monitored. valid interval (1 to 10 min.) |
| `metric` | *string* | name of the host metric targeted by monitoring. by designating a specific constant string, comparative monitoring is possible [*1](#comparative-monitoring) |
Expand Down Expand Up @@ -195,7 +196,7 @@ This function disables notifications in monitoring. Alerts occur in response to
| KEY | TYPE | DESCRIPTION |
| ------------ | -------- | -------------------------------- |
| `type` | *string* | constant string `"connectivity"` |
| `name` | *string* | [optional] arbitrary name that can be seen in the list of monitors and elsewhere. The default value is `connectivity`. |
| `name` | *string* | [optional] arbitrary name that can be referenced from the monitors list, etc. The default value is `connectivity`. |
| `memo` | *string* | [optional] notes for the monitoring configuration |
| `scopes` | *array[string]* | [optional] The service name or role details name of the monitoring target. [*2](#service-name) |
| `excludeScopes` | *array[string]* | [optional] The service name or role details name of the monitoring exception. [*2](#service-name) |
Expand Down Expand Up @@ -283,7 +284,7 @@ This function disables notifications in monitoring. Alerts occur in response to
| KEY | TYPE | DESCRIPTION |
| ------------ | -------- | -------------------------------- |
| `type` | *string* | constant string `"service"` |
| `name` | *string* | arbitrary name that can refer to monitors list, etc. |
| `name` | *string* | arbitrary name that can be referenced from the monitors list, etc. |
| `memo` | *string* | [optional] notes for the monitoring configuration |
| `service` | *string* | name of the service targeted by monitoring |
| `duration` | *number* | monitors the average value of the designated number of points. range: most recent 1~10 points |
Expand Down Expand Up @@ -398,7 +399,7 @@ This function disables notifications in monitoring. Alerts occur in response to
| KEY | TYPE | DESCRIPTION |
| ---------------------- | ---------- | -------------------------------- |
| `type` | *string* | constant string `"external"` |
| `name` | *string* | arbitrary name that can refer to monitors list, etc. |
| `name` | *string* | arbitrary name that can be referenced from the monitors list, etc. |
| `memo` | *string* | [optional] notes for the monitoring configuration |
| `url` | *string* | monitoring target URL |
| `method` | *string* | [optional] request method, one of `GET`, `POST`, `PUT`, `DELETE`. If omitted, `GET` method is used. |
Expand Down Expand Up @@ -518,7 +519,7 @@ In order to monitor response time, it's necessary to assign `responseTimeWarning
| KEY | TYPE | DESCRIPTION |
| ------------ | -------- | -------------------------------- |
| `type` | *string* | constant string `"expression"` |
| `name` | *string* | arbitrary name that can be seen in the list of monitors and elsewhere |
| `name` | *string* | arbitrary name that can be referenced from the monitors list, etc. |
| `memo` | *string* | [optional] notes for the monitoring configuration |
| `expression` | *string* | Expression of the monitoring target. Only valid for graph sequences that become one line. |
| `operator` | *string* | determines the conditions that state whether the designated variable is either big or small. the observed value is on the left of ”>”or ”<” and the designated value is on the right|
Expand Down Expand Up @@ -685,6 +686,103 @@ In order to monitor response time, it's necessary to assign `responseTimeWarning
- each field is the same as when the [monitor was created](#create)
- list is ordered as monitor type -> name (same as the list of monitors on mackerel.io)

<h3 id="create-anomaly-detection-monitoring">Monitoring with Anomaly Detection for Roles</h3>

#### Input (when monitoring with Anomaly Detection for Roles)

| KEY | TYPE | DESCRIPTION |
| ------------ | -------- | -------------------------------- |
| `type` | *string* | constant string `"anomalyDetection"` |
| `name` | *string* | arbitrary name that can be referenced from the monitors list, etc. |
| `memo` | *string* | [optional] notes for the monitoring configuration |
| `scopes` | *array[string]* | [optional] monitoring target’s service name and role details name [*2](#service-name) |
| `warningSensitivity` | *string* | the sensitivity (`insensitive`, `normal`, or `sensitive`) that generates warning alerts. |
| `criticalSensitivity` | *string* | the sensitivity (`insensitive`, `normal`, or `sensitive`) that generates critical alerts. |
| `maxCheckAttempts` | *number* | [optional] number of consecutive Warning/Critical instances before an alert is made. Default setting is 3 (1-10) |
| `trainingPeriodFrom` | *number* | [optional] Specified training period (Uses metric data starting from the specified time) |
| `notificationInterval` | *number* | [optional] the time interval (in minutes) for re-sending notifications. If this field is omitted, notifications will not be re-sent. |
| `isMute` | *boolean* | [optional] whether monitoring is muted or not |

##### Example Input

```json
{
"type": "anomalyDetection",
"name": "anomaly detection",
"memo": "my anomaly detection for roles",
"scopes": [
"myService: myRole"
],
"warningSensitivity": "insensitive",
"maxCheckAttempts": 3
}
```

#### Response (Monitoring with Anomaly Detection for Roles)

##### Success

```json
{
"id" : "2cSZzK3XfmG",
"type": "anomalyDetection",
"name": "anomaly detection",
"memo": "my anomaly detection for roles",
"scopes": [
"myService: myRole"
],
"warningSensitivity": "insensitive",
"maxCheckAttempts": 3
}
```

`id` will be given and returned

##### Error

<table class="default api-error-table">
<thead>
<tr>
<th class="status-code">STATUS CODE</th>
<th class="description">DESCRIPTION</th>
</tr>
</thead>
<tbody>
<tr>
<td>400</td>
<td>when the input is in a format that can’t be received</td>
</tr>
<tr>
<td>400</td>
<td>when the <code>name</code> is empty</td>
</tr>
<tr>
<td>400</td>
<td>when the<code>memo</code>exceeds 250 characters</td>
</tr>
<tr>
<td>400</td>
<td>when the specified service name or role details name is not registered in <code>scope</code> or <code>excludeScopes</code></td>
</tr>
<tr>
<td>400</td>
<td>when the specified <code>warningSensitivity</code> or <code>criticalSensitivity</code> is not <code>insensitive</code> / <code>normal</code> / <code>sensitive</code></td>
</tr>
<tr>
<td>400</td>
<td>when the notification re-sending time interval is not set at 10 minutes or more</td>
</tr>
<tr>
<td>400</td>
<td>when a future vaule is specified for <code>trainingPeriodFrom</code></td>
</tr>
<tr>
<td>403</td>
<td>when the API doesn't have the required permissions</td>
</tr>
</tbody>
</table>

----------------------------------------------

<h2 id="get">Get monitor configurations</h2>
Expand Down
4 changes: 4 additions & 0 deletions content/docs/entry/custom-checks.md
Expand Up @@ -22,6 +22,7 @@ In the [agent settings file](https://mackerel.io/docs/entry/spec/agent#config-fi
```config
[plugin.checks.ssh]
command = ["ruby", "/path/to/check-ssh.rb"]
custom_identifier = "SOME_IDENTIFIER" # optional
notification_interval = 60
max_check_attempts = 1
check_interval = 5
Expand All @@ -34,6 +35,9 @@ memo = "This check monitor is ..."

- Item name: With the key for the settings file, the item name must begin with "plugin.checks." and contain exactly two periods. Anything after the second dot will be used as the monitor settings name.
- command: This command will have the agent temporarily execute, and use it’s exit status/standard output as the monitoring result.
- custom_identifier: Monitoring results are sent as a monitor of the host of the specified identifier, not the host on which the agent is running.
- If the check result is not OK, it will be notified as an alert for the host that is specified here.
- This can be useful for adding monitors to hosts integrated with AWS / Azure Integration. For more details, refer to the [AWS Integration Document](https://mackerel.io/docs/entry/integrations/aws#plugin-custom-identifier).
- notification_interval: The notification re-sending interval will be designated in minutes. If the notification is abbreviated, it will not be re-sent. An interval of less than 10 minutes can not be designated. If an interval of less than 10 min is designated, the notification will be re-sent at 10 minutes.
- max_check_attempts: An alert will be sent for any result other than “okay” in the designated number sequence. For example, if set at 3 and the latest monitoring result for all three is not ok, then a notification will be sent. **When used with `prevent_alert_auto_close`, the value of `max_check_attempts` will be treated as `1` regardless of the specified value.**
- check_interval: Designate the check monitoring execution interval in minutes. The default value is 1 minute. The configurable range is 1 to 60 minutes. If a value of less than 1 minute is designated, monitoring will be run at 1 minute intervals. If a value of more than 60 minutes is designated, monitoring will be run at 60 minute intervals.
Expand Down
4 changes: 2 additions & 2 deletions content/docs/entry/faq/contracts/combined-integration.md
Expand Up @@ -8,8 +8,8 @@ EditURL: https://blog.hatena.ne.jp/mackerelio/mackerelio-docs.hatenablog.mackere

When using mackerel-agent and AWS/Azure Integration together, the metrics obtained from the two functions are aggregated into one host with a billable rate of either a standard host or a micro host.

- When mackerel-agent is installed on an EC2/Azure VM instance while also using the Integration function: 1 Standard host
- When [using the custom_identifier to post metrics](https://mackerel.io/docs/entry/integrations/aws#plugin-custom-identifier) for Integration registered hosts in other services: 1 Micro host
- When mackerel-agent is installed on an EC2/Azure VM instance while also using the Integration function: 1 Standard host
- When [using the custom_identifier to aggregate monitors with the plugin](https://mackerel.io/docs/entry/integrations/aws#plugin-custom-identifier) for Integration registered hosts in other services: 1 Micro host

However, please note that the upper limit for the number of metrics per host does not change. For other precautions regarding exceeding metrics etc., refer to [Handling of host conversion when plan limits are exceeded](https://mackerel.io/docs/entry/faq/contracts/limit-exceeded-conversion).

Expand Down
3 changes: 3 additions & 0 deletions content/docs/entry/howto/anomaly-detection-for-roles.md
Expand Up @@ -38,3 +38,6 @@ Go to the Monitors screen, located on the left side menu, and click the “Add M
- Monitoring will not continue until the anomaly detection training has completed.
- Multiple monitors with anomaly detection can not be specified for the same role
- Only available for the Trial and Paid plans
- Every 5 hosts targeted for monitoring will count as 1 Standard host
- The same host will be counted multiple times if it is monitored through multiple roles
- A usage charge will incur starting with one monitored host
4 changes: 4 additions & 0 deletions content/docs/entry/howto/container-agent.md
Expand Up @@ -93,9 +93,13 @@ If not using the plugin, the agent can be used with just environment variable co
| MACKEREL_APIBASE | Specifies the Mackerel API endpoint(Default: `https://api.mackerelio.com/`). |
| MACKEREL_ROLES | Sets tasks, pod services, and roles. |
| MACKEREL_AGENT_CONFIG | Sets the agent configuration file. Details for this will be described later. |
| MACKEREL_AGENT_CONFIG_POLLING_DURATION_MINUTES | Specifies time interval of retrieval in minutes for detecting changes in the agent configuration file.|
| MACKEREL_IGNORE_CONTAINER | Sets the name of the container to be excluded from monitoring with regular expressions. |
| MACKEREL_HOST_STATUS_ON_START | When set, the host status changes to the specified value upon startup of the agent. Valid values are "standby", "working", "maintenance", and "poweroff".|


By default, the configuration file is read once at startup. With `MACKEREL_AGENT_CONFIG_POLLING_DURATION_MINUTES` configured, the configuration file is periodically retrieved to detect and apply changes.

### Using the configuration file

Set the file path of the agent configuration file with the environment variable `MACKEREL_AGENT_CONFIG`.
Expand Down
48 changes: 41 additions & 7 deletions content/docs/entry/howto/install-agent/amazon-linux.md
Expand Up @@ -7,7 +7,11 @@ EditURL: https://blog.hatena.ne.jp/mackerelio/mackerelio-docs.hatenablog.mackere

The content described on this page is also available from the [New Host registration screen in Mackerel](https://mackerel.io/my/instruction-agent).

<h2 id="v2">When using Amazon Linux 2 LTS</h2>
<h2>Install the package</h2>
Amazon Linux and Amazon Linux 2 LTS run different commands for installation. Please check out each procedure.
Installation can also be done directly using the `rpm` command.

<h3 id="v2">When using Amazon Linux 2 LTS</h3>

Execute the following command:

Expand All @@ -17,7 +21,7 @@ curl -fsSL https://mackerel.io/file/script/amznlinux/setup-all-yum-v2.sh | MACKE

You can check the API key from the [Organization page’s API Keys tab](https://mackerel.io/my?tab=apikeys). Keep in mind that this key is used to identify your organization, so we strongly advise not sharing it with others.

<h2 id="v1">When using Amazon Linux</h2>
<h3 id="v1">When using Amazon Linux</h3>

Execute the following command:

Expand All @@ -27,24 +31,54 @@ curl -fsSL https://mackerel.io/file/script/amznlinux/setup-all-yum.sh | MACKEREL

You can check the API key from the [Organization page’s API Keys tab](https://mackerel.io/my?tab=apikeys). Keep in mind that this key is used to identify your organization, so we strongly advise not sharing it with others.

<h2 id="config">Edit the configuration file</h2>
<h3 id="rpm-v2">Using the rpm command with Amazon Linux 2 LTS</h2>

Edit the file `/etc/mackerel-agent/mackerel-agent.conf` and configure the API key.
To install mackerel-agent with `rpm` run the following command:

```
apikey = "<YOUR_API_KEY>"
sudo rpm -ivh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.amzn2.x86_64.rpm
```

To update Mackerel-agent with `rpm` run the following command:

```
sudo rpm -Uvh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.amzn2.x86_64.rpm
```

You can check the API key from the [Organization page’s API Keys tab](https://mackerel.io/my?tab=apikeys). Keep in mind that this key is used to identify your organization, so we strongly advise not sharing it with others.
<h3 id="rpm-v1">Using the rpm command with Amazon Linux</h2>

For more details, check out the [mackerel-agent specifications](https://mackerel.io/docs/entry/spec/agent) help page.
To install mackerel-agent with `rpm` run the following command:

```
sudo rpm -ivh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.x86_64.rpm
```

To update Mackerel-agent with `rpm` run the following command:

```
sudo rpm -Uvh https://mackerel.io/file/agent/rpm/mackerel-agent-latest.x86_64.rpm
```

<h2 id="config">Edit the configuration file</h2>

Edit the `/etc/mackerel-agent/mackerel-agent.conf` file to configure the agent.

By using the configuration file, the following can be implemented:

- [Service and role configuration](https://mackerel.io/docs/entry/spec/agent#setting-services-and-roles)
- [Posting user-defined custom metrics](https://mackerel.io/docs/entry/advanced/custom-metrics)
- [Adding monitors for script checks](https://mackerel.io/docs/entry/custom-checks)

For more details, check out the [mackerel-agent specifications](https://mackerel.io/docs/entry/spec/agent) help page.

Please be sure to configure the API key if installed from rpm. This is done automatically if set up with the setup script.

```
apikey = "<YOUR_API_KEY>"
```

You can check the API key from the [Organization page’s API Keys tab](https://mackerel.io/my?tab=apikeys). Keep in mind that this key is used to identify your organization, so we strongly advise not sharing it with others.

<h2 id="start-agent">Starting the agent</h2>
<h3>When using Amazon Linux 2 LTS</h3>

Expand Down

0 comments on commit 3ee6a56

Please sign in to comment.