amonapp / amonagent

Single binary agent for Linux
https://amon.cx
MIT License
48 stars 21 forks source link

mysql plugin #8

Open zodman opened 7 years ago

zodman commented 7 years ago

root@237001:~# /opt/amonagent/amonagent -debug -test-plugin=mysql panic: runtime error: invalid memory address or nil pointer dereference panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x20 pc=0x64b136]

goroutine 1 [running]: panic(0x742e40, 0xc420012070) /usr/local/go/src/runtime/panic.go:500 +0x1a1 database/sql.(Rows).Close(0x0, 0x0, 0x0) /usr/local/go/src/database/sql/sql.go:1864 +0x26 panic(0x742e40, 0xc420012070) /usr/local/go/src/runtime/panic.go:458 +0x243 database/sql.(Rows).Next(0x0, 0x7ded78) /usr/local/go/src/database/sql/sql.go:1752 +0x26 github.com/amonapp/amonagent/plugins/mysql.(MySQL).Collect(0xc4200e4ec0, 0x0, 0x0, 0x0, 0x0) /home/martin/go/src/github.com/amonapp/amonagent/plugins/mysql/mysql.go:287 +0x1d4c github.com/amonapp/amonagent.(Agent).TestPlugin(0xc4200e4f00, 0x7ffc0ba277e1, 0x5, 0xc42000b8c0, 0x28) /home/martin/go/src/github.com/amonapp/amonagent/agent.go:35 +0x197 main.main() /home/martin/go/src/github.com/amonapp/amonagent/cmd/amonagent.go:101 +0x2d0

My conf:

root@237001:~# cat /etc/opt/amonagent/plugins-enabled/mysql.conf {"host": "wp:pass@/wp_anime"}

jyksnw commented 7 years ago

@zodman did you resolve this issue? It looks like the issue might be related to missing host information form the config.

Try updating: {"host": "wp:pass@/wp_anime"}

To: {"host": "wp:pass@127.0.0.1:3306/wp_anime"} (assuming that your database is local)