57 lines
2.4 KiB
Bash
Executable file
57 lines
2.4 KiB
Bash
Executable file
print_config_title 'CHECK MUNIN BASIC CONFIG'
|
|
|
|
# This does not check if 'munin-node-configure --shell | sh -x' has been executed
|
|
# This does not check if MUNIN 'monitoring server' has configured this machine
|
|
# Check /etc/munin/munin-node.conf config file, checked parameters : allow/port
|
|
|
|
conf_file_to_test="/etc/munin/munin-node.conf"
|
|
|
|
# Check if conf file exist
|
|
if [[ ! -f "${conf_file_to_test}" ]]
|
|
then
|
|
echo -e "${RED}ERROR : file ${conf_file_to_test} NOT FOUND.${NC}\n"
|
|
MUNIN_CONFIG_CHECK_FAILED=${MUNIN_CONFIG_CHECK_FAILED}" Error, file ${conf_file_to_test} not found;"
|
|
else
|
|
|
|
# allow
|
|
check_value_in_conf_file "MUNIN" "${conf_file_to_test}" "allow" '\^127\\\.0\\\.0\\\.1\$ \^::1\$'" ${IPV4_MASTER_MUNIN} ${IPV6_MASTER_MUNIN}"
|
|
|
|
case ${?} in
|
|
0) # OK, nothing to do
|
|
;;
|
|
1) # Error (wrong number of param or other)
|
|
MUNIN_CONFIG_CHECK_FAILED=${MUNIN_CONFIG_CHECK_FAILED}" Error during allow check with function check_value_in_conf_file, maybe incorrect number of parameter or file not found;"
|
|
;;
|
|
2) # Unexpected value is set
|
|
MUNIN_CONFIG_CHECK_FAILED=${MUNIN_CONFIG_CHECK_FAILED}" allow param is not well configured or has other value, set allow param (IPv6+IPv4) for localhost and Munin server;"
|
|
;;
|
|
3) # All expected values are NOT configured
|
|
MUNIN_CONFIG_CHECK_FAILED=${MUNIN_CONFIG_CHECK_FAILED}" allow param is not well configured, set allow param (IPv6+IPv4) for localhost and Munin server;"
|
|
;;
|
|
*) # Unknown return code...
|
|
MUNIN_CONFIG_CHECK_FAILED=${MUNIN_CONFIG_CHECK_FAILED}" Error, unknown return code when calling check_value_in_conf_file to check allow param;"
|
|
;;
|
|
esac
|
|
|
|
|
|
# port
|
|
check_value_in_conf_file "MUNIN" "${conf_file_to_test}" "port" "4949"
|
|
|
|
case ${?} in
|
|
0) # OK, nothing to do
|
|
;;
|
|
1) # Error (wrong number of param or other)
|
|
MUNIN_CONFIG_CHECK_FAILED=${MUNIN_CONFIG_CHECK_FAILED}" Error during port check with function check_value_in_conf_file, maybe incorrect number of parameter or file not found;"
|
|
;;
|
|
2) # Unexpected value is set
|
|
MUNIN_CONFIG_CHECK_FAILED=${MUNIN_CONFIG_CHECK_FAILED}" port is not well configured or has other value, set 'port 4949';"
|
|
;;
|
|
3) # All expected values are NOT configured
|
|
MUNIN_CONFIG_CHECK_FAILED=${MUNIN_CONFIG_CHECK_FAILED}" port is not well configured, set 'port 4949';"
|
|
;;
|
|
*) # Unknown return code...
|
|
MUNIN_CONFIG_CHECK_FAILED=${MUNIN_CONFIG_CHECK_FAILED}" Error, unknown return code when calling check_value_in_conf_file to check port;"
|
|
;;
|
|
esac
|
|
|
|
fi
|