Linking into a computer's inventory?

aamjohns
Contributor II

Hi,
I have an in house app that is very handy. It is a central admin app, central info, stuff like that. I'd like for our techs to be able to click a link that would take them to a system's inventory in JSS. I see that the URL uses the assigned ID. Is there a way I could be a translation list of computer name to ID so I could generate a URL they could click?

Thanks.

6 REPLIES 6

aamjohns
Contributor II

I do see I could do a report to csv or xml, which I could then reference or pull into sql. But I would need that report to run on a schedule of some sort. Something like that maybe.

ctangora
Contributor III

what about using the API to pull the info directly into your app?

mm2270
Legendary Contributor III

Yeah, possibly. You could use the Casper Suite API to pull the JSS ID for the Mac using either the computer name or one of its MAC addresses. The MAC address is a little more reliable, especially if you have any potentially weird stuff in the computer names, like spaces or odd characters. They usually have to be translated before they can be used in a JSS URL if so. For example, all spaces become %20.

Anyway, if you set up a Casper API read account, you can use it in a shell script or other scripting languages to query the JSS directly for the computer's API record and pull the ID from that, then generate the proper clickable URL for your app.

I'm not sure how your in house app is designed or what can be run from it, but it, or some helper application would probably need to run a script of some sort to get the info.

ctangora
Contributor III

I was thinking you could just run a curl to the API to get the XML and parse it as needed in the in-house app. No need to send them to the JSS for information, let the info go dynamically into the home-brewed app on demand.

mm2270
Legendary Contributor III

@ctangora, sure that makes sense, provided its possible for the OP to do. I don't know anything about his in-house app. I had started my post before I saw yours or probably wouldn't have bothered. But yeah, grabbing all or some of the date from the API would be the way to go. though, parsing the xml can be a little work, it is possible.

aamjohns
Contributor II

I appreciate the suggestions and ideas. I had actually forgotten about the API. I believe it was mentioned during our jump-start and then slip my mind since then. I like that idea. The in-house app is vb.net and sql. Thanks.