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
/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
Check API endpoint.¶
Check resource ID of monitoring target.¶
Note
Check tenantID, API key and API secret key.¶
Check the meter name to collect.¶
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
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
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",
]
Confirm sample values to be collected.¶
dry-run
option to check collection of sample values.# 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.¶
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.
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.
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.
Note
counter_name
of the API before using custom meter agent.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.display_name
.Run/Stop at background¶
Start in the background
# service ecl2mond start
Stop background process
# service ecl2mond stop
Check background process
# service ecl2mond status
Check the log¶
/var/log/ecl2mond.log
.Setting up auto start of the service¶
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.