Uninstalling a package on many robots
search cancel

Uninstalling a package on many robots

book

Article ID: 408313

calendar_today

Updated On:

Products

DX Unified Infrastructure Management (Nimsoft / UIM)

Issue/Introduction

I have a need to remove a package or probe from many robots.  I need a script that will do this for me without a lot of manual intervention.

Environment

Release: Any
Component: pu command

Resolution

  • GET A LIST OF ADDRESSES TO POPULATE OUR BATCH FILE
    The following database query creates a list of robot addresses.  The "where" clause at the end limits the list to robots that have "Linux" in the os_name.  You can change this "where" clause to suit your needs.
    -- list of distinct robot addresses for robots by OS
    SELECT distinct r.address
    from cm_device cd
    join cm_nimbus_robot r on r.dev_id=cd.dev_id
    join cm_computer_system cs on cs.cs_id=cd.cs_id
    where cs.os_name like '%Linux%' 

  • PUT THE OUTPUT INTO A FILE CALLED address_list.txt
    Edit the list as needed to only include the intended robots.

  • CREATE A BATCH FILE THAT CALLS THE LIST:
    The below example can be pasted into a batch file and used to uninstall the cdm probe.  The password will need to be updated.
    @ECHO OFF

    SET PASSWORD=<password>

    FOR /F "tokens=*" %%A in (address_list.txt) do (
    pu.exe -u administrator -p %PASSWORD% %%A/controller inst_pkg_remove cdm cdm 0
    )
  • EXECUTE THE BATCH FILE 
    For this example, the batch file and the address_list.txt file will need to be located in the <InstallFolder>/Nimsoft/bin folder.  
    Either double click the file or run it from the command line.  You'll see the results displayed as follows below:

    The line regarding the probe_crypto_mode can be ignored as benign.

  • CONFIRM RESULTS
    After this is complete, check the robots to see if the probe has been removed.