Reply

Associate script with device?

JBrown_1
Techie
Posts: 26
2935     0

Is there a way to associate a script with a device or devices?  I know you can do that with jobs, but jobs do not ask for input for variables when they are run.  I would like to have a way for the script to be only for specific devices so the user does not have to select them each time.

Please provide example

MGriffin
Techie
Posts: 37
2936     0

Joe,

Would you mind providing an example of what you're attempting to accomplish?

Jobs, I'm assuming a CCS here, will prompt for input on script execution if Script-Variables are used, so, you must be speaking about something else?

Specific Devices, or a Device Group, will always need to be selected for the script to run against, however, you can apply a Script-Filter directive to permit the script to run against specific devices only; via IPAddress, Vendor, Model, member of a specific device group, etc...

 

I would like to create a

JBrown_1
Techie
Posts: 26
2936     0

I would like to create a script for setting up new VLANs on switches - the same set of switches each time, with different VLAN numbers and IP addresses each time.  

The only jobs I have created so far are scheduled jobs which require you to specify the script and the device and run one time or at specified times.  Each time I run the job, it is for the same script variables set up the first time the job was created.  If there is a differnet way to set up a  job that will ask for variables each time, that would work.  

Hi Joe,

Authority
Posts: 40
2936     0

Hi Joe,

You can use script variables as shown below.. You can provide values for these variables while you schedule your Job. If you use a Perl Script, you have to declare it again with a "our $your_variable" in the script.

To run on the same device, probably you can select a larger group, and then use a filter by "Hostname", "IP" etc.

# BEGIN-SCRIPT-BLOCK

# Script-Variables:
# $your_variable_name "your default value"

#END-SCRIPT-BLOCK

 

our $your_variable_name;

 

hope it helps

Mike, can you explain how you

JBrown_1
Techie
Posts: 26
2936     0

Mike, can you explain how you get a job to prompt for input?  Am I missing something?  Is there another way to run a job other than scheduled jobs?

Could this become a feature

JBrown_1
Techie
Posts: 26
2936     0

Could this become a feature enhancement request?  We have lots of manual templates we apply to specific devices.  I would like to turn them into scripts and make it as easy as possible for the user by preselecting the device the script is to be run against, yet still gather information from the user such as IP address, VLAN name, VLAN number, etc. 

So far, I am not seeing that functionality within NetMRI.  

You can use list to lookup

Adviser
Posts: 411
2936     0

You can use list to lookup the Device IP/Name and then pull your variables like VLAN Name/IP adress/etc..

But predefine list of devices can be done via Group/Config Search(Adhoc groups) and Script-Variables ie. $name like /(RTR1|RTR2|SW1|SW5)

There is a lot of different ways you can do this Smiley Happy

 

I hope this helps

Sif

Follow me on LinkedIn: https://www.linkedin.com/in/sifbaksh
Twitter: https://twitter.com/sifbaksh

Sif, how to I connect to

JBrown_1
Techie
Posts: 26
2936     0

Sif, how to I connect to those devices in the list in the script?  I know how to check device name variable match to tell it not to run a script, but how do I tell it to connnect if the name matches?  I suppose I could tell it to run against all devices and then let it filter for just the names in the script, but that seems inefficient if NetMRI is going to cycle a check against all known devices.  

Showing results for 
Search instead for 
Do you mean 

Recommended for You