diff options
author | mboelen <michael@cisofy.com> | 2014-09-15 14:01:09 +0400 |
---|---|---|
committer | mboelen <michael@cisofy.com> | 2014-09-15 14:01:09 +0400 |
commit | c9fde8c2d11744cc0875bc3e5dd0abf096211755 (patch) | |
tree | 0997d08919db7ec4e2aa9065c3e9aaf1671c4d6f /include/tests_nameservices | |
parent | 35d32fb5e40b86632677fd2256aebeddf926394a (diff) |
Code cleanup and small enhancements
Diffstat (limited to 'include/tests_nameservices')
-rw-r--r-- | include/tests_nameservices | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/include/tests_nameservices b/include/tests_nameservices index f2e72ee9..e58124c4 100644 --- a/include/tests_nameservices +++ b/include/tests_nameservices @@ -44,12 +44,12 @@ FIND=`cat /etc/resolv.conf | grep "^domain" | awk '{ print $2 }'` if [ "${FIND}" = "" ]; then logtext "Result: no default domain found" - Display --indent 2 --text "- Checking default DNS search domain..." --result NONE --color WHITE + Display --indent 2 --text "- Checking default DNS search domain" --result NONE --color WHITE else logtext "Result: found default domain" logtext "Output: ${FIND}" report "resolv_conf_domain=${FIND}" - Display --indent 2 --text "- Checking default DNS search domain..." --result FOUND --color GREEN + Display --indent 2 --text "- Checking default DNS search domain" --result FOUND --color GREEN RESOLV_DOMAINNAME="${FIND}" fi fi @@ -78,23 +78,23 @@ # Warn if we have more than 6 search domains, which is maximum in most resolvers if [ ${N} -gt 6 ]; then logtext "Result: Found ${N} search domains" - Display --indent 2 --text "- Checking search domains..." --result WARNING --color YELLOW + Display --indent 2 --text "- Checking search domains" --result WARNING --color YELLOW ReportWarning ${TEST_NO} "L" "Found more than 6 search domains, which is usually more than the maximum allowed number in most resolvers" else logtext "Result: Found ${N} search domains" - Display --indent 2 --text "- Checking search domains..." --result FOUND --color GREEN + Display --indent 2 --text "- Checking search domains" --result FOUND --color GREEN fi fi else logtext "Result: /etc/resolv.conf does not exist, skipping test" - Display --indent 2 --text "- Checking search domains..." --result "NOT FOUND" --color YELLOW + Display --indent 2 --text "- Checking search domains" --result "NOT FOUND" --color YELLOW fi # Check amount of search domains (max 1) FIND=`cat /etc/resolv.conf | grep "^search" | wc -l | tr -s ' ' | tr -d ' '` if [ ! "${FIND}" = "0" -a ! "${FIND}" = "1" ]; then logtext "Result: found ${FIND} line(s) with a search statement (expecting less than 2 lines)" - Display --indent 4 --text "- Checking search domains lines..." --result "CONFIG ERROR" --color YELLOW + Display --indent 4 --text "- Checking search domains lines" --result "CONFIG ERROR" --color YELLOW ReportWarning ${TEST_NO} "L" "Found more than 1 search lines in /etc/resolv.conf, which is probably a misconfiguration" else logtext "Result: found ${FIND} line(s) with a search statement (expecting less than 2 lines)" @@ -113,7 +113,7 @@ FIND=`grep "^options" /etc/resolv.conf | awk '{ print $2 }'` if [ "${FIND}" = "" ]; then logtext "Result: no specific other options configured in /etc/resolv.conf" - Display --indent 2 --text "- Checking /etc/resolv.conf options..." --result "NONE" --color WHITE + Display --indent 2 --text "- Checking /etc/resolv.conf options" --result "NONE" --color WHITE else for I in ${FIND}; do logtext "Found option: ${I}" @@ -121,11 +121,11 @@ #rotate --> add performance tune point #timeout <3 --> add performe tune point done - Display --indent 2 --text "- Checking /etc/resolv.conf options..." --result "FOUND" --color GREEN + Display --indent 2 --text "- Checking /etc/resolv.conf options" --result "FOUND" --color GREEN fi else logtext "Result: /etc/resolv.conf not found, test skipped" - Display --indent 2 --text "- Checking /etc/resolv.conf options..." --result "NOT FOUND" --color YELLOW + Display --indent 2 --text "- Checking /etc/resolv.conf options" --result "NOT FOUND" --color YELLOW fi fi # @@ -137,7 +137,7 @@ if [ ${SKIPTEST} -eq 0 ]; then FIND=`uname -n` logtext "Result: 'uname -n' returned ${FIND}" - Display --indent 2 --text "- Checking uname -n output..." --result DONE --color GREEN + Display --indent 2 --text "- Checking uname -n output" --result DONE --color GREEN fi # ################################################################################# @@ -152,10 +152,10 @@ logtext "Result: file /etc/nodename exists" FIND=`cat /etc/nodename` logtext "Output: ${FIND}" - Display --indent 2 --text "- Checking /etc/nodename..." --result "DONE" --color GREEN + Display --indent 2 --text "- Checking /etc/nodename" --result "DONE" --color GREEN else logtext "Result: file /etc/nodename could not be found" - Display --indent 2 --text "- Checking /etc/nodename..." --result "NONE FOUND" --color YELLOW + Display --indent 2 --text "- Checking /etc/nodename" --result "NONE FOUND" --color YELLOW fi fi # @@ -210,10 +210,10 @@ if [ ! "${DOMAINNAME}" = "" ]; then logtext "Result: found domain name" report "domainname=${DOMAINNAME}" - Display --indent 2 --text "- Searching DNS domain name..." --result "FOUND" --color GREEN + Display --indent 2 --text "- Searching DNS domain name" --result "FOUND" --color GREEN Display --indent 6 --text "Domain name: ${DOMAINNAME}" else - Display --indent 2 --text "- Searching DNS domain name..." --result "UNKNOWN" --color YELLOW + Display --indent 2 --text "- Searching DNS domain name" --result "UNKNOWN" --color YELLOW ReportSuggestion ${TEST_NO} "Check DNS configuration for the dns domain name" fi fi @@ -228,10 +228,10 @@ FIND=`${PSBINARY} ax | grep "nscd" | grep -v "grep"` if [ ! "${FIND}" = "" ]; then logtext "Result: nscd is running" - Display --indent 2 --text "- Checking nscd status..." --result RUNNING --color GREEN + Display --indent 2 --text "- Checking nscd status" --result RUNNING --color GREEN else logtext "Result: nscd is not running" - Display --indent 2 --text "- Checking nscd status..." --result "NOT FOUND" --color WHITE + Display --indent 2 --text "- Checking nscd status" --result "NOT FOUND" --color WHITE #YYY show performance suggestion if LDAP is used fi fi @@ -246,11 +246,11 @@ FIND=`${PSBINARY} ax | grep "/named" | grep -v "grep"` if [ ! "${FIND}" = "" ]; then logtext "Result: found BIND process" - Display --indent 2 --text "- Checking BIND status..." --result "FOUND" --color GREEN + Display --indent 2 --text "- Checking BIND status" --result "FOUND" --color GREEN BIND_RUNNING=1 else logtext "Result: BIND not running" - Display --indent 2 --text "- Checking BIND status..." --result "NOT FOUND" --color WHITE + Display --indent 2 --text "- Checking BIND status" --result "NOT FOUND" --color WHITE fi fi # @@ -270,9 +270,9 @@ fi done if [ ! "${BIND_CONFIG_LOCATION}" = "" ]; then - Display --indent 4 --text "- Checking BIND configuration file..." --result "FOUND" --color GREEN + Display --indent 4 --text "- Checking BIND configuration file" --result "FOUND" --color GREEN else - Display --indent 4 --text "- Checking BIND configuration file..." --result "NOT FOUND" --color YELLOW + Display --indent 4 --text "- Checking BIND configuration file" --result "NOT FOUND" --color YELLOW fi fi # @@ -289,10 +289,10 @@ FIND=`${NAMEDCHECKCONFBINARY} ${BIND_CONFIG_LOCATION}; echo $?` if [ "${FIND}" = "0" ]; then logtext "Result: configuration file ${BIND_CONFIG_LOCATION} seems to be fine" - Display --indent 4 --text "- Checking BIND configuration consistency..." --result "OK" --color GREEN + Display --indent 4 --text "- Checking BIND configuration consistency" --result "OK" --color GREEN else logtext "Result: possible errors found in ${BIND_CONFIG_LOCATION}" - Display --indent 4 --text "- Checking BIND configuration consistency..." --result WARNING --color RED + Display --indent 4 --text "- Checking BIND configuration consistency" --result WARNING --color RED ReportWarning ${TEST_NO} "Errors discovered in BIND configuration file" fi else @@ -318,11 +318,11 @@ FIND=`${DIGBINARY} @localhost version.bind chaos txt | grep "^version.bind" | grep TXT | egrep "[0-9].[0-9].[0-9]*"` if [ "${FIND}" = "" ]; then logtext "Result: no useful information in banner found" - Display --indent 4 --text "- Checking BIND version in banner ..." --result "OK" --color GREEN + Display --indent 4 --text "- Checking BIND version in banner" --result "OK" --color GREEN AddHP 2 2 else logtext "Result: possible BIND version available in version banner" - Display --indent 4 --text "- Checking BIND version in banner..." --result WARNING --color RED + Display --indent 4 --text "- Checking BIND version in banner" --result WARNING --color RED ReportWarning ${TEST_NO} "M" "Found BIND version in banner" ReportSuggestion ${TEST_NO} "The version in BIND can be masked by defining 'version none' in the configuration file" AddHP 0 2 @@ -360,11 +360,11 @@ FIND=`${PSBINARY} ax | grep "/pdns_server" | grep -v "grep"` if [ ! "${FIND}" = "" ]; then logtext "Result: found PowerDNS process" - Display --indent 2 --text "- Checking PowerDNS status..." --result "RUNNING" --color GREEN + Display --indent 2 --text "- Checking PowerDNS status" --result "RUNNING" --color GREEN POWERDNS_RUNNING=1 else logtext "Result: PowerDNS not running" - Display --indent 2 --text "- Checking PowerDNS status..." --result "NOT FOUND" --color WHITE + Display --indent 2 --text "- Checking PowerDNS status" --result "NOT FOUND" --color WHITE fi fi # @@ -380,13 +380,13 @@ for I in ${POWERDNS_CONFIG_LOCS}; do if [ -f ${I}/pdns.conf ]; then POWERDNS_AUTH_CONFIG_LOCATION="${I}/pdns.conf" - logtext "Result: found configuration file (${POWERDNS_AUTH_CONFIG_LOCATION})" + logtext "Result: found configuration file (${POWERDNS_AUTH_CONFIG_LOCATION})" fi done if [ ! "${POWERDNS_AUTH_CONFIG_LOCATION}" = "" ]; then - Display --indent 4 --text "- Checking PowerDNS configuration file..." --result "FOUND" --color GREEN + Display --indent 4 --text "- Checking PowerDNS configuration file" --result "FOUND" --color GREEN else - Display --indent 4 --text "- Checking PowerDNS configuration file..." --result "NOT FOUND" --color YELLOW + Display --indent 4 --text "- Checking PowerDNS configuration file" --result "NOT FOUND" --color YELLOW fi fi # @@ -412,10 +412,10 @@ for I in ${FIND}; do logtext "Found backend: ${I}" done - Display --indent 4 --text "- Checking PowerDNS backends..." --result "FOUND" --color GREEN + Display --indent 4 --text "- Checking PowerDNS backends" --result "FOUND" --color GREEN else logtext "Result: no PowerDNS backends found" - Display --indent 4 --text "- Checking PowerDNS backends..." --result "NOT FOUND" --color YELLOW + Display --indent 4 --text "- Checking PowerDNS backends" --result "NOT FOUND" --color YELLOW fi fi # @@ -458,12 +458,12 @@ FIND=`${PSBINARY} ax | grep "ypbind" | grep -v "grep"` if [ ! "${FIND}" = "" ]; then logtext "Result: ypbind is running" - Display --indent 2 --text "- Checking ypbind status..." --result "FOUND" --color GREEN + Display --indent 2 --text "- Checking ypbind status" --result "FOUND" --color GREEN YPBIND_RUNNING=1 ReportSuggestion "Disable the usage of NIS/NIS+ and use an alternative like LDAP or Kerberos instead" else logtext "Result: ypbind is not active" - Display --indent 2 --text "- Checking ypbind status..." --result "NOT FOUND" --color WHITE + Display --indent 2 --text "- Checking ypbind status" --result "NOT FOUND" --color WHITE fi fi # @@ -522,10 +522,10 @@ if [ ! "${NISDOMAIN}" = "" ]; then logtext "Found NIS domain: ${NISDOMAIN}" report "nisdomain=${NISDOMAIN}" - Display --indent 4 --text "- Checking NIS domain..." --result "FOUND" --color GREEN + Display --indent 4 --text "- Checking NIS domain" --result "FOUND" --color GREEN else logtext "Result: No NIS domain found" - Display --indent 4 --text "- Checking NIS domain..." --result "UNKNOWN" --color YELLOW + Display --indent 4 --text "- Checking NIS domain" --result "UNKNOWN" --color YELLOW fi fi # @@ -553,7 +553,7 @@ fi else logtext "Result: /etc/hosts not found, test skipped" - Display --indent 4 --text "Searching duplicate line..." --result "SKIPPED" --color YELLOW + Display --indent 4 --text "Searching duplicate line" --result "SKIPPED" --color YELLOW fi fi # |