Config file finding unexpected $end, not sure why

时间:2015-07-31 19:28:15

标签: linux monitoring collectd

I am using a custom config of collectd and for some reason I keep getting a failure when I try and run the service. Originally I had everything in one big file, but to make changing configs easier I want to separate out the settings for various plugins and components. Collectd has a Include option to do exactly this. It seems to work, but when collectd tries to grab the external part of the program I get the following error:

Parse error in file `/etc/collectd/collectd.conf.d/http.conf', line 1100 near `': syntax error, unexpected $end, expecting EOL

If I go in and copy paste direct into the server using vim, it will work. However when the package installs it won't. I know these kinds of errors can come from mismatched brackets or quotes or something, but his is not a problem in these files. Is there anything else which could cause such an error?

1 个答案:

答案 0 :(得分:3)

对于用户,他们有类似的错误。对于我的情况,我没有返回collectd.conf或plugins配置文件底部的行。要进行验证,您可以使用此命令

$ xxd collectd.conf | tail -n1 | grep 0a

00001c0: 730a 0a                                  s..

您必须在文件末尾看到0a

注意:您可以使用插件配置文件替换collectd.conf