-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdbconfig.php
33 lines (31 loc) · 984 Bytes
/
dbconfig.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<?php
/**
* Prepares PostgreSQL query
*
* PHP version 5
*
* @category PHP
* @package Report generation
* @author Rostyslav Fridman <[email protected]>
* @author Nikita Koptel <[email protected]>
* @license http://www.apache.org/licenses/LICENSE-2.0 Apache License 2.0
* @link http://netxms.example.com
*/
/**
* Prepares query
*
* @return string
*/
function prepareQuery()
{
// Enter the names of your servers, to speed up the query
// Please change the names according to your corresponding installation
$allowed_names = array('webserver.*', 'monitoring.*', 'database.*');
foreach ($allowed_names as &$name) {
$name = "object_properties.name ~ '$name'";
}
$query = "SELECT object_properties.name AS server, object_properties.object_id AS id FROM object_properties WHERE (";
$query .= implode(" OR ", $allowed_names);
$query .= ") AND object_properties.status != '6' ORDER BY server";
return $query;
}