committing changes in /etc made by "sh /tmp/netdata-kickstart.sh --claim-token aLhhRAZeOuysZlEP2bXAEarAjyl6z0IlFnLpMtFWsqkdYLI6WmChuWGDFb4yhAopbktpArp9VzOZWVnjNXyjXOeaa3YDjx1-lkEtn8eUVo6tmzvLmla3qos98YymqYnDdQFLpAw --claim-url https://app.netdata.cloud"

Package changes:
This commit is contained in:
2023-01-24 13:04:06 +02:00
parent 59be7aacb9
commit e582ddedad
13 changed files with 392 additions and 18 deletions

View File

@@ -54,6 +54,14 @@ mkdir -p './mail/spamassassin/sa-update-keys/private-keys-v1.d'
mkdir -p './modulefiles' mkdir -p './modulefiles'
mkdir -p './modules-load.d' mkdir -p './modules-load.d'
mkdir -p './named' mkdir -p './named'
mkdir -p './netdata/charts.d'
mkdir -p './netdata/custom-plugins.d'
mkdir -p './netdata/ebpf.d'
mkdir -p './netdata/go.d'
mkdir -p './netdata/health.d'
mkdir -p './netdata/python.d'
mkdir -p './netdata/ssl'
mkdir -p './netdata/statsd.d'
mkdir -p './newrelic-infra/integrations.d' mkdir -p './newrelic-infra/integrations.d'
mkdir -p './nginx/conf.d/ganool/nginx/modules' mkdir -p './nginx/conf.d/ganool/nginx/modules'
mkdir -p './nginx/conf.d/ganool/nginx/ngx1/nginx/modules' mkdir -p './nginx/conf.d/ganool/nginx/ngx1/nginx/modules'
@@ -3005,6 +3013,7 @@ maybe chmod 0644 'logrotate.d/mysecureshell'
maybe chmod 0644 'logrotate.d/mysql' maybe chmod 0644 'logrotate.d/mysql'
maybe chgrp 'named' 'logrotate.d/named' maybe chgrp 'named' 'logrotate.d/named'
maybe chmod 0640 'logrotate.d/named' maybe chmod 0640 'logrotate.d/named'
maybe chmod 0644 'logrotate.d/netdata'
maybe chmod 0644 'logrotate.d/nginx' maybe chmod 0644 'logrotate.d/nginx'
maybe chmod 0644 'logrotate.d/php-fpm' maybe chmod 0644 'logrotate.d/php-fpm'
maybe chmod 0644 'logrotate.d/ppp' maybe chmod 0644 'logrotate.d/ppp'
@@ -3911,6 +3920,18 @@ maybe chmod 0640 'named.rfc1912.zones'
maybe chgrp 'named' 'named.root.key' maybe chgrp 'named' 'named.root.key'
maybe chmod 0644 'named.root.key' maybe chmod 0644 'named.root.key'
maybe chmod 0644 'netconfig' maybe chmod 0644 'netconfig'
maybe chmod 0755 'netdata'
maybe chmod 0644 'netdata/.install-type'
maybe chmod 0755 'netdata/charts.d'
maybe chmod 0755 'netdata/custom-plugins.d'
maybe chmod 0755 'netdata/ebpf.d'
maybe chmod 0755 'netdata/edit-config'
maybe chmod 0755 'netdata/go.d'
maybe chmod 0755 'netdata/health.d'
maybe chmod 0644 'netdata/netdata.conf'
maybe chmod 0755 'netdata/python.d'
maybe chmod 0755 'netdata/ssl'
maybe chmod 0755 'netdata/statsd.d'
maybe chmod 0644 'networks' maybe chmod 0644 'networks'
maybe chmod 0755 'newrelic-infra' maybe chmod 0755 'newrelic-infra'
maybe chmod 0644 'newrelic-infra.yml' maybe chmod 0644 'newrelic-infra.yml'

11
group
View File

