-
Notifications
You must be signed in to change notification settings - Fork 37
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Harvest should load templates from a set of conf directories #2330
Comments
Given: tree /tmp/foo/
/tmp/foo/
└── zapi
├── cdot
│ └── 9.8.0
│ ├── aggr.yaml
│ ├── aggr2.yaml
│ ├── custom_volume.yaml
│ └── volume.yaml
├── custom.yaml
├── default.yaml
└── limited.yaml cat /tmp/foo/zapi/custom.yaml objects:
Volume: custom_volume.yaml cat /tmp/foo/zapi/limited.yaml collector: Zapi
# Order here matters!
schedule:
- data: 3m
objects:
Aggregate: aggr2.yaml
Node: node.yaml
Volume: volume.yaml cat harvest.yml Pollers:
fas8060:
addr: 10.193.48.163
conf_path: /tmp/foo:conf
sar:
addr: 10.193.48.154
collectors:
- Zapi:
- limited.yaml cat /tmp/foo/zapi/default.yaml collector: Zapi
# Order here matters!
schedule:
- data: 3m
objects:
Aggregate: aggr.yaml
AggregateEfficiency: aggr_efficiency.yaml
CIFSSession: cifs_session.yaml
ClusterPeer: clusterpeer.yaml
Disk: disk.yaml
EmsDestination: ems_destination.yaml
LIF: lif.yaml
Lun: lun.yaml
# NetPort: netPort.yaml
Namespace: namespace.yaml
Node: node.yaml
NtpServer: ntpserver.yaml
QosPolicyAdaptive: qos_policy_adaptive.yaml
QosPolicyFixed: qos_policy_fixed.yaml
QosWorkload: qos_workload.yaml
Qtree: qtree.yaml
Security: security.yaml
SecurityAccount: security_account.yaml
SecurityAuditDestination: security_audit_dest.yaml
SecurityCert: security_certificate.yaml
SecurityLogin: security_login.yaml
Sensor: sensor.yaml
Shelf: shelf.yaml
SnapMirror: snapmirror.yaml
SnapshotPolicy: snapshotpolicy.yaml
Status: status.yaml
Status_7mode: status_7.yaml
Subsystem: subsystem.yaml
Support: support.yaml
SVM: svm.yaml
Volume: volume.yaml sar examplesexample 1go run cmd/poller/poller.go --poller sar --promPort 14001 --confpath conf2:conf3:conf4:/tmp/foo:conf
2023-08-25T12:26:37-04:00 INF poller/poller.go:204 > Init Poller=sar asup=false confPath=conf2:conf3:conf4:/tmp/foo:conf config=harvest.yml daemon=false debug=false homePath= hostname=cgrindst-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=14001 version="harvest version 2.0.2-rc2 (commit HEAD) (build date undefined) darwin/amd64"
2023-08-25T12:26:38-04:00 INF collector/helpers.go:80 > best-fit template Poller=sar collector=Zapi:Volume path=/tmp/foo/zapi/cdot/9.8.0/volume.yaml v=9.13.1
2023-08-25T12:26:38-04:00 INF collector/helpers.go:80 > best-fit template Poller=sar collector=Zapi:Aggregate path=/tmp/foo/zapi/cdot/9.8.0/aggr2.yaml v=9.13.1
2023-08-25T12:26:39-04:00 INF collector/helpers.go:80 > best-fit template Poller=sar collector=Zapi:Node path=conf/zapi/cdot/9.8.0/node.yaml v=9.13.1 Notes:
example 2go run cmd/poller/poller.go --poller sar --promPort 14001 --confpath conf:/tmp/foo
2023-08-25T12:35:36-04:00 INF poller/poller.go:204 > Init Poller=sar asup=false confPath=conf:/tmp/foo config=harvest.yml daemon=false debug=false homePath= hostname=cgrindst-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=14001 version="harvest version 2.0.2-rc2 (commit HEAD) (build date undefined) darwin/amd64"
2023-08-25T12:35:37-04:00 INF collector/helpers.go:80 > best-fit template Poller=sar collector=Zapi:Volume path=conf/zapi/cdot/9.8.0/volume.yaml v=9.13.1
2023-08-25T12:35:37-04:00 INF collector/helpers.go:80 > best-fit template Poller=sar collector=Zapi:Aggregate path=/tmp/foo/zapi/cdot/9.8.0/aggr2.yaml v=9.13.1
2023-08-25T12:35:38-04:00 INF collector/helpers.go:80 > best-fit template Poller=sar collector=Zapi:Node path=conf/zapi/cdot/9.8.0/node.yaml v=9.13.1 Notes:
example 3go run cmd/poller/poller.go --poller sar --promPort 14001
2023-08-25T12:37:49-04:00 INF poller/poller.go:204 > Init Poller=sar asup=false confPath=conf config=harvest.yml daemon=false debug=false homePath= hostname=cgrindst-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=14001 version="harvest version 2.0.2-rc2 (commit HEAD) (build date undefined) darwin/amd64"
2023-08-25T12:37:49-04:00 WRN poller/poller.go:592 > Unable to load template. Poller=sar collector=Zapi confPaths=["conf"] err="template not found on confPath" template=limited.yaml
2023-08-25T12:37:49-04:00 ERR poller/poller.go:273 > Failed to read objects error="no templates loaded for Zapi" Poller=sar collector=Zapi templates=["limited.yaml"] Notes:
fas8060 examplesexample 1go run cmd/poller/poller.go --poller fas8060
2023-08-25T12:46:13-04:00 INF poller/poller.go:204 > Init Poller=fas8060 asup=false confPath=/tmp/foo:conf config=harvest.yml daemon=false debug=false homePath= hostname=cgrindst-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=0 version="harvest version 2.0.2-rc2 (commit HEAD) (build date undefined) darwin/amd64"
2023-08-25T12:46:18-04:00 INF collector/helpers.go:80 > best-fit template Poller=fas8060 collector=Zapi:Aggregate path=/tmp/foo/zapi/cdot/9.8.0/aggr.yaml v=9.8.0
2023-08-25T12:46:30-04:00 INF collector/helpers.go:80 > best-fit template Poller=fas8060 collector=Zapi:Volume path=/tmp/foo/zapi/cdot/9.8.0/volume.yaml v=9.8.0
2023-08-25T12:46:30-04:00 INF collector/helpers.go:80 > best-fit template Poller=fas8060 collector=Zapi:Volume path=/tmp/foo/zapi/cdot/9.8.0/custom_volume.yaml v=9.8.0
2023-08-25T12:45:40-04:00 INF collector/helpers.go:80 > best-fit template Poller=fas8060 collector=Zapi:LIF path=conf/zapi/cdot/9.8.0/lif.yaml v=9.8.0
... Notes:
example 2go run cmd/poller/poller.go --poller fas8060 --confpath /tmp/foo
2023-08-25T13:07:33-04:00 INF poller/poller.go:204 > Init Poller=fas8060 asup=false confPath=/tmp/foo config=harvest.yml daemon=false debug=false homePath= hostname=cgrindst-mac-0 logLevel=info logPath=/var/log/harvest/ profiling=0 promPort=0 version="harvest version 2.0.2-rc2 (commit HEAD) (build date undefined) darwin/amd64"
2023-08-25T13:07:36-04:00 INF collector/helpers.go:80 > best-fit template Poller=fas8060 collector=Zapi:Volume path=/tmp/foo/zapi/cdot/9.8.0/volume.yaml v=9.8.0
2023-08-25T13:07:36-04:00 INF collector/helpers.go:80 > best-fit template Poller=fas8060 collector=Zapi:Volume path=/tmp/foo/zapi/cdot/9.8.0/custom_volume.yaml v=9.8.0
2023-08-25T13:07:41-04:00 INF collector/helpers.go:80 > best-fit template Poller=fas8060 collector=Zapi:Aggregate path=/tmp/foo/zapi/cdot/9.8.0/aggr.yaml v=9.8.0
2023-08-25T13:07:42-04:00 WRN poller/poller.go:667 > init collector-object error="no best-fit template for lun.yaml on /tmp/foo" Poller=fas8060 collector=Zapi object=Lun
... Notes:
|
Tested in release branch 23.11 with commit eeab975
Case 1: conf path from harvest poller
Explanation:
Case 2: limited yaml from harvest poller section with multiple conf path in cli
Explanation:
Case 3: limited yaml from harvest poller section with multiple conf path in cli
Explanation:
Case 4: normal poller definition from harvest.yml with multiple conf path in cli
Explanation:
Case 5: custom.yaml with conf
Explanation:
Case 6: without any confpath, default conf would be loaded
Explanation:
|
The text was updated successfully, but these errors were encountered: