11.1.5.2. How to use custom meter with custom meter agent

This section describes how to monitor the load average every 5 minutes for virtual server instances in the JP1 region using a custom meter agent.

Setting up config file

To use installed custom meter agent, you need to setting up configuration file in advance.

Note

Configuration file of custom meter agent is created as /etc/ecl2mond/ecl2mond.conf at installation.

Parameters in configuration file

Parameter name

Required / Optional

Data format

Default value

Available value

Description of parameter

monitoringUrl

Required

Characters

None

 

API endpoint of Monitoring

interval

Optional

Integer

5

1-3599

Collection of samples, transmission interval (min)

authUrl

Required

Characters

None

 

API endpoint of Keystone

authInterval

Optional

Integer

60

5-3599

Interval of getting token(min)

resourceId

Required

Characters

None

 

Resource ID of monitoring target

tenantId

Required

Characters

None

 

Tenant ID

userName

Required

Characters

None

 

API key

password

Required

Characters

None

 

API secret key

meters

Required

Characteristics order

None

 

Meter name of collection target

logLevel

Optional

Characters

logLevel

"TRACE", "DEBUG", "INFO", "WARNING", "ERROR", "FATAL"

Log level

Note

Interval of getting token need to be set as default
If you set a time longer than expiration time of the token as interval of getting token, custom meter agent will reacquire the token at the timing of an authentication error due to expiration of the token when registering value to custom meter.
Please refer to SSS API reference for expiration time of the token.

Check API endpoint.

For API endpoint of Monitoring and Keystone, please refer to API reference

Check resource ID of monitoring target.

In case of monitoring ECL2.0 resource, resource ID can be checked on Monitoring control panel.
Select the service on Monitoring control panel and refer target resource. At that timing, resource ID is displayed with grayed out next to the resource name.
リソースIDの取得

Note

Specify any characteristic as resource ID when monitoring target is not in ECL2.0.
Custom resource with resource name specified as resource ID will be created.

Check tenantID, API key and API secret key.

For how to check these value, please refer to Check various information and update API key .

Check the meter name to collect.

Please refer to Service Description for information of collection target meters.
  • device name of Disk meter can be checked at /proc/diskstats .

# cat /proc/diskstats
252       0 vda 7539 9 379254 35296 430860 34304 4178175 3008943 0 1144564 3043883
252       1 vda1 1126 1 56425 3590 1043 0 4216 1273 0 2419 4862
252       2 vda2 6322 8 321237 31502 339169 34304 4173959 3003522 0 1138976 3034675
253       0 dm-0 6049 0 317373 31287 375337 0 4173959 3315145 0 1143978 3346433
253       1 dm-1 187 0 3040 233 0 0 0 0 0 233 233
It is disk.vda1.currently.ios.count that collects the number of I/Os running on disk vda1 .
  • nwif name , meter related to network can be checked at /proc/net/dev .

# cat /proc/net/dev
Inter-|   Receive                                                |  Transmit
face |bytes    packets errs drop fifo frame compressed multicast|bytes    packets errs drop fifo colls carrier compressed
eth0: 6059364541 15552704    0    0    0     0          0         0 2258708075 14096298    0    0    0     0       0          0
lo:   23020     249    0    0    0     0          0         0    23020     249    0    0    0     0       0          0
It is network.eth0.receive.bytes that collects the number of bytes received by the network interface eth0 ,

Example of configuration file

monitoringUrl: Enter the ECL2.0 Monitoring API Endpoint URL
# ex. "https://monitoring-jp1-ecl.api.ntt.com/"
monitoringUrl = "https://monitoring-jp1-ecl.api.ntt.com/"

# interval: Specify the time interval to collect and send the value by the agent
# [ 1 - 3599 ] minutes, default: 5
interval = 5

# authUrl: Enter the ECL2.0 Keystone API Endpoint URL
# ex. "https://keystone-jp1-ecl.api.ntt.com/"
authUrl = "https://keystone-jp1-ecl.api.ntt.com/"

# authInterval: Specify the time interval to refresh auth token
# [ 5 - 3599 ] min, default: 60
authInterval = 60

# resourceId: Enter the target resource id for custom meter creation
# ex. nova_12ab-12cd56gh9-ab34ef78i-34cd
resourceId = "nova_6708b574-434d-4476-b8c1-2a128ab5edc1"

# tenantId: Enter your tenant id
tenantId = "<tenantID>"

# userName: Enter your API key
userName = "<API key>"

# password: Enter your API secret key
password = "<API secret key>"

meters = [
  "loadavg.1.count",
]

Check operation

Start command and its option

# ecl2mond [options]

Confirm sample values to be collected.

At first, execute command with dry-run option to check collection of sample values.
The result of sample value collection will be standard output.
# ecl2mond -m dry-run
+------+---------------------------------------------+-----------------+----------------+----------+
| No   | Name                                        | Value           | Unit           | Type     |
+------+---------------------------------------------+-----------------+----------------+----------+
|    1 |                             loadavg.1.count |            0.00 |          count |    gauge |
+------+---------------------------------------------+-----------------+----------------+----------+
  • Detail of output item

Name

Contents

No

Meter number

Name

Meter name

Value

Sample value

Unit

Meter unit

Type

Meter type

Note

When meter collects difference, you need execute dry-run twice. At the second run, sample value will be calculated by difference from the first run.

Check creating custom meter and transmitting sample value.

Then, execute command with run-once option and send request of creating custom meter to Monitoring server.
# ecl2mond -m run-once
+------+---------------------------------------------+-----------------+----------------+----------+
| No   | Name                                        | Value           | Unit           | Type     |
+------+---------------------------------------------+-----------------+----------------+----------+
|    1 |                             loadavg.1.count |            0.00 |          count |    gauge |
+------+---------------------------------------------+-----------------+----------------+----------+
Finished.
Verify custom meter has been created on Monitoring control panel.
作成されたカスタムメーターの確認

Note

It takes a few minutes to display sent data on Monitoring graph.

Note

At the first run, only custom meter is created, no sample value is registered.

You need to execute command with run-once option again to send sample value to Monitoring server.
# ecl2mond -m run-once
+------+---------------------------------------------+-----------------+----------------+----------+
| No   | Name                                        | Value           | Unit           | Type     |
+------+---------------------------------------------+-----------------+----------------+----------+
|    1 |                             loadavg.1.count |            0.00 |          count |    gauge |
+------+---------------------------------------------+-----------------+----------------+----------+
Finished.
Verify sample value has been registered to custom meter via Monitoring control panel.
カスタムメーターにサンプル値が登録されていることを確認

Note

NOTE: In case of not display custom meter as expected
Make sure you have not created a custom meter by specifying the same character string as the meter name collected by the custom meter agent as counter_name of the API before using custom meter agent.
In such case, display_name specified in API will be displayed as meter name, then meter name displayed on Monitoring control panel and meter name on custom meter agent will be different.
In order to unify meter name, you need to call custom meter API with specifying custom meter agent name as display_name.

Run/Stop at background

In order to keep on sending sample data to Monitoring server, you need to running agent in the background.
  • Start in the background

# service ecl2mond start
  • Stop background process

# service ecl2mond stop
  • Check background process

# service ecl2mond status

Check the log

In case of running custom meter agent in the background, the log is output at /var/log/ecl2mond.log .

Setting up auto start of the service

By setting the custom meter agent to start automatically when the server is started, you can continue monitoring with monitoring even if the server is restarted.
  • Auto start setting

# systemctl enable ecl2mond.service
  • Disable auto start setting

# systemctl disable ecl2mond.service
  • Check auto start setting

# systemctl is-enabled ecl2mond.service

Note

Auto start setting may already configured after install.

Check a Graph of Custom Meter

Monitoring data sent by custom meter agent is displayed on ECL2.0 Monitoring control panel.
Please refer to Verifying Meters ( Monitoring Items ) for how to check.
The graph will be displayed by selecting the meter for the resource specified by configuration file.

Alert setting for Custom Meter

Alarm can be configured in the same method as other meters.
Please refer to Using Monitoring Alarms for details.