prometheus / node_exporter

Exporter for machine metrics
https://prometheus.io/
Apache License 2.0
11.05k stars 2.34k forks source link

Solaris/Illumos support #1803

Open dsnt02518 opened 4 years ago

dsnt02518 commented 4 years ago

I've recently had to build node_exporter (from git master) for an Oracle Solaris system (11.3), and noticed that the 'Solaris' support is actually currently Illumos/OpenIndiana support. Both systems have different sets of ZFS kstat information available, and hence the zfs collector doesn't work on Oracle Solaris as-is.

I've modified the collector to properly support both flavours, and enabled the 'uname' collector (bsd variety) for Solaris/Illumos.

I've also added a filesystem collector for Solaris/Illumos based on the Linux filesystem collector, but using /etc/mnttab instead. I realise this strictly breaks the rules, namely 'A Collector may only read /proc or /sys files', however under Solaris the kernel mount table is mounted via the 'mnttab' FS as /etc/mnttab.

I also had to tweak Makefile.common to enable a build on both systems, as by default the build expects to be able to download a 'promu' binary, and solaris/illumos are not part of the standard releases. This doesn't feel very complete to me, as the build will not fully work as expected on either platform without first manually building 'promu', and the vetting will still fail on both platforms due to an attempt to download promtool (no solaris prometheus binaries available). However it will at least now build on both platforms.

Code is at https://github.com/dsnt02518/node_exporter/tree/dsnt02518/solaris_illumos but I'm not sure this is ready for a PR yet?

Let me know if this should be broken out into multiple issues or if any more info is needed.

discordianfish commented 4 years ago

All that seems reasonable to me.. Unfortunately none of the core maintainers is invested much in solaris(es), so can't promising anything.

I guess for proper support, you'd need to add support to promu first.

brian-brazil commented 4 years ago

@n27051538 may also be interested, from a SPARC Solaris standpoint.

n27051538 commented 4 years ago

Hello, dears. Thank you, @brian-brazil for mention. It seems that SPARC Solaris will die soon even in my company. But I have to monitor it still, so I solved my today problem by writing simple exporter on Python. https://github.com/n27051538/solaris_exporter I do not know GoLang, so I could not support modification of node_exporter for SPARC Solaris support.

jamesbeedy commented 4 years ago

@n27051538 We packaged the node exporter as a snap, possibly if you can run snaps on solaris then it may be of value to you.

n27051538 commented 4 years ago

I'm not sure, but it seems that snap not supports SPARC Solaris.