I was wondering if there is a way to monitor Centos services like kubelet, keepalived, even a custom service that I wrote, using Metricbeat or any other Elastic service. i.e. is there a way to have metricbeat run a command like:
while not directly related to systemd services, the built-in system module of metricbeat has a process metricset that can be enabled. It supports filtering down the reported processes. It also integrates with cgroups, which are the primary process tracking mechanism systemd uses. Since systemd names the cgroups after the units, it should be easy to query the metricbeat results for the processes belonging to a specific service.
Thank you for the quick reply @weltenwort . I tried this and I do get entries based on the service. But the problem is when the service stops, the entries stop. Is there any way that a field can show the status of the service? So something like the equivalent of heartbeat but instead of tcp/http/... for systemd.