Beats for Solaris Platform

I am trying to install beats for Solaris and some ARM platforms so I am compiling from source code.

As first step I tried to compile from source code for Solaris platform . Following are the steps I followed.

  1. Installed Go (1.4) BootStrap - https://golang.org/doc/install/source#go14
  2. Compiled GO (1.6) and generated GO binaries - https://golang.org/doc/install/source#introduction
  3. Compile Beats using GO 1.6 as suggested here - https://github.com/elastic/beats/blob/master/CONTRIBUTING.md#setting-up-your-dev-environment

Step 1 and 2 went through fine but while trying to compile beats I am getting following error

My Environment Variable

GOPATH is /export/home/shamoham/go/go1_6/go/ 
GOROOT is /export/home/shamoham/go/go1_6/go 
PATH is /softwares/jdk/jdk1.8.0_45/:/opt/csw/bin:/opt/solarisstudio12.3/bin:/softwares/jdk/jdk1.8.0_45//bin:/usr/bin:/usr/sbin:/export/home/shamoham/go/go1_6/go/bin

STEP I used for compiling Beat (TopBeat)

shamoham@shamohamsolaris:/export/home/shamoham/go/go1_6/go/src/github.com/elastic/beats/topbeat$ gmake
go build
# github.com/elastic/beats/vendor/github.com/elastic/gosigar
../vendor/github.com/elastic/gosigar/concrete_sigar.go:20: cpuUsage.Get undefined (type Cpu has no field or method Get)
../vendor/github.com/elastic/gosigar/concrete_sigar.go:30: cpuUsage.Get undefined (type Cpu has no field or method Get)
../vendor/github.com/elastic/gosigar/concrete_sigar.go:49: l.Get undefined (type LoadAverage has no field or method Get)
../vendor/github.com/elastic/gosigar/concrete_sigar.go:55: m.Get undefined (type Mem has no field or method Get)
../vendor/github.com/elastic/gosigar/concrete_sigar.go:61: s.Get undefined (type Swap has no field or method Get)
../vendor/github.com/elastic/gosigar/concrete_sigar.go:67: f.Get undefined (type FileSystemUsage has no field or method Get)

I am not sure what is wrong in here. I am new to GO. Do I need to Use any specific Glide command before installation for pulling in dependency?

Note : I tried using make and i got an error so I used gmake above. Any help is appreciated

Topbeat isn't supported on Solaris which is why it won't compile. This is a limitation of the gosigar library.

And FYI, we do have a vagrant box for Solaris that we use for testing purposes. It has the Golang dev environment setup. We test libbeat, Filebeat, and Packetbeat on Solaris. We boot the vagrant box then Jenkins runs this script inside the box to build and test.

1 Like

Hi @andrewkroh Thanks alot for your reply.

As suggested I tried to compile packet beat on solaris which went through fine and while executing packet beat on Solaris I am getting following error. Does this has some thing to do with GO?

Note: I thought of pulling the binary from elastic jenkins workspace, but looks like the build is in failed state. http://build-eu-00.elastic.co/view/Beats/job/beats-solaris/ws/packetbeat/

