Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
H
HPCasCode
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
hpc-team
HPCasCode
Merge requests
!380
Telegraf monitoring for Karaage (hpc.erc.monash.edu.au)
Code
Review changes
Check out branch
Download
Patches
Plain diff
Merged
Telegraf monitoring for Karaage (hpc.erc.monash.edu.au)
telegraf-1.15
into
master
Overview
3
Commits
21
Pipelines
4
Changes
3
Merged
Kerri Wait
requested to merge
telegraf-1.15
into
master
4 years ago
Overview
3
Commits
21
Pipelines
4
Changes
3
Expand
0
0
Merge request reports
Viewing commit
521a2013
Prev
Next
Show latest version
3 files
+
37
−
110
Inline
Compare changes
Side-by-side
Inline
Show whitespace changes
Show one file at a time
Files
3
Search (e.g. *.vue) (Ctrl+P)
521a2013
Update telegraf role to intelligently populate hw_counters plugin config
· 521a2013
Kerri Wait
authored
4 years ago
roles/telegraf/files/hw_counters.fact
+
5
−
3
Options
@@ -6,10 +6,12 @@ import os
def
render_data
(
data
):
return
json
.
dumps
(
data
)
device_name
=
'
mlx5_0
'
hw_counters
=
{}
path
=
'
/sys/class/infiniband/{}/ports/1/hw_counters/
'
.
format
(
device_name
)
path_prefix
=
'
/sys/class/infiniband
'
path_suffix
=
'
ports/1/hw_counters
'
hw_counters
[
device_name
]
=
os
.
listdir
(
path
)
for
device_name
in
os
.
listdir
(
path_prefix
):
path
=
os
.
path
.
join
(
path_prefix
,
device_name
,
path_suffix
)
hw_counters
[
device_name
]
=
os
.
listdir
(
path
)
print
(
render_data
(
hw_counters
))
\ No newline at end of file
Loading