From | To | Expression |
---|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SELF=${0##*/} SDIR=${0%/*} | |
######################################################################################################################## | |
######################################################## config ######################################################## | |
# Set some defaults | |
VERSION=0.3 | |
CENTOS_RELEASE="7" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=telegraf in Docker container | |
After=docker.service container-influxdb.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Restart=always | |
ExecStartPre=-/usr/bin/docker stop telegraf | |
ExecStartPre=-/usr/bin/docker rm telegraf |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=influxdb in Docker container | |
After=docker.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Restart=always | |
ExecStartPre=-/usr/bin/docker stop influxdb | |
ExecStartPre=-/usr/bin/docker rm influxdb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=grafana in Docker container | |
After=docker.service container-influxdb.service | |
Requires=docker.service | |
[Service] | |
TimeoutStartSec=0 | |
Restart=always | |
ExecStartPre=-/usr/bin/docker stop grafana | |
ExecStartPre=-/usr/bin/docker rm grafana |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
######################################################################################################################## | |
""" | |
Telegraf input plugin for Arris TM1602AP2 | |
Copyright © 2018 by John Celoria. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# -*- coding: utf-8 -*- | |
######################################################################################################################## | |
""" | |
Telegraf input plugin for Motorola Surfboard 6141 | |
Copyright © 2017 by John Celoria. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
SELF=${0##*/} SDIR=${0%/*} | |
######################################################################################################################## | |
# Get home-assistant states | |
# | |
# Copyright © 2017 by John Celoria. | |
# | |
# This program is free software; you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################################################################## | |
# Common Elasticsearch functions | |
function es() { | |
local id=$1; shift; local cmd=$1; shift; local connect region json curl="$(type -P curl) -sL --netrc-file ~/.netrc-es" | |
local actions=(aliases allocation health indices nodes recovery shards settings stats clear-cache) | |
local regex="+(*$(IFS='|';echo "${actions[*]}"|sed 's/|/|*/g'))" | |
function _help() { | |
echo "Usage: es <id> ${regex##*+}" >&2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
######################################################################################################################## | |
# ssh wrapper to continuously retry if unavailable | |
function ssh() { | |
local next prev host port | |
for ((i=1;i<=$#;++i)); do | |
next=$((i+1)); [[ $((i-1)) -eq 0 ]] || prev=$((i-1)) | |
case "${!i}" in | |
-p*) [[ "${!i}" =~ -p$ ]] && port=${!next} || port=${!i//-p} ;; | |
*@*) host=${!i##*@} ;; | |
-*) true ;; |