Subversion-Projekte lars-tiefland.nagios-php

Revision

Revision 47 | Revision 84 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 47 Revision 82
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile -... Zeile 2...
-
 
2
 
-
 
3
    /**
-
 
4
     * host
-
 
5
     * 
-
 
6
     * @package nagios-php   
-
 
7
     * @author Lars Tiefland
-
 
8
     * @copyright 2012
-
 
9
     * @version $Rev$
-
 
10
     * @access public
2
 
11
     */
3
    class host
12
    class host
4
    {
13
    {
5
        public $display_name;
14
        public $display_name;
6
        public $host_id;
15
        public $host_id;
7
        public $host_object_id;
16
        public $host_object_id;
Zeile -... Zeile 17...
-
 
17
        public $services;
-
 
18
 
-
 
19
        /**
-
 
20
         * host::__construct()
-
 
21
         * 
-
 
22
         * @param mixed $id
8
        public $services;
23
         * @return
9
 
24
         */
10
        public function __construct( $id )
25
        public function __construct( $id )
11
        {
26
        {
12
            $sql = "SELECT
27
            $sql = "SELECT
Zeile 28... Zeile 43...
28
                $this->$feld = $wert;
43
                $this->$feld = $wert;
29
            }
44
            }
30
            $this->services = host::getHostServiceList( $id );
45
            $this->services = host::getHostServiceList( $id );
31
        }
46
        }
Zeile -... Zeile 47...
-
 
47
 
-
 
48
        /**
-
 
49
         * host::getHostServiceList()
-
 
50
         * 
-
 
51
         * @param mixed $host_id
-
 
52
         * @return
32
 
53
         */
33
        public static function getHostServiceList( $host_id )
54
        public static function getHostServiceList( $host_id )
34
        {
55
        {
35
            $sql = "SELECT
56
            $sql = "SELECT
36
                    service_id
57
                    service_id
Zeile 46... Zeile 67...
46
            {
67
            {
47
                $ret[] = new service( $row["service_id"] );
68
                $ret[] = new service( $row["service_id"] );
48
            }
69
            }
49
            return $ret;
70
            return $ret;
50
        }
71
        }
-
 
72
        /**
-
 
73
         * host::getStatusList()
-
 
74
         * 
-
 
75
         * @return
-
 
76
         */
51
        public static function getStatusList()
77
        public static function getStatusList()
52
        {
78
        {
53
            $sql = "SELECT
79
            $sql = "SELECT
54
					count(current_state) AS anz
80
					count(current_state) AS anz
55
				FROM
81
				FROM