Infoblox Exchange Cybersecurity Roadshow 2020 – Join us!
North America | Europe | Middle East/Africa | Asia-Pacific

Network Change & Configuration Management

Reply
Highlighted

EDIT: NetMRI's Sessions log is showing that the command is sent twice..

[ Edited ]
Techie
Posts: 2
4601     0

Hi All :-)

New in the community (I have a colleague that normally post here)

 

Original subject: Perl script sending commands twice

EDIT:

Turns out that the command is NOT sent twice, but the Session log is recording it as it was sent twice..

 

Is that normal?? :-)

 

 

 

Below is original post:

-------------------------

But here is my problem, when using a Perl script the NetMRI is sending the commands twice??

We are sending to Cisco and HP switches.
(example: show running config interface fastethernet 0/1 to Cisco)

 

Maybe there is somthing I'm missing, but I dont know where to look...

 

This is our NetMRI test Perl script:

# BEGIN-SCRIPT-BLOCK
# Script-Filter:
#	($Vendor eq "HP" or $Vendor eq "Cisco")
# END-SCRIPT-BLOCK

use strict;
use warnings;
use NetMRI_Easy 0.6;
my $easy = new NetMRI_Easy({ api_version => 2.5 });


# Well-knowns
our $model;
our $version;
our $vendor;

if($vendor eq "HP"){
	$easy->send_command("show run int 1");
	sleep 10;
}
if ($vendor eq "Cisco"){
	$easy->send_command("show run int fa0/1");
	sleep 10;
}

Output from taken from NetMRI's Session Log (Cisco example, but it is the same issue on HP):

*******************************************
**       Cisco test switch               **
*******************************************
CiscoSwitchName#
CiscoSwitchName#enable
CiscoSwitchName#
CiscoSwitchName#terminal no monitor
CiscoSwitchName#terminal no editing
CiscoSwitchName#terminal length 0
CiscoSwitchName#show run int fa0/1
Building configuration...

Current configuration : 146 bytes
!
interface FastEthernet0/1
 switchport access vlan 111
 switchport mode access
 switchport voice vlan 222
 shutdown
 spanning-tree portfast
end

CiscoSwitchName#> show run int fa0/1  
< Building configuration...

Current configuration : 146 bytes
!
interface FastEthernet0/1
 switchport access vlan 111
 switchport mode access
 switchport voice vlan 222
 shutdown
 spanning-tree portfast
end
exit
Connection to 10.200.81.23 closed by remote host.

Connection to 10.200.81.23 closed.



*** Job Completed Successfully ***

So I get the config from Fa0/1 twice??? once should be enough :-)

BTW, it is all commands, this is just a small test we made.

 

Any ideas?

 

Sincerely
Rasmus Christiansen

Highlighted

Re: EDIT: NetMRI's Sessions log is showing that the command is sent twice..

Adviser
Posts: 353
4602     0

Certainly looks like a bug - I will ask QA to reproduce it. Thanks.

Highlighted

Re: EDIT: NetMRI's Sessions log is showing that the command is sent twice..

Adviser
Posts: 412
4602     0

Also try removing the SLEEP Smiley Happy, NetMRI will wait for the prompt to come back


Try changing the following:

use NetMRI_Easy 0.6;
my $easy = new NetMRI_Easy({ api_version => 2.5 });

 

to:

use NetMRI_Easy;
my $easy = new NetMRI_Easy({ api_version => 'auto' });

 

Also did you try a basic CCS script for both:

 

Script-Filter:
$vendor in ["Cisco","HP"]

########################################################################
Action:
Config SNMP

Action-Commands: {$Vendor eq "HP"}
sh run int 1

Action-Commands: {$Vendor eq "Cisco"}
sh run int fa0/1

 

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

Re: EDIT: NetMRI's Sessions log is showing that the command is sent twice..

Adviser
Posts: 353
4602     0

Sif - I disagree on the "auto" versioning. By specifying an explicit version, the user does not have to update their scripts if the API behavior changes in a later version.

 

Also "auto" requires an extra API call when the job starts, to negotiate the version with the server. 

 

John

 

Highlighted

Re: EDIT: NetMRI's Sessions log is showing that the command is sent twice..

Adviser
Posts: 412
4602     0

Thanks John, I did forget about that Smiley Happy

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

Re: EDIT: NetMRI's Sessions log is showing that the command is sent twice..

Techie
Posts: 2
4602     0

Tried to remove sleep, session log still have two entries.

 

The CCS script do not have two entries.

Highlighted

Re: EDIT: NetMRI's Sessions log is showing that the command is sent twice..

Adviser
Posts: 412
4602     0

Did you open a case on this?

 

Sif

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

Re: EDIT: NetMRI's Sessions log is showing that the command is sent twice..

Authority
Posts: 36
4602     0

We had the exact same issue some time ago.

It manifested itself only on a virtual NetMRI with remote sandbox.

 

Support searched high and low for it, but never could replicate it.

Then all of a sudden, after and upgrade, it was gone.

Showing results for 
Search instead for 
Do you mean 

Recommended for You