Subversion Repositories ALCASAR

Rev

Rev 3037 | Details | Compare with Previous | Last modification | View Log

Rev Author Line No. Line
2770 rexy 1
<?php
2
/**
3
 * Darwin System Class
4
 *
5
 * PHP version 5
6
 *
7
 * @category  PHP
8
 * @package   PSI Darwin OS class
9
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
10
 * @copyright 2009 phpSysInfo
11
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
12
 * @version   SVN: $Id: class.Darwin.inc.php 638 2012-08-24 09:40:48Z namiltd $
13
 * @link      http://phpsysinfo.sourceforge.net
14
 */
15
 /**
16
 * Darwin sysinfo class
17
 * get all the required information from Darwin system
18
 * information may be incomplete
19
 *
20
 * @category  PHP
21
 * @package   PSI Darwin OS class
22
 * @author    Michael Cramer <BigMichi1@users.sourceforge.net>
23
 * @copyright 2009 phpSysInfo
24
 * @license   http://opensource.org/licenses/gpl-2.0.php GNU General Public License version 2, or (at your option) any later version
25
 * @version   Release: 3.0
26
 * @link      http://phpsysinfo.sourceforge.net
27
 */
28
class Darwin extends BSDCommon
29
{
30
    /**
31
     * define the regexp for log parser
32
     */
33
    /* public function __construct($blockname = false)
34
    {
35
        parent::__construct($blockname);
36
        $this->error->addWarning("The Darwin version of phpSysInfo is a work in progress, some things currently don't work!");
37
        $this->setCPURegExp1("/CPU: (.*) \((.*)-MHz (.*)\)/");
38
        $this->setCPURegExp2("/(.*) ([0-9]+) ([0-9]+) ([0-9]+) ([0-9]+)/");
39
        $this->setSCSIRegExp1("/^(.*): <(.*)> .*SCSI.*device/");
40
    } */
325 richard 41
 
2770 rexy 42
    /**
43
     * get a value from sysctl command
44
     *
45
     * @param string $key key of the value to get
46
     *
47
     * @return string
48
     */
49
    protected function grabkey($key)
50
    {
51
        if (CommonFunctions::executeProgram('sysctl', $key, $s, PSI_DEBUG)) {
52
            $s = preg_replace('/'.$key.': /', '', $s);
53
            $s = preg_replace('/'.$key.' = /', '', $s);
325 richard 54
 
2770 rexy 55
            return $s;
56
        } else {
57
            return '';
58
        }
59
    }
325 richard 60
 
2770 rexy 61
    /**
62
     * get a value from ioreg command
63
     *
64
     * @param string $key key of the value to get
65
     *
66
     * @return string
67
     */
68
    private function _grabioreg($key)
69
    {
70
        if (CommonFunctions::executeProgram('ioreg', '-c "'.$key.'"', $s, PSI_DEBUG)) {
71
            /* delete newlines */
72
            $s = preg_replace("/\s+/", " ", $s);
73
            /* new newlines */
74
            $s = preg_replace("/[\|\t ]*\+\-o/", "\n", $s);
75
            /* combine duplicate whitespaces and some chars */
76
            $s = preg_replace("/[\|\t ]+/", " ", $s);
325 richard 77
 
2770 rexy 78
            $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
79
            $out = "";
80
            foreach ($lines as $line) {
81
                if (preg_match('/^([^<]*) <class '.$key.',/', $line)) {
82
                    $out .= $line."\n";
83
                }
84
            }
325 richard 85
 
2770 rexy 86
            return $out;
87
        } else {
88
            return '';
89
        }
90
    }
325 richard 91
 
2770 rexy 92
    /**
93
     * get CPU information
94
     *
95
     * @return void
96
     */
97
    protected function cpuinfo()
98
    {
99
        $dev = new CpuDevice();
3100 rexy 100
        if (CommonFunctions::executeProgram('hostinfo', '', $buf, PSI_DEBUG) && ($buf !== '') && preg_match('/^Processor type:[ ]+(.+)$/m', $buf, $proc) && (($proc[1] = trim($proc[1])) !== '')) {
101
            $dev->setModel($proc[1]);
2770 rexy 102
            $buf=$this->grabkey('hw.model');
3037 rexy 103
            if (($buf !== null) && (trim($buf) != "")) {
2770 rexy 104
                $this->sys->setMachine(trim($buf));
3037 rexy 105
                if (CommonFunctions::rftsdata('ModelTranslation.txt', $buffer)) {
2770 rexy 106
                    $buffer = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
107
                    foreach ($buffer as $line) {
108
                        $ar_buf = preg_split("/:/", $line, 3);
109
                        if (trim($buf) === trim($ar_buf[0])) {
110
                            $dev->setModel(trim($ar_buf[2]));
111
                            $this->sys->setMachine($this->sys->getMachine().' - '.trim($ar_buf[1]));
112
                            break;
113
                        }
114
                    }
115
                }
116
            }
117
            $buf=$this->grabkey('machdep.cpu.brand_string');
3037 rexy 118
            if (($buf !== null) && (trim($buf) != "") &&
2770 rexy 119
                 ((trim($buf) != "i486 (Intel 80486)") || ($dev->getModel() == ""))) {
120
                $dev->setModel(trim($buf));
121
            }
122
            $buf=$this->grabkey('machdep.cpu.features');
3037 rexy 123
            if (($buf !== null) && (trim($buf) != "")) {
2770 rexy 124
                if (preg_match("/ VMX/", $buf)) {
125
                    $dev->setVirt("vmx");
126
                } elseif (preg_match("/ SVM/", $buf)) {
127
                    $dev->setVirt("svm");
128
                }
129
            }
130
        }
131
        $dev->setCpuSpeed(round($this->grabkey('hw.cpufrequency') / 1000000));
132
        $dev->setBusSpeed(round($this->grabkey('hw.busfrequency') / 1000000));
133
        $bufn=$this->grabkey('hw.cpufrequency_min');
134
        $bufx=$this->grabkey('hw.cpufrequency_max');
3037 rexy 135
        if (($bufn !== null) && (trim($bufn) != "") && ($bufx !== null) && (trim($bufx) != "") && ($bufn != $bufx)) {
2770 rexy 136
            $dev->setCpuSpeedMin(round($bufn / 1000000));
137
            $dev->setCpuSpeedMax(round($bufx / 1000000));
138
        }
139
        $buf=$this->grabkey('hw.l2cachesize');
3037 rexy 140
        if ($buf !== "") {
2770 rexy 141
            $dev->setCache(round($buf));
142
        }
143
        $ncpu = $this->grabkey('hw.ncpu');
3037 rexy 144
        if (($ncpu === "") || !($ncpu >= 1)) {
2770 rexy 145
            $ncpu = 1;
3037 rexy 146
        }
147
        if (($ncpu == 1) && PSI_LOAD_BAR) {
148
            $dev->setLoad($this->cpuusage());
149
        }
2770 rexy 150
        for ($ncpu ; $ncpu > 0 ; $ncpu--) {
151
            $this->sys->setCpus($dev);
152
        }
153
    }
325 richard 154
 
2770 rexy 155
    /**
156
     * get the pci device information out of ioreg
157
     *
158
     * @return void
159
     */
160
    protected function pci()
161
    {
162
        if (!$arrResults = Parser::lspci(false)) { //no lspci port
163
            $s = $this->_grabioreg('IOPCIDevice');
164
            $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
165
            foreach ($lines as $line) {
166
                $dev = new HWDevice();
167
                if (!preg_match('/"IOName" = "([^"]*)"/', $line, $ar_buf)) {
168
                    $ar_buf = preg_split("/[\s@]+/", $line, 19);
169
                }
170
                if (preg_match('/"model" = <?"([^"]*)"/', $line, $ar_buf2)) {
171
                    $dev->setName(trim($ar_buf[1]). ": ".trim($ar_buf2[1]));
172
                } else {
173
                    $dev->setName(trim($ar_buf[1]));
174
                }
175
                $this->sys->setPciDevices($dev);
176
            }
177
        } else {
178
            foreach ($arrResults as $dev) {
179
                $this->sys->setPciDevices($dev);
180
            }
181
        }
182
    }
325 richard 183
 
2770 rexy 184
    /**
185
     * get the ide device information out of ioreg
186
     *
187
     * @return void
188
     */
189
    protected function ide()
190
    {
191
        $s = $this->_grabioreg('IOATABlockStorageDevice');
192
        $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
193
        foreach ($lines as $line) {
194
                    $dev = new HWDevice();
195
                    if (!preg_match('/"Product Name"="([^"]*)"/', $line, $ar_buf))
196
                       $ar_buf = preg_split("/[\s@]+/", $line, 19);
197
                    $dev->setName(trim($ar_buf[1]));
198
                    $this->sys->setIdeDevices($dev);
199
        }
325 richard 200
 
2770 rexy 201
        $s = $this->_grabioreg('IOAHCIBlockStorageDevice');
202
        $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
203
        foreach ($lines as $line) {
204
                    $dev = new HWDevice();
205
                    if (!preg_match('/"Product Name"="([^"]*)"/', $line, $ar_buf))
206
                       $ar_buf = preg_split("/[\s@]+/", $line, 19);
207
                    $dev->setName(trim($ar_buf[1]));
208
                    $this->sys->setIdeDevices($dev);
209
        }
210
    }
325 richard 211
 
2770 rexy 212
    /**
213
     * get the usb device information out of ioreg
214
     *
215
     * @return void
216
     */
217
    protected function usb()
218
    {
219
        $s = $this->_grabioreg('IOUSBDevice');
220
        $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
221
        foreach ($lines as $line) {
222
                    $dev = new HWDevice();
223
                    if (!preg_match('/"USB Product Name" = "([^"]*)"/', $line, $ar_buf))
224
                       $ar_buf = preg_split("/[\s@]+/", $line, 19);
225
                    $dev->setName(trim($ar_buf[1]));
226
                    if (defined('PSI_SHOW_DEVICES_INFOS') && PSI_SHOW_DEVICES_INFOS) {
227
                        if (preg_match('/"USB Vendor Name" = "([^"]*)"/', $line, $ar_buf)) {
228
                            $dev->setManufacturer(trim($ar_buf[1]));
229
                        }
230
                        if (preg_match('/"USB Product Name" = "([^"]*)"/', $line, $ar_buf)) {
231
                            $dev->setProduct(trim($ar_buf[1]));
232
                        }
233
                        if (defined('PSI_SHOW_DEVICES_SERIAL') && PSI_SHOW_DEVICES_SERIAL
234
                           && preg_match('/"USB Serial Number" = "([^"]*)"/', $line, $ar_buf)) {
235
                            $dev->setSerial(trim($ar_buf[1]));
236
                        }
237
                    }
238
                    $this->sys->setUsbDevices($dev);
239
        }
240
    }
325 richard 241
 
2770 rexy 242
    /**
243
     * get the scsi device information out of ioreg
244
     *
245
     * @return void
246
     */
247
    protected function scsi()
248
    {
249
        $s = $this->_grabioreg('IOBlockStorageServices');
250
        $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
251
        foreach ($lines as $line) {
252
                    $dev = new HWDevice();
253
                    if (!preg_match('/"Product Name"="([^"]*)"/', $line, $ar_buf))
254
                       $ar_buf = preg_split("/[\s@]+/", $line, 19);
255
                    $dev->setName(trim($ar_buf[1]));
256
                    $this->sys->setScsiDevices($dev);
257
        }
258
    }
325 richard 259
 
2770 rexy 260
    /**
261
     * get memory and swap information
262
     *
263
     * @return void
264
     */
265
    protected function memory()
266
    {
3100 rexy 267
        if (($s = $this->grabkey('hw.memsize')) > 0) {
268
            $this->sys->setMemTotal($s);
269
            if (CommonFunctions::executeProgram('vm_stat', '', $pstat, PSI_DEBUG)) {
270
                // calculate free memory from page sizes (each page = 4096)
271
                if (preg_match('/^Pages free:\s+(\S+)/m', $pstat, $free_buf)) {
272
                    if (preg_match('/^Anonymous pages:\s+(\S+)/m', $pstat, $anon_buf)
273
                       && preg_match('/^Pages wired down:\s+(\S+)/m', $pstat, $wire_buf)
274
                       && preg_match('/^File-backed pages:\s+(\S+)/m', $pstat, $fileb_buf)) {
275
                            // OS X 10.9 or never
276
                            $this->sys->setMemFree($free_buf[1] * 4 * 1024);
277
                            $this->sys->setMemApplication(($anon_buf[1]+$wire_buf[1]) * 4 * 1024);
278
                            $this->sys->setMemCache($fileb_buf[1] * 4 * 1024);
279
                            if (preg_match('/^Pages occupied by compressor:\s+(\S+)/m', $pstat, $compr_buf)) {
280
                                $this->sys->setMemBuffer($compr_buf[1] * 4 * 1024);
281
                            }
282
                    } else {
283
                        if (preg_match('/^Pages speculative:\s+(\S+)/m', $pstat, $spec_buf)) {
284
                            $this->sys->setMemFree(($free_buf[1]+$spec_buf[1]) * 4 * 1024);
285
                        } else {
286
                            $this->sys->setMemFree($free_buf[1] * 4 * 1024);
2770 rexy 287
                        }
3100 rexy 288
                        $appMemory = 0;
289
                        if (preg_match('/^Pages wired down:\s+(\S+)/m', $pstat, $wire_buf)) {
290
                            $appMemory += $wire_buf[1] * 4 * 1024;
291
                        }
292
                        if (preg_match('/^Pages active:\s+(\S+)/m', $pstat, $active_buf)) {
293
                            $appMemory += $active_buf[1] * 4 * 1024;
294
                        }
295
                        $this->sys->setMemApplication($appMemory);
325 richard 296
 
3100 rexy 297
                        if (preg_match('/^Pages inactive:\s+(\S+)/m', $pstat, $inactive_buf)) {
298
                            $this->sys->setMemCache($inactive_buf[1] * 4 * 1024);
299
                        }
2770 rexy 300
                    }
3100 rexy 301
                } else {
302
                    $lines = preg_split("/\n/", $pstat, -1, PREG_SPLIT_NO_EMPTY);
303
                    $ar_buf = preg_split("/\s+/", $lines[1], 19);
304
                    $this->sys->setMemFree($ar_buf[2] * 4 * 1024);
2770 rexy 305
                }
3100 rexy 306
                $this->sys->setMemUsed($this->sys->getMemTotal() - $this->sys->getMemFree());
2770 rexy 307
            }
325 richard 308
 
3100 rexy 309
            if (($swap = $this->grabkey("vm.swapusage")) > 0) {
310
                $swap0 = preg_split('/M/', $swapBuff);
311
                $swap1 = preg_split('/=/', $swap0[0]);
312
                $swap2 = preg_split('/=/', $swap0[1]);
313
                $swap3 = preg_split('/=/', $swap0[2]);
314
                if (($swap=str_replace(',', '.', trim($swap1[1]))) > 0) {
2976 rexy 315
                    $dev = new DiskDevice();
316
                    $dev->setName('SWAP');
317
                    $dev->setMountPoint('SWAP');
318
                    $dev->setFsType('swap');
319
                    $dev->setTotal($swap * 1024 * 1024);
3100 rexy 320
                    $dev->setUsed(str_replace(',', '.', trim($swap2[1])) * 1024 * 1024);
321
                    $dev->setFree(str_replace(',', '.', trim($swap3[1])) * 1024 * 1024);
2976 rexy 322
                    $this->sys->setSwapDevices($dev);
323
                }
2770 rexy 324
            }
325
        }
326
    }
325 richard 327
 
2770 rexy 328
    /**
329
     * get the thunderbolt device information out of ioreg
330
     *
331
     * @return void
332
     */
333
    protected function _tb()
334
    {
335
        $s = $this->_grabioreg('IOThunderboltPort');
336
        $lines = preg_split("/\n/", $s, -1, PREG_SPLIT_NO_EMPTY);
337
        foreach ($lines as $line) {
338
                    $dev = new HWDevice();
339
                    if (!preg_match('/"Description" = "([^"]*)"/', $line, $ar_buf))
340
                       $ar_buf = preg_split("/[\s@]+/", $line, 19);
341
                    $dev->setName(trim($ar_buf[1]));
342
                    $this->sys->setTbDevices($dev);
343
        }
344
    }
325 richard 345
 
2770 rexy 346
    /**
347
     * get network information
348
     *
349
     * @return void
350
     */
351
    private function _network()
352
    {
353
        if (CommonFunctions::executeProgram('netstat', '-nbdi | cut -c1-24,42- | grep Link', $netstat, PSI_DEBUG)) {
354
            $lines = preg_split("/\n/", $netstat, -1, PREG_SPLIT_NO_EMPTY);
355
            foreach ($lines as $line) {
356
                $ar_buf = preg_split("/\s+/", $line, 10);
357
                if (!empty($ar_buf[0])) {
358
                    $dev = new NetDevice();
359
                    $dev->setName($ar_buf[0]);
360
                    $dev->setTxBytes($ar_buf[8]);
361
                    $dev->setRxBytes($ar_buf[5]);
362
                    $dev->setErrors($ar_buf[4] + $ar_buf[7]);
363
                    if (isset($ar_buf[10])) {
364
                        $dev->setDrops($ar_buf[10]);
365
                    }
366
                    if (defined('PSI_SHOW_NETWORK_INFOS') && (PSI_SHOW_NETWORK_INFOS) && (CommonFunctions::executeProgram('ifconfig', $ar_buf[0].' 2>/dev/null', $bufr2, PSI_DEBUG))) {
367
                        $bufe2 = preg_split("/\n/", $bufr2, -1, PREG_SPLIT_NO_EMPTY);
368
                        foreach ($bufe2 as $buf2) {
369
                            if (preg_match('/^\s+ether\s+(\S+)/i', $buf2, $ar_buf2)) {
370
                                if (!defined('PSI_HIDE_NETWORK_MACADDR') || !PSI_HIDE_NETWORK_MACADDR) $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').preg_replace('/:/', '-', strtoupper($ar_buf2[1])));
371
                            } elseif (preg_match('/^\s+inet\s+(\S+)\s+netmask/i', $buf2, $ar_buf2)) {
372
                                $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1]);
373
                            } elseif ((preg_match('/^\s+inet6\s+([^\s%]+)\s+prefixlen/i', $buf2, $ar_buf2)
374
                                  || preg_match('/^\s+inet6\s+([^\s%]+)%\S+\s+prefixlen/i', $buf2, $ar_buf2))
375
                                  && ($ar_buf2[1]!="::") && !preg_match('/^fe80::/i', $ar_buf2[1])) {
376
                                $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').strtolower($ar_buf2[1]));
377
                            } elseif (preg_match('/^\s+media:\s+/i', $buf2) && preg_match('/[\(\s](\d+)(G*)base/i', $buf2, $ar_buf2)) {
378
                                if (isset($ar_buf2[2]) && strtoupper($ar_buf2[2])=="G") {
379
                                    $unit = "G";
380
                                } else {
381
                                    $unit = "M";
382
                                }
383
                                if (preg_match('/[<\s]([^\s<]+)-duplex/i', $buf2, $ar_buf3))
384
                                    $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1].$unit.'b/s '.strtolower($ar_buf3[1]));
385
                                else
386
                                    $dev->setInfo(($dev->getInfo()?$dev->getInfo().';':'').$ar_buf2[1].$unit.'b/s');
387
                            }
388
                        }
389
                    }
390
                    $this->sys->setNetDevices($dev);
391
                }
