smartmon "# scan_smart_devices: glob(3) aborted matching pattern /dev/discs/disc*" error in k8s

289 views
Skip to first unread message

Yi Yang

unread,
Apr 21, 2018, 5:00:49 AM4/21/18
to Prometheus Users

I use openstack-helm-infra/prometheus-node-exporter in a kubernetes enviroment.
I want to collector disk info by using smartmon.
So I add a container named 'smartmon-collector' to collector disk info by smartmon.sh.
Ant it will put the file into /var/lib/node-exporter, sharing with node-exporter. I start node-exporter by arg '--collector.textfile.directory=/var/lib/node-exporter'.

But , when I start it, and i entry the smartmon-collector container, the output of smartmon.sh is just as folowing:

/tmp/smartmon.sh

HELP smartmon_smartctl_version SMART metric smartctl_version

TYPE smartmon_smartctl_version gauge

smartmon_smartctl_version{nodename="node-3",version="6.2"} 1

Not as much as I run the smartmon.sh script in host.

I execute "smartctl --scan-open" in container, output:

smartctl --scan-open

scan_smart_devices: glob(3) aborted matching pattern /dev/discs/disc*


Should I set a volumeMounts like '/sys',"/proc","/dev", or others. How to solve it?
Thank you in advance

Yi Yang

unread,
Apr 21, 2018, 5:01:44 AM4/21/18
to Prometheus Users
I should run the script in host,or in the container?
If run the script in host, and set a hostpath bewteen host and node-exporter pod, it works.

But, I run the script in container, the script could not collector the disk data. How to make it.

在 2018年4月21日星期六 UTC+8下午5:00:49,Yi Yang写道:

Yi Yang

unread,
Apr 22, 2018, 3:57:54 AM4/22/18
to Prometheus Users

I should set a security context for my container.
for docker, i should run with '--privileged'.
for k8s, i should wirte srcurity context as below:
securityContext:
  privileged: true


在 2018年4月21日星期六 UTC+8下午5:01:44,Yi Yang写道:

Yi Yang

unread,
Apr 22, 2018, 3:58:45 AM4/22/18
to Prometheus Users


在 2018年4月21日星期六 UTC+8下午5:00:49,Yi Yang写道:

I use openstack-helm-infra/prometheus-node-exporter in a kubernetes enviroment.

Yi Yang

unread,
Apr 22, 2018, 4:00:00 AM4/22/18
to Prometheus Users
I should set a security context for my container.
for docker, i should run with '--privileged'.
for k8s, i should wirte srcurity context as below:
securityContext:
  privileged: true

在 2018年4月21日星期六 UTC+8下午5:00:49,Yi Yang写道:

I use openstack-helm-infra/prometheus-node-exporter in a kubernetes enviroment.

Reply all
Reply to author
Forward
0 new messages