'Execute the LogicMonitor installer if not
already installed'

def install(self):

    self.module.debug('Running    Collector.install...')
    if (self.platform == 'Linux'):
        self.module.debug('Platform    is    Linux')
        installer = self.get_installer_binary()
        if (self.info is None):
            self.module.debug('Retrieving    collector    information')
            self.info = self._get()
        if (not os.path.exists((self.installdir + '/agent'))):
            self.module.debug('System    changed')
            self.change = True
            if self.check_mode:
                self.exit(changed=True)
            self.module.debug('Setting    installer    file    permissions')
            os.chmod(installer, 484)
            self.module.debug('Executing    installer')
            (ret_code, out, err) = self.module.run_command((installer + '    -y'))
            if (ret_code != 0):
                self.fail(msg=('Error:    Unable    to    install    collector:    ' + err))
            else:
                self.module.debug('Collector    installed    successfully')
        else:
            self.module.debug('Collector    already    installed')
    else:
        self.fail(msg=('Error:    LogicMonitor    Collector    must    be    ' + 'installed    on    a    Linux    device'))
