- Community Home
- >
- Networking
- >
- IMC
- >
- Insert variable into script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2016 05:09 AM
02-17-2016 05:09 AM
Insert variable into script
I'm trying to perform a task via IMC's configuration template feature which contains a variable dependent on the last octet of a device's IP address.
Is there a way to write a script that will insert this into a variable? So far, I've got:
mycommand ${variable name}
So I need the last octet to fill the ${variable name} part.
Thanks in advance!
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-17-2016 09:46 AM
02-17-2016 09:46 AM
Re: Insert variable into script
There's two different ways of handling variables with IMC. One way is to define a variable that you'll get asked for when you go to run the script. This is OK for a script that you want to run regularly against different devices, and don't mind manually entering a value each time you run it.
But for your case, I think you're looking more at using "MIB parameters"
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)).
However...you might not be able to find a MIB parameter that matches the last octet.
If you can't, then you might be better off deploying a script that performs more complex processing on the switch itself. Depending on what your device can do, that might be Python or TCL.