munkireport / munkireport-php

A reporting tool for munki
MIT License
393 stars 138 forks source link

Feature request: configurable "computer name" field #1479

Open flammable opened 2 years ago

flammable commented 2 years ago

I'd like to stop relying on hostnames/computer names for identifying devices. One of the major hurdles is that MunkiReport uses the computer name for stuff like the client listing, event log, etc. If I pivoted to using serial numbers or asset numbers for hostnames, for instance, it would make using MunkiReport significantly more difficult.

In the future, would it be possible to allow using a different field for identifying Macs in MunkiReport? Maybe something like the manifest name, or a unique preference key we can set on each machine in the MunkiReport domain? It's reasonable to continue defaulting to the computer name for this stuff, but it'd be great to have an environment variable to override that.

Thanks!

Mike

guille-okt commented 1 year ago

what's your current computer identification? @flammable

flammable commented 1 year ago

So, I've changed jobs since I posted this feature request! I think it's less of an issue at my new workplace.

That said, at my old job, I was hoping to use serial numbers for the hostnames, but have MunkiReport display something else (configurable by me in the .env file) as the main identifier per device. Here's what we were using:

username-computertype

So, I'd script setting the hostname based on who enrolled the device (during DEP/ADE), and what kind of computer it was (abbreviated from system_profiler). In my case, my computer was named msolin-mbp. I wanted to move to serial numbers instead, but the chief complaint I got was that the service desk wouldn't be able to find people's computers as easily anymore.

The workaround I had in mind was to continue using my script, but only use that to populate the Munki manifest, or something in the MunkiReport preference file - not the hostname. For the hostname, I'd populate it using the serial number instead. Then, in MunkiReport's .env file, I'd be able to override what's shown as the primary identifier in the various views (client listing, events, device details, etc.).