unioslo / nivlheim

A system for collecting key information from all your servers and presenting it through an easy-to-use web GUI with search and browse functions. The previous generation of this system is used in production at the University of Oslo, Norway.
GNU General Public License v3.0
9 stars 7 forks source link

Registering Owner group field #187

Open Joan10 opened 1 year ago

Joan10 commented 1 year ago

Hello all,

We are trying to set up our first Nivlheim server and we are interested in registring the owner or contact information of hosts. Seems that the field Owner group is the way to go, but can't find anywhere how it gets populated or how we can configure it. I found this issue https://github.com/unioslo/nivlheim/issues/107 but I still can't realise how ownership gets determined. Could someone give me a hand?

Thanks, Joan

oyvindhagberg commented 1 year ago

Hello Joan,

The code that determines the owner group for hosts is very company-specific for us, so we wanted to keep it outside of the Nivlheim codebase. We did this by having Nivlheim make a http call to (something external) for each host, supplying the hostname, and receiving back the name of the owner group, which then is stored in that field.

You configure the url in server.conf. Here's an example (this is how we do it):

HostOwnerPluginURL=http://127.0.0.1/owner.pl

Nivlheim makes a HTTP POST to that url, with the following parameters: key = a temporary API key, if the plugin wants to make API calls back to Nivlheim hostname = the hostname that Nivlheim wants to know the owner of certfp = the certificate fingerprint of that host (useful if you want to make API calls back)

Nivlheim expects the plugin to answer with HTTP status 200 and one line of text, the name of the owner group. Nivlheim will store that value in the "owner" field for that host.

Here's the code for the server side: https://github.com/unioslo/nivlheim/blob/master/server/service/host_owner.go

Regards, Øyvind Hagberg