Subversion Repositories ALCASAR

Rev

Rev 2770 | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log

Rev 2770 Rev 3037
Line 25... Line 25...
25
 * @link      http://phpsysinfo.sourceforge.net
25
 * @link      http://phpsysinfo.sourceforge.net
26
 */
26
 */
27
class HPUX extends OS
27
class HPUX extends OS
28
{
28
{
29
    /**
29
    /**
-
 
30
     * uptime command result.
-
 
31
     */
-
 
32
    private $_uptime = null;
-
 
33
 
-
 
34
    /**
30
     * Virtual Host Name
35
     * Virtual Host Name
31
     *
36
     *
32
     * @return void
37
     * @return void
33
     */
38
     */
34
    private function _hostname()
39
    private function _hostname()
35
    {
40
    {
36
        if (PSI_USE_VHOST === true) {
41
        if (PSI_USE_VHOST) {
37
            if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
42
            if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
38
        } else {
43
        } else {
39
            if (CommonFunctions::executeProgram('hostname', '', $ret)) {
44
            if (CommonFunctions::executeProgram('hostname', '', $ret)) {
40
                $this->sys->setHostname($ret);
45
                $this->sys->setHostname($ret);
41
            }
46
            }
Line 60... Line 65...
60
     *
65
     *
61
     * @return void
66
     * @return void
62
     */
67
     */
63
    private function _uptime()
68
    private function _uptime()
64
    {
69
    {
65
        if (CommonFunctions::executeProgram('uptime', '', $buf)) {
70
        if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) {
66
            if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
71
            if (preg_match("/up (\d+) days,\s*(\d+):(\d+),/", $this->_uptime, $ar_buf)) {
67
                $min = $ar_buf[3];
72
                $min = $ar_buf[3];
68
                $hours = $ar_buf[2];
73
                $hours = $ar_buf[2];
69
                $days = $ar_buf[1];
74
                $days = $ar_buf[1];
70
                $this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60);
75
                $this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60);
71
            }
76
            }
Line 78... Line 83...
78
     *
83
     *
79
     * @return void
84
     * @return void
80
     */
85
     */
81
    private function _loadavg()
86
    private function _loadavg()
82
    {
87
    {
83
        if (CommonFunctions::executeProgram('uptime', '', $buf)) {
88
        if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) {
84
            if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) {
89
            if (preg_match("/average: (.*), (.*), (.*)$/", $this->_uptime, $ar_buf)) {
85
                $this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]);
90
                $this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]);
86
            }
91
            }
87
        }
92
        }
88
    }
93
    }
89
 
94
 
Line 123... Line 128...
123
                            $dev->setCache(preg_replace("/[a-zA-Z]/", "", $arrBuff[1]) * 1024);
128
                            $dev->setCache(preg_replace("/[a-zA-Z]/", "", $arrBuff[1]) * 1024);
124
                            break;
129
                            break;
125
                        case 'bogomips':
130
                        case 'bogomips':
126
                        case 'cpu0bogo':
131
                        case 'cpu0bogo':
127
                            $dev->setBogomips($arrBuff[1]);
132
                            $dev->setBogomips($arrBuff[1]);
128
                            break;
-
 
129
                        }
133
                        }
130
                    }
134
                    }
131
                }
135
                }
132
            }
136
            }
133
        }
137
        }
Line 356... Line 360...
356
    /**
360
    /**
357
     * get the information
361
     * get the information
358
     *
362
     *
359
     * @see PSI_Interface_OS::build()
363
     * @see PSI_Interface_OS::build()
360
     *
364
     *
361
     * @return Void
365
     * @return void
362
     */
366
     */
363
    public function build()
367
    public function build()
364
    {
368
    {
365
        if (!$this->blockname || $this->blockname==='vitals') {
369
        if (!$this->blockname || $this->blockname==='vitals') {
366
            $this->_distro();
370
            $this->_distro();
Line 375... Line 379...
375
            $this->_pci();
379
            $this->_pci();
376
            $this->_ide();
380
            $this->_ide();
377
            $this->_scsi();
381
            $this->_scsi();
378
            $this->_usb();
382
            $this->_usb();
379
        }
383
        }
380
        if (!$this->blockname || $this->blockname==='network') {
-
 
381
            $this->_network();
-
 
382
        }
-
 
383
        if (!$this->blockname || $this->blockname==='memory') {
384
        if (!$this->blockname || $this->blockname==='memory') {
384
            $this->_memory();
385
            $this->_memory();
385
        }
386
        }
386
        if (!$this->blockname || $this->blockname==='filesystem') {
387
        if (!$this->blockname || $this->blockname==='filesystem') {
387
            $this->_filesystems();
388
            $this->_filesystems();
388
        }
389
        }
-
 
390
        if (!$this->blockname || $this->blockname==='network') {
-
 
391
            $this->_network();
-
 
392
        }
389
    }
393
    }
390
}
394
}