sqshq / sampler

Tool for shell commands execution, visualization and alerting. Configured with a simple YAML file.
https://sampler.dev
GNU General Public License v3.0
12.88k stars 573 forks source link

2019/08/07 13:37:30 Failed to read config file: yaml: line 51: mapping values are not allowed in this context #32

Closed 0x234 closed 5 years ago

0x234 commented 5 years ago

Using the example.yml

sampler --config example.yml
2019/08/07 13:37:30 Failed to read config file: yaml: line 51: mapping values are not allowed in this context

JafarAkhondali commented 5 years ago

Sample problem here

sqshq commented 5 years ago

Hi @jbunce, @JafarAkhondali What's your OS and sampler version?

JafarAkhondali commented 5 years ago

@sqshq

Distributor ID: Debian
Description:    Debian GNU/Linux 10 (buster)
Release:    10
Codename:   buster

1.0.2

sqshq commented 5 years ago

I'm trying to reproduce it -

docker run -it debian
apt update
apt install wget
apt install libasound2-dev
wget https://github.com/sqshq/sampler/releases/download/v1.0.2/sampler-1.0.2-linux-amd64 -O /usr/local/bin/sampler
chmod +x /usr/local/bin/sampler
wget https://raw.githubusercontent.com/sqshq/sampler/master/example.yml
sampler -c example.yml

Everything works as expected, no issues with yaml parsing

Does this peace alone work for you?

gauges:
  - title: DAY PROGRESS
    position: [[45, 3], [35, 2]]
    cur:
      sample: date +%H
    max:
      sample: echo 24
    min:
      sample: echo 0

How about this one?

gauges:
  - title: DAY PROGRESS
    position: [[45, 3], [35, 2]]
    cur:
      sample: "date +%H"
    max:
      sample: echo 24
    min:
      sample: echo 0
JafarAkhondali commented 5 years ago

@sqshq Sorry, my problem was a stupid one. Its working.

sqshq commented 5 years ago

Let me close it for now, since I can't reproduce it. @jbunce feel free to reopen it if needed