@@ -2,7 +2,7 @@ root:x:0:
bin:x:1: bin:x:1:
daemon:x:2: daemon:x:2:
sys:x:3: sys:x:3:
adm:x:4: adm:x:4:netdata
tty:x:5: tty:x:5:
disk:x:6: disk:x:6:
lp:x:7: lp:x:7:
@@ -21,7 +21,7 @@ ftp:x:50:
lock:x:54: lock:x:54:
audio:x:63: audio:x:63:
users:x:100: users:x:100:
nobody:x:65534: nobody:x:65534:netdata
dbus:x:81: dbus:x:81:
utmp:x:22: utmp:x:22:
utempter:x:35: utempter:x:35:
@@ -47,9 +47,9 @@ slocate:x:21:
named:x:25: named:x:25:
redis:x:987: redis:x:987:
memcached:x:986: memcached:x:986:
nginx:x:985:madalin,smiti nginx:x:985:madalin,smiti,netdata
apache:x:48: apache:x:48:
docker:x:984:sftp docker:x:984:sftp,netdata
cgred:x:983: cgred:x:983:
dovecot:x:97: dovecot:x:97:
dovenull:x:982: dovenull:x:982:
@@ -101,9 +101,10 @@ mailcow:x:1017:
rundeck:x:1018: rundeck:x:1018:
litecoin:x:1019: litecoin:x:1019:
bogdan:x:1020: bogdan:x:1020:
squid:x:23: squid:x:23:netdata
laser:x:1021: laser:x:1021:
pydio:x:1022: pydio:x:1022:
sftp:x:1023: sftp:x:1023:
toranon:x:955: toranon:x:955:
privoxy:x:73: privoxy:x:73:
netdata:x:954:

10
group-
View File

@@ -2,7 +2,7 @@ root:x:0:
bin:x:1: bin:x:1:
daemon:x:2: daemon:x:2:
sys:x:3: sys:x:3:
adm:x:4: adm:x:4:netdata
tty:x:5: tty:x:5:
disk:x:6: disk:x:6:
lp:x:7: lp:x:7:
@@ -47,9 +47,9 @@ slocate:x:21:
named:x:25: named:x:25:
redis:x:987: redis:x:987:
memcached:x:986: memcached:x:986:
nginx:x:985:madalin,smiti nginx:x:985:madalin,smiti,netdata
apache:x:48: apache:x:48:
docker:x:984:sftp docker:x:984:sftp,netdata
cgred:x:983: cgred:x:983:
dovecot:x:97: dovecot:x:97:
dovenull:x:982: dovenull:x:982:
@@ -101,8 +101,10 @@ mailcow:x:1017:
rundeck:x:1018: rundeck:x:1018:
litecoin:x:1019: litecoin:x:1019:
bogdan:x:1020: bogdan:x:1020:
squid:x:23: squid:x:23:netdata
laser:x:1021: laser:x:1021:
pydio:x:1022: pydio:x:1022:
sftp:x:1023: sftp:x:1023:
toranon:x:955: toranon:x:955:
privoxy:x:73:
netdata:x:954:

11
gshadow
View File

@@ -2,7 +2,7 @@ root:::
bin::: bin:::
daemon::: daemon:::
sys::: sys:::
adm::: adm:::netdata
tty::: tty:::
disk::: disk:::
lp::: lp:::
@@ -21,7 +21,7 @@ ftp:::
lock::: lock:::
audio::: audio:::
users::: users:::
nobody::: nobody:::netdata
dbus:!:: dbus:!::
utmp:!:: utmp:!::
utempter:!:: utempter:!::
@@ -47,9 +47,9 @@ slocate:!::
named:!:: named:!::
redis:!:: redis:!::
memcached:!:: memcached:!::
nginx:!::madalin,smiti nginx:!::madalin,smiti,netdata
apache:!:: apache:!::
docker:!::sftp docker:!::sftp,netdata
cgred:!:: cgred:!::
dovecot:!:: dovecot:!::
dovenull:!:: dovenull:!::
@@ -101,9 +101,10 @@ mailcow:!::
rundeck:!:: rundeck:!::
litecoin:!:: litecoin:!::
bogdan:!:: bogdan:!::
squid:!:: squid:!::netdata
laser:!:: laser:!::
pydio:!:: pydio:!::
sftp:!:: sftp:!::
toranon:!:: toranon:!::
privoxy:!:: privoxy:!::
netdata:!::

View File

@@ -2,7 +2,7 @@ root:::
bin::: bin:::
daemon::: daemon:::
sys::: sys:::
adm::: adm:::netdata
tty::: tty:::
disk::: disk:::
lp::: lp:::
@@ -47,9 +47,9 @@ slocate:!::
named:!:: named:!::
redis:!:: redis:!::
memcached:!:: memcached:!::
nginx:!::madalin,smiti nginx:!::madalin,smiti,netdata
apache:!:: apache:!::
docker:!::sftp docker:!::sftp,netdata
cgred:!:: cgred:!::
dovecot:!:: dovecot:!::
dovenull:!:: dovenull:!::
@@ -101,8 +101,10 @@ mailcow:!::
rundeck:!:: rundeck:!::
litecoin:!:: litecoin:!::
bogdan:!:: bogdan:!::
squid:!:: squid:!::netdata
laser:!:: laser:!::
pydio:!:: pydio:!::
sftp:!:: sftp:!::
toranon:!:: toranon:!::
privoxy:!::
netdata:!::

