sensu-plugins / sensu-plugins-cpu-checks

This plugin provides native CPU instrumentation for monitoring and metrics collection, including: CPU usage and metrics for user, nice, system, idle, iowait, irq, softirq, steal, and guest.
http://sensu-plugins.io
MIT License
13 stars 34 forks source link

Support Installing on non linux platforms #28

Open csoleimani opened 7 years ago

csoleimani commented 7 years ago

Hi, Could MacOS support get added to this since Sensu also has a Mac client now?

I get a dependency error with linux-kstat on MacOS

majormoses commented 7 years ago

It looks like it only used by this check: https://github.com/sensu-plugins/sensu-plugins-cpu-checks/blob/1.1.2/bin/metrics-cpu-mpstat.rb unforunately removing the check is not something we would do lightly especially considering that the number of linux systems being monitored far outweigh any other platform. I will have to look more to find a viable go forward path and I imagine this lies with writing a ruby extension to conditionally add the dependency on linux during install time rather than build time but I am sure that will not be a very popular stance as it will require a c compiler.

mattyjones commented 6 years ago

I am taking this on and will explore refactoring this out and returning it to full portability when I have merged and released the updates to the Gems.

majormoses commented 6 years ago

an option although kinda messy

majormoses commented 6 years ago

The other option is to define the platforms here: https://guides.rubygems.org/specification-reference/#platform= and have multiple gemspecs that could publish a linux specific one that includes that gemspec and for all others exclude that check file and the dependency that causes the issue.