Failed to parse gcfg data: can't store data at section "http"
Opened this issue · 1 comments
Hello,
I'm trying run a few simple tests with the influxsnmp tool and I'm having a hard time getting the binary to run with the config file.
Here is a sample of my config (Ubuntu 14.04):
-config.gcfg-
[common]
httpPort = 8085
; multiple snmp devices can be specified
; their config name must match a mib config name
; or an alternate config name can be used
; or there must be a wildcard mib configured -- named '*'
;[snmp "h3c-a5500"]
;[snmp "H3C-COMMON-SYSTEM-MIB"]
[snmp "inf-sw-switch"]
host = 192.168.2.4
community = v3
;port = 161
port = 8086
timeout = 20
retries = 5
;repeat = 0
freq = 30
;debug = false
; if port file is ommited then all columns will be retrieved
portfile = h3cPorts.txt
; this is a wildcard -- becomes default
; if a 'snmp' section name is not otherwise specified
[mibs "inf-sw-srvroom"]
name= ifXTable
column = ifInMulticastPkts
[influx "*"]
url = http://localhost:8086/
;host = localhost
port = 8086
db = snmp
;user = username
;password = password
;web status monitor - set port to 0 to disable
[http]
port = 9501
I'm running the binary with this command: ../bin/influxsnmp -config config.gcfg
Upon running the binary, I get:
../bin/influxsnmp -config config.gcfg
2016/09/06 15:38:22 Failed to parse gcfg data: warnings:
can't store data at section "http"
can't store data at section "http"
can't store data at section "snmp", subsection "inf-sw-srvroom", variable "portfile"
can't store data at section "mibs", subsection "inf-sw-srvroom", variable "column"
can't store data at section "influx", subsection "", variable "port"
can't store data at section "influx", subsection "", variable "db"
can't store data at section "http"
can't store data at section "http"
I believe I understand what the errors are stating but I can't seem to sort out the correct syntax for this. I've read the docs that I can find and I wasn't sure if the 'mibs' section requires a mib entry, etc....
Would it be possible if you could point me in the right direction on this one?
I've tried running this through my favorite search engines but couldn't seem to find an answer and I'm not familiar with go enough to really figure it out.
Thank you very much for your help.
Cheers,
Mike
~
I have a similar error:
Failed to parse gcfg data: warnings:
can't store data at section "mibs", subsection "*", variable "rename"
can't store data at section "influx", subsection "switch", variable "user"
This is the extract of my config.gcfg file:
[mibs "*"]
name = sysName
rename = sysName=myNewName ; rename entry
[influx "switch"]
url = http://127.0.0.1:8086/
database = events
user = test
password = test
When I generate the mibinfo.json file (and mib2.json), the app returns this message, but it creates the outputs without problem:
./influxsnmp -dump -filter > /tmp/mibinfo.json
2016/09/28 18:53:23 poller error: no OID found for ifXEntry
If I comment the conflictive lines in config.gcfg, when I run the app, it gives me the following message:
./influxsnmp -config config.gcfg.tmp
panic: invalid character '{' looking for beginning of object key string
goroutine 1 [running]:
panic(0x8b11c0, 0xc8201a4640)
/usr/lib/go/src/runtime/panic.go:481 +0x3e6
main.main()
/home/dragonxtek/go/src/github.com/paulstuart/influxsnmp/main.go:437 +0x33c
Please, help me to run your app
Thanks for your help