Skip to content

Automatically transfer WhatsUp Gold's Inventory to Ansible

Notifications You must be signed in to change notification settings

kahhong/WhatsUpGold-to-Ansible

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 

Repository files navigation

WhatsUpGold-to-Ansible

This python script should be run on Ansible control machine to transfer WhatsUp Gold's Inventory to Ansible.

Prerequisites

  1. All WhatsUp Gold groups to be transferred to Ansible should be under a static group.

Example:

Groups to be transferred (static)
  |-- Group 1 will be transferred (dynamic)
  |-- Group 2 will also be transferred (dynamic)

Group 3 will not be transferred
  1. The Group description in WhatsUp Gold should be reserved for its Ansible's equivalent group name. WhatsUp Gold Group Description

What do you need to change

host = IP Address of the WhatsUp Gold Monitor
username = Swagger API's username
password = Swagger API's password

...

def get_groups():
    # Group id of 51 refers to all custom dynamic groups
    # To get the ids of other groups, send this url with an id of -2.
    groupid = The groupid of the static group containing all the groups to be transferred.
    
    ...
    
f = open(r'Absolute path of Ansible inventory file for output', "w")

Others

You can schedule this script to run on a timely basis to ensure your Ansible's inventory stays updated as your WhatsUp Gold's inventory.

About

Automatically transfer WhatsUp Gold's Inventory to Ansible

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages