Subversion Repositories ALCASAR

Rev

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

Rev 2770 Rev 3037
Line 24... Line 24...
24
* @version   Release: 3.0
24
* @version   Release: 3.0
25
* @link      http://phpsysinfo.sourceforge.net
25
* @link      http://phpsysinfo.sourceforge.net
26
*/
26
*/
27
class AIX extends OS
27
class AIX extends OS
28
{
28
{
-
 
29
    /**
-
 
30
     * uptime command result.
-
 
31
     */
-
 
32
    private $_uptime = null;
29
 
33
 
-
 
34
    /**
-
 
35
     * prtconf command result.
-
 
36
     */
30
    private $_aixdata = array();
37
    private $_aixdata = array();
31
 
38
 
32
    /**
39
    /**
33
     * Virtual Host Name
40
     * Virtual Host Name
34
     * @return void
41
     * @return void
35
     */
42
     */
36
    private function _hostname()
43
    private function _hostname()
37
    {
44
    {
38
        /*   if (PSI_USE_VHOST === true) {
45
        /*   if (PSI_USE_VHOST) {
39
               if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
46
               if (CommonFunctions::readenv('SERVER_NAME', $hnm)) $this->sys->setHostname($hnm);
40
           } else {
47
           } else {
41
               if (CommonFunctions::executeProgram('hostname', '', $ret)) {
48
               if (CommonFunctions::executeProgram('hostname', '', $ret)) {
42
                   $this->sys->setHostname($ret);
49
                   $this->sys->setHostname($ret);
43
               }
50
               }
Line 62... Line 69...
62
     * time the system is running
69
     * time the system is running
63
     * @return void
70
     * @return void
64
     */
71
     */
65
    private function _uptime()
72
    private function _uptime()
66
    {
73
    {
67
        if (CommonFunctions::executeProgram('uptime', '', $buf)) {
74
        if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) {
68
            if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $buf, $ar_buf)) {
75
            if (preg_match("/up (\d+) day[s]?,\s*(\d+):(\d+),/", $this->_uptime, $ar_buf)) {
69
                $min = $ar_buf[3];
76
                $min = $ar_buf[3];
70
                $hours = $ar_buf[2];
77
                $hours = $ar_buf[2];
71
                $days = $ar_buf[1];
78
                $days = $ar_buf[1];
72
                $this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60);
79
                $this->sys->setUptime($days * 86400 + $hours * 3600 + $min * 60);
73
            }
80
            }
Line 79... Line 86...
79
     * optionally create a loadbar
86
     * optionally create a loadbar
80
     * @return void
87
     * @return void
81
     */
88
     */
82
    private function _loadavg()
89
    private function _loadavg()
83
    {
90
    {
84
        if (CommonFunctions::executeProgram('uptime', '', $buf)) {
91
        if (($this->_uptime !== null) || CommonFunctions::executeProgram('uptime', '', $this->_uptime)) {
85
            if (preg_match("/average: (.*), (.*), (.*)$/", $buf, $ar_buf)) {
92
            if (preg_match("/average: (.*), (.*), (.*)$/", $this->_uptime, $ar_buf)) {
86
                $this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]);
93
                $this->sys->setLoad($ar_buf[1].' '.$ar_buf[2].' '.$ar_buf[3]);
87
            }
94
            }
88
        }
95
        }
89
    }
96
    }
90
 
97
 
Line 327... Line 334...
327
    /**
334
    /**
328
     * get the information
335
     * get the information
329
     *
336
     *
330
     * @see PSI_Interface_OS::build()
337
     * @see PSI_Interface_OS::build()
331
     *
338
     *
332
     * @return Void
339
     * @return void
333
     */
340
     */
334
    public function build()
341
    public function build()
335
    {
342
    {
336
        $this->error->addError("WARN", "The AIX version of phpSysInfo is a work in progress, some things currently don't work");
343
        $this->error->addWarning("The AIX version of phpSysInfo is a work in progress, some things currently don't work");
337
        if (!$this->blockname || $this->blockname==='vitals') {
344
        if (!$this->blockname || $this->blockname==='vitals') {
338
            $this->_distro();
345
            $this->_distro();
339
            $this->_hostname();
346
            $this->_hostname();
340
            $this->_kernel();
347
            $this->_kernel();
341
            $this->_uptime();
348
            $this->_uptime();
Line 347... Line 354...
347
            $this->_pci();
354
            $this->_pci();
348
            $this->_ide();
355
            $this->_ide();
349
            $this->_scsi();
356
            $this->_scsi();
350
            $this->_usb();
357
            $this->_usb();
351
        }
358
        }
352
        if (!$this->blockname || $this->blockname==='network') {
-
 
353
            $this->_network();
-
 
354
        }
-
 
355
        if (!$this->blockname || $this->blockname==='memory') {
359
        if (!$this->blockname || $this->blockname==='memory') {
356
            $this->_memory();
360
            $this->_memory();
357
        }
361
        }
358
        if (!$this->blockname || $this->blockname==='filesystem') {
362
        if (!$this->blockname || $this->blockname==='filesystem') {
359
            $this->_filesystems();
363
            $this->_filesystems();
360
        }
364
        }
-
 
365
        if (!$this->blockname || $this->blockname==='network') {
-
 
366
            $this->_network();
-
 
367
        }
361
    }
368
    }
362
}
369
}