sudo ./packetbeat -d '*' -e
2016/03/22 12:30:42.266559 beat.go:221: DBG  Initializing output plugins
2016/03/22 12:30:42.266669 geolite.go:24: INFO GeoIP disabled: No paths were set under shipper.geoip.paths
2016/03/22 12:30:42.266813 client.go:431: DBG  ES Ping(url=http://somemachine.something.com:9200, timeout=1m30s)
2016/03/22 12:30:42.786221 client.go:440: DBG  Ping status code: 200
2016/03/22 12:30:42.786341 outputs.go:89: INFO Activated elasticsearch as output plugin.
2016/03/22 12:30:42.786362 publish.go:235: DBG  Create output worker
2016/03/22 12:30:42.786459 publish.go:277: DBG  No output is defined to store the topology. The server fields might not be filled.
2016/03/22 12:30:42.786539 publish.go:291: INFO Publisher name: sthjprtsol51
2016/03/22 12:30:42.786591 async.go:70: INFO Flush Interval set to: 1s
2016/03/22 12:30:42.786618 async.go:71: INFO Max Bulk Size set to: 50
2016/03/22 12:30:42.786635 async.go:79: DBG  create bulk processing worker (interval=1s, bulk size=50)
2016/03/22 12:30:42.786744 beat.go:238: INFO Init Beat: packetbeat; Version: 5.0.0-SNAPSHOT
panic: reflect: call of reflect.Value.Type on zero Value
goroutine 15 [running]:
panic(0xbf2b20, 0xc821232ca0)
		/export/home/shamoh/go/go1_6/go/src/runtime/panic.go:464 +0x3ef
reflect.Value.Type(0x0, 0x0, 0x0, 0x0, 0x0)
		/export/home/shamoh/go/go1_6/go/src/reflect/value.go:1671 +0x7b
github.com/elastic/beats/vendor/github.com/urso/ucfg.pointerize(0xffff80ffbf3130a8, 0xcf4380, 0xffff80ffbf3130a8, 0xc0dc60, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/vendor/github.com/urso/ucfg/reify.go:384 +0x143
github.com/elastic/beats/vendor/github.com/urso/ucfg.reifyValue(0xd216e0, 0x6, 0xd1afe8, 0x1, 0xffff80ffbf3130a8, 0xcf4380, 0xffff80ffbf346500, 0x16c75a8, 0x0, 0x0, ...)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/vendor/github.com/urso/ucfg/reify.go:176 +0x370
github.com/elastic/beats/vendor/github.com/urso/ucfg.reifyMap(0xd216e0, 0x6, 0xd1afe8, 0x1, 0xae7f20, 0xc821282228, 0x195, 0xc821236068, 0x0, 0x0)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/vendor/github.com/urso/ucfg/reify.go:63 +0x49d
github.com/elastic/beats/vendor/github.com/urso/ucfg.reifyMergeValue(0xd216e0, 0x6, 0xd1afe8, 0x1, 0xae7f20, 0xc821282228, 0x195, 0xffff80ffbf346498, 0xc821236068, 0x0, ...)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/vendor/github.com/urso/ucfg/reify.go:271 +0x807
github.com/elastic/beats/vendor/github.com/urso/ucfg.reifyGetField(0xc821236050, 0xd216e0, 0x6, 0xd1afe8, 0x1, 0xc821247450, 0x9, 0xae7f20, 0xc821282228, 0x195, ...)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/vendor/github.com/urso/ucfg/reify.go:126 +0x1c9
github.com/elastic/beats/vendor/github.com/urso/ucfg.reifyStruct(0xd216e0, 0x6, 0xd1afe8, 0x1, 0xcbcc40, 0xc8211da200, 0x199, 0xc821236050, 0x0, 0x0)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/vendor/github.com/urso/ucfg/reify.go:102 +0x6ee
github.com/elastic/beats/vendor/github.com/urso/ucfg.reifyInto(0xd216e0, 0x6, 0xd1afe8, 0x1, 0xcbcc40, 0xc8211da200, 0x199, 0xc821236050, 0x0, 0x0)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/vendor/github.com/urso/ucfg/reify.go:37 +0x306
github.com/elastic/beats/vendor/github.com/urso/ucfg.(*Config).Unpack(0xc821236050, 0xaae9e0, 0xc8211da200, 0xc8211c3db0, 0x1, 0x1, 0x0, 0x0)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/vendor/github.com/urso/ucfg/reify.go:22 +0x204
github.com/elastic/beats/libbeat/cfgfile.Read(0xaae9e0, 0xc8211da200, 0xc8211ca450, 0x27, 0x0, 0x0)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/libbeat/cfgfile/cfgfile.go:65 +0x5bd
github.com/elastic/beats/packetbeat/beater.(*Packetbeat).Config(0xc8211da200, 0xc8211de480, 0x0, 0x0)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/packetbeat/beater/packetbeat.go:108 +0x5d
github.com/elastic/beats/libbeat/beat.(*Beat).Start(0xc8211de480, 0x0, 0x0)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/libbeat/beat/beat.go:166 +0xdc
github.com/elastic/beats/libbeat/beat.Run.func1(0xc8211de480)
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/libbeat/beat/beat.go:121 +0x42
created by github.com/elastic/beats/libbeat/beat.Run
		/export/home/shamoh/go/go1_6/go/src/github.com/elastic/beats/libbeat/beat/beat.go:133 +0x8d

I do not think this is a Solaris specific issue. It looks more like a config parsing issue/bug. Can you please post your configuration file.

@andrewkroh Please find my devices output. Also the packetbeat config file.

sudo ./packetbeat -devices
0: net0 (No description available)
1: lo0 (No description available)

Thanks, I can reproduce the issue on OSX. We are investigating.

I should have also mentioned the work-around. If you remove the empty config options (like mysql:) this should allow it to start.

1 Like

Thanks @andrewkroh that indeed worked for packetbeats.

FYI.. Also the same config with out removing empty config worked on other platforms like linux. Is this a candidate bug for Solaris ?