Learn How We Can Help You Keep Teleworkers Safe During the COVID-19 Crisis

Network Change & Configuration Management

Reply
Highlighted

How to see via Perl API which device uses which Credential

Techie
Posts: 14
2685     0
 
Highlighted

sorry, the text of the

Techie
Posts: 14
2685     0

sorry, the text of the question did not appear, here it is:

I'm trying to find a Perl API which would tell me the credentials (both CLI & SNMP) associated to a given device, but I do not seem to find it.

This information must exist somewhere (device details shows it).

Does anybody have a clue?

Thanks,

Bernard Baudoux.

 

Highlighted

For SNMP v2c community

Adviser
Posts: 353
2685     0

For SNMP v2c community strings, you can get the value by calling the DeviceCommunity method on the Device object, as long as you have view_sensitive privilege.

For CLI and SNMPv3, you can get the encryped value via the Device Password Log controller:

https://netmri/api/2.9/device_password_logs/search?DevicePwLogStatus=OK

However, there is no way to get the unencrypted value via the API.

 

 

 

Highlighted

Should be simple enough to

Techie
Posts: 8
2685     0

Should be simple enough to make your own little rainbow table after some manual checking of the first few encrypted values you get back with what you can find in the NetMRI UI.

Highlighted

Thanks John.

Techie
Posts: 14
2685     0

Thanks John.

I've tried, but I get an error message:

my $DevCommunity = $easy->broker->InfraDevice->DeviceCommunity->index({ DeviceID => $DeviceID });

returns NetMRI general/validation-failed The action failed because the request was not valid. DeviceID is required.

However, $DeviceID contains a valid device ID number.

Any idea why I get this message?

Thanks,

Bernard.

 

Highlighted

Sure. Remove the "index" part

Adviser
Posts: 353
2685     0

Sure. Remove the "index" part:

 

my $DevCommunity = $easy->broker->InfraDevice->DeviceCommunity({ DeviceID => $DeviceID });

Another way to call it is if you have a device or infradevice object, you can call the method on that object (this may only be in one of the most recent releases):

my $DevCommunity = $device->DeviceCommunity();

 

John

 

Highlighted

Working, Thanks John.

Techie
Posts: 14
2685     0

Working, Thanks John.

Bernard.

 

Showing results for 
Search instead for 
Do you mean 

Recommended for You