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_ddrs.py
#!/usr/bin/python2.6
import yaml
import subprocess
import MySQLdb as mdb
import sys
    
def __run__(params):

    ddd = int(params.get('ddd'))
    warning = int(params.get('warning'))
    critical = int(params.get('critical'))

    con = mdb.connect('db1.locawebtelecom.com.br','nagioscheck','nagioscheck6969','pabxmanagement');

    with con:

        cur=con.cursor()
        cur.execute("select count(*) from voipregistration where ddd=%s and companyname is null and proprietary is false and unavailable is false;",(ddd))
        data = cur.fetchall()

        for row in data:
            result = row[0]

        if result > warning :
            return [0, '%s disponiveis DDRs para o DDD %s' % (result,ddd)]
        elif  warning >= result >= critical :
            return [1, '%s disponiveis DDRs para o DDD %s' % (result,ddd)]
        else :
            return [2, '%s disponiveis DDRs para o DDD %s' % (result,ddd)]