adejoux / nmon2influxdb

Make NMON data dynamic with InfluxDB
GNU Affero General Public License v3.0
80 stars 29 forks source link

panic: runtime error: index out of range #57

Closed DLV111 closed 7 years ago

DLV111 commented 7 years ago

Upgraded from the version noted on the webpage (wget https://github.com/adejoux/nmon2influxdb/releases/download/v0.9.0/nmon2influxdb-linux-amd64.gz) to the current version available here. 2.1.5) https://github.com/adejoux/nmon2influxdb/releases

All worked fine before, now encountering this issue.

File being imported: nmon2influxdb.zip

# /usr/local/bin/nmon2influxdb --debug import /var/log/nmon/nmon2influxdb.nmon
2017/11/21 15:28:14 Using configuration file /root/.nmon2influxdb.cfg
2017/11/21 15:28:14 Creating InfluxDB database nmon_reports
2017/11/21 15:28:14 SetRetentionPolicy: CREATE RETENTION POLICY "log_retention" ON "nmon2influxdb_log" DURATION 2d REPLICATION 1 DEFAULT
2017/11/21 15:28:14 configuration: {Debug:true DebugFile: Timezone:Australia/Adelaide InfluxdbUser:secretuser InfluxdbPassword:secret InfluxdbServer:localhost InfluxdbPort:8086 InfluxdbSecure:false InfluxdbSkipCertCheck:false InfluxdbDatabase:nmon_reports GrafanaUser:secretuser GrafanaPassword:secret GrafanaURL: GrafanaAccess: GrafanaDatasource: HMCServer: HMCUser:secretuser HMCPassword:secret HMCDatabase:nmon2influxdbHMC HMCDataRetention: HMCManagedSystem: HMCManagedSystemOnly:false HMCSamples:0 ImportSkipDisks:false ImportAllCpus:false ImportBuildDashboard:false ImportForce:false ImportSkipMetrics:JFSINODE ImportLogDatabase:nmon2influxdb_log ImportLogRetention:2d ImportDataRetention: ImportSSHUser:root ImportSSHKey:/root/.ssh/id_rsa DashboardWriteFile:false StatsLimit:0 StatsSort:mean StatsFilter: StatsFrom: StatsTo: StatsHost: Metric: ListFilter: ListHost: Inputs:[]}
2017/11/21 15:28:14 Adding serie CPU_ALL
2017/11/21 15:28:14 Adding serie DISKBSIZE
2017/11/21 15:28:14 Adding serie DISKBUSY
2017/11/21 15:28:14 Adding serie DISKREAD
2017/11/21 15:28:14 Adding serie DISKWRITE
2017/11/21 15:28:14 Adding serie DISKXFER
2017/11/21 15:28:14 Adding serie JFSFILE
2017/11/21 15:28:14 Adding serie MEM
2017/11/21 15:28:14 Adding serie NET
2017/11/21 15:28:14 Adding serie NETPACKET
2017/11/21 15:28:14 Adding serie PROC
2017/11/21 15:28:14 ERROR: parsing the following line : TOP,%CPU Utilisation
2017/11/21 15:28:14 Adding serie TOP
2017/11/21 15:28:15 Adding serie VM
2017/11/21 15:28:15 Import file: /var/log/nmon/nmon2influxdb.nmon
2017/11/21 15:28:15 NMON file separator: ,
2017/11/21 15:28:15 query: SELECT last("value") FROM "timestamp" WHERE "file" = 'nmon2influxdb.nmon'
panic: runtime error: index out of range

goroutine 1 [running]:
github.com/adejoux/influxdbclient.(*InfluxDB).ReadLastPoint(0xc42022c1b0, 0x8b428a, 0x5, 0xc42011e530, 0x8b5e30, 0x9, 0x0, 0x1, 0x0, 0x0)
        /home/adejoux/devel/go/src/github.com/adejoux/influxdbclient/api.go:299 +0x2bd
github.com/adejoux/nmon2influxdb/nmon.Import(0xc4201a0000)
        /home/adejoux/devel/go/src/github.com/adejoux/nmon2influxdb/nmon/import.go:87 +0x5ad
github.com/codegangsta/cli.HandleAction(0x807ae0, 0x8cbc18, 0xc4201a0000, 0xc420011000, 0x0)
        /home/adejoux/devel/go/src/github.com/codegangsta/cli/app.go:487 +0x7c
github.com/codegangsta/cli.Command.Run(0x8b470c, 0x6, 0x0, 0x0, 0x0, 0x0, 0x0, 0x8b92d7, 0x11, 0x0, ...)
        /home/adejoux/devel/go/src/github.com/codegangsta/cli/command.go:207 +0xb72
github.com/codegangsta/cli.(*App).Run(0xc420110680, 0xc4200100c0, 0x6, 0x6, 0x0, 0x0)
        /home/adejoux/devel/go/src/github.com/codegangsta/cli/app.go:250 +0x7d0
main.main()
        /home/adejoux/devel/go/src/github.com/adejoux/nmon2influxdb/main.go:317 +0x22e5
adejoux commented 7 years ago

Hello,

Thanks for submitting the bug. I couldn't reproduce it by myself: image

But you provided enough output for me to find where the bug could be.It would be nice if you can test if the bug is still occuring with the attached nmon2influxdb new binary.

Thanks,

Alain nmon2influxdb.zip

DLV111 commented 7 years ago

Hey Alain,

Thanks for the quick response, i downloaded the .zip file you attached and its nmon data, not an actual binary. Can you please provide the binary for linux?

Thanks

adejoux commented 7 years ago

Sorry :)

Here the file nmon2influxdb.gz

Thanks

DLV111 commented 7 years ago

Hey,

It works - thanks!

Thanks

adejoux commented 7 years ago

Thanks. Closed :)