add bundle:ipmitool, add grafana dashboard row
All checks were successful
kunsi/bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-10-18 19:42:27 +02:00
parent 92b2e19e44
commit 8300f48541
Signed by: kunsi
GPG key ID: 12E3D2136B818350
4 changed files with 260 additions and 3 deletions

View file

@ -0,0 +1,228 @@
def dashboard_row_ipmitool(panel_id, node):
return {
'title': 'ipmitool',
'collapse': False,
'editable': False,
'height': '250px',
'panels': [
{
'aliasColors': {},
'bars': False,
'dashLength': 10,
'dashes': False,
'datasource': None,
'fieldConfig': {
'defaults': {
'displayName': '${__field.labels.name}'
},
'overrides': []
},
'fill': 0,
'fillGradient': 0,
'hiddenSeries': False,
'id': next(panel_id),
'legend': {
'alignAsTable': False,
'avg': False,
'current': False,
'hideEmpty': True,
'hideZero': True,
'max': False,
'min': False,
'rightSide': False,
'show': True,
'total': False,
'values': False
},
'lines': True,
'linewidth': 1,
'NonePointMode': 'None',
'options': {
'alertThreshold': True
},
'percentage': False,
'pluginVersion': '7.5.5',
'pointradius': 2,
'points': False,
'renderer': 'flot',
'seriesOverrides': [],
'spaceLength': 10,
'span': 8,
'stack': False,
'steppedLine': False,
'targets': [
{
'groupBy': [
{'type': 'time', 'params': ['$__interval']},
{'type': 'fill', 'params': ['linear']},
],
'orderByTime': "ASC",
'policy': "default",
'query': f"""from(bucket: "telegraf")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r["_measurement"] == "ipmi_sensor" and
r["unit"] == "degrees_c" and
r["host"] == "{node.name}"
)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "cpu")""",
'resultFormat': 'time_series',
'select': [[
{'type': 'field', 'params': ['value']},
{'type': 'mean', 'params': []},
]],
"tags": []
},
],
'thresholds': [],
'timeRegions': [],
'title': 'temperatures',
'tooltip': {
'shared': True,
'sort': 0,
'value_type': 'individual'
},
'type': 'graph',
'xaxis': {
'buckets': None,
'mode': 'time',
'name': None,
'show': True,
'values': []
},
'yaxes': [
{
'format': 'celsius',
'label': None,
'logBase': 1,
'max': None,
'min': 0,
'show': True,
},
{
'format': 'short',
'label': None,
'logBase': 1,
'max': None,
'min': None,
'show': False,
}
],
'yaxis': {
'align': False,
'alignLevel': None
}
},
{
'aliasColors': {},
'bars': False,
'dashLength': 10,
'dashes': False,
'datasource': None,
'fieldConfig': {
'defaults': {
'displayName': '${__field.labels.name}'
},
'overrides': []
},
'fill': 0,
'fillGradient': 0,
'hiddenSeries': False,
'id': next(panel_id),
'legend': {
'alignAsTable': False,
'avg': False,
'current': False,
'hideEmpty': True,
'hideZero': True,
'max': False,
'min': False,
'rightSide': False,
'show': True,
'total': False,
'values': False
},
'lines': True,
'linewidth': 1,
'NonePointMode': 'None',
'options': {
'alertThreshold': True
},
'percentage': False,
'pluginVersion': '7.5.5',
'pointradius': 2,
'points': False,
'renderer': 'flot',
'seriesOverrides': [],
'spaceLength': 10,
'span': 4,
'stack': False,
'steppedLine': False,
'targets': [
{
'groupBy': [
{'type': 'time', 'params': ['$__interval']},
{'type': 'fill', 'params': ['linear']},
],
'orderByTime': "ASC",
'policy': "default",
'query': f"""from(bucket: "telegraf")
|> range(start: v.timeRangeStart, stop: v.timeRangeStop)
|> filter(fn: (r) =>
r["_measurement"] == "ipmi_sensor" and
r["unit"] == "rpm" and
r["host"] == "{node.name}"
)
|> aggregateWindow(every: v.windowPeriod, fn: mean, createEmpty: false)
|> yield(name: "fan")""",
'resultFormat': 'time_series',
'select': [[
{'type': 'field', 'params': ['value']},
{'type': 'mean', 'params': []},
]],
"tags": []
},
],
'thresholds': [],
'timeRegions': [],
'title': 'fans',
'tooltip': {
'shared': True,
'sort': 0,
'value_type': 'individual'
},
'type': 'graph',
'xaxis': {
'buckets': None,
'mode': 'time',
'name': None,
'show': True,
'values': []
},
'yaxes': [
{
'format': 'rotrpm',
'label': None,
'logBase': 1,
'max': None,
'min': 0,
'show': True,
'decimals': 0,
},
{
'format': 'short',
'label': None,
'logBase': 1,
'max': None,
'min': None,
'show': False,
}
],
'yaxis': {
'align': False,
'alignLevel': None
}
},
],
}

View file

@ -97,7 +97,10 @@ for rnode in repo.nodes:
], ],
} }
if rnode.has_bundle('lm-sensors'): if rnode.has_bundle('ipmitool'):
dashboard['rows'].append(dashboard_row_ipmitool(panel_id, rnode))
dashboard['tags'].add('ipmitool')
elif rnode.has_bundle('lm-sensors'):
dashboard['rows'].append(dashboard_row_sensors(panel_id, rnode)) dashboard['rows'].append(dashboard_row_sensors(panel_id, rnode))
dashboard['tags'].add('lm-sensors') dashboard['tags'].add('lm-sensors')

View file

@ -0,0 +1,27 @@
defaults = {
'apt': {
'packages': {
'ipmitool': {},
},
},
'telegraf': {
'input_plugins': {
'builtin': {
'ipmi_sensor': [{
'interval': '30s',
'metric_version': 2,
'timeout': '20s',
'use_sudo': True,
}],
},
},
'sudo_commands': {
'/usr/bin/ipmitool *',
},
},
'pacman': {
'packages': {
'ipmitool': {},
},
},
}

View file

@ -11,6 +11,7 @@ nodes['rx300'] = {
'dovecot', 'dovecot',
'element-web', 'element-web',
'gitea', 'gitea',
'ipmitool',
'jenkins-ci', 'jenkins-ci',
'lm-sensors', 'lm-sensors',
'matrix-dimension', 'matrix-dimension',
@ -52,8 +53,6 @@ nodes['rx300'] = {
}, },
'apt': { 'apt': {
'packages': { 'packages': {
'ipmitool': {},
# for franzi.business deployment # for franzi.business deployment
'ruby': {}, 'ruby': {},
'ruby-dev': {}, 'ruby-dev': {},