Automating Scope Loading - TADDM/taddm-wiki GitHub Wiki
The scripts attached here will assist in properly automating and scheduling the loading of discovery scope files. The scripts will read discover scope files out of a directory and create the scope files in TADDM giving each the name found in the scope file.
This has been tested on 7.2.2 and 7.3.0.
Download the PowerShell script autoloadscopes.ps1 or Bash script autoloadscopes.sh to your <taddm>/custom directory on any of the discovery servers in a streaming environment. You may need to create the directory 'custom'.
-
Create scope files under custom/scopes directory- Create directory <taddm>\custom\scopes if it doesn't already exist and create one file for each scope you want. Name each file with a .scope extension. The first line of the file should contain a comment (line beginning with #) with the intended scope name.
# My_Scope_Name # Another comment that is ignored by loader and script 192.17.10.139,,machine1 192.17.10.138,,machine2
-
Change the default user name and password- The script contains an API command line call to load each scope and that line contains the default TADDM administrator and password. Change this manually if necessary.
For the Windows PowerShell script to work, you will need to install PowerShell if you are running on Windows 2003. Also, make sure that you run 'Set-ExecutionPolicy Unrestricted' for both the 32-bit and 64-bit PowerShell at the command prompt. This only needs done once.
Now simply use the Windows task scheduler or cron to schedule execution of the autoloadscopes script.
You may have lots of scopes loaded in to TADDM that you want to start managing from the command line. In this case you will need to generate scope files from your existing scope sets. This set of scrips allows you to query the scopes in TADDM and write them to file.
- Download the Python script queryscopes.jy to <taddm>/custom on any of the discovery servers in a streaming environment.
- Windows Only: Download the batch wrapper script queryscopes.bat to <taddm>/custom.
- Create scopes directory under custom directory.
- You can run the queryscopes.jy script with -s <scopeset> and it will print the scope set to standard output. Redirect standard output to scopes/<scopeset>.scope. The script also takes -u <user> -p <password> but uses the TADDM defaults if not present.
- There is a wrapper Bash script qallscopes.sh and a wrapper Powershell script qallscopes.ps1 that will iterate through all the existing scopes in TADDM and run queryscopes.jy for each one, automatically redirecting output to custom/scopes. Wrapper scripts use the default administrator account. If you want to use a different account you must edit the script.