Symptom
Post snmp write operation that modified the vdc_hostname, we see that the CLI prompt and the vdc_hostname were both updated (expected behavior). However, the switch hostname retained the old value (incorrect)
Conditions
switch# show run | in ^vdc|hostname
hostname switch
vdc switch id 1
Apply the snmp write to modify the vdc_hostname:
❯ snmpset -v2c -c cisco 1.3.6.1.2.1.1.5.0 s new_vdc_hostname
SNMPv2-MIB::sysName.0 = STRING: new_vdc_hostname
new_vdc_hostname# show run | in ^vdc|hostname <<<<<<<<<< new prompt
hostname switch <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< ** unchanged ** hostname
vdc new_vdc_hostname id 1 <<<<<<<<<<<<<<<<<<<<<<<<< new vdc_hostname
Note: there is no entry in the `show accounting log` to reflect this recent change.
Workaround
To prevent overwriting operation via snmp, set the snmp-server community to read-only with
(config)# snmp-server community
or
(config)# snmp-server community group network-operator
Further Problem Description