Add sysContact, informsink and trap2sink verifications for SNMPD.
This commit is contained in:
parent
72cdff40fa
commit
bc8d4ecfe2
|
@ -64,3 +64,65 @@ case ${?} in
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
check_value_in_conf_file "SNMP" "/etc/snmp/snmpd.conf" "informsink" "${NAME_MASTER_MONITORING}[[:space:]]*public"
|
||||||
|
|
||||||
|
case ${?} in
|
||||||
|
0) # OK, nothing to do
|
||||||
|
;;
|
||||||
|
1) # Error (wrong number of param or other)
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" Error during informsink check with function check_value_in_conf_file, maybe incorrect number of parameter;"
|
||||||
|
;;
|
||||||
|
2) # Unexpected value is set
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" informsink are not well configured or has other value, set 'informsink ${NAME_MASTER_MONITORING} public;"
|
||||||
|
;;
|
||||||
|
3) # All expected values are NOT configured
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" informsink are not well configured, set 'informsink ${NAME_MASTER_MONITORING} public';"
|
||||||
|
;;
|
||||||
|
*) # Unknown return code...
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" Error, unknown return code when calling check_value_in_conf_file to check informsink;"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
check_value_in_conf_file "SNMP" "/etc/snmp/snmpd.conf" "sysLocation" "${DC_for_function_check_value_in_conf_file}"
|
||||||
|
|
||||||
|
case ${?} in
|
||||||
|
0) # OK, nothing to do
|
||||||
|
;;
|
||||||
|
1) # Error (wrong number of param or other)
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" Error during sysLocation check with function check_value_in_conf_file, maybe incorrect number of parameter;"
|
||||||
|
;;
|
||||||
|
2) # Unexpected value is set
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" sysLocation are not well configured or has other value, set 'sysLocation ${DC}';"
|
||||||
|
;;
|
||||||
|
3) # All expected values are NOT configured
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" sysLocation are not well configured, set 'sysLocation ${DC}';"
|
||||||
|
;;
|
||||||
|
*) # Unknown return code...
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" Error, unknown return code when calling check_value_in_conf_file to check sysLocation;"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
check_value_in_conf_file "SNMP" "/etc/snmp/snmpd.conf" "sysContact" "${ENTITY_for_function_check_value_in_conf_file}[[:space:]]*<${MAIL_ALIAS_ROOT}>"
|
||||||
|
|
||||||
|
case ${?} in
|
||||||
|
0) # OK, nothing to do
|
||||||
|
;;
|
||||||
|
1) # Error (wrong number of param or other)
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" Error during sysContact check with function check_value_in_conf_file, maybe incorrect number of parameter;"
|
||||||
|
;;
|
||||||
|
2) # Unexpected value is set
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" sysContact are not well configured or has other value, set 'sysContact ${ENTITY} <${MAIL_ALIAS_ROOT}>';"
|
||||||
|
;;
|
||||||
|
3) # All expected values are NOT configured
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" sysContact are not well configured, set 'sysContact ${ENTITY} <${MAIL_ALIAS_ROOT}>';"
|
||||||
|
;;
|
||||||
|
*) # Unknown return code...
|
||||||
|
SNMP_CONFIG_CHECK_FAILED=${SNMP_CONFIG_CHECK_FAILED}" Error, unknown return code when calling check_value_in_conf_file to check sysContact;"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue