1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
|
// SPDX-License-Identifier: GPL-3.0-or-later
//go:build linux
// +build linux
package logind
import "github.com/netdata/netdata/go/plugins/plugin/go.d/agent/module"
const (
prioSessions = module.Priority + iota
prioSessionsType
prioSessionsState
prioUsersState
)
var charts = module.Charts{
sessionsChart.Copy(),
sessionsTypeChart.Copy(),
sessionsStateChart.Copy(),
usersStateChart.Copy(),
}
var sessionsChart = module.Chart{
ID: "sessions",
Title: "Logind Sessions",
Units: "sessions",
Fam: "sessions",
Ctx: "logind.sessions",
Priority: prioSessions,
Type: module.Stacked,
Dims: module.Dims{
{ID: "sessions_remote", Name: "remote"},
{ID: "sessions_local", Name: "local"},
},
}
var sessionsTypeChart = module.Chart{
ID: "sessions_type",
Title: "Logind Sessions By Type",
Units: "sessions",
Fam: "sessions",
Ctx: "logind.sessions_type",
Priority: prioSessionsType,
Type: module.Stacked,
Dims: module.Dims{
{ID: "sessions_type_console", Name: "console"},
{ID: "sessions_type_graphical", Name: "graphical"},
{ID: "sessions_type_other", Name: "other"},
},
}
var sessionsStateChart = module.Chart{
ID: "sessions_state",
Title: "Logind Sessions By State",
Units: "sessions",
Fam: "sessions",
Ctx: "logind.sessions_state",
Priority: prioSessionsState,
Type: module.Stacked,
Dims: module.Dims{
{ID: "sessions_state_online", Name: "online"},
{ID: "sessions_state_closing", Name: "closing"},
{ID: "sessions_state_active", Name: "active"},
},
}
var usersStateChart = module.Chart{
ID: "users_state",
Title: "Logind Users By State",
Units: "users",
Fam: "users",
Ctx: "logind.users_state",
Priority: prioUsersState,
Type: module.Stacked,
Dims: module.Dims{
{ID: "users_state_offline", Name: "offline"},
{ID: "users_state_closing", Name: "closing"},
{ID: "users_state_online", Name: "online"},
{ID: "users_state_lingering", Name: "lingering"},
{ID: "users_state_active", Name: "active"},
},
}
|