X-Git-Url: https://git.adam-barratt.org.uk/?a=blobdiff_plain;ds=sidebyside;f=dsa-nagios-checks%2Fchecks%2Fdsa-check-config;h=7ce992e75ce0719f4b21c13f8c62f9dc70b35a4b;hb=a860b52a347f35fe3c370234216545c9f36dad6e;hp=d4b845d2d2de5538aedad3d2d6a9b8b7ae656eb2;hpb=5c87040e8dcb13d102301e271ed91f48e658ee2e;p=mirror%2Fdsa-nagios.git diff --git a/dsa-nagios-checks/checks/dsa-check-config b/dsa-nagios-checks/checks/dsa-check-config index d4b845d..7ce992e 100755 --- a/dsa-nagios-checks/checks/dsa-check-config +++ b/dsa-nagios-checks/checks/dsa-check-config @@ -9,7 +9,7 @@ set -e err=0 log() { - if [ "$0" = "ok" ] && [ "$err" = 0 ]; then + if [ "$1" = "ok" ] && [ "$err" = 0 ]; then err=0 elif [ "$1" = "warn" ] && [ "$err" -lt 1 ]; then err=1 @@ -40,23 +40,6 @@ check_aliases() { log warn "debian-admin not found in root entry in aliases" } -check_ldap_conf() { - if ! [ -e /etc/ldap/ldap.conf ]; then - log unknown "/etc/ldap/ldap.conf not found" - return - fi - - if egrep '^URI.*ldap://db.debian.org' /etc/ldap/ldap.conf > /dev/null && - egrep '^BASE.*dc=debian,dc=org' /etc/ldap/ldap.conf > /dev/null && - egrep '^TLS_CACERT.*/etc/ssl/servicecerts/db.debian.org.crt' /etc/ldap/ldap.conf > /dev/null && - egrep '^TLS_REQCERT.*hard' /etc/ldap/ldap.conf > /dev/null ; then - log ok "ldap.conf configured properly" - return - fi - - log warn "ldap.conf does not have URI, BASE, TLS_CACERT, TLS_REQCERT all configured correctly" -} - check_ssh_hostkeys() { if [ -e /etc/ssh/ssh_host_ed25519_key ] ; then if ! [ -e /etc/ssh/ssh_host_ed25519_key.pub ]; then @@ -88,7 +71,6 @@ check_ipv6_dad() { check_aliases -check_ldap_conf check_ssh_hostkeys check_ipv6_dad