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

API & Integration

Reply
Highlighted
Accepted Solution

Get network insight information on a host

Techie
Posts: 3
1797     0

I've been working with WAPI v2.7 through PowerShell... To this point I'm able to query ib for host information by name returning extattrs and dhcp. I can get the same information by ipaddr and newtork information.  I can reconstruct the grid membership and service information. However, I'm stomped on finding how to get the network insight information on and object.  Has anybody figured out how this is done?

 

Highlighted

Re: Get network insight information on a host

Community Manager
Community Manager
Posts: 248
1798     0

get the 'discovered_data' on an objct. That will have the NI information.

Highlighted

Re: Get network insight information on a host

Techie
Posts: 3
1798     0

Thank you for the direction... I added this to the request.

PowerShell Code Snipit

---

$Uri = "{0}/ipv4address?ip_address={1}&_return_as_object=1&_return_fields%2b=discovered_data" -f $baseURL, $ipv4Address

$ibResults = Invoke-RestMethod -Method get -Uri $Uri -SessionVariable authcookie -Headers $WebHeaders

---

discovered_data property was added to the data set for the object returned. 

 

Please bear with while ask for insight in to the datatime structure returerned.  I've tried several convertion options that I'm awere of but no joy.

   first_discovered : 1406810418

   last_discovered : 1420625857

 

thank you again.

-john

 

 

Highlighted

Re: Get network insight information on a host

Community Manager
Community Manager
Posts: 152
1798     0

They're "epoch" intergers, the number of seconds passed since January 1, 1970.

 

https://www.epochconverter.com/

 

Best,

Matt

Highlighted

Re: Get network insight information on a host

Techie
Posts: 3
1798     0

Bingo!  I knew it had to be something like that but didn't know the reference date.

 

Thanks so much for the quick responce.

 

$LastDate = ([Datetime]"1/1/1970").AddSeconds($ibResults.result.discovered_data.last_discovered)

Showing results for 
Search instead for 
Do you mean 

Recommended for You