add .editorconfig, format files correctly
All checks were successful
bundlewrap/pipeline/head This commit looks good

This commit is contained in:
Franzi 2021-02-17 10:56:18 +01:00
parent b42e39ed0a
commit fbb8840dff
Signed by: kunsi
GPG key ID: 12E3D2136B818350
33 changed files with 240 additions and 238 deletions

16
.editorconfig Normal file
View file

@ -0,0 +1,16 @@
root = true
[*]
indent_style = space
indent_size = 4
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[*.yaml]
indent_size = 2
# possibly sql dumps
[*.sql]
indent_size = unset

View file

@ -3,8 +3,8 @@
# /etc/kernel/postinst.d/unattended-upgrades # /etc/kernel/postinst.d/unattended-upgrades
case "$DPKG_MAINTSCRIPT_PACKAGE::$DPKG_MAINTSCRIPT_NAME" in case "$DPKG_MAINTSCRIPT_PACKAGE::$DPKG_MAINTSCRIPT_NAME" in
linux-image-extra*::postrm) linux-image-extra*::postrm)
exit 0;; exit 0;;
esac esac
if [ -d /var/run ]; then if [ -d /var/run ]; then

View file

@ -1,10 +1,3 @@
# __ ____
# / /_ __ ______ ____/ / /__ _ ___________ _____
# / __ \/ / / / __ \/ __ / / _ \ | /| / / ___/ __ `/ __ \
# / /_/ / /_/ / / / / /_/ / / __/ |/ |/ / / / /_/ / /_/ /
#/_.___/\__,_/_/ /_/\__,_/_/\___/|__/|__/_/ \__,_/ .___/
# /_/
#
# CAUTION! This file is managed with bundlewrap. # CAUTION! This file is managed with bundlewrap.
# Any manual edits will be lost! # Any manual edits will be lost!

View file

@ -1,10 +1,3 @@
# __ ____
# / /_ __ ______ ____/ / /__ _ ___________ _____
# / __ \/ / / / __ \/ __ / / _ \ | /| / / ___/ __ `/ __ \
# / /_/ / /_/ / / / / /_/ / / __/ |/ |/ / / / /_/ / /_/ /
#/_.___/\__,_/_/ /_/\__,_/_/\___/|__/|__/_/ \__,_/ .___/
# /_/
#
# CAUTION! This file is managed with bundlewrap. # CAUTION! This file is managed with bundlewrap.
# Any manual edits will be lost! # Any manual edits will be lost!

View file

@ -1,15 +1,15 @@
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"]; require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
if environment :matches "imap.mailbox" "*" { if environment :matches "imap.mailbox" "*" {
set "mailbox" "${1}"; set "mailbox" "${1}";
} }
if string "${mailbox}" "Trash" { if string "${mailbox}" "Trash" {
stop; stop;
} }
if environment :matches "imap.user" "*" { if environment :matches "imap.user" "*" {
set "username" "${1}"; set "username" "${1}";
} }
pipe :copy "sa-learn-ham.sh" [ "${username}" ]; pipe :copy "sa-learn-ham.sh" [ "${username}" ];

View file

@ -1,7 +1,7 @@
require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"]; require ["vnd.dovecot.pipe", "copy", "imapsieve", "environment", "variables"];
if environment :matches "imap.user" "*" { if environment :matches "imap.user" "*" {
set "username" "${1}"; set "username" "${1}";
} }
pipe :copy "sa-learn-spam.sh" [ "${username}" ]; pipe :copy "sa-learn-spam.sh" [ "${username}" ];

View file

@ -1,7 +1,7 @@
% for user, config in sorted(node.metadata.get('icinga2', {}).get('api_users', {}).items()): % for user, config in sorted(node.metadata.get('icinga2', {}).get('api_users', {}).items()):
object ApiUser "${user}" { object ApiUser "${user}" {
password = "${config['password']}" password = "${config['password']}"
permissions = [ "${'", "'.join(sorted(config['permissions']))}" ] permissions = [ "${'", "'.join(sorted(config['permissions']))}" ]
} }
% endfor % endfor

View file