392
            }
393
        }
394
    }
325 richard 395
 
2770 rexy 396
    /**
397
     * get icon name
398
     *
399
     * @return void
400
     */
401
    protected function distro()
402
    {
403
        $this->sys->setDistributionIcon('Darwin.png');
2976 rexy 404
        if ((!CommonFunctions::executeProgram('system_profiler', 'SPSoftwareDataType', $buffer, PSI_DEBUG) || !preg_match('/\n\s*System Version:/', $buffer))
405
           && (!CommonFunctions::executeProgram('sw_vers', '', $buffer, PSI_DEBUG) || !preg_match('/^ProductName:/', $buffer))) {
2770 rexy 406
            parent::distro();
407
        } else {
2976 rexy 408
            $distro_tmp = preg_split("/\n/", $buffer, -1, PREG_SPLIT_NO_EMPTY);
409
            foreach ($distro_tmp as $info) {
410
                $info_tmp = preg_split('/:/', $info, 2);
3037 rexy 411
                if (isset($distro_tmp[0]) && ($distro_tmp[0] !== null) && (trim($distro_tmp[0]) != "") &&
412
                     isset($distro_tmp[1]) && ($distro_tmp[1] !== null) && (trim($distro_tmp[1]) != "")) {
2976 rexy 413
                    $distro_arr[trim($info_tmp[0])] = trim($info_tmp[1]);
414
                }
415
            }
416
            if (isset($distro_arr['ProductName']) && isset($distro_arr['ProductVersion']) && isset($distro_arr['BuildVersion'])) {
417
                $distro_arr['System Version'] = $distro_arr['ProductName'].' '.$distro_arr['ProductVersion'].' ('.$distro_arr['BuildVersion'].')';
418
            }
419
            if (isset($distro_arr['System Version'])) {
420
                $distro = $distro_arr['System Version'];
3100 rexy 421
                if (preg_match('/^Mac OS |^OS X |^macOS |^iPhone OS |^Mac OS$|^OS X$|^macOS$|^iPhone OS$/', $distro)) {
2976 rexy 422
                    $this->sys->setDistributionIcon('Apple.png');
423
                    if (preg_match('/(^Mac OS X Server|^Mac OS X|^OS X Server|^OS X|^macOS Server|^macOS) ((\d+)\.\d+)/', $distro, $ver)
424
                        && ($list = @parse_ini_file(PSI_APP_ROOT."/data/osnames.ini", true))) {
425
                        if (isset($list['macOS'][$ver[2]])) {
426
                            $distro.=' '.$list['macOS'][$ver[2]];
427
                        } elseif (isset($list['macOS'][$ver[3]])) {
428
                            $distro.=' '.$list['macOS'][$ver[3]];
2770 rexy 429
                        }
430
                    }
431
                }
2976 rexy 432
                $this->sys->setDistribution($distro);
433
            } else {
434
                parent::distro();
2770 rexy 435
            }
436
        }
437
    }