12
logrotate.d/netdata Normal file
View File

@@ -0,0 +1,12 @@
/var/log/netdata/*.log {
daily
missingok
rotate 14
compress
delaycompress
notifempty
sharedscripts
postrotate
/bin/kill -HUP `cat /run/netdata/netdata.pid 2>/dev/null` 2>/dev/null || true
endscript
}

3
netdata/.install-type Normal file
View File

@@ -0,0 +1,3 @@
INSTALL_TYPE='binpkg-rpm'
PREBUILT_ARCH='x86_64'
PREBUILT_DISTRO=' '

309
netdata/edit-config Executable file
View File

@@ -0,0 +1,309 @@
#!/usr/bin/env sh
# shellcheck disable=SC1091
[ -f /etc/profile ] && . /etc/profile
set -e
script_dir="$(CDPATH="" cd -- "$(dirname -- "$0")" && pwd -P)"
usage() {
check_directories
cat <<EOF
USAGE:
${0} [options] FILENAME
Copy and edit the stock config file named: FILENAME
if FILENAME is already copied, it will be edited as-is.
Stock config files at: '${NETDATA_STOCK_CONFIG_DIR}'
User config files at: '${NETDATA_USER_CONFIG_DIR}'
The editor to use can be specified either by setting the EDITOR
environment variable, or by using the --editor option.
The file to edit can also be specified using the --file option.
For a list of known config files, run '${0} --list'
EOF
exit 0
}
error() {
echo >&2 "ERROR: ${1}"
}
abspath() {
if [ -d "${1}" ]; then
echo "$(cd "${1}" && /usr/bin/env PWD= pwd -P)/"
else
echo "$(cd "$(dirname "${1}")" && /usr/bin/env PWD= pwd -P)/$(basename "${1}")"
fi
}
is_prefix() {
echo "${2}" | grep -qE "^${1}"
return $?
}
check_directories() {
if [ -e "${script_dir}/.environment" ]; then
OLDPATH="${PATH}"
# shellcheck disable=SC1091
. "${script_dir}/.environment"
PATH="${OLDPATH}"
fi
if [ -n "${NETDATA_PREFIX}" ] && [ -d "${NETDATA_PREFIX}/usr/lib/netdata/conf.d" ]; then
stock_dir="${NETDATA_PREFIX}/usr/lib/netdata/conf.d"
elif [ -n "${NETDATA_PREFIX}" ] && [ -d "${NETDATA_PREFIX}/lib/netdata/conf.d" ]; then
stock_dir="${NETDATA_PREFIX}/lib/netdata/conf.d"
elif [ -d "${script_dir}/../../usr/lib/netdata/conf.d" ]; then
stock_dir="${script_dir}/../../usr/lib/netdata/conf.d"
elif [ -d "${script_dir}/../../lib/netdata/conf.d" ]; then
stock_dir="${script_dir}/../../lib/netdata/conf.d"
elif [ -d "/usr/lib/netdata/conf.d" ]; then
stock_dir="/usr/lib/netdata/conf.d"
fi
[ -z "${NETDATA_USER_CONFIG_DIR}" ] && NETDATA_USER_CONFIG_DIR="${script_dir}"
[ -z "${NETDATA_STOCK_CONFIG_DIR}" ] && NETDATA_STOCK_CONFIG_DIR="${stock_dir}"
if [ -z "${NETDATA_STOCK_CONFIG_DIR}" ]; then
error "Unable to find stock config directory."
exit 1
fi
}
check_editor() {
if [ -z "${editor}" ]; then
if [ -n "${EDITOR}" ] && command -v "${EDITOR}" >/dev/null 2>&1; then
editor="${EDITOR}"
elif command -v editor >/dev/null 2>&1; then
editor="editor"
elif command -v vi >/dev/null 2>&1; then
editor="vi"
else
error "Unable to find a usable editor, tried \${EDITOR} (${EDITOR}), editor, and vi."
exit 1
fi
elif ! command -v "${editor}" >/dev/null 2>&1; then
error "Unable to locate user specified editor ${editor}, is it in your PATH?"
exit 1
fi
}
running_in_container() {
[ -e /.dockerenv ] && return 0
[ -e /.dockerinit ] && return 0
[ -r /proc/1/environ ] && tr '\000' '\n' </proc/1/environ | grep -Eiq '^container=podman' && return 0
grep -qF -e /docker/ -e /libpod- /proc/self/cgroup 2>/dev/null && return 0
}
get_docker_command() {
if [ -x "${docker}" ]; then
return 0
elif command -v docker >/dev/null 2>&1; then
docker="$(command -v docker)"
elif command -v podman >/dev/null 2>&1; then
docker="$(command -v podman)"
else
error "Unable to find a usable container tool stack. I support Docker and Podman."
exit 1
fi
}
run_in_container() {
${docker} exec "${1}" /bin/sh -c "${2}" || return 1
return 0
}
check_for_container() {
get_docker_command
${docker} container inspect "${1}" >/dev/null 2>&1 || return 1
run_in_container "${1}" "[ -d \"${NETDATA_STOCK_CONFIG_DIR}\" ]" >/dev/null 2>&1 || return 1
return 0
}
handle_container() {
if running_in_container; then
return 0
elif [ -z "${container}" ] && [ -f "${script_dir}/.container-hostname" ]; then
echo >&2 "Autodetected containerized Netdata instance. Attempting to autodetect container ID."
possible_container="$(cat "${script_dir}/.container-hostname")"
if check_for_container "${possible_container}"; then
container="${possible_container}"
elif check_for_container netdata; then
container="netdata"
else
error "Could not autodetect container ID. It must be supplied on the command line with the --container option."
exit 1
fi
echo >&2 "Found Netdata container with ID or name ${container}"
elif [ -n "${container}" ]; then
if ! check_for_container "${container}"; then
error "No container with ID or name ${container} exists."
exit 1
fi
fi
}
list_files() {
check_directories
handle_container
if test -t; then
width="$(tput cols)"
fi
if [ -z "${container}" ]; then
if [ "$(uname -s)" = "Linux" ]; then
# shellcheck disable=SC2046,SC2086
files="$(cd "${NETDATA_STOCK_CONFIG_DIR}" && ls ${width:+-C} ${width:+-w ${width}} $(find . -type f | cut -d '/' -f 2-))"
elif [ "$(uname -s)" = "FreeBSD" ]; then
if [ -n "${width}" ]; then
export COLUMNS="${width}"
fi
# shellcheck disable=SC2046
files="$(cd "${NETDATA_STOCK_CONFIG_DIR}" && ls ${width:+-C} $(find . -type f | cut -d '/' -f 2-))"
else
# shellcheck disable=SC2046
files="$(cd "${NETDATA_STOCK_CONFIG_DIR}" && ls $(find . -type f | cut -d '/' -f 2-))"
fi
else
files="$(run_in_container "${container}" "cd /usr/lib/netdata/conf.d && ls ${width:+-C} ${width:+-w ${width}} \$(find . -type f | cut -d '/' -f 2-)")"
fi
if [ -z "${files}" ]; then
error "Failed to find any configuration files."
exit 1
fi
cat <<EOF
The following configuration files are known to this script:
${files}
EOF
exit 0
}
parse_args() {
while [ -n "${1}" ]; do
case "${1}" in
"--help") usage ;;
"--list") list_files ;;
"--file")
if [ -n "${2}" ]; then
file="${2}"
shift 1
else
error "No file specified to edit."
exit 1
fi
;;
"--container")
if [ -n "${2}" ]; then
container="${2}"
shift 1
else
error "No container ID or name specified with the --container option."
exit 1
fi
;;
"--editor")
if [ -n "${2}" ]; then
editor="${2}"
shift 1
else
error "No editor specified with the --editor option."
exit 1
fi
;;
*)
if [ -z "${2}" ]; then
file="${1}"
else
error "Unrecognized option ${1}."
exit 1
fi
;;
esac
shift 1
done
[ -z "${file}" ] && usage
absfile="$(abspath "${file}")"
if ! is_prefix "${script_dir}" "${absfile}"; then
error "${file} is not located under ${script_dir}"
exit 1
fi
file="${absfile##"${script_dir}"}"
}
copy_native() {
if [ ! -w "${NETDATA_USER_CONFIG_DIR}" ]; then
error "Cannot write to ${NETDATA_USER_CONFIG_DIR}!"
exit 1
fi
if [ -f "${NETDATA_STOCK_CONFIG_DIR}/${1}" ]; then
echo >&2 "Copying '${NETDATA_STOCK_CONFIG_DIR}/${1}' to '${NETDATA_USER_CONFIG_DIR}/${1}' ... "
cp -p "${NETDATA_STOCK_CONFIG_DIR}/${1}" "${NETDATA_USER_CONFIG_DIR}/${1}" || exit 1
else
echo >&2 "Creating empty '${NETDATA_USER_CONFIG_DIR}/${1}' ... "
touch "${NETDATA_USER_CONFIG_DIR}/${1}" || exit 1
fi
}
copy_container() {
if [ ! -w "${NETDATA_USER_CONFIG_DIR}" ]; then
error "Cannot write to ${NETDATA_USER_CONFIG_DIR}!"
exit 1
fi
if run_in_container "${container}" "[ -f \"${NETDATA_STOCK_CONFIG_DIR}/${1}\" ]"; then
echo >&2 "Copying '${NETDATA_STOCK_CONFIG_DIR}/${1}' to '${NETDATA_USER_CONFIG_DIR}/${1}' ... "
${docker} cp -a "${container}:${NETDATA_STOCK_CONFIG_DIR}/${1}" "${NETDATA_USER_CONFIG_DIR}/${1}" || exit 1
else
echo >&2 "Creating empty '${NETDATA_USER_CONFIG_DIR}/${1}' ... "
touch "${NETDATA_USER_CONFIG_DIR}/${1}" || exit 1
fi
}
copy() {
if [ -f "${NETDATA_USER_CONFIG_DIR}/${1}" ]; then
return 0
elif [ -n "${container}" ]; then
copy_container "${1}"
else
copy_native "${1}"
fi
}
edit() {
echo >&2 "Editing '${1}' ..."
# check we can edit
if [ ! -w "${1}" ]; then
error "Cannot write to ${1}!"
exit 1
fi
"${editor}" "${1}"
exit $?
}
main() {
parse_args "${@}"
check_directories
check_editor
handle_container
copy "${file}"
edit "${absfile}"
}
main "${@}"

19
netdata/netdata.conf Normal file
View File

@@ -0,0 +1,19 @@
# netdata configuration
#
# You can download the latest version of this file, using:
#
# wget -O /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
# or
# curl -o /etc/netdata/netdata.conf http://localhost:19999/netdata.conf
#
# You can uncomment and change any of the options below.
# The value shown in the commented settings, is the default value.
#
[global]
run as user = netdata
# default storage size - increase for longer data retention
page cache size = 32
dbengine multihost disk space = 256

1
passwd
View File

@@ -78,3 +78,4 @@ pydio:x:1021:1022::/home/pydio:/bin/bash
sftp:x:1023:1023::/home/sftp:/bin/bash sftp:x:1023:1023::/home/sftp:/bin/bash
toranon:x:959:955:Tor anonymizing user:/var/lib/tor:/sbin/nologin toranon:x:959:955:Tor anonymizing user:/var/lib/tor:/sbin/nologin
privoxy:x:73:73::/etc/privoxy:/sbin/nologin privoxy:x:73:73::/etc/privoxy:/sbin/nologin
netdata:x:958:954:Netdata pseudo user:/usr/share/netdata:/sbin/nologin

View File

@@ -77,3 +77,4 @@ laser:x:1020:1021::/home/laser:/bin/bash
pydio:x:1021:1022::/home/pydio:/bin/bash pydio:x:1021:1022::/home/pydio:/bin/bash
sftp:x:1023:1023::/home/sftp:/bin/bash sftp:x:1023:1023::/home/sftp:/bin/bash
toranon:x:959:955:Tor anonymizing user:/var/lib/tor:/sbin/nologin toranon:x:959:955:Tor anonymizing user:/var/lib/tor:/sbin/nologin
privoxy:x:73:73::/etc/privoxy:/sbin/nologin

1
shadow
View File

@@ -78,3 +78,4 @@ pydio:!!:19102:0:99999:7:30::
sftp:!!:19193:0:99999:7:30:: sftp:!!:19193:0:99999:7:30::
toranon:!!:19312:::::: toranon:!!:19312::::::
privoxy:!!:19312:::::: privoxy:!!:19312::::::
netdata:!!:19381::::::

View File

@@ -0,0 +1 @@
/usr/lib/systemd/system/netdata.service