50 lines
2.1 KiB
Bash
Executable File
50 lines
2.1 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
|
|
|
|
|
|
# allow
|
|
check_value_in_conf_file "MUNIN" "/etc/munin/munin-node.conf" "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;"
|
|
;;
|
|
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" "/etc/munin/munin-node.conf" "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;"
|
|
;;
|
|
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
|
|
|
|
|