Subversion Repositories ALCASAR

Rev

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

Rev 2770 Rev 3037
Line 30... Line 30...
30
     * define the regexp for log parser
30
     * define the regexp for log parser
31
     */
31
     */
32
    public function __construct($blockname = false)
32
    public function __construct($blockname = false)
33
    {
33
    {
34
        parent::__construct($blockname);
34
        parent::__construct($blockname);
35
        $this->setCPURegExp1("/^cpu(.*)\, (.*) MHz/");
35
        $this->setCPURegExp1("/^cpu(.*)\, (.*) MHz/\n/^CPU: (.*) \((.*)-MHz (.*)\)/"); // multiple regexp separated by \n
36
        $this->setCPURegExp2("/^(.*) at scsibus.*: <(.*)> .*/");
36
        $this->setCPURegExp2("/^(.*) at scsibus.*: <(.*)> .*/");
37
        $this->setSCSIRegExp2("/^(da[0-9]+): (.*)MB /");
37
        $this->setSCSIRegExp2("/^(da[0-9]+): (.*)MB /");
38
        $this->setPCIRegExp1("/(.*): <(.*)>(.*) (pci|legacypci)[0-9]+$/");
38
        $this->setPCIRegExp1("/(.*): <(.*)>(.*) (pci|legacypci)[0-9]+$/");
39
        $this->setPCIRegExp2("/(.*): <(.*)>.* at [0-9\.]+$/");
39
        $this->setPCIRegExp2("/(.*): <(.*)>.* at [0-9\.]+$/");
40
    }
40
    }
41
 
41
 
42
    /**
42
    /**
43
     * UpTime
-
 
44
     * time the system is running
-
 
45
     *
-
 
46
     * @return void
-
 
47
     */
-
 
48
    private function _uptime()
-
 
49
    {
-
 
50
        $a = $this->grabkey('kern.boottime');
-
 
51
        preg_match("/sec = ([0-9]+)/", $a, $buf);
-
 
52
        $this->sys->setUptime(time() - $buf[1]);
-
 
53
    }
-
 
54
 
-
 
55
    /**
-
 
56
     * get network information
43
     * get network information
57
     *
44
     *
58
     * @return void
45
     * @return void
59
     */
46
     */
60
    private function _network()
47
    private function _network()
Line 138... Line 125...
138
    /**
125
    /**
139
     * get the information
126
     * get the information
140
     *
127
     *
141
     * @see BSDCommon::build()
128
     * @see BSDCommon::build()
142
     *
129
     *
143
     * @return Void
130
     * @return void
144
     */
131
     */
145
    public function build()
132
    public function build()
146
    {
133
    {
147
        parent::build();
134
        parent::build();
148
        if (!$this->blockname || $this->blockname==='vitals') {
135
        if (!$this->blockname || $this->blockname==='vitals') {
149
            $this->_distroicon();
136
            $this->_distroicon();
150
            $this->_uptime();
-
 
151
            $this->_processes();
137
            $this->_processes();
152
        }
138
        }
153
        if (!$this->blockname || $this->blockname==='network') {
139
        if (!$this->blockname || $this->blockname==='network') {
154
            $this->_network();
140
            $this->_network();
155
        }
141
        }