cancel
Showing results for 
Search instead for 
Did you mean: 

XIQ-SE: How to push additional SNMPv3 credentials to a Fabric Engine switch via workflow

XIQ-SE: How to push additional SNMPv3 credentials to a Fabric Engine switch via workflow

LeeM
New Contributor II

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.

1 ACCEPTED SOLUTION

Zdeněk_Pala
Extreme Employee

 

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

 

 

 

Regards Zdeněk Pala

View solution in original post

4 REPLIES 4

LeeM
New Contributor II

Just seen:

The "Onboard Mgmt VLAN" Workflow just got updated to support this type of input (credentials).

https://github.com/extremenetworks/ExtremeScripting/blob/master/XMC_XIQ-SE/oneview_workflows/xwf/Onb...

 

Robert_Haynes
Extreme Employee

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.

Zdeněk_Pala
Extreme Employee

 

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

 

 

 

Regards Zdeněk Pala

LeeM
New Contributor II

Many thanks! Works perfectly fine!

GTM-P2G8KFN