Network Change & Configuration Management

Reply
Accepted Solution

Perl API NetMRI send variable to run Script broker->script->run

[ Edited ]
hoppem
Techie
Posts: 12
1977     1

Hello,

 

 

i will run this script run with the perl API in NetMRI.

-> https://netmri.kathrein.de/webui/configuration_management/ ->scripts

 

#########################################################
Script-Filter:
	$Vendor eq "Cisco"

Script-Variables:
	$interface	string		"gi1/0/1"
	$description	string		"desc"
################################################
Action:
	List the VLANs

Action-Description:
	List the VLANs from the show snmp context command

Action-Commands:
	SET: $exists = "false"
	conf t
	cmdfreeport $interface $description
	end
	wr mem

 

but how can i send my variables to the script ? ($interface and $description) 

 

my $interface = "gi1/0/1"
my $description = "desc Value"

 

 

my $interface = "gi1/0/1"
my  $description = "desc Value"

my $response = $client->broker->script->run({ name => $script_name, device_ids => $device_id, script_variables => ??????????????????????,
});

 

Highlighted

Re: Perl API NetMRI send variable to run Script broker->script->run

Adviser
Posts: 357
1977     1

You don't send a variable called "script_variables". Instead, you send in variables named the same as yours, starting with a dollar sign. So:

 

my $interface = "gi1/0/1";
my  $description = "desc Value";

my $response = $client->broker->script->run({
name => $script_name,
device_ids => $device_id,
'$interface' => $interface,
'$description' => $description});
Showing results for 
Search instead for 
Do you mean 

Recommended for You