@ -1,18 +1,18 @@
% for monitored_node in sorted(monitored_nodes): % for monitored_node in sorted(monitored_nodes):
% if not monitored_node.dummy: % if not monitored_node.dummy:
object ScheduledDowntime "unattended_upgrades" { object ScheduledDowntime "unattended_upgrades" {
host_name = "${monitored_node.name}" host_name = "${monitored_node.name}"
author = "upgrade-and-reboot" author = "upgrade-and-reboot"
comment = "Downtime for upgrade-and-reboot" comment = "Downtime for upgrade-and-reboot"
fixed = true fixed = true
ranges = { ranges = {
"${days[monitored_node.metadata.get('apt', {}).get('unattended_upgrades', {}).get('day', 5)]}" = "01:${monitored_node.magic_number%30}-01:${(monitored_node.magic_number%30)+30}" "${days[monitored_node.metadata.get('apt', {}).get('unattended_upgrades', {}).get('day', 5)]}" = "01:${monitored_node.magic_number%30}-01:${(monitored_node.magic_number%30)+30}"
} }
child_options = "DowntimeTriggeredChildren" child_options = "DowntimeTriggeredChildren"
} }
% endif % endif
% endfor % endfor

View file

@ -1,33 +1,33 @@
% for group in sorted(repo.groups): % for group in sorted(repo.groups):
object HostGroup "group-${group.name}" { object HostGroup "group-${group.name}" {
display_name = "bw group ${group.name}" display_name = "bw group ${group.name}"
assign where "${group.name}" in host.vars.bw_groups assign where "${group.name}" in host.vars.bw_groups
} }
% endfor % endfor
% for bundle in sorted(bundles): % for bundle in sorted(bundles):
object ServiceGroup "bundle-${bundle}" { object ServiceGroup "bundle-${bundle}" {
display_name = "bw bundle ${bundle}" display_name = "bw bundle ${bundle}"
assign where service.vars.bundle == "${bundle}" assign where service.vars.bundle == "${bundle}"
} }
% endfor % endfor
object ServiceGroup "checks_with_mail" { object ServiceGroup "checks_with_mail" {
display_name = "Checks which send E-Mails" display_name = "Checks which send E-Mails"
assign where service.vars.notification.mail == true assign where service.vars.notification.mail == true
} }
object HostGroup "checks_with_sms" { object HostGroup "checks_with_sms" {
display_name = "Hosts which send SMS" display_name = "Hosts which send SMS"
assign where host.vars.notification.sms == true assign where host.vars.notification.sms == true
} }
object ServiceGroup "checks_with_sms" { object ServiceGroup "checks_with_sms" {
display_name = "Checks which send SMS" display_name = "Checks which send SMS"
assign where service.vars.notification.sms == true assign where service.vars.notification.sms == true
} }

View file

@ -1,21 +1,21 @@
% for monitored_node in sorted(monitored_nodes): % for monitored_node in sorted(monitored_nodes):
object Host "${monitored_node.name}" { object Host "${monitored_node.name}" {
import "generic-host" import "generic-host"
address = "${monitored_node.metadata.get('icinga_options', {}).get('hostname', monitored_node.hostname)}" address = "${monitored_node.metadata.get('icinga_options', {}).get('hostname', monitored_node.hostname)}"
vars.os = "${monitored_node.os}" vars.os = "${monitored_node.os}"
vars.sla = "${monitored_node.metadata.get('sla', '24x7')}" vars.sla = "${monitored_node.metadata.get('sla', '24x7')}"
vars.period = "${sla_info[monitored_node.metadata.get('sla', '24x7')]}" vars.period = "${sla_info[monitored_node.metadata.get('sla', '24x7')]}"
vars.location = "${monitored_node.metadata.get('location', 'unknown')}" vars.location = "${monitored_node.metadata.get('location', 'unknown')}"
vars.bw_groups = [ "${'", "'.join(sorted({group.name for group in monitored_node.groups}))}" ] vars.bw_groups = [ "${'", "'.join(sorted({group.name for group in monitored_node.groups}))}" ]
vars.notification.sms = ${str(monitored_node.metadata.get('icinga_options', {}).get('vars.notification.sms', True)).lower()} vars.notification.sms = ${str(monitored_node.metadata.get('icinga_options', {}).get('vars.notification.sms', True)).lower()}
vars.notification.mail = true vars.notification.mail = true
} }
% endfor % endfor
apply Dependency "disable-service-checks-on-host-down" to Service { apply Dependency "disable-service-checks-on-host-down" to Service {
disable_checks = true disable_checks = true
ignore_soft_states = true ignore_soft_states = true
assign where true assign where true
} }

