IMC
cancel
Showing results for 
Search instead for 
Did you mean: 

MIB Parameters - Deployment Task

 
nryan85
Frequent Visitor

MIB Parameters - Deployment Task

Hello,

I'm trying to create a deployment configuration task with variables.  I want to use a MIB parameter as one of the variables but I can't seem to get it to work.  Mainly I want to be able to use the hostname of the device as the value of the variable. 

I created a variable in the template using ${hostname}

The deployment task itself has examples for MIB parameters (shown below)

2.Input MIB parameter, according with $(mibName|mibVariable|index).
For example: $(H3C-SYS-MAN-MIB|h3cSysImageSize|65537) or $(H3C-SYS-MAN-MIB|h3cSysImageSize|@(H3C-SYS-MAN-MIB|h3cSysReloadImage|65536)).

I'm trying to use this MIB parameter as the value of the variable

$(RFC1213-MIB|sysName|0)

However, it does not seem to be attempting to look up the snmp value.  When you view the configuration that should contain the variable values it only puts the $(RFC1213-MIB|sysName|0) in the configuration (not the value of what it should be).

Any ideas?  Thank you very much for any assistance.

7 REPLIES
LindsayHill
Honored Contributor

Re: MIB Parameters - Deployment Task

Try using "$(SNMPv2-MIB|sysName|0)"

I just did a quick check on my system, without actually deploying the content. It looked OK in the Configuration Content preview.

nryan85
Frequent Visitor

Re: MIB Parameters - Deployment Task

Thanks for your response,

I tried with the suggested changes and I still get the same result.  I must be doing somethign wrong?

To test I created a new configuration template that just contains one line in the CLI Script type of template:  ping ${pingVar}

I then deployed that template and in the parameters screen I see the pingVar variable.  For the value of the variable I put what you suggested:  $(SNMPv2-MIB|sysName|0)

On the final screen where you can view the configuration, it just shows the this:

ping $(SNMPv2-MIB|sysName|0)^|^

Does it matter that we use SNMPv3 on our devices?  I tried changing your MIB name to SNMPv3-MIB just hoping but similar results.  I've tried deplying the script to HP switches as well as Cisco routers and results are the same.  Any ideas?

Thanks again.

LindsayHill
Honored Contributor

Re: MIB Parameters - Deployment Task

I think I might know what's going on here. Sounds like you're doing a double-expansion. 


nryan85 wrote:

To test I created a new configuration template that just contains one line in the CLI Script type of template:  ping ${pingVar}

<snip>

I then deployed that template and in the parameters screen I see the pingVar variable.  For the value of the variable I put what you suggested:  $(SNMPv2-MIB|sysName|0)

Instead of defining a variable, then assigning $(SNMPv2-MIB|sysName|0) to that variable, skip a step. When you define your CLI script, use $(SNMPv2-MIB|sysName|0) there. Note that this means you won't be asked for that variable value when you go to deploy the CLI template. 

If you did want to be able to enter a value for that variable at deployment time (e.g. because sometimes you wanted to enter a specific hostname, not the device hostname), you'll probably need to define a separate CLI template.


nryan85 wrote:

Does it matter that we use SNMPv3 on our devices?  I tried changing your MIB name to SNMPv3-MIB just hoping but similar results.  


And no, in this case it doesn't matter that you're using SNMPv3. The "v2" here is a different versioning thing, not related to SNMP v1 vs v2c vs v3. Confusing, yes?

nryan85
Frequent Visitor

Re: MIB Parameters - Deployment Task

Hello Lindsay,

Thanks again for helping.

I actually tried this when I was using the RFC1213-MIB but it didn't work then.  I gave it a try again using SNMPv2 as you suggested..so now I just have the single line in the CLI Script configuration template with the command set as "ping $(SNMPv2-MIB|sysName|0)"

Unfortuantly it still doesn't work.  After I deploy the template to a device, the final screen with the configuration content it just shows the results as "ping $(SNMPv2-MIB|sysName|0)^|^"   without the quotes of course.

Not sure what where I'm going wrong.  

Thanks again.

 

LindsayHill
Honored Contributor

Re: MIB Parameters - Deployment Task

These are the steps I went through. I'm using IMC 7.2 running on RHEL 6.x. For test purposes, I'm using a Juniper SRX as the target device, although it doesn't really matter here.

  1. Login to IMC, go to Service -> Configuration Center -> Configuration Templates.
  2. Click Add -> Add CLI script
  3. Set Template Name to ping.cfg.
  4. Click "Select Model" and add all Juniper devices (yes it's more than we need, but it doesn't really matter here)
  5. In the "Content" section, set Command to "ping $(SNMPv2-MIB|sysName|0)", leave Response blank. Click OK.
  6. Click on "..." to right of ping.cfg, under "Operation" column. Click Deploy.
  7. Click Select Device. Select my test SRX (srx01). Leave everything else unchanged, click Next.
  8. Click Next again.
  9. Now we're at the last screen, and if we click Finish, it will deploy that configuration. Click the icon under "Configuration Content." It shows "ping srx01^|^"

What is the *exact* sequence of steps you're going through?

nryan85
Frequent Visitor

Re: MIB Parameters - Deployment Task

Just re-did everything from your exact steps and still same result.  I attached some screenshots to hopefully prove I'm not completely insane.  Only difference is I'm on version iMC PLAT 7.1 (E0303P16) hosted on Windows.

Thank you very much for taking the time to assist.  Maybe I should just update to 7.2  Been meaning to so this just might push me to do it!  

LindsayHill
Honored Contributor

Re: MIB Parameters - Deployment Task

Hmm. Your screenshots look OK. I don't recall seeing anything related to this in the release notes. If you are running UAM, you'll need to stay on 7.1. Otherwise you can go to 7.2. Make sure you've got backups, etc.