# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
# _update_every is a special variable - it holds the number of seconds
# between the calls of the _update() function
ap_update_every=
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
# the URL to download apache status info
apache_url="http://127.0.0.1:80/server-status?auto"
apache_curl_opts=
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
apcupsd_ip=127.0.0.1
apcupsd_port=3551
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
# THIS PLUGIN IS OBSOLETE
# USE apps.plugin INSTEAD
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
# if this chart is called X.chart.sh, then all functions and global variables
# must start with X_
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
# if this chart is called X.chart.sh, then all functions and global variables
# must start with X_
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+# Contributed by @jsveiga with PR #480
+
# the exim command to run
exim_command=
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+# contributed by @paulfantom with PR #511
+
# if this chart is called X.chart.sh, then all functions and global variables
# must start with X_
hddtemp_host="localhost"
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
load_average_update_every=5
load_priority=100
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
mem_apps_apps=
# these are required for computing memory in bytes and cpu in seconds
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
# http://dev.mysql.com/doc/refman/5.0/en/server-status-variables.html
#
# https://dev.mysql.com/doc/refman/5.1/en/show-status.html
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
# if this chart is called X.chart.sh, then all functions and global variables
# must start with X_
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
# a space separated list of UPS names
# if empty, the list returned by 'upsc -l' will be used
nut_ups=
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
opensips_opts="fifo get_statistics all"
opensips_cmd=
opensips_update_every=5
# no need for shebang - this file is loaded from charts.d.plugin
-# if this chart is called X.chart.sh, then all functions and global variables
-# must start with X_
-
-# first, you need open php-fpm status in php-fpm.conf
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+# Contributed by @safeie with PR #276
+
+# first, you need open php-fpm status in php-fpm.conf
# second, you need add status location in nginx.conf
# you can see, https://easyengine.io/tutorials/php/fpm-status-page/
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
# the postqueue command
# if empty, it will use the one found in the system path
postfix_postqueue=
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
# sensors docs
# https://www.kernel.org/doc/Documentation/hwmon/sysfs-interface
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+
squid_host=
squid_port=
squid_url=
# no need for shebang - this file is loaded from charts.d.plugin
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+# Contributed by @jgeromero with PR #277
+
# Description: Tomcat netdata charts.d plugin
# Author: Jorge Romero
# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
# GPL v3+
#
-# Script the send alarm notifications for netdata
+# Script to send alarm notifications for netdata
#
# Features:
# - multiple notification methods
# - telegram.org notifications
#
-me="${0}"
+export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
+export LC_ALL=C
+
+# -----------------------------------------------------------------------------
+
+PROGRAM_NAME="$(basename "${0}")"
+
+logdate() {
+ date "+%Y-%m-%d %H:%M:%S"
+}
+
+log() {
+ local status="${1}"
+ shift
+
+ echo >&2 "$(logdate): ${PROGRAM_NAME}: ${status}: ${*}"
+
+}
+
+warning() {
+ log WARNING "${@}"
+}
+
+error() {
+ log ERROR "${@}"
+}
+
+info() {
+ log INFO "${@}"
+}
+
+fatal() {
+ log FATAL "${@}"
+ exit 1
+}
+
+debug=0
+debug() {
+ [ $debug -eq 1 ] && log DEBUG "${@}"
+}
+
+# -----------------------------------------------------------------------------
# check for BASH v4+ (required for associative arrays)
[ $(( ${BASH_VERSINFO[0]} )) -lt 4 ] && \
- echo >&2 "${me}: BASH version 4 or later is required (this is ${BASH_VERSION})." && \
- exit 1
+ fatal "BASH version 4 or later is required (this is ${BASH_VERSION})."
+# -----------------------------------------------------------------------------
# defaults to allow running this script by hand
+
NETDATA_CONFIG_DIR="${NETDATA_CONFIG_DIR-/etc/netdata}"
NETDATA_CACHE_DIR="${NETDATA_CACHE_DIR-/var/cache/netdata}"
[ -z "${NETDATA_REGISTRY_URL}" ] && NETDATA_REGISTRY_URL="https://registry.my-netdata.io"
# don't do anything if this is not WARNING, CRITICAL or CLEAR
if [ "${status}" != "WARNING" -a "${status}" != "CRITICAL" -a "${status}" != "CLEAR" ]
then
- echo >&2 "${me}: not sending notification for ${status} on '${chart}.${name}'"
+ info "not sending notification for ${status} on '${chart}.${name}'"
exit 1
fi
# don't do anything if this is CLEAR, but it was not WARNING or CRITICAL
if [ "${old_status}" != "WARNING" -a "${old_status}" != "CRITICAL" -a "${status}" = "CLEAR" ]
then
- echo >&2 "${me}: not sending notification for ${status} on '${chart}.${name}' (last status was ${old_status})"
+ info "not sending notification for ${status} on '${chart}.${name}' (last status was ${old_status})"
exit 1
fi
# check that we have at least a method enabled
if [ "${SEND_EMAIL}" != "YES" -a "${SEND_PUSHOVER}" != "YES" -a "${SEND_TELEGRAM}" != "YES" -a "${SEND_SLACK}" != "YES" ]
then
- echo >&2 "All notification methods are disabled. Not sending a notification."
- exit 1
+ fatal "All notification methods are disabled. Not sending a notification."
fi
# -----------------------------------------------------------------------------
if [ $ret -eq 0 ]
then
- echo >&2 "${me}: Sent email notification for: ${host} ${chart}.${name} is ${status} to '${to_email}'"
+ info "sent email notification for: ${host} ${chart}.${name} is ${status} to '${to_email}'"
return 0
else
- echo >&2 "${me}: Failed to send email notification for: ${host} ${chart}.${name} is ${status} to '${to_email}' with error code ${ret}."
+ error "failed to send email notification for: ${host} ${chart}.${name} is ${status} to '${to_email}' with error code ${ret}."
return 1
fi
fi
if [ "${httpcode}" == "200" ]
then
- echo >&2 "${me}: Sent pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}'"
+ info "sent pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}'"
sent=$((sent + 1))
else
- echo >&2 "${me}: Failed to send pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP error code ${httpcode}."
+ error "failed to send pushover notification for: ${host} ${chart}.${name} is ${status} to '${user}' with HTTP error code ${httpcode}."
fi
done
if [ "${httpcode}" == "200" ]
then
- echo >&2 "${me}: Sent telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}'"
+ info "sent telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}'"
sent=$((sent + 1))
elif [ "${httpcode}" == "401" ]
then
- echo >&2 "${me}: Failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}': Wrong bot token."
+ error "failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}': Wrong bot token."
else
- echo >&2 "${me}: Failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}' with HTTP error code ${httpcode}."
+ error "failed to send telegram notification for: ${host} ${chart}.${name} is ${status} to '${chatid}' with HTTP error code ${httpcode}."
fi
done
httpcode=$(${curl} --write-out %{http_code} --silent --output /dev/null -X POST --data-urlencode "payload=${payload}" "${webhook}")
if [ "${httpcode}" == "200" ]
then
- echo >&2 "${me}: Sent slack notification for: ${host} ${chart}.${name} is ${status} to '${channel}'"
+ info "sent slack notification for: ${host} ${chart}.${name} is ${status} to '${channel}'"
sent=$((sent + 1))
else
- echo >&2 "${me}: Failed to send slack notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP error code ${httpcode}."
+ error "failed to send slack notification for: ${host} ${chart}.${name} is ${status} to '${channel}', with HTTP error code ${httpcode}."
fi
done
#!/usr/bin/env bash
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+# Script to find a better name for cgroups
+#
+
export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
export LC_ALL=C
+# -----------------------------------------------------------------------------
+
+PROGRAM_NAME="$(basename "${0}")"
+
+logdate() {
+ date "+%Y-%m-%d %H:%M:%S"
+}
+
+log() {
+ local status="${1}"
+ shift
+
+ echo >&2 "$(logdate): ${PROGRAM_NAME}: ${status}: ${*}"
+
+}
+
+warning() {
+ log WARNING "${@}"
+}
+
+error() {
+ log ERROR "${@}"
+}
+
+info() {
+ log INFO "${@}"
+}
+
+fatal() {
+ log FATAL "${@}"
+ exit 1
+}
+
+debug=0
+debug() {
+ [ $debug -eq 1 ] && log DEBUG "${@}"
+}
+
+# -----------------------------------------------------------------------------
+
NETDATA_CONFIG_DIR="${NETDATA_CONFIG_DIR-/etc/netdata}"
CONFIG="${NETDATA_CONFIG_DIR}/cgroups-names.conf"
CGROUP="${1}"
NAME=
+# -----------------------------------------------------------------------------
+
if [ -z "${CGROUP}" ]
then
- echo >&2 "${0}: called without a cgroup name. Nothing to do."
- exit 1
+ fatal "called without a cgroup name. Nothing to do."
fi
if [ -f "${CONFIG}" ]
NAME="$(grep "^${CGROUP} " "${CONFIG}" | sed "s/[[:space:]]\+/ /g" | cut -d ' ' -f 2)"
if [ -z "${NAME}" ]
then
- echo >&2 "${0}: cannot find cgroup '${CGROUP}' in '${CONFIG}'."
+ info "cannot find cgroup '${CGROUP}' in '${CONFIG}'."
fi
#else
-# echo >&2 "${0}: configuration file '${CONFIG}' is not available."
+# info "configuration file '${CONFIG}' is not available."
fi
function get_name_classic {
local DOCKERID="$1"
- echo >&2 "Running command: docker ps --filter=id=\"${DOCKERID}\" --format=\"{{.Names}}\""
+ info "Running command: docker ps --filter=id=\"${DOCKERID}\" --format=\"{{.Names}}\""
NAME="$( docker ps --filter=id="${DOCKERID}" --format="{{.Names}}" )"
return 0
}
local DOCKERID="$1"
if [ ! -S "/var/run/docker.sock" ]
then
- echo >&2 "Can't find /var/run/docker.sock"
+ warning "Can't find /var/run/docker.sock"
return 1
fi
- echo >&2 "Running API command: /containers/${DOCKERID}/json"
+ info "Running API command: /containers/${DOCKERID}/json"
JSON=$(echo -e "GET /containers/${DOCKERID}/json HTTP/1.0\r\n" | nc -U /var/run/docker.sock | egrep '^{.*')
NAME=$(echo $JSON | jq -r .Name,.Config.Hostname | grep -v null | head -n1 | sed 's|^/||')
return 0
fi
if [ -z "${NAME}" ]
then
- echo >&2 "Cannot find the name of docker container '${DOCKERID}'"
+ warning "cannot find the name of docker container '${DOCKERID}'"
NAME="${DOCKERID:0:12}"
else
- echo >&2 "Docker container '${DOCKERID}' is named '${NAME}'"
+ info "docker container '${DOCKERID}' is named '${NAME}'"
fi
fi
fi
[ ${#NAME} -gt 100 ] && NAME="${NAME:0:100}"
fi
-echo >&2 "${0}: cgroup '${CGROUP}' is called '${NAME}'"
+info "cgroup '${CGROUP}' is called '${NAME}'"
echo "${NAME}"
#!/usr/bin/env bash
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+# charts.d.plugin allows easy development of BASH plugins
+#
+# if you need to run parallel charts.d processes, link this file to a different name
+# in the same directory, with a .plugin suffix and netdata will start both of them,
+# each will have a different config file and modules configuration directory.
+#
+
export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/bin:/usr/local/sbin"
PROGRAM_FILE="$0"
PROGRAM_NAME="${PROGRAM_NAME/.plugin}"
MODULE_NAME="main"
-# if you need to run parallel charts.d processes
-# just link this files with a different name
-# in the same directory, with a .plugin suffix
-# netdata will start multiple of them
-# each will have a different config file
-
# -----------------------------------------------------------------------------
# create temp dir
#!/usr/bin/env bash
-me="${0}"
-
-# the frequency to send info to netdata
-# passed by netdata as the first parameter
-update_every="${1-1}"
-
-# the netdata configuration directory
-# passed by netdata as an environment variable
-NETDATA_CONFIG_DIR="${NETDATA_CONFIG_DIR-/etc/netdata}"
-
-# -----------------------------------------------------------------------------
-
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
# This plugin requires a special version of fping.
# Get it from https://github.com/ktsaou/fping
# and build it, like this:
# Then, create /etc/netdata/fping.conf
# and set the configuration options given below
+export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
+export LC_ALL=C
+
+# -----------------------------------------------------------------------------
+
+PROGRAM_NAME="$(basename "${0}")"
+
+logdate() {
+ date "+%Y-%m-%d %H:%M:%S"
+}
+
+log() {
+ local status="${1}"
+ shift
+
+ echo >&2 "$(logdate): ${PROGRAM_NAME}: ${status}: ${*}"
+
+}
+
+warning() {
+ log WARNING "${@}"
+}
+
+error() {
+ log ERROR "${@}"
+}
+
+info() {
+ log INFO "${@}"
+}
+
+fatal() {
+ log FATAL "${@}"
+ echo "DISABLE"
+ exit 1
+}
+
+debug=0
+debug() {
+ [ $debug -eq 1 ] && log DEBUG "${@}"
+}
+
+# -----------------------------------------------------------------------------
+
+# the frequency to send info to netdata
+# passed by netdata as the first parameter
+update_every="${1-1}"
+
+# the netdata configuration directory
+# passed by netdata as an environment variable
+NETDATA_CONFIG_DIR="${NETDATA_CONFIG_DIR-/etc/netdata}"
+
# -----------------------------------------------------------------------------
# configuration options
# can be overwritten at /etc/netdata/fping.conf
retries=1
# -----------------------------------------------------------------------------
-
# load the configuration file
+
if [ ! -f "${NETDATA_CONFIG_DIR}/fping.conf" ]
then
- echo >&2 "${me}: configuration file '${NETDATA_CONFIG_DIR}/fping.conf' not found - nothing to do."
- echo "DISABLE"
- exit 1
+ fatal "configuration file '${NETDATA_CONFIG_DIR}/fping.conf' not found - nothing to do."
fi
source "${NETDATA_CONFIG_DIR}/fping.conf"
if [ -z "${hosts}" ]
then
- echo >&2 "${me}: no hosts configued in '${NETDATA_CONFIG_DIR}/fping.conf' - nothing to do."
- echo "DISABLE"
- exit 1
+ fatal "no hosts configued in '${NETDATA_CONFIG_DIR}/fping.conf' - nothing to do."
fi
if [ -z "${fping}" -o ! -x "${fping}" ]
then
- echo >&2 "${me}: command '${fping}' is not executable - cannot proceed."
- echo "DISABLE"
- exit 1
+ fatal "command '${fping}' is not executable - cannot proceed."
fi
# the fping options we will use
exec "${fping}" "${options[@]}"
# if we cannot execute fping, stop
-echo >&2 "${me}: command '${fping} ${options[@]}' failed to be executed."
-echo "DISABLE"
-exit 1
+fatal "command '${fping} ${options[@]}' failed to be executed."
#!/usr/bin/env bash
+# netdata
+# real-time performance and health monitoring, done right!
+# (C) 2016 Costa Tsaousis <costa@tsaousis.gr>
+# GPL v3+
+#
+# This script is a helper to allow netdata collect tc data
+# parsing tc output has been implemented in C, inside netdata
+# This script allows setting names to dimensions.
+
export PATH="${PATH}:/sbin:/usr/sbin:/usr/local/sbin"
+export LC_ALL=C
PROGRAM_FILE="$0"
PROGRAM_NAME="$(basename $0)"
PROGRAM_NAME="${PROGRAM_NAME/.plugin}"
+# -----------------------------------------------------------------------------
+
+logdate() {
+ date "+%Y-%m-%d %H:%M:%S"
+}
+
+log() {
+ local status="${1}"
+ shift
+
+ echo >&2 "$(logdate): ${PROGRAM_NAME}: ${status}: ${*}"
+
+}
+
+warning() {
+ log WARNING "${@}"
+}
+
+error() {
+ log ERROR "${@}"
+}
+
+info() {
+ log INFO "${@}"
+}
+
+fatal() {
+ log FATAL "${@}"
+ exit 1
+}
+
+debug=0
+debug() {
+ [ $debug -eq 1 ] && log DEBUG "${@}"
+}
+
+# -----------------------------------------------------------------------------
+
plugins_dir="${NETDATA_PLUGINS_DIR}"
[ -z "$plugins_dir" ] && plugins_dir="$( dirname $PROGRAM_FILE )"
if [ -z "${tc}" -o ! -x "${tc}" ]
then
- echo >&2 "${PROGRAM_NAME}: Cannot find command 'tc' in this system."
- exit 1
+ fatal "cannot find command 'tc' in this system."
fi
devices=