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

parse_config fails when metric alias has a dash and a configuration is provided #8

Open
grimeyCH opened this issue Mar 14, 2019 · 1 comment

Comments

@grimeyCH
Copy link
Contributor

grimeyCH commented Mar 14, 2019

Quick reproduction:

  • Change the standard network-io metric to:
[metric network_io:test-network]  
;Network traffic in kB/s.  
NETWORK_IO_INTERFACE=eth0
  • run metrics.sh in verbose mode and it will output something like
$ ./metrics.sh -c metrics.ini -v
Started in verbose mode
OS detected: linux
Available metrics: cpu disk_io disk_usage heartbeat memory network_io ping swap
Available reporters: file influxdb keen_io logentries_com prometheus stathat statsd stdout udp
Loading configuration file: metrics.ini
./metrics.sh: 1: eval: Syntax error: Bad function name

minimal example config file i used for the above run is attached.
metrics.txt

In my humble opinion it fails in config.sh here:
eval "${fn_name}_config () { $_body; }"
But couldn't figure out why

@pstadler
Copy link
Owner

Functions can’t contain dashes. Need to implement something around get_alias I suppose.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants