Subversion-Projekte lars-tiefland.nagios-php

Revision

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

Revision 9 Revision 42
Zeile 1... Zeile 1...
1
<?php
1
<?php
Zeile 2... Zeile 2...
2
 
2
 
3
    class service
3
    class service
-
 
4
    {
-
 
5
        public $display_name;
-
 
6
        public $service_id;
-
 
7
        public $service_object_id;
-
 
8
 
-
 
9
        public function __construct($id)
-
 
10
        {
-
 
11
            $sql="SELECT
-
 
12
                    service_id,
-
 
13
                    display_name,
-
 
14
                    service_object_id
-
 
15
                FROM
-
 
16
                    services
-
 
17
                WHERE
-
 
18
                    service_id = $id
-
 
19
                AND
-
 
20
                    instance_id = " . $GLOBALS["cfg"]["instance"] . "
-
 
21
            ";
-
 
22
            $res = $GLOBALS["db"]->query($sql);
-
 
23
            $row = $res->fetchObject("service");
4
    {
24
        }
5
        public static function getStatusList()
25
        public static function getStatusList()
6
        {
26
        {
7
            $sql = "SELECT
27
            $sql = "SELECT
8
					count(current_state) AS anz
28
					count(current_state) AS anz
Zeile 19... Zeile 39...
19
            $sql = "SELECT
39
            $sql = "SELECT
20
					count(current_state) AS anz
40
					count(current_state) AS anz
21
				FROM
41
				FROM
22
					servicestatus
42
					servicestatus
23
				WHERE
43
				WHERE
24
					instance_id = " . $GLOBALS["cfg"]["instance"] . "
44
					instance_id = o
25
				AND
45
				AND
26
					current_state = 1
46
					current_state = 1
27
			";
47
			";
28
            $res = $GLOBALS["db"]->query( $sql );
48
            $res = $GLOBALS["db"]->query( $sql );
29
            $row = $res->fetchRow();
49
            $row = $res->fetchRow();