March 30, 2019 · Tips

Agility With ChatOps - Inventory Management

The Problem

Inventory (asset management) can be a pain to keep up with. With the exponential growth in configuration and management tools, IT professionals have more agents than ever running on computers we manage.

The question for us became:

How do we create an easy way to remove a computer that's being decommissioned from all of these tools?

Especially ones that don't have an automated pruning system in place of their own. As we implement systems to help us accomplish more specialized tasks (remote access, software package deployment, etc.), stale records have to be pruned – most often in tools that are licensed per-node.

The ChatOps Solution

We began creating a PoshBot module called nuke to perform this task for us. It's not quite finished yet – we're still waiting on API access to a particular tool – but its existing individual functions dutifully remove computers from various other tools we use.

We were able to use PowerShell code to remove records of computers from our ticket system's inventory CMDB, SCCM, Munki, and (newly minted) Gorilla.

Nearly all of this is done via a documented API or, in the case of Gorilla and Munki, by removing a manifest from a simple Git repository.

Even if a tool you're using doesn't have an easy, well-documented REST API, there is likely a way you can automate actions in it. Making it as easy as possible for service desk positions to perform these tasks through automation will save your organization lots of time and effort!