unmarshal errors

707 views
Skip to first unread message

jennykim...@gmail.com

unread,
Mar 27, 2017, 10:38:45 AM3/27/17
to Prometheus Users

Hi!


I'm trying to run this tutorial (https://www.percona.com/blog/2016/02/29/graphing-mysql-performance-with-prometheus-and-grafana/) to get MySQL to work with Prometheus, but can't get my Prometheus to work. The config is written underneath and so is the error-message. Please help me!!!


I even tried the code in http://www.yamllint.com, and it said it was valid....


Thank you! :) 



cat << EOF > /opt/prometheus/prometheus.yml

global

  scrape_interval 5s

  evaluation_interval 5s

scrape_configs

  - job_name linux

    target_groups

      - targets ['192.168.56.107:9100']

        labels

          alias db1

  - job_name mysql

    target_groups

      - targets ['192.168.56.107:9104']

        labels

          alias db1

EOF



INFO[0000] Starting prometheus (version=1.5.2, branch=master, revision=bd1182d29f462c39544f94cc822830e1c64cf55b)  source=main.go:75

INFO[0000] Build context (go=go1.7.5, user=root@a8af9200f95d, date=20170210-14:41:22)  source=main.go:76

INFO[0000] Loading configuration file prometheus.yml     source=main.go:248

ERRO[0000] Error loading config: couldn't load configuration (-config.file=prometheus.yml): yaml: unmarshal errors:

  line 1: cannot unmarshal !!str `cat << ...` into config.plain  source=main.go:150

conor.b...@robustperception.io

unread,
Mar 27, 2017, 11:21:58 AM3/27/17
to Prometheus Users, jennykim...@gmail.com
Hi Jenny,

It appears you have accidentally included the 'cat' command in your config file. 

You'll want to remove the top and bottom lines from your config file (prometheus.yml) in order for it to work.
Reply all
Reply to author
Forward
0 new messages