View file

@ -1,8 +1,8 @@
library "db_ido_pgsql" library "db_ido_pgsql"
object IdoPgsqlConnection "ido-pgsql" { object IdoPgsqlConnection "ido-pgsql" {
user = "icinga2", user = "icinga2",
password = "${node.metadata['postgresql']['roles']['icinga2']['password']}", password = "${node.metadata['postgresql']['roles']['icinga2']['password']}",
host = "localhost", host = "localhost",
database = "icinga2" database = "icinga2"
} }

View file

@ -1,74 +1,74 @@
object NotificationCommand "send-host-notification" { object NotificationCommand "send-host-notification" {
import "plugin-notification-command" import "plugin-notification-command"
command = [ ConfigDir + "/scripts/icinga_notification_wrapper" ] command = [ ConfigDir + "/scripts/icinga_notification_wrapper" ]
arguments = { arguments = {
"--mail" = { "--mail" = {
set_if = {{ set_if = {{
host_vars = host.vars host_vars = host.vars
if (host_vars.notification.mail == true) { if (host_vars.notification.mail == true) {
return true return true
} else { } else {
return false return false
}
}}
value = "$user.email$"
} }
}} "--sms" = {
value = "$user.email$" set_if = {{
} host_vars = host.vars
"--sms" = { if (host_vars.notification.sms == true) {
set_if = {{ return true
host_vars = host.vars } else {
if (host_vars.notification.sms == true) { return false
return true }
} else { }}
return false value = "$user.vars.mobile$"
}
"--host_name" = "$host.display_name$"
"--state" = "$host.state$"
"--output" = "$host.output$"
"--escalation" = {
set_if = "$escalation$"
} }
}}
value = "$user.vars.mobile$"
} }
"--host_name" = "$host.display_name$"
"--state" = "$host.state$"
"--output" = "$host.output$"
"--escalation" = {
set_if = "$escalation$"
}
}
} }
object NotificationCommand "send-service-notification" { object NotificationCommand "send-service-notification" {
import "plugin-notification-command" import "plugin-notification-command"
command = [ ConfigDir + "/scripts/icinga_notification_wrapper" ] command = [ ConfigDir + "/scripts/icinga_notification_wrapper" ]
arguments = { arguments = {
"--mail" = { "--mail" = {
set_if = {{ set_if = {{
svc_vars = service.vars svc_vars = service.vars
if (svc_vars.notification.mail == true) { if (svc_vars.notification.mail == true) {
return true return true
} else { } else {
return false return false
}
}}
value = "$user.email$"
} }
}} "--sms" = {
value = "$user.email$" set_if = {{
} svc_vars = service.vars
"--sms" = { if (svc_vars.notification.sms == true) {
set_if = {{ return true
svc_vars = service.vars } else {
if (svc_vars.notification.sms == true) { return false
return true }
} else { }}
return false value = "$user.vars.mobile$"
}
"--host_name" = "$host.display_name$"
"--service_name" = "$service.display_name$"
"--state" = "$service.state$"
"--output" = "$service.output$"
"--escalation" = {
set_if = "$escalation$"
} }
}}
value = "$user.vars.mobile$"
} }
"--host_name" = "$host.display_name$"
"--service_name" = "$service.display_name$"
"--state" = "$service.state$"
"--output" = "$service.output$"
"--escalation" = {
set_if = "$escalation$"
}
}
} }

View file

