-
Notifications
You must be signed in to change notification settings - Fork 0
/
host.php
44 lines (40 loc) · 2.17 KB
/
host.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
34
35
36
37
38
39
40
41
42
43
44
<?php
# +-----------------------------------------------------------------+
# | |
# | ( ___ \ | \ /\|\ /||\ /|( ( /| |
# | | ( ) ) | \ / /| ) ( || ) ( || \ ( | |
# | | (__/ / | (_/ / | | | || (___) || \ | | |
# | | __ ( | _ ( | | | || ___ || (\ \) | |
# | | ( \ \ | ( \ \ | | | || ( ) || | \ | |
# | | )___) )_ | / \ \| (___) || ) ( || ) \ | |
# | |/ \___/(_) |_/ \/(_______)|/ \||/ )_) |
# | |
# | Copyright Bastian Kuhn 2011 mail@bastian-kuhn.de |
# +-----------------------------------------------------------------+
#
# NagUI more information: http://nagui.de
#
# This is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation in version 2. NagUI is distributed
# in the hope that it will be useful, but WITHOUT ANY WARRANTY; with-
# out even the implied warranty of MERCHANTABILITY or FITNESS FOR A
# PARTICULAR PURPOSE. See the GNU General Public License for more de-
# ails. You should have received a copy of the GNU General Public
# License along with GNU Make; see the file COPYING. If not, write
# to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor,
# Boston, MA 02110-1301 USA.
require("./includes/header.inc.php");
$columns = (isset($_GET['columns'])) ? str_replace(","," ",$_GET['columns']) : str_replace(","," ",$fields_host) ;
$columns_array = (isset($_GET['columns'])) ? explode(',',$_GET['columns']) : explode(',',$fields_host);
$output_format = (isset($_GET['output_format'])) ? $_GET['output_format'] : $output_format;
$host_name = $_GET['host_name'];
$query = "GET hosts\nColumns: $columns\nFilter: host_name = $host_name\n";
$erg = $livestatus->query($query);
if($output_format == "smarty")
{
$output->smarty($erg,$columns_array,"host.html");
}elseif($output_format == "json")
{
$output->json($erg,$columns_array);
}