ā01-19-2024 06:40 AM
Hello there!
I have to push multiple SNMPv3 users to all of our Fabric Engine switches. Is there a way to do this with a XIQ-SE Workflow?
Our external monitoring (Icinga) should use it's own user / credential set to access the Switch, but with ZTP+ I can only set one Administration Profile which will be used by the Site Engine itself.
I tried to add users inside the "Apply Config Template" workflow from GitHub, but it only accepts \ny to skip confirmation prompts. The Switch doesn't allow in-line-passwords, so it is not possible to add credentials this way.
In other words: I want to execute the following command including the prompts:
snmp-server user Icinga group "readgrp" sha aes
AuthenticationProtocolPassword
AuthenticationProtocolPassword
PrivacyProtocolPassword
PrivacyProtocolPassword
Thanks for any advise!
The only way to do it at the moment would be to login on all the devices and create the snmp users manually.
Solved! Go to Solution.
ā01-20-2024 05:22 AM
I am using this function:
def sendConfigCmds(cmds, wait = True):
for cmd in cmds:
cli_results = emc_cli.send( cmd, wait )
if cli_results.isSuccess() is False:
print 'CLI-ERROR: %s' %cli_results.getError()
wf_error("CLI ERROR EXECUTING CLI COMMANDS")
status = emc_results.Status
emc_results.setStatus( status.ERROR)
exit
cli_lines = cli_results.getOutput()
return cli_lines
The "wait" boolean variable True means "wait for prompt"
The "wait" boolean variable False means "do not wait for prompt"
so you can try:
sendConfigCmds (['snmp-server user Icinga group "readgrp" sha aes'],wait=False)
sendConfigCmds (['AuthenticationProtocolPassword'],wait=False)
sendConfigCmds (['AuthenticationProtocolPassword'],wait=False)
sendConfigCmds (['PrivacyProtocolPassword'],wait=False)
sendConfigCmds (['PrivacyProtocolPassword'],wait=True)
good luck
ā01-21-2024 11:31 PM
Just seen:
The "Onboard Mgmt VLAN" Workflow just got updated to support this type of input (credentials).
ā01-20-2024 05:31 PM
You can likely also do a simple "Execute CLI" / CLI script under tasks as the sample script you provided is simple enough. Workflow would provide a better error condition / checking capability (i.e. check the work) but Execute CLI would also allow this to be done.
ā01-20-2024 05:22 AM
I am using this function:
def sendConfigCmds(cmds, wait = True):
for cmd in cmds:
cli_results = emc_cli.send( cmd, wait )
if cli_results.isSuccess() is False:
print 'CLI-ERROR: %s' %cli_results.getError()
wf_error("CLI ERROR EXECUTING CLI COMMANDS")
status = emc_results.Status
emc_results.setStatus( status.ERROR)
exit
cli_lines = cli_results.getOutput()
return cli_lines
The "wait" boolean variable True means "wait for prompt"
The "wait" boolean variable False means "do not wait for prompt"
so you can try:
sendConfigCmds (['snmp-server user Icinga group "readgrp" sha aes'],wait=False)
sendConfigCmds (['AuthenticationProtocolPassword'],wait=False)
sendConfigCmds (['AuthenticationProtocolPassword'],wait=False)
sendConfigCmds (['PrivacyProtocolPassword'],wait=False)
sendConfigCmds (['PrivacyProtocolPassword'],wait=True)
good luck
ā01-21-2024 10:18 PM
Many thanks! Works perfectly fine!