HEX
Server: Apache
System: Linux vpshost0650.publiccloud.com.br 4.4.79-grsec-1.lc.x86_64 #1 SMP Wed Aug 2 14:18:21 -03 2017 x86_64
User: bandeirantesbomb3 (10068)
PHP: 8.0.7
Disabled: apache_child_terminate,dl,escapeshellarg,escapeshellcmd,exec,link,mail,openlog,passthru,pcntl_alarm,pcntl_exec,pcntl_fork,pcntl_get_last_error,pcntl_getpriority,pcntl_setpriority,pcntl_signal,pcntl_signal_dispatch,pcntl_sigprocmask,pcntl_sigtimedwait,pcntl_sigwaitinfo,pcntl_strerror,pcntl_wait,pcntl_waitpid,pcntl_wexitstatus,pcntl_wifexited,pcntl_wifsignaled,pcntl_wifstopped,pcntl_wstopsig,pcntl_wtermsig,php_check_syntax,php_strip_whitespace,popen,proc_close,proc_open,shell_exec,symlink,system
Upload Files
File: //usr/lib/python2.7/site-packages/lap/rhel_monitor.py
#/usr/bin/python
import subprocess
import getpass

def __run__(params):

    if getpass.getuser() != "root":
        subscription_command = "sudo /usr/bin/subscription-manager config --list "
        status = " sudo /usr/bin/subscription-manager list"
    else:
        subscription_command = "/usr/bin/subscription-manager config --list "
        status = "/usr/bin/subscription-manager list"
    
    satellite_server = subprocess.Popen(subscription_command.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
    satellite_server = satellite_server.stdout.read()
    
    
    
    try:
        baseurl = params.get("baseurl",False)
    
        if baseurl in satellite_server:
            if baseurl in satellite_server:
                satellite_server = baseurl 
            else:
                satellite_server="SEM SERVER"
     
        status2 = subprocess.Popen(status.split(), stdout=subprocess.PIPE, stderr=subprocess.PIPE)
        status = status2.stdout.read()
    
    
        if 'Subscribed' in status:
            status = "Registrado"
        else:
            status = "Nao Registrado"
     
        if status == 'Registrado' and satellite_server == baseurl:
            return([0, '{0} no server {1}'.format(status,satellite_server)])
        elif status != 'Registrado':
            return ([2, '{0} no server {1}'.format(status,satellite_server)])
        elif satellite_server !=  baseurl :
            return ([1, '{0} no server {1}, VERIFICAR com N2'.format(status,satellite_server)])
    
    except Exception, error:
        return([1, 'Erro encaminhar para N2 !!! - {0} ---- {1} '.format(status,satellite_server)])