325 richard 438
 
2770 rexy 439
    /**
440
     * Processes
441
     *
442
     * @return void
443
     */
444
    protected function _processes()
445
    {
446
        if (CommonFunctions::executeProgram('ps', 'aux', $bufr, PSI_DEBUG)) {
447
            $lines = preg_split("/\n/", $bufr, -1, PREG_SPLIT_NO_EMPTY);
448
            $processes['*'] = 0;
449
            foreach ($lines as $line) {
450
                if (preg_match("/^\S+\s+\d+\s+\S+\s+\S+\s+\d+\s+\d+\s+\S+\s+(\w)/", $line, $ar_buf)) {
451
                    $processes['*']++;
452
                    $state = $ar_buf[1];
453
                    if ($state == 'U') $state = 'D'; //linux format
454
                    elseif ($state == 'I') $state = 'S';
455
                    elseif ($state == 'D') $state = 'd'; //invalid
456
                    if (isset($processes[$state])) {
457
                        $processes[$state]++;
458
                    } else {
459
                        $processes[$state] = 1;
460
                    }
461
                }
462
            }
463
            if ($processes['*'] > 0) {
464
                $this->sys->setProcesses($processes);
465
            }
466
        }
467
    }
325 richard 468
 
2770 rexy 469
    /**
470
     * get the information
471
     *
472
     * @see PSI_Interface_OS::build()
473
     *
3037 rexy 474
     * @return void
2770 rexy 475
     */
476
    public function build()
477
    {
478
        parent::build();
479
        if (!$this->blockname || $this->blockname==='vitals') {
480
            $this->_processes();
481
        }
482
        if (!$this->blockname || $this->blockname==='hardware') {
483
            $this->_tb();
484
        }
485
        if (!$this->blockname || $this->blockname==='network') {
486
            $this->_network();
487
        }
325 richard 488
    }
2770 rexy 489
}