Subversion-Projekte lars-tiefland.nagios-php

Revision

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

Revision 104 Revision 106
Zeile 2... Zeile 2...
2
 
2
 
3
    /**
3
    /**
4
     * @package nagios-php
4
     * @package nagios-php
5
     * @author Lars Tiefland <ltiefland@gmail.com>
5
     * @author Lars Tiefland <ltiefland@gmail.com>
6
     * @copyright 2013
6
     * @copyright 2013
7
     * @version $Rev: 104 $
7
     * @version $Rev: 106 $
Zeile 8... Zeile 8...
8
     */
8
     */
Zeile -... Zeile 9...
-
 
9
 
9
 
10
    // $Id: servicegroup.php 106 2013-01-03 10:12:56Z lars $
10
    // $Id: servicegroup.php 104 2013-01-03 10:05:52Z lars $
11
 
11
 
12
    /**
-
 
13
     * serviceGroup
-
 
14
     * 
-
 
15
     * @package nagios-php
-
 
16
     * @author Lars Tiefland
12
    require_once "includes/common.php";
17
     * @copyright 2013
13
 
18
     * @version $Id: servicegroup.php 106 2013-01-03 10:12:56Z lars $
14
    $sg = serviceGroup::getList();
19
     * @access public
-
 
20
     */
-
 
21
    class serviceGroup
15
 
22
    {
-
 
23
        public $alias;
-
 
24
        public $hostgroup_id;
16
    switch ( $_GET["mode"] )
25
        public $members;
-
 
26
 
-
 
27
        /**
17
    {
28
         * serviceGroup::__construct()
-
 
29
         * 
-
 
30
         * @param mixed $id
-
 
31
         * @return
-
 
32
         */
-
 
33
        public function __construct($id)
-
 
34
        {
18
        case "overview":
35
            $sql = "SELECT
19
            $title = "Service Overview For All Host Groups";
36
                    alias,
-
 
37
                    hostgroup_id
-
 
38
                FROM
-
 
39
                    hostgroups
-
 
40
                WHERE
20
            break;
41
                    instance_id = " . $GLOBALS["cfg"]["instance"] . "
-
 
42
                AND
-
 
43
                    hostgroup_id = $id
-
 
44
            ";
-
 
45
            $res = $GLOBALS["db"]->query( $sql );
-
 
46
            $row = $res->fetchRow();
-
 
47
            foreach ( $row as $feld => $wert )
-
 
48
            {
-
 
49
                $this->$feld = $wert;
-
 
50
            }
-
 
51
            //$this->members = $this->getMemberList( $id );
-
 
52
        }
-
 
53
        
21
        case "grid":
54
        /**
-
 
55
         * serviceGroup::getList()
-
 
56
         * 
-
 
57
         * @return
-
 
58
         */
-
 
59
        public static function getList()
-
 
60
        {
-
 
61
            $sql="SELECT
-
 
62
                    groupgroup_id
-
 
63
                FROM
-
 
64
                    servicegroups
-
 
65
                WHERE
22
            $title = "Status Grid For All Host Groups";
66
                    instance_id = " . $GLOBALS["cfg"]["instance"] . "
-
 
67
            ";
-
 
68
            $res = $GLOBALS["db"]->query( $sql );
23
            break;
69
            while ( $row = $res->fetchRow() )
-
 
70
            {
-
 
71
                $ret[] = new serviceGroup( $row["servicegroup_id"] );
24
        case "summary":
72
            }
25
            $title = "Status Summary For All Host Groups";
-
 
26
            break;
-
 
27
    }
-
 
28
 
-
 
29
    $GLOBALS["ui"]->assign( "servicegroups", $sg )->assign( "title", $title )->
73
            return $ret;
30
        display( "servicegroups.tpl" );
74
        }