I am trying to push out a script to configure HP switches with SNMPv3, but I am continually failing. Here is the order of operation.
Here is the steps to enable SNMPv3 on HP Procurve:
switchname(config)# snmpv3 enable (Starts creation of initial user)
SNMPv3 Initialization process.
Creating user 'initial'
Authentication Protocol: MD5
Enter authentication password: ********* (This is the next input requested, this is input properly)
Privacy protocol is DES
Enter privacy password: ********* (This is the next input requested, this is input properly)
User 'initial' has been created
Would you like to create a user that uses SHA? [y/n] n (This is where it fails. I cannot get it to paste this n because after entering the privacy password it never matches the regex for the prompt to move forward)
User creation is done. SNMPv3 is now functional.
Would you like to restrict SNMPv1 and SNMPv2c messages to have read only
access (you can set this later by the command 'snmpv3 restricted-access')? [y/n] n (Haven't got to this step, but I suspect the solution to previous line will fix this one)
***************************************************************************************************************
Device Template
<Command Name="snmp3enable" Value="snmpv3 enable" RegEx="*Enter authentication password:" />
<Command Name="snmp3enable2" Value="Thetopsecrectpassword" RegEx="*Enter privacy password:" />
<Command Name="snmp3enable3" Value="Thetopsecrectpassword" RegEx="Would you like to create a user that uses SHA? [y/n]" /> I have tried a bunch of variations of this Regex
<Command Name="snmp3enable4" Value="n" RegEx="*command 'snmpv3 restricted-access')" />
<Command Name="snmp3enable5" Value="n" />
<Command Name="snmp3user" Value="snmpv3 user supersecretuser auth sha Thetopsecrectpassword priv aes Thetopsecrectpassword" />
<Command Name="snmp3group" Value="snmpv3 group managerpriv user supersecretuser sec-model ver3" />
<Command Name="snmp3noinitial" Value="no snmpv3 user initial" />
***************************************************************************************************************
And finally the script:
${EnterConfigMode}
${snmp3enable}
${snmp3enable2}
${snmp3enable3}
${snmp3enable4}
${snmp3enable5}
${snmp3user}
${snmp3group}
${snmp3noinitial}
${SaveConfig}
Any help is greatly appreciated.