4 .
/usr
/libexec
/ovirt-functions
6 trap '__st=$?; stop_log; exit $__st' 0
7 trap 'exit $?' 1 2 13 15
9 warn
() { printf '%s\n' "$*" >&2; }
11 if ! is_local_storage_configured
; then
12 warn
"Local storage must be configured prior to configuring SNMP."
18 local CONF
=/var
/lib
/net-snmp
/snmpd.conf
19 ovirt_store_config
/etc
/sysconfig
/snmpd
/var
/lib
/net-snmp
/ >/dev
/null
22 # reset snmpd options to defaults, image has "-v" to prevent snmpd start
23 sed -c -ie '/^OPTIONS/d' /etc
/sysconfig
/snmpd
25 sed -c -ie '/^createUser root/d' $CONF
27 echo "createUser root SHA $password AES" >> $CONF
32 service snmpd stop
> /dev
/null
33 while umount
/etc
/sysconfig
/snmpd
; do : ; done 2> /dev
/null
34 remove_config
/etc
/sysconfig
/snmpd
> /dev
/null
37 if [[ "$1" == "AUTO" ]]; then
38 if [ -n "${OVIRT_SNMP_PASSWORD}" ]; then
39 enable_snmpd
$OVIRT_SNMP_PASSWORD
42 ask_yes_or_no
"Enable SNMP agent ([Y]es/[N]o/[A]bort)?" true true
47 read -p "Enter password for SNMPv3 USM 'root' user: " -esr
50 read -p "Confirm password: " -esr
52 if [ "$password1" = "$password" ]; then break; fi
55 enable_snmpd
$password ;;