'Uninstall LogicMontitor collector from the system'

def uninstall(self):

    self.module.debug('Running    Collector.uninstall...')
    uninstallfile = (self.installdir + '/agent/bin/uninstall.pl')
    if os.path.isfile(uninstallfile):
        self.module.debug('Collector    uninstall    file    exists')
        self.module.debug('System    changed')
        self.change = True
        if self.check_mode:
            self.exit(changed=True)
        self.module.debug('Running    collector    uninstaller')
        (ret_code, out, err) = self.module.run_command(uninstallfile)
        if (ret_code != 0):
            self.fail(msg=('Error:    Unable    to    uninstall    collector:    ' + err))
        else:
            self.module.debug('Collector    successfully    uninstalled')
    elif os.path.exists((self.installdir + '/agent')):
        self.fail(msg=(('Unable    to    uninstall    LogicMonitor    ' + 'Collector.    Can    not    find    LogicMonitor    ') + 'uninstaller.'))
