Skip to content

Instantly share code, notes, and snippets.

View SuperQ's full-sized avatar

Ben Kochie SuperQ

View GitHub Profile
@SuperQ
SuperQ / url_sd_config.sh
Created July 27, 2018 13:15
Prometheus json/yaml URL to file_sd_config downloader.
#!/bin/bash
#
# Description: Download a URL and write out a file_sd_config.
# Author: Ben Kochie <[email protected]>
set -o pipefail
if [[ $# -ne 2 || $1 == "-h" ]] ; then
echo "usage $(basename $0) <url> <sd file>"
exit
@SuperQ
SuperQ / junos exapmle
Last active July 8, 2019 18:00
Fix Telegraf mysql commands metric names
metric_relabel_configs:
- source_labels:
- __name__
regex: 'mysql_com_(.+)'
target_label: command
- __name__
regex: 'mysql_com_(.+)'
target_label: __name__
replacement: mysql_commands_total
@SuperQ
SuperQ / internet_check.sh
Created September 23, 2020 08:36
A script to check internet connectivity with the node_exporter textfile
#!/usr/bin/env sh
if curl -s -f -o /dev/null https://www.google.com; then
echo "node_internet_connected 1"
else
echo "node_internet_connected 0"
fi
@SuperQ
SuperQ / kubeApiServer_values.yaml
Last active June 8, 2022 13:49
Drop excessive cAdvisor metrics from kube-prometheus-stack helm chart.
# Taken from https://bugzilla.redhat.com/show_bug.cgi?id=1801154
kubeApiServer:
serviceMonitor:
metricRelabelings:
- action: drop
regex: apiserver_request_duration_seconds_bucket;(0.15|0.25|0.3|0.35|0.4|0.45|0.6|0.7|0.8|0.9|1.25|1.5|1.75|2.5|3|3.5|4.5|6|7|8|9|15|25|30|50)
sourceLabels:
- __name__
- le