Skip to content
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

Failed to define custom ZapiPerf collector file (other than defaults.yaml) #396

Closed
albinpopote opened this issue Aug 6, 2021 · 2 comments · Fixed by #399
Closed

Failed to define custom ZapiPerf collector file (other than defaults.yaml) #396

albinpopote opened this issue Aug 6, 2021 · 2 comments · Fixed by #399
Labels
bug Something isn't working status/done

Comments

@albinpopote
Copy link

Describe the bug
When I try to change the collector configuration file for ZapiPerf like describe at the end of the section (change to not use the default.yaml) : https://github.com/NetApp/harvest/blob/main/cmd/collectors/zapiperf/README.md#harvest-configuration-file
I got the error : "cannot unmarshal !!map into string"

Environment
Provide accurate information about the environment to help us reproduce the issue.

  • Harvest version: harvest version 21.05.4-1 (commit 8976370) (build date 2021-08-02T11:24:55+0200) linux/amd64
  • Command line arguments used: ./bin/harvest start --foreground --verbose--collectors ZapiPerf --objects SystemNode DC-01
  • OS: Debian 10.9
  • Install method: dpkg install from manual package compilation
  • ONTAP Version: CDOT 9.5

To Reproduce
Steps to reproduce the behavior:

Create a file limited.yaml in folder /opt/harvest/conf/zapiperf/ :

root@XXX:/opt/harvest# ll conf/zapiperf/
total 16
drwxr-xr-x 3 harvest harvest 4096 juil.  1 22:33 7mode
drwxr-xr-x 4 harvest harvest 4096 août   6 16:59 cdot
-rw-r--r-- 1 harvest harvest 1798 août   2 11:24 default.yaml
-rw-r--r-- 1 harvest harvest   95 août   6 15:44 limited.yaml

With the following content:

root@XXX:/opt/harvest# cat conf/zapiperf/limited.yaml
objects:
  SystemNode:             system_node.yaml
  HostAdapter:            hostadapter.yaml

And change the harvest.yml on the application root folder :

root@XXX:/opt/harvest# cat harvest.yml
...

Defaults:
  collectors:
    - ZapiPerf
  use_insecure_tls: true

Pollers:
  DC-01:
    datacenter: Lab
    addr: 192.168.xxx.xxx
    auth_style: basic_auth
    username: admin
    password: xxxxxxx
    exporters:
      - my_influxdb
    collectors:
      - ZapiPerf:
        - limited.yaml

Got the error when a try to launch with command :

root@XXX:/opt/harvest# ./bin/harvest start --foreground --trace --collectors ZapiPerf --objects SystemNode DC-01
error unmarshalling config file=[./harvest.yml] yaml: unmarshal errors:
  line 25: cannot unmarshal !!map into string
config [./harvest.yml]: yaml: unmarshal errors:
  line 25: cannot unmarshal !!map into string

Line 25 corresponds to:

      - ZapiPerf:
@cgrinds cgrinds added bug Something isn't working and removed status/needs-triage labels Aug 8, 2021
@cgrinds
Copy link
Collaborator

cgrinds commented Aug 8, 2021

thanks for the detailed report @albinpopote this feature was accidentally omitted with the transition from Python to Go.

cgrinds added a commit that referenced this issue Aug 9, 2021
* fix: built-in collectors should have overridable config

Fixes #396
@cgrinds cgrinds self-assigned this Aug 26, 2021
@cgrinds
Copy link
Collaborator

cgrinds commented Aug 26, 2021

Verified fix with harvest version 21.08.0-1 (commit 956ebfa) (build date 2021-08-25T11:36:10-0400) linux/amd64 limited.yaml is merged correctly

@cgrinds cgrinds removed their assignment May 6, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working status/done
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants