aboutsummaryrefslogtreecommitdiff
path: root/utils/prometheus-node-exporter-lua/files/usr/lib/lua/prometheus-collectors/selinux.lua
blob: 9bfb6c8b5f5fce4fb76d07dad775650a7538dc2e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
local function scrape()
  local enforcing_mode = get_contents("/sys/fs/selinux/enforce")

  if enforcing_mode ~= nil then
    metric("node_selinux_enabled", "gauge", nil, 0)
  else
    metric("node_selinux_enabled", "gauge", nil, 1)
    metric("node_selinux_current_mode", "gauge", nil, enforcing_mode)
  end
end

return { scrape = scrape }