Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F8395555
pergamon.filesystem.sizes.py
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
pergamon.filesystem.sizes.py
View Options
from
grafanalib.core
import
*
def
filesystem_graph
(
mountpoint
,
time_from
=
None
):
if
time_from
is
not
None
:
timeFrom
=
"
%s
"
%
(
time_from
,)
else
:
timeFrom
=
None
return
Graph
(
title
=
'Size of
%s
'
%
(
mountpoint
,),
dataSource
=
"Prometheus"
,
timeFrom
=
timeFrom
,
targets
=
[
Target
(
expr
=
'node_filesystem_size_bytes{instance="192.168.100.29:9100",mountpoint="
%s
"}'
%
(
mountpoint
),
legendFormat
=
"Filesystem size"
,
refId
=
'A'
,
),
Target
(
expr
=
'node_filesystem_size_bytes{instance="192.168.100.29:9100",mountpoint="
%s
"} -
\
node_filesystem_avail_bytes{instance="192.168.100.29:9100",mountpoint="
%s
"}'
%
(
mountpoint
,
mountpoint
),
legendFormat
=
"Used space"
,
refId
=
'B'
,
),
],
yAxes
=
[
YAxis
(
format
=
'decbytes'
),
YAxis
(
format
=
SHORT_FORMAT
),
],
)
dashboard
=
Dashboard
(
title
=
"Pergamon filesystem sizes auto-generated"
,
templating
=
Templating
(
list
=
[
Template
(
name
=
"filesystem"
,
label
=
""
,
query
=
'node_filesystem_size_bytes{instance="192.168.100.29:9100"}'
,
regex
=
'/mountpoint=
\"
(.*)
\"
/'
,
dataSource
=
'Prometheus'
,
includeAll
=
True
,
default
=
"All"
,
hide
=
2
,
),
]),
rows
=
[
Row
(
title
=
'$filesystem'
,
panels
=
[
filesystem_graph
(
'$filesystem'
),
filesystem_graph
(
'$filesystem'
,
"1y"
),
],
repeat
=
'filesystem'
,
),
],)
.
auto_panel_ids
()
File Metadata
Details
Attached
Mime Type
text/x-python
Expires
Jun 4 2025, 7:41 PM (11 w, 6 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3241038
Attached To
rDSNIP Code snippets
Event Timeline
Log In to Comment