InfoSight Predictive Analytics
1825706 Members
3438 Online
109686 Solutions
New Discussion

Extracting Infosight Nimble performance statistics

 
SOLVED
Go to solution
JockHowie
Occasional Contributor

Extracting Infosight Nimble performance statistics

Greetings of the day
Is it possible to extract a list of Recommended Actions as reported in the Infosight Nimble Operational Dashboard web interface using a REST query ( Powershell sorry, not cURL ), PowerShell commandlets or GUI export option ?
Picture1.png
Can I access these array- and volume-level performance statistics myself using REST or PowerShell commandlets ?
Picture2.png
Picture3.png

6 REPLIES 6
buzzsubash
HPE Pro

Re: Extracting Infosight Nimble performance statistics

Hi,

I am afraid we do not have an option to export recommended actions from infosight.

As of now, only infosight wellness is supported. Please refer https://infosight.hpe.com/InfoSight/media/cms/active/public/pubs_HPE_infosight_wellness_spec.pdf

Subash Geetha Krishnan
HPE Services – Hybrid Cloud Support

I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
JockHowie
Occasional Contributor

Re: Extracting Infosight Nimble performance statistics

Thanks Subash, I'd appreciate some guidance to accessing the Wellness API

Wellness API app.png

I set up the app access and generated a client key and secret which seemed to work OK for generating the session token - but I must have missed a key detail because I get this error message

Invoke-RestMethod : {"fault":{"faultstring":"Invalid access token","detail":{"errorcode":"oauth.v2.InvalidAccessToken"}}}

from running :
$wellnessUrl = 'https://infosight.hpe.com/apis/wellness/v1/issues'
$header = @{ 'Accept' = 'application/json' ; 'authorization' = "bearer $accessToken" }
$response = Invoke-RestMethod -Uri $wellnessUrl -Method Get -Headers @{ 'Authentication' = 'Bearer $accessToken' }

Any thoughts would be much appreciated

buzzsubash
HPE Pro
Solution

Re: Extracting Infosight Nimble performance statistics

I am not quite sure about powershell, however, I just did test in python. I am pasting 2 scripts for your reference
1. To generate access token

import requests

# Your credentials
client_id = '<xxx>'
client_secret = '<xxx>'

url = 'https://infosight.hpe.com/apis/oauth/token'

payload = {
    'grant_type': 'client_credentials',
    'client_id': client_id,
    'client_secret': client_secret
}

headers = {
    'Content-Type': 'application/x-www-form-urlencoded'
}

response = requests.post(url, headers=headers, data=payload)

if response.status_code == 200:
    token_info = response.json()
    access_token = token_info.get('access_token')

    with open('access_token.txt', 'w') as file:
        file.write(access_token)

    print(f"Access Token saved to 'access_token.txt'")
else:
    print(f"Failed to get access token. Status Code: {response.status_code}")
    print(response.text)


Then used the generated access token to poll the endpoint 

import requests


wellness_url = 'https://infosight.hpe.com/apis/wellness/v1/issues'


with open('access_token.txt', 'r') as file:
    access_token = file.read().strip()


headers = {
    'Accept': 'application/json',
    'Authorization': f'Bearer {access_token}'  
}


response = requests.get(wellness_url, headers=headers)


if response.status_code == 200:

    issues = response.json()
    print("Wellness Issues Data:")
    print(issues)
else:

    print(f"Failed to get wellness issues. Status Code: {response.status_code}")
    print(response.text)

 

Please let know if it helps

Subash Geetha Krishnan
HPE Services – Hybrid Cloud Support

I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo
JockHowie
Occasional Contributor

Re: Extracting Infosight Nimble performance statistics

Yes, thanks heaps Subash, when I spotted that the command is case-sensisitve from your Python code and this worked great

$header = @{ 'Accept' = 'application/json' ; 'Authorization' = "Bearer $accessToken" }

Sunitha_Mod
Honored Contributor

Re: Extracting Infosight Nimble performance statistics

Hello @JockHowie,

That's Excellent! 

We are extremely glad to hear the issue has been resolved and thank you for keeping us updated. 

NCG1
HPE Pro

Re: Extracting Infosight Nimble performance statistics

Hi JockHowie,

 

Hope you are doing good.

 

As the issue is resolved, I'll go ahead and close this case. But if you need any further assistance, you can reply back to us.

 

 

Regards,

Naveen Chandru G



I work at HPE
HPE Support Center offers support for your HPE services and products when and how you need it. Get started with HPE Support Center today.
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
Accept or Kudo