openwrt / openwrt/packages

prometheus-node-exporter-lua: wifi / wifi_stations error when wireless network is disabled

Open
#9,758 1 comment 0 reactions 1 assignee View on GitHub

@champtar is already working on this.

Since Aug 16, 2019.

stale
Dominant language
Makefile
Stars
4.6k
Forks
4k
Avg merge
3d 12h
Merged PRs (30d)
134

Description

Maintainer: @champtar (me)
Environment: All

Description:

Wed Aug 14 16:46:53 2019 daemon.info prometheus-node-exporter-lua[11: /usr/lib/lua/prometheus-collectors/wifi.lua:16: bad argument #1 to 'type' (string expected, got nil)
Wed Aug 14 16:46:53 2019 daemon.info prometheus-node-exporter-lua[11: /usr/lib/lua/prometheus-collectors/wifi_stations.lua:29: bad argument #1 to 'type' (string expected, got nil)
Wed Aug 14 16:47:01 2019 daemon.info prometheus-node-exporter-lua[11: /usr/lib/lua/prometheus-collectors/wifi.lua:16: bad argument #1 to 'type' (string expected, got nil)
Wed Aug 14 16:47:01 2019 daemon.info prometheus-node-exporter-lua[11: /usr/lib/lua/prometheus-collectors/wifi_stations.lua:29: bad argument #1 to 'type' (string expected, got nil)

When interface is down, ifname is not present (which is normal)

root@OpenWrt:~# ubus call network.wireless status
{
	"radio0": {
		"up": false,
		"pending": false,
		"autostart": true,
		"disabled": true,
		"retry_setup_failed": false,
		"config": {
			"channel": "11",
			"hwmode": "11g",
			"path": "platform\/ar933x_wmac",
			"htmode": "HT20",
			"disabled": true
		},
		"interfaces": [
			{
				"section": "default_radio0",
				"config": {
					"mode": "ap",
					"ssid": "OpenWrt",
					"encryption": "none",
					"network": [
						"lan"
					],
					"mode": "ap"
				}
			}
		]
	}
}

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.