Reply

python script - connection issue for 90% of hp devices

New Member
Posts: 1
3039     0

Hello,

 

I tried use script to change same configuration on my switches, but I received error like that:

-------

*** Error / Traceback (most recent call last): 
   File "", line 161, in  
   File "/usr/lib/python3.4/site-packages/infoblox_netmri/easy/netmri_easy.py", line 36, in __init__ 
     self.cli_connection = self._open_cli_connection() 
   File "/usr/lib/python3.4/site-packages/infoblox_netmri/easy/netmri_easy.py", line 79, in _open_cli_connection 
     DeviceID=self.device_id 
   File "/usr/lib/python3.4/site-packages/infoblox_netmri/api/broker/v3_3_0/cli_connection_broker.py", line 78, in open 
     return self.api_request(self._get_method_fullname("open"), kwargs) 
   File "/usr/lib/python3.4/site-packages/infoblox_netmri/api/broker/broker.py", line 24, in api_request 
     params 
   File "/usr/lib/python3.4/site-packages/infoblox_netmri/client.py", line 227, in api_request 
     return self._make_request(url=url, method="post", data=data) 
   File "/usr/lib/python3.4/site-packages/infoblox_netmri/client.py", line 103, in _make_request 
     return self._send_request(url, method, data, extra_headers) 
   File "/usr/lib/python3.4/site-packages/infoblox_netmri/client.py", line 129, in _send_request 
     raise HTTPError(res.json(), response=res) 
 requests.exceptions.HTTPError: {'message': 'Device handler init for device 173 failed: api_open_session failure, buf: 

*** ERROR: No authentication information found for device ***', 'error': 'general/cli-error'} 
  ***

 Session log does not exist since there was an unknown error. 

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

 

 

Username and password are ok, I can connect from my computer without problem.  

 

 

# BEGIN-SCRIPT-BLOCK
#
# Script-Filter:
# $Vendor eq "HP"
#
# END-SCRIPT-BLOCK

import requests, json, re
from infoblox_netmri.easy import NetMRIEasy


# This values will be provided by NetMRI before execution
defaults = {
"api_url": api_url,
"http_username": http_username,
"http_password": http_password,
"job_id": job_id,
"device_id": device_id,
"batch_id": batch_id
}


# Create NetMRI context manager. It will close session after execution

with NetMRIEasy(**defaults) as easy:
  easy.send_command('show version')

Re: python script - connection issue for 90% of hp devices

Authority
Posts: 4
3039     0

I work with a variety of network device brands, including HP/Aruba (procurve). When I get the "No authentication information found for device" error, it is because NetMRI does not know (discovery process has not determiend) the CLI credentials for the device.

 

One way to check: Under the Network Explorer > Discovery tabs, find the device and check the "S" (SNMP credential status) and "C" (CLI credential status) columns. They need to be green check boxes for NetMRI to function properly. In this case it is the "C" column you care about.

 

Another way to check:  Open the device viewer for that device. On the right under "settings & stats" pick "CLI credentials" and you can review what credentials have been tested and found to work/not-work for that device. You need at least one found to be good...and for that to populate the top fields above the list (and you can use "show password" button to show it, and "test" to test it).

Showing results for 
Search instead for 
Did you mean: 

Recommended for You