sown / tasks

Tasks for sown projects
0 stars 0 forks source link

Recreate Server Attributes Checks with Netbox #63

Open trickeydan opened 4 years ago

trickeydan commented 4 years ago

We should check that the server attributes match that in netbox

TimStallard commented 4 years ago

Doing this from a netbox report would probably make sense. Random thought I just had - currently this is driven by a cron job that submits a bunch of info to auth2. One option might be to generate an SSH key on netbox, and configure it (via ansible) to run a check script as a forced command on all servers?

That way we could have the report collect data on-demand (using paramiko), without giving netbox any unnecessary access to servers.

TimStallard commented 4 years ago

I've started some work on this in the server-attributes branch of the ansible repo.

It uses an SSH forced command to run a little script on each server (all deployed via ansible), netbox side is in /opt/netbox/netbox/reports/attributes.py on netbox.

Seeing as this gives netbox (hopefully very restricted) root access to servers, I'd appreciate a second look over this before deploying it everywhere. Just testing with --limit AUTH2,VMS-B53-1,DATA1,NETBOX,vault-b53-1 for now.

drn05r commented 5 months ago

Tim has some code on an old Mac mini that Dan wrote a couple of years ago. He is looking into recovering it.