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: //lib/python2.7/site-packages/lap/check_raid_hp.py
import subprocess
import re
import os
import string

def __run__(params):
    if not os.path.exists('/usr/lib/check_mk_agent/need_sudo/check_raid_hp'):
        return [2, '/need_sudo/check_raid_hp is not installed, please reinstall locaweb-plugins']

    if not os.path.exists('/usr/sbin/hpacucli'):
        return [2, 'hpacucli is not installed, please install hpacucli']

    try:
        p = subprocess.Popen(['/usr/bin/sudo',
            '/usr/lib/check_mk_agent/need_sudo/check_raid_hp'],
            stdout=subprocess.PIPE)
    except Exception as e:
        return [2, 'CRITICAL - Problems executing check_raid_hp %s' % repr(e)]

    bad_chars = "(){}<>[],'"
    out = str(p.stdout.read().split('\n'))
    out = out.translate(string.maketrans("", "", ), bad_chars)

    if "CRITICAL" in out:
        return [2, '%s' % out]
    elif "WARNING" in out:
        return [1, '%s' % out]
    else:
        return [0, '%s' % out]