@ -1,61 +1,61 @@
apply Notification "notify_host-notification" to Host { apply Notification "notify_host-notification" to Host {
import "host-notification" import "host-notification"
interval = 30m interval = 30m
times = { times = {
begin = 1m begin = 1m
end = 30m end = 30m
} }
assign where host.vars.notification.sms == true assign where host.vars.notification.sms == true
} }
apply Notification "notify_service-notification" to Service { apply Notification "notify_service-notification" to Service {
import "service-notification" import "service-notification"
interval = 30m interval = 30m
times = { times = {
begin = 1m begin = 1m
end = 30m end = 30m
} }
assign where service.vars.notification.sms == true assign where service.vars.notification.sms == true
} }
apply Notification "notify_host-notification-escalation" to Host { apply Notification "notify_host-notification-escalation" to Host {
import "host-notification" import "host-notification"
interval = 20m interval = 20m
times = { times = {
begin = 30m begin = 30m
} }
vars.escalation = true vars.escalation = true
assign where host.vars.notification.sms == true assign where host.vars.notification.sms == true
} }
apply Notification "notify_service-notification-escalation" to Service { apply Notification "notify_service-notification-escalation" to Service {
import "service-notification" import "service-notification"
interval = 20m interval = 20m
times = { times = {
begin = 30m begin = 30m
} }
vars.escalation = true vars.escalation = true
assign where service.vars.notification.sms == true assign where service.vars.notification.sms == true
} }
apply Notification "notify_service-notification-mail" to Service { apply Notification "notify_service-notification-mail" to Service {
import "service-notification" import "service-notification"
interval = 0 interval = 0
assign where service.vars.notification.mail == true assign where service.vars.notification.mail == true
ignore where service.vars.notification.sms == true ignore where service.vars.notification.sms == true
} }

View file

@ -1,22 +1,22 @@
% for node_data, icingaconf in sorted(bundle_metadata.items()): % for node_data, icingaconf in sorted(bundle_metadata.items()):
% for service, config in sorted(icingaconf.items()): % for service, config in sorted(icingaconf.items()):
object Service "${service}" { object Service "${service}" {
import "generic-service" import "generic-service"
host_name = "${node_data.name}" host_name = "${node_data.name}"
% for k, v in sorted(config.items()): % for k, v in sorted(config.items()):
% if k not in {'import', 'command_on_monitored_host'} and not k.startswith('vars.notification'): % if k not in {'import', 'command_on_monitored_host'} and not k.startswith('vars.notification'):
% if isinstance(v, bool) or isinstance(v, int) or k in ["check_interval", "retry_interval"]: % if isinstance(v, bool) or isinstance(v, int) or k in ["check_interval", "retry_interval"]:
${k} = ${str(v).lower()} ${k} = ${str(v).lower()}
% elif isinstance(v, list): % elif isinstance(v, list):
${k} = [${", ".join(['"' + i + '"' for i in v])}] ${k} = [${", ".join(['"' + i + '"' for i in v])}]
% else: % else:
${k} = "${v}" ${k} = "${v}"
% endif % endif
% endif % endif
% endfor % endfor
vars.bundle = "${bundle_name}" vars.bundle = "${bundle_name}"
vars.notification.sms = ${str(config.get('vars.notification.sms', False)).lower()} vars.notification.sms = ${str(config.get('vars.notification.sms', False)).lower()}
vars.notification.mail = ${str(config.get('vars.notification.mail', False)).lower()} vars.notification.mail = ${str(config.get('vars.notification.mail', False)).lower()}
} }
% endfor % endfor
% endfor % endfor

View file

@ -68,8 +68,8 @@ template Notification "service-notification" {
user_groups = [ "on-call_sms" ] user_groups = [ "on-call_sms" ]
if(service.vars.period) { if(service.vars.period) {
period = service.vars.period period = service.vars.period
} else { } else {
period = host.vars.period period = host.vars.period
} }
} }

View file

@ -1,35 +1,35 @@
object TimePeriod "24x7" { object TimePeriod "24x7" {
import "legacy-timeperiod" import "legacy-timeperiod"
display_name = "24x7" display_name = "24x7"
ranges = { ranges = {
"monday" = "00:00-24:00" "monday" = "00:00-24:00"
"tuesday" = "00:00-24:00" "tuesday" = "00:00-24:00"
"wednesday" = "00:00-24:00" "wednesday" = "00:00-24:00"
"thursday" = "00:00-24:00" "thursday" = "00:00-24:00"
"friday" = "00:00-24:00" "friday" = "00:00-24:00"
"saturday" = "00:00-24:00" "saturday" = "00:00-24:00"
"sunday" = "00:00-24:00" "sunday" = "00:00-24:00"
} }
} }
object TimePeriod "weekdays_9to6" { object TimePeriod "weekdays_9to6" {
import "legacy-timeperiod" import "legacy-timeperiod"
display_name = "9to6 (UTC)" display_name = "9to6 (UTC)"
ranges = { ranges = {
"monday" = "09:00-18:00" "monday" = "09:00-18:00"
"tuesday" = "09:00-18:00" "tuesday" = "09:00-18:00"
"wednesday" = "09:00-18:00" "wednesday" = "09:00-18:00"
"thursday" = "09:00-18:00" "thursday" = "09:00-18:00"
"friday" = "09:00-18:00" "friday" = "09:00-18:00"
} }
} }
object TimePeriod "never" { object TimePeriod "never" {
import "legacy-timeperiod" import "legacy-timeperiod"
display_name = "never" display_name = "never"
ranges = { ranges = {
} }
} }

View file

@ -4,20 +4,20 @@ object UserGroup "on-call_sms" {
% for username, config in sorted(node.metadata.get('icinga2', {}).get('icinga_users', {}).items()): % for username, config in sorted(node.metadata.get('icinga2', {}).get('icinga_users', {}).items()):
object User "${username}" { object User "${username}" {
display_name = "${username}" display_name = "${username}"
enable_notifications = true enable_notifications = true
period = "24x7" period = "24x7"
% if not config['is_admin']: % if not config['is_admin']:
states = [ OK, Warning, Critical, Up, Down ] states = [ OK, Warning, Critical, Up, Down ]
types = [ Problem, Recovery ] types = [ Problem, Recovery ]
% endif % endif
% if config['is_admin'] and (config['email'] or config['phone']): % if config['is_admin'] and (config['email'] or config['phone']):
groups = [ "on-call_sms" ] groups = [ "on-call_sms" ]
% endif % endif
email = "${config['email']}" email = "${config['email']}"
vars.mobile = "${config['phone']}" vars.mobile = "${config['phone']}"
} }
% endfor % endfor

View file

@ -90,6 +90,7 @@ def notify_per_sms():
def notify_per_mail(): def notify_per_mail():
# editorconfig-checker-disable
text = """ text = """
_ _ _ _
(_)____(_)___ ____ _____ _ (_)____(_)___ ____ _____ _
@ -108,6 +109,7 @@ Service: {service}"""
State: {state} State: {state}
{output}""" {output}"""
# editorconfig-checker-enable
mail = email.mime.text.MIMEText(text.format( mail = email.mime.text.MIMEText(text.format(
host=args.host_name, host=args.host_name,

View file

@ -17,12 +17,6 @@ defaults = {
'icingaweb2': {}, 'icingaweb2': {},
'icingaweb2-module-monitoring': {}, 'icingaweb2-module-monitoring': {},
# needed for check_rbl
'libdata-validate-ip-perl': {},
'libmonitoring-plugin-perl': {},
'libnet-dns-perl': {},
'libreadonly-perl': {},
# neeeded for statusmonitor # neeeded for statusmonitor
'python3-flask': {}, 'python3-flask': {},
} }

View file

@ -33,5 +33,5 @@ exit_hook() {<%text>
<%text> <%text>
HANDLER="$1"; shift HANDLER="$1"; shift
if [[ "${HANDLER}" =~ ^(deploy_cert|exit_hook)$ ]]; then if [[ "${HANDLER}" =~ ^(deploy_cert|exit_hook)$ ]]; then
"$HANDLER" "$@" "$HANDLER" "$@"
fi</%text> fi</%text>

View file

@ -77,11 +77,11 @@ suppress_key_server_warning: true
%endif %endif
password_config: password_config:
enabled: true enabled: true
email: email:
enable_notifs: false enable_notifs: false
notif_from: "Matrix <noreply@${server_name}" notif_from: "Matrix <noreply@${server_name}"
enable_group_creation: true enable_group_creation: true

View file

@ -1,4 +1,5 @@
#!/usr/bin/env perl #!/usr/bin/env perl
# editorconfig-checker-disable-file
# check_nginx_status.pl # check_nginx_status.pl
# Author : regis.leroy at makina-corpus.com # Author : regis.leroy at makina-corpus.com
# Licence : GPL - http://www.fsf.org/licenses/gpl.txt # Licence : GPL - http://www.fsf.org/licenses/gpl.txt
@ -411,14 +412,14 @@ if ($response->is_success) {
$InfoData = sprintf (" %.3f sec. response time, Active: %d (Writing: %d Reading: %d Waiting: %d)" $InfoData = sprintf (" %.3f sec. response time, Active: %d (Writing: %d Reading: %d Waiting: %d)"
. " ReqPerSec: %.3f ConnPerSec: %.3f ReqPerConn: %.3f" . " ReqPerSec: %.3f ConnPerSec: %.3f ReqPerConn: %.3f"
,$timeelapsed,$ActiveConn,$Writing,$Reading,$Waiting,$ReqPerSec,$ConnPerSec,$ReqPerConn); ,$timeelapsed,$ActiveConn,$Writing,$Reading,$Waiting,$ReqPerSec,$ConnPerSec,$ReqPerConn);
# Manage warn and crit values for the perfdata # Manage warn and crit values for the perfdata
my $p_warn_a_level = "$o_warn_a_level"; my $p_warn_a_level = "$o_warn_a_level";
my $p_crit_a_level = "$o_crit_a_level"; my $p_crit_a_level = "$o_crit_a_level";
my $p_warn_rps_level = "$o_warn_rps_level"; my $p_warn_rps_level = "$o_warn_rps_level";
my $p_crit_rps_level = "$o_crit_rps_level"; my $p_crit_rps_level = "$o_crit_rps_level";
my $p_warn_cps_level = "$o_warn_cps_level"; my $p_warn_cps_level = "$o_warn_cps_level";
my $p_crit_cps_level = "$o_crit_cps_level"; my $p_crit_cps_level = "$o_crit_cps_level";
if ($p_warn_a_level == "-1") { if ($p_warn_a_level == "-1") {
$p_warn_a_level = ""; $p_warn_a_level = "";
@ -438,7 +439,7 @@ if ($response->is_success) {
if ($p_crit_cps_level == "-1") { if ($p_crit_cps_level == "-1") {
$p_crit_cps_level = ""; $p_crit_cps_level = "";
} }
$PerfData = sprintf ("Writing=%d;;;; Reading=%d;;;; Waiting=%d;;;; Active=%d;%s;%s;; " $PerfData = sprintf ("Writing=%d;;;; Reading=%d;;;; Waiting=%d;;;; Active=%d;%s;%s;; "
. "ReqPerSec=%f;%s;%s;; ConnPerSec=%f;%s;%s;; ReqPerConn=%f;;;;" . "ReqPerSec=%f;%s;%s;; ConnPerSec=%f;%s;%s;; ReqPerConn=%f;;;;"
,($Writing),($Reading),($Waiting),($ActiveConn) ,($Writing),($Reading),($Waiting),($ActiveConn)

View file

@ -1,4 +1,5 @@
#!/bin/bash #!/bin/bash
# editorconfig-checker-disable-file
# created by McArt <hello@mcart.ru> http://www.mcart.ru/ # created by McArt <hello@mcart.ru> http://www.mcart.ru/
# Uncomment to enable debugging # Uncomment to enable debugging
@ -91,7 +92,7 @@ fi
check_postfix_mailqueue() { check_postfix_mailqueue() {
# Can be set via environment, but default is fetched by postconf (if available, # Can be set via environment, but default is fetched by postconf (if available,
# else /var/spool/postfix) # else /var/spool/postfix)
if which postconf > /dev/null ; then if which postconf > /dev/null ; then
SPOOLDIR=${spooldir:-`postconf -h queue_directory`} SPOOLDIR=${spooldir:-`postconf -h queue_directory`}
else else

View file

@ -1,6 +1,6 @@
% for zone in sorted(zones): % for zone in sorted(zones):
zone "${zone}" { zone "${zone}" {
file "/var/lib/powerdns/zones/${zone}"; file "/var/lib/powerdns/zones/${zone}";
type native; type native;
}; };
% endfor % endfor

View file

@ -1,4 +1,5 @@
#!/usr/bin/perl -w #!/usr/bin/perl -w
# editorconfig-checker-disable-file
# Check SMART status of ATA/SCSI/NVMe drives, returning any usable metrics as perfdata. # Check SMART status of ATA/SCSI/NVMe drives, returning any usable metrics as perfdata.
# For usage information, run ./check_smart -h # For usage information, run ./check_smart -h
# #
@ -105,7 +106,7 @@ if ($opt_d || $opt_g ) {
# normal mode - push opt_d on the list of devices # normal mode - push opt_d on the list of devices
push(@dev,$opt_d); push(@dev,$opt_d);
} else { } else {
# glob all devices - try '?' first # glob all devices - try '?' first
@dev =glob($opt_g); @dev =glob($opt_g);
} }
@ -222,8 +223,8 @@ foreach $device ( split(":",$device) ){
# we had a pattern based on $opt_g # we had a pattern based on $opt_g
$tag = $device; $tag = $device;
$tag =~ s/\Q$opt_g\E//; $tag =~ s/\Q$opt_g\E//;
if($interface =~ qr/(?:megaraid|3ware|cciss)/){ if($interface =~ qr/(?:megaraid|3ware|cciss)/){
$label = "[$interface] - "; $label = "[$interface] - ";
} else { } else {
$label = "[$device] - "; $label = "[$device] - ";
} }
@ -428,7 +429,7 @@ foreach $device ( split(":",$device) ){
warn "(debug) Exclude List for Checks: ", join(",", @exclude_checks), "\n" if $opt_debug; warn "(debug) Exclude List for Checks: ", join(",", @exclude_checks), "\n" if $opt_debug;
warn "(debug) Exclude List for Perfdata: ", join(",", @exclude_perfdata), "\n" if $opt_debug; warn "(debug) Exclude List for Perfdata: ", join(",", @exclude_perfdata), "\n" if $opt_debug;
warn "(debug) Warning Thresholds:\n" if $opt_debug; warn "(debug) Warning Thresholds:\n" if $opt_debug;
for my $warnpair ( sort keys %warn_list ) { warn "$warnpair=$warn_list{$warnpair}\n" if $opt_debug; } for my $warnpair ( sort keys %warn_list ) { warn "$warnpair=$warn_list{$warnpair}\n" if $opt_debug; }
warn "\n" if $opt_debug; warn "\n" if $opt_debug;
# separate metric-gathering and output analysis for ATA vs SCSI SMART output # separate metric-gathering and output analysis for ATA vs SCSI SMART output
@ -673,11 +674,11 @@ foreach $device ( split(":",$device) ){
} }
warn "(debug) gathered perfdata:\n@perfdata\n\n" if $opt_debug; warn "(debug) gathered perfdata:\n@perfdata\n\n" if $opt_debug;
$perf_string = join(' ', @perfdata); $perf_string = join(' ', @perfdata);
warn "###########################################################\n" if $opt_debug; warn "###########################################################\n" if $opt_debug;
warn "(debug) LOCAL STATUS: $exit_status_local, FINAL STATUS: $exit_status\n" if $opt_debug; warn "(debug) LOCAL STATUS: $exit_status_local, FINAL STATUS: $exit_status\n" if $opt_debug;
warn "###########################################################\n\n\n" if $opt_debug; warn "###########################################################\n\n\n" if $opt_debug;
if($exit_status_local ne 'OK'){ if($exit_status_local ne 'OK'){
if ($opt_g) { if ($opt_g) {
$status_string = $label.join(', ', @error_messages); $status_string = $label.join(', ', @error_messages);
@ -687,7 +688,7 @@ foreach $device ( split(":",$device) ){
$status_string = join(', ', @error_messages); $status_string = join(', ', @error_messages);
} }
push @drives_status_not_okay, $status_string; push @drives_status_not_okay, $status_string;
} }
else { else {
if ($opt_g) { if ($opt_g) {
$status_string = $label."Device is clean"; $status_string = $label."Device is clean";

View file

@ -1,13 +1,14 @@
#!/bin/bash #!/bin/bash
# # editorconfig-checker-disable-file
#
# Plugin to check free ram space # Plugin to check free ram space
# using check_by_ssh # using check_by_ssh
# by Markus Walther (voltshock@gmx.de) # by Markus Walther (voltshock@gmx.de)
# The script needs a working check_by_ssh connection and needs to run on the client to check it # The script needs a working check_by_ssh connection and needs to run on the client to check it
# #
# Command-Line for check_by_ssh # Command-Line for check_by_ssh
# command_line $USER1$/check_by_ssh -H $HOSTNAME$ -p $ARG1$ -C "$ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$" # command_line $USER1$/check_by_ssh -H $HOSTNAME$ -p $ARG1$ -C "$ARG2$ $ARG3$ $ARG4$ $ARG5$ $ARG6$"
# #
# Command-Line for service (example) # Command-Line for service (example)
# check_by_ssh!82!/nagios/check_ram.sh!20!10 # check_by_ssh!82!/nagios/check_ram.sh!20!10
# #

View file

@ -45,7 +45,7 @@ if node.has_bundle('systemd-networkd'):
if node.has_bundle('netdata'): if node.has_bundle('netdata'):
files['/etc/netdata/go.d/unbound.conf'] = { files['/etc/netdata/go.d/unbound.conf'] = {
'source': 'netdata-unbound.conf', 'source': 'netdata-unbound.yaml',
'triggers': { 'triggers': {
'svc_systemd:netdata:restart', 'svc_systemd:netdata:restart',
}, },

View file

@ -13,5 +13,5 @@ id-assoc pd 0 {
}; };
profile default { profile default {
information-only; information-only;
}; };

View file

@ -89,4 +89,4 @@ xXqzmNnloA1T7VjwPqIIzkj/u0V8nICG/ktLzp1OsCFatWXh7LbU+hwYl6gsFH/mFDqVxJ3+
DKQivyf1NatzEwl62foVjGUSpvh3ymtmtUQ4JUkNDsXiRBWczaiGSuzD9Qi0ONdkAX3bewqm DKQivyf1NatzEwl62foVjGUSpvh3ymtmtUQ4JUkNDsXiRBWczaiGSuzD9Qi0ONdkAX3bewqm
N4TfE+XIpCPxxHXwGq9Rv1IFjOdCX0iG436GHyTLC1tTUIKF5xV4Y0+cXIM= N4TfE+XIpCPxxHXwGq9Rv1IFjOdCX0iG436GHyTLC1tTUIKF5xV4Y0+cXIM=
=hqgj =hqgj
-----END PGP PUBLIC KEY BLOCK----- -----END PGP PUBLIC KEY BLOCK-----

View file

@ -1,12 +1,12 @@
client_max_body_size 0; client_max_body_size 0;
location / { location / {
proxy_pass http://127.0.0.1:8000; proxy_pass http://127.0.0.1:8000;
proxy_set_header Host $host; proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr; proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Host $server_name; proxy_set_header X-Forwarded-Host $server_name;
proxy_read_timeout 1200s; proxy_read_timeout 1200s;
} }
location /seafhttp { location /seafhttp {

View file

@ -1,5 +1,5 @@
location ~ /(data|conf|bin|inc|vendor)/ { location ~ /(data|conf|bin|inc|vendor)/ {
deny all; deny all;
} }
location / { try_files $uri $uri/ @dokuwiki; } location / { try_files $uri $uri/ @dokuwiki; }

View file

@ -44,12 +44,12 @@ set -g base-index 1
# Allows for faster key repetition # Allows for faster key repetition
set -s escape-time 0 set -s escape-time 0
# Rather than constraining window size to the maximum size of any client # Rather than constraining window size to the maximum size of any client
# connected to the *session*, constrain window size to the maximum size of any # connected to the *session*, constrain window size to the maximum size of any
# client connected to *that window*. Much more reasonable. # client connected to *that window*. Much more reasonable.
setw -g aggressive-resize on setw -g aggressive-resize on
# Allows us to use C-a a <command> to send commands to a TMUX session inside # Allows us to use C-a a <command> to send commands to a TMUX session inside
# another TMUX session # another TMUX session
bind-key a send-prefix bind-key a send-prefix