Linux SMR02 2.6.32-220.7.1.el6.x86_64 #1 SMP Wed Mar 7 00:52:02 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@SMR02 asterisk_exporter-1.1.1.linux-amd64]# ./asterisk_exporter
level=info ts=2021-12-03T15:25:11.072Z caller=main.go:57 msg="starting asterisk_exporter" version="(version=, branch=, revision=)"
level=info ts=2021-12-03T15:25:11.072Z caller=main.go:58 build_context="(go=go1.16, user=, date=)"
level=info ts=2021-12-03T15:25:11.072Z caller=main.go:200 msg="collector registered" collector=agents
level=info ts=2021-12-03T15:25:11.073Z caller=main.go:200 msg="collector registered" collector=core
level=info ts=2021-12-03T15:25:11.073Z caller=main.go:200 msg="collector registered" collector=sip
level=info ts=2021-12-03T15:25:11.073Z caller=main.go:175 msg="all collectors registered"
level=info ts=2021-12-03T15:25:11.073Z caller=main.go:75 msg="Listening on address" address=:9815
level=info ts=2021-12-03T15:25:11.073Z caller=tls_config.go:191 msg="TLS is disabled." http2=false
panic: runtime error: index out of range [0] with length 0
goroutine 8 [running]:
github.com/robinmarechal/asterisk_exporter/cmd.(*CmdRunner).newAgentsInfo(0xc000234260, 0xc0003a4000, 0x5f, 0x0, 0x0, 0x0)
/home/robin/go/src/github.com/robinmarechal/asterisk_exporter/cmd/cmd_parser.go:200 +0x494
github.com/robinmarechal/asterisk_exporter/cmd.(*CmdRunner).AgentsInfo(0xc000234260, 0x939660)
/home/robin/go/src/github.com/robinmarechal/asterisk_exporter/cmd/cmd_runner.go:345 +0x7b
github.com/robinmarechal/asterisk_exporter/collector.collectAgentMetrics(0xc000234260, 0xc0000668c0, 0x2, 0x2)
/home/robin/go/src/github.com/robinmarechal/asterisk_exporter/collector/agent_collector.go:93 +0x2f
github.com/robinmarechal/asterisk_exporter/collector.(*agentCollector).Collect(0xc000206640, 0xc0002054a0)
/home/robin/go/src/github.com/robinmarechal/asterisk_exporter/collector/agent_collector.go:76 +0x147
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
/home/robin/go/pkg/mod/github.com/prometheus/client_golang@v1.10.0/prometheus/registry.go:446 +0x12b
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
/home/robin/go/pkg/mod/github.com/prometheus/client_golang@v1.10.0/prometheus/registry.go:538 +0xe4d
Linux SMR02 2.6.32-220.7.1.el6.x86_64 #1 SMP Wed Mar 7 00:52:02 GMT 2012 x86_64 x86_64 x86_64 GNU/Linux
[root@SMR02 asterisk_exporter-1.1.1.linux-amd64]# ./asterisk_exporter
level=info ts=2021-12-03T15:25:11.072Z caller=main.go:57 msg="starting asterisk_exporter" version="(version=, branch=, revision=)"
level=info ts=2021-12-03T15:25:11.072Z caller=main.go:58 build_context="(go=go1.16, user=, date=)"
level=info ts=2021-12-03T15:25:11.072Z caller=main.go:200 msg="collector registered" collector=agents
level=info ts=2021-12-03T15:25:11.073Z caller=main.go:200 msg="collector registered" collector=core
level=info ts=2021-12-03T15:25:11.073Z caller=main.go:200 msg="collector registered" collector=sip
level=info ts=2021-12-03T15:25:11.073Z caller=main.go:175 msg="all collectors registered"
level=info ts=2021-12-03T15:25:11.073Z caller=main.go:75 msg="Listening on address" address=:9815
level=info ts=2021-12-03T15:25:11.073Z caller=tls_config.go:191 msg="TLS is disabled." http2=false
panic: runtime error: index out of range [0] with length 0
goroutine 8 [running]:
github.com/robinmarechal/asterisk_exporter/cmd.(*CmdRunner).newAgentsInfo(0xc000234260, 0xc0003a4000, 0x5f, 0x0, 0x0, 0x0)
/home/robin/go/src/github.com/robinmarechal/asterisk_exporter/cmd/cmd_parser.go:200 +0x494
github.com/robinmarechal/asterisk_exporter/cmd.(*CmdRunner).AgentsInfo(0xc000234260, 0x939660)
/home/robin/go/src/github.com/robinmarechal/asterisk_exporter/cmd/cmd_runner.go:345 +0x7b
github.com/robinmarechal/asterisk_exporter/collector.collectAgentMetrics(0xc000234260, 0xc0000668c0, 0x2, 0x2)
/home/robin/go/src/github.com/robinmarechal/asterisk_exporter/collector/agent_collector.go:93 +0x2f
github.com/robinmarechal/asterisk_exporter/collector.(*agentCollector).Collect(0xc000206640, 0xc0002054a0)
/home/robin/go/src/github.com/robinmarechal/asterisk_exporter/collector/agent_collector.go:76 +0x147
github.com/prometheus/client_golang/prometheus.(*Registry).Gather.func1()
/home/robin/go/pkg/mod/github.com/prometheus/client_golang@v1.10.0/prometheus/registry.go:446 +0x12b
created by github.com/prometheus/client_golang/prometheus.(*Registry).Gather
/home/robin/go/pkg/mod/github.com/prometheus/client_golang@v1.10.0/prometheus/registry.go:538 +0xe4d