mirror of
https://github.com/librenms/librenms.git
synced 2024-10-07 16:52:45 +00:00
fix resolving fuckup
git-svn-id: http://www.observium.org/svn/observer/trunk@1869 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
@@ -1,17 +1,102 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
|
echo('<div style="padding: 10px;">');
|
||||||
|
|
||||||
|
if($_POST['addapp']) {
|
||||||
|
if($_SESSION['userlevel'] == '10') {
|
||||||
|
include("includes/app-add.inc.php");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if($_POST['delapp']) {
|
||||||
|
if($_SESSION['userlevel'] == '10') {
|
||||||
|
include("includes/app-delete.inc.php");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if ($handle = opendir($config['install_dir'] . "/includes/polling/applications/")) {
|
if ($handle = opendir($config['install_dir'] . "/includes/polling/applications/")) {
|
||||||
while (false !== ($file = readdir($handle))) {
|
while (false !== ($file = readdir($handle))) {
|
||||||
if ($file != "." && $file != ".." && strstr($file, ".inc.php")) {
|
if ($file != "." && $file != ".." && strstr($file, ".inc.php")) {
|
||||||
$file = str_replace(".inc.php", "", $file);
|
$file = str_replace(".inc.php", "", $file);
|
||||||
$servicesform .= "<option value='$file'>$file</option>";
|
$applicationsform .= "<option value='$file'>$file</option>";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
closedir($handle);
|
closedir($handle);
|
||||||
}
|
}
|
||||||
|
|
||||||
echo("$servicesform");
|
$query = mysql_query("SELECT * FROM `devices` ORDER BY `hostname`");
|
||||||
|
while($device = mysql_fetch_array($query)) {
|
||||||
|
$devicesform .= "<option value='" . $device['device_id'] . "'>" . $device['hostname'] . "</option>";
|
||||||
|
}
|
||||||
|
|
||||||
|
if($updated) { print_message("Applications Updated"); }
|
||||||
|
|
||||||
|
if(mysql_result(mysql_query("SELECT COUNT(*) from `applications` WHERE `device_id` = '".$device['device_id']."'"), 0) > '0') {
|
||||||
|
$i = "1";
|
||||||
|
$app_query = mysql_query("select * from applications WHERE device_id = '".$device['device_id']."' ORDER BY app_type");
|
||||||
|
while($application = mysql_fetch_array($app_query)) {
|
||||||
|
$existform .= "<option value='" . $application['app_id'] . "'>" . $application['app_type'] . "</option>";
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
if($existform){
|
||||||
|
echo('<div style="float: left;">');
|
||||||
|
echo("
|
||||||
|
|
||||||
|
<h1>Remove application</h1>
|
||||||
|
|
||||||
|
<form id='delapp' name='delapp' method='post' action=''>
|
||||||
|
<input type=hidden name='delapp' value='yes'>
|
||||||
|
<table width='200' border='0'>
|
||||||
|
<option type=hidden name=device value='".$device['device_id']."'>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Type
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select name='app'>
|
||||||
|
$existform
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<input type='submit' name='Submit' value='Delete' />
|
||||||
|
<label><br />
|
||||||
|
</label>
|
||||||
|
</form>");
|
||||||
|
|
||||||
|
|
||||||
|
echo('</div>');
|
||||||
|
}
|
||||||
|
|
||||||
|
echo('<div style="width: 45%; float: right;">');
|
||||||
|
|
||||||
|
echo("
|
||||||
|
<h1>Add application</h1>
|
||||||
|
|
||||||
|
<form id='addapp' name='addapp' method='post' action=''>
|
||||||
|
<input type=hidden name='addapp' value='yes'>
|
||||||
|
<table width='200' border='0'>
|
||||||
|
<option type=hidden name=device value='".$device['device_id']."'>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
Type
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<select name='type'>
|
||||||
|
$applicationsform
|
||||||
|
</select>
|
||||||
|
</td>
|
||||||
|
</tr>
|
||||||
|
</table>
|
||||||
|
<input type='submit' name='Submit' value='Add' />
|
||||||
|
<label><br />
|
||||||
|
</label>
|
||||||
|
</form>");
|
||||||
|
|
||||||
|
echo('</div>');
|
||||||
|
|
||||||
|
echo('</div>');
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
@@ -32,8 +32,6 @@ while($device = mysql_fetch_array($query)) {
|
|||||||
if($updated) { print_message("Device Settings Saved"); }
|
if($updated) { print_message("Device Settings Saved"); }
|
||||||
|
|
||||||
|
|
||||||
echo('<div style="float: left;">');
|
|
||||||
|
|
||||||
if(mysql_result(mysql_query("SELECT COUNT(*) from `services` WHERE `device_id` = '".$device['device_id']."'"), 0) > '0') {
|
if(mysql_result(mysql_query("SELECT COUNT(*) from `services` WHERE `device_id` = '".$device['device_id']."'"), 0) > '0') {
|
||||||
$i = "1";
|
$i = "1";
|
||||||
$service_query = mysql_query("select * from services WHERE device_id = '".$device['device_id']."' ORDER BY service_type");
|
$service_query = mysql_query("select * from services WHERE device_id = '".$device['device_id']."' ORDER BY service_type");
|
||||||
@@ -44,7 +42,12 @@ if(mysql_result(mysql_query("SELECT COUNT(*) from `services` WHERE `device_id` =
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if($existform){
|
||||||
|
echo('<div style="float: left;">');
|
||||||
echo("
|
echo("
|
||||||
|
|
||||||
|
<h1>Remove Service</h1>
|
||||||
|
|
||||||
<form id='delsrv' name='delsrv' method='post' action=''>
|
<form id='delsrv' name='delsrv' method='post' action=''>
|
||||||
<input type=hidden name='delsrv' value='yes'>
|
<input type=hidden name='delsrv' value='yes'>
|
||||||
<table width='200' border='0'>
|
<table width='200' border='0'>
|
||||||
@@ -67,10 +70,13 @@ echo("
|
|||||||
|
|
||||||
|
|
||||||
echo('</div>');
|
echo('</div>');
|
||||||
|
}
|
||||||
|
|
||||||
echo('<div style="width: 45%; float: right;">');
|
echo('<div style="width: 45%; float: right;">');
|
||||||
|
|
||||||
echo("
|
echo("
|
||||||
|
<h1>Add Service</h1>
|
||||||
|
|
||||||
<form id='addsrv' name='addsrv' method='post' action=''>
|
<form id='addsrv' name='addsrv' method='post' action=''>
|
||||||
<input type=hidden name='addsrv' value='yes'>
|
<input type=hidden name='addsrv' value='yes'>
|
||||||
<table width='200' border='0'>
|
<table width='200' border='0'>
|
||||||
|
@@ -527,7 +527,9 @@ function createHost ($host, $community, $snmpver, $port = 161, $transport = 'udp
|
|||||||
|
|
||||||
function isDomainResolves($domain)
|
function isDomainResolves($domain)
|
||||||
{
|
{
|
||||||
return count(dns_get_record($domain)) != 0;
|
# duh.
|
||||||
|
#return count(dns_get_record($domain)) != 0;
|
||||||
|
return gethostbyname($domain) != $domain;
|
||||||
}
|
}
|
||||||
|
|
||||||
function hoststatus($id)
|
function hoststatus($id)
|
||||||
|
Reference in New Issue
Block a user