ansible icon indicating copy to clipboard operation
ansible copied to clipboard

Add support for node_exporter on MacOS

Open zhan9san opened this issue 2 years ago • 8 comments

Hi,

Thanks for your great work on this project and I am very glad that the node_exporter Ansible role is active again.

Would it be possible to add support for node_exporter on MacOS?

Reference: https://github.com/devops37/ansible-node-exporter/pull/1/files

zhan9san avatar May 09 '23 06:05 zhan9san

I don't have a problem with adding support for MacOS personally, but @SuperQ and @paulfantom might have other ideas.

But rather than adding support for just MacOS I would like to see the implementation done in a way that we can also support other non-systemd systems, preferably without adding many system specific workarounds, and of course we would need to be able to test everything in the CI. (I actually proposed adding support for non-systemd service managers in the past.)

gardar avatar May 09 '23 17:05 gardar

Thanks for your attention.

Do you have concerns if we perform a lift-shit migration of this PR, https://github.com/devops37/ansible-node-exporter/pull/1/files?

zhan9san avatar May 09 '23 18:05 zhan9san

Previously we intended that the roles only supported systemd, as it was complicated to support multiple supervisors.

SuperQ avatar May 09 '23 18:05 SuperQ

Before we increase the maintenance overhead by adding support for other supervisors (or do any other major changes) I'd like to merge some of the common tasks as proposed in #64 I've been experimenting with this a bit, just have to find some time to finish it.

gardar avatar May 11 '23 10:05 gardar

@SuperQ @gardar

Previously we intended that the roles only supported systemd, as it was complicated to support multiple supervisors.

I agree with you that it would make this project more complicated. But it's a real requirement for us.

Unlike sysvinit which is deprecated, Launchd is widely used on MacOS.

The systemd is only supported on Linux-like OS, I have many MacOS servers need monitoring.

If you don't mind, I'd like to submit a PR to add support for node_exporter on MacOS.

zhan9san avatar May 18 '23 03:05 zhan9san

If we're going to support this, we need to commit to supporting launchd/MacOS on all modules for consistency.

For the launchd config files, I wonder if community.general.xml would be useful for the config.

SuperQ avatar May 18 '23 09:05 SuperQ

@SuperQ

Thanks for your attention.

I don't think it's a good idea to support all modules. Or we can support the rest modules gradually.

Currently, we only need to deploy node_exporter on MacOS, and hardly anyone will want to deploy prometheus/alertmanager on MacOS.

For the launchd config files, the easiest way to do it is by template engine. It follows what we have done in system unit files

It has been working well on my forked repo.

Let me know what you think.

zhan9san avatar May 18 '23 09:05 zhan9san

Revisiting this topic after a year or two. It would be great if MacOS support could be added. What is the latest opinion?

I have been using a customized node_exporter that supports Linux/MacOS/Windows but it's preferable to leverage the community role that's actively maintained.

node_exporter is different than other roles, because in any environment you install a main 'server' component with prometheus, alert manager, grafana, etc, and this can be Linux-only. However the end-nodes being monitored may vary widely. It's only node_exporter that needs to be installed on multiple operating systems.

my first choice would be: Linux/MacOS/Windows/FreeBSD/everything.
second choice: still a step forward - add MacOS functionality.

sdarwin avatar Jan 28 '25 12:01 sdarwin