Advanced Configuration
Monitoring Multiple Similar Resources
If multiple resources share the same configuration (credentials, type), use arrays:
resources:
linux-servers:
attributes:
host.name: [server-01, server-02, server-03]
host.type: linux
protocols:
ssh:
username: admin
password: shared-password
timeout: 120s
Customizing What Gets Monitored
Connectors are auto-selected based on host.type and protocols. To override, use the connectors property as in the example below:
resources:
my-server:
attributes:
host.name: server-01
host.type: linux
protocols:
ssh:
username: admin
password: changeme
connectors: ['#hardware', '!MIB2'] # Hardware connectors, exclude MIB2
Use the below syntax for the connectors property to force or exclude specific connectors or categories of connectors:
| Prefix | Meaning |
|---|---|
+ | Force connector (e.g. +MySQL to force the MySQL connector) |
! | Exclude connector (e.g. !IpmiTool to disable the IpmiTool connector) |
# | Include category (see available categories) |
See Connectors Directory for the full listing of available connectors. Alternatively, you can also use the below command line:
metricshub -l
Using Environment Variables
Reference environment variables in your configuration:
resources:
my-server:
attributes:
host.name: ${env::SERVER_HOSTNAME}
host.type: linux
protocols:
ssh:
username: ${env::SSH_USERNAME}
password: ${env::SSH_PASSWORD}
Structuring Your Configuration
Using a Single File (Small Environments)
For environments with fewer than ~50 resources, use a single metricshub.yaml:
attributes:
site: my-datacenter
resources:
server-1:
attributes:
host.name: server-01
host.type: linux
protocols:
ssh:
username: root
password: changeme
server-2:
attributes:
host.name: server-02
host.type: win
protocols:
wmi:
username: administrator
password: changeme
Using Multiple Files (Large Environments)
For larger environments, split configuration across multiple files:
config/
├── global-settings.yaml # Collect period, logging, etc.
├── license.yaml # Enterprise license
├── paris-resources.yaml # Resources at Paris site
├── london-resources.yaml # Resources at London site
└── ...
Store backup or example files in subfolders (e.g., config/examples/) to prevent conflicts.
global-settings.yaml
collectPeriod: 1m
loggerLevel: info
enableSelfMonitoring: true
paris-resources.yaml
resourceGroups:
paris:
attributes:
site: paris-dc
resources:
server-1:
attributes:
host.name: paris-server-01
host.type: linux
protocols:
ssh:
username: root
password: changeme
Using Resource Groups
For distributed infrastructures with multiple sites:
resourceGroups:
boston:
attributes:
site: boston-dc
resources:
myBostonHost1:
attributes:
host.name: my-boston-host-01
host.type: storage
protocols:
http:
https: true
username: admin
password: changeme
chicago:
attributes:
site: chicago-dc
resources:
myChicagoHost1:
attributes:
host.name: my-chicago-host-01
host.type: linux
protocols:
ssh:
username: root
password: changeme
For sustainability metrics reporting within resource groups, see Sustainability Settings.
Customizing Data Collection
In the MetricsHub configuration file, locate the resource for which you wish to customize data collection and specify the variables attribute available under the additionalConnectors section:
resources:
<host-id>:
attributes:
host.name: <hostname>
host.type: <type>
additionalConnectors:
<connector-id>: # Unique ID. Use 'uses' if different from the original connector ID
uses: <connector-original-id> # Optional - Original ID if not in key
force: true # Optional (default: true); false for auto-detection only
variables:
<variable-name>: <value>
| Property | Description |
|---|---|
<connector-id> | Custom ID for this additional connector. |
uses | (Optional) Provide an ID for this additional connector. If not specified, the key ID will be used. |
force | (Optional) Set to false if you want the connector to only be activated when detected (Default: true - always activated). |
variables | Specify the connector variable to be used and its value (Format: <variable-name>: <value>). |
Note: If a connector is added under the
additionalConnectorssection with missing or unspecified variables, those variables will automatically be populated with default values defined by the connector itself.
For practical examples demonstrating effective use of this feature, refer to the following pages: