Reply

Discover Now via API/Script?

Authority
Posts: 37
2340     0

We have a device that is successfully being backed up when a Discover Now is executed, but times out with the automatic config collections later on. While we wait for a fix, we are wondering if there is a way to kick off a Discover Now via a script (presumably Perl)? That would allow us to 1) schedule it and 2) not have to give SysAdmin out to users that would not normally have. NetMRI 6.9.4.

Re: Discover Now via API/Script?

Adviser
Posts: 357
2340     0
Yes, though first I would try the GET-CONFIGS command in CCS, if all you want is the config file. See the CCS Supplement document in the help under Additional Documentation.

If you want to do the full Discovery Now equivalent you would use this API call:

https://netmri/api/3/devices/docs#discover


John
Highlighted

Re: Discover Now via API/Script?

[ Edited ]
Authority
Posts: 37
2340     0

Unfortunatly, the behavior is different, so these do not work. There is something different about doing a Discover Now from the GUI. I even tried setting ignore_history_ind to 1. Any ideas? The Perl script I used is below, but as I said, it doesn't behave the same as the GUI's Disvoer Now.

 

# BEGIN-SCRIPT-BLOCK
# Script-Filter:
# $name like /-bane-of-my-existence-/i
# END-SCRIPT-BLOCK

use strict;
use warnings;
use NetMRI_Easy 0.6;

my $easy = new NetMRI_Easy({ api_version => 2.5 });
my $dev = $easy->device;
my %discover_hash = ( DeviceID => $dev->DeviceID, ignore_history_ind => 1 );
my $href = $dev->broker->discover( \%discover_hash );

Showing results for 
Search instead for 
Do you mean 

Recommended for You