403Webshell
Server IP : 123.56.80.60  /  Your IP : 216.73.216.78
Web Server : Apache/2.4.54 (Win32) OpenSSL/1.1.1s PHP/7.4.33 mod_fcgid/2.3.10-dev
System : Windows NT iZhx3sob14hnz7Z 10.0 build 14393 (Windows Server 2016) i586
User : SYSTEM ( 0)
PHP Version : 7.4.33
Disable Function : NONE
MySQL : OFF  |  cURL : ON  |  WGET : OFF  |  Perl : OFF  |  Python : OFF  |  Sudo : OFF  |  Pkexec : OFF
Directory :  C:/wamp/apps/phpsysinfo3.4.2/includes/mb/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Command :


[ Back ]     

Current File : C:/wamp/apps/phpsysinfo3.4.2/includes/mb/class.qtssnmp.inc.php
<?php
/**
 * qtstemp sensor class, getting hardware temperature information through snmpwalk
 *
 * PHP version 5
 *
 * @category  PHP
 * @package   PSI_Sensor
 * @author    Mieczyslaw Nalewaj <namiltd@users.sourceforge.net>
 * @copyright 2016 phpSysInfo
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
 * @version   Release: 3.0
 * @link      http://phpsysinfo.sourceforge.net
 */
class QTSsnmp extends Sensors
{
    /**
     * get temperature information
     *
     * @return void
     */
    private function _temperature()
    {
        if (!defined('PSI_EMU_PORT')) {
            $address = '127.0.0.1';
        } else {
            $address = PSI_EMU_HOSTNAME;
        }
        if (CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$address." .1.3.6.1.4.1.24681.1.2.5.0", $buffer, PSI_DEBUG)
           && preg_match('/^[\.\d]+ = STRING:\s\"?(\d+)\sC/', $buffer, $data)) {
            $dev = new SensorDevice();
            $dev->setName("CPU");
            $dev->setValue($data[1]);
            $this->mbinfo->setMbTemp($dev);
        }

        if (CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$address." .1.3.6.1.4.1.24681.1.2.6.0", $buffer, PSI_DEBUG)
           && preg_match('/^[\.\d]+ = STRING:\s\"?(\d+)\sC/', $buffer, $data)) {
            $dev = new SensorDevice();
            $dev->setName("System");
            $dev->setValue($data[1]);
            $this->mbinfo->setMbTemp($dev);
        }

        if (CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$address." .1.3.6.1.4.1.24681.1.2.11.1.3", $buffer, PSI_DEBUG)) {
            $lines = preg_split('/\r?\n/', $buffer);
            foreach ($lines as $line) if (preg_match('/^[\.\d]+\.(\d+) = STRING:\s\"?(\d+)\sC/', $line, $data)) {
                $dev = new SensorDevice();
                $dev->setName("HDD ".$data[1]);
                $dev->setValue($data[2]);
                $this->mbinfo->setMbTemp($dev);
            }
        }
    }

    /**
     * get fan information
     *
     * @return void
     */
    private function _fans()
    {
        if (!defined('PSI_EMU_PORT')) {
            $address = '127.0.0.1';
        } else {
            $address = PSI_EMU_HOSTNAME;
        }
        if (CommonFunctions::executeProgram("snmpwalk", "-Ona -c public -v 1 -t ".PSI_SNMP_TIMEOUT_INT." -r ".PSI_SNMP_RETRY_INT." ".$address." .1.3.6.1.4.1.24681.1.2.15.1.3", $buffer, PSI_DEBUG)) {
            $lines = preg_split('/\r?\n/', $buffer);
            foreach ($lines as $line) if (preg_match('/^[\.\d]+\.(\d+) = STRING:\s\"?(\d+)\sRPM/', $line, $data)) {
                $dev = new SensorDevice();
                $dev->setName("Fan ".$data[1]);
                $dev->setValue($data[2]);
                $this->mbinfo->setMbFan($dev);
            }
        }
    }

    /**
     * get the information
     *
     * @see PSI_Interface_Sensor::build()
     *
     * @return void
     */
    public function build()
    {
        if ((PSI_OS == 'Linux') && (!defined('PSI_EMU_HOSTNAME') || defined('PSI_EMU_PORT'))) {
            $this->_temperature();
            $this->_fans();
        }
    }
}

Youez - 2016 - github.com/yon3zu
LinuXploit