Getting status of services in CentOS 6.

39 views
Skip to first unread message

Yagyansh S. Kumar

unread,
Mar 31, 2020, 6:22:17 AM3/31/20
to Prometheus Users
Hi. We have systemd collector in Prometheus that enables us to get the metrics - status of services from systemd. This works well in CentOS 7.
But CentOS 6 does not have systemd, hence, the collector keeps throwing error. Is there any alternative for this for CentOS 6?
Also, in my 6 VMs the URL http://localhost:9001 was giving 404 status and supervisord collector was enabled, and the load of the machines sky rocketed and node_exporter started consuming over 98%+ CPU. I haven't seen any abnormality in the server, so can this be cause for the high load, because I think these kind of bugs were fixed in late 2017.

Thanks!

Christian Hoffmann

unread,
Mar 31, 2020, 5:20:39 PM3/31/20
to Yagyansh S. Kumar, Prometheus Users
Hi,

On 3/31/20 12:22 PM, Yagyansh S. Kumar wrote:
> Hi. We have systemd collector in Prometheus that enables us to get the
> metrics - status of services from systemd. This works well in CentOS 7.
> But CentOS 6 does not have systemd, hence, the collector keeps throwing
> error. Is there any alternative for this for CentOS 6?

I don't think there is any alternative which is as integrated/powerful
as systemd is on CentOS 7 and onwards.
There are lots of service supervisors. Technically, CentOS 6 uses
Upstart. However, almost no service seemed to make use of it, not even
system ones. Instead, most of the services were plain old SysV init
scripts. For those, there is no such supervision or integrated API for
monitoring.

Basically, I would go for process-based monitoring in this case (using
process_exporter).

On the other hand, support for CentOS 6 will end in only a few months so
I guess any efforts should be invested regarding migrations towards
CentOS 7 or 8...

Kind regards,
Christian

Joey Jojo

unread,
Mar 31, 2020, 6:07:51 PM3/31/20
to Prometheus Users
Hey Yagyansh,

Sorry to hijack your post but I am wondering if you made this work in Cent OS, if you could help me with my issue with monitoring Systemd Services. Basically I need to add custom services to the --collector.systemd.unit-whitelist="(apache2|ssh|rsyslog|nginx).service" but not sure how to do it?

Again sorry to hijack your post and sorry can't add anything to help

Yagyansh S. Kumar

unread,
Apr 1, 2020, 10:03:46 AM4/1/20
to Prometheus Users
Hi Joey,

As far as I know, if you have created a service file(in /etc/systemd/system/) for your custom service, you don't need to whitelist it separately, node_exporter's systemd collector itself will scrape the metrics for your custom service.

Yagyansh S. Kumar

unread,
Apr 1, 2020, 10:10:13 AM4/1/20
to Prometheus Users
Alas, only if migration from CentOS 6 to 7 was in my hand :P.
But thanks for the suggestion, will give process exporter a try.
Reply all
Reply to author
Forward
0 new messages