mtakaki / cachet-url-monitor

URL monitor plugin for cachethq.io
MIT License
125 stars 49 forks source link

Problem with config.yml #51

Closed ghost closed 6 years ago

ghost commented 6 years ago

Hi! I have some problem. When me made

[root@bessmertni-poni bin]# docker run -it --rm -v /usr/local/bin/config.yml:/usr/src/app/config/config.yml:ro mtakaki/cachet-url-monitor
Traceback (most recent call last):
  File "cachet_url_monitor/scheduler.py", line 89, in <module>
    scheduler = Scheduler(sys.argv[1])
  File "cachet_url_monitor/scheduler.py", line 55, in __init__
    self.configuration = Configuration(config_file)
  File "/usr/src/app/cachet_url_monitor/configuration.py", line 83, in __init__
    self.data = load(file(self.config_file, 'r'))
  File "/usr/local/lib/python2.7/site-packages/yaml/__init__.py", line 71, in load
    return loader.get_single_data()
  File "/usr/local/lib/python2.7/site-packages/yaml/constructor.py", line 37, in get_single_data
    node = self.get_single_node()
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 36, in get_single_node
    document = self.compose_document()
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 55, in compose_document
    node = self.compose_node(None, None)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 84, in compose_node
    node = self.compose_mapping_node(anchor)
  File "/usr/local/lib/python2.7/site-packages/yaml/composer.py", line 127, in compose_mapping_node
    while not self.check_event(MappingEndEvent):
  File "/usr/local/lib/python2.7/site-packages/yaml/parser.py", line 98, in check_event
    self.current_event = self.state()
  **File "/usr/local/lib/python2.7/site-packages/yaml/parser.py", line 439, in parse_block_mapping_key
    "expected <block end>, but found %r" % token.id, token.start_mark)**
**yaml.parser.ParserError: while parsing a block mapping
  in "config/config.yml", line 1, column 1
expected <block end>, but found '<block mapping start>'
  in "config/config.yml", line 3, column 3**

it's my config.yml

endpoint:
      url: http://google.com
  method: GET
  timeout: 1 # seconds
  expectation:
    - type: HTTP_STATUS
      status_range: 200-300
    - type: LATENCY
      threshold: 1
    - type: REGEX
      regex: ".*<body>.*"
  allowed_fails: 0
cachet:
  api_url: http://localhost/api/v1
  token: example_my_toker_from_cachet
  component_id: 1
  metric_id: 1
  action:
    - CREATE_INCIDENT
    - UPDATE_STATUS
  public_incidents: true
frequency: 30
latency_unit: ms

What i do wrong? Thank you!

ghost commented 6 years ago

I solved my problem. Routing did not work