git-svn-id: http://www.observium.org/svn/observer/trunk@2785 61d68cd4-352d-0410-923a-c4978735b2b8
This commit is contained in:
Tom Laermans
2011-12-15 16:34:13 +00:00
parent 19ae34c4d8
commit b118ea7062
3 changed files with 18 additions and 12 deletions

View File

@@ -27,7 +27,7 @@ if ($config['enable_libvirt'] == '1' && $device['os'] == "linux" )
{
# Check if we are using SSH if we can log in without password - without blocking the discovery
# Also automatically add the host key so discovery doesn't block on the yes/no question, and run echo so we don't get stuck in a remote shell ;-)
exec('ssh -o "StrictHostKeyChecking no" -o "PreferredAuthentications publickey" -o "IdentitiesOnly yes" ' . $device['hostname'] . ' echo', $out, $ret);
exec('ssh -o "StrictHostKeyChecking no" -o "PreferredAuthentications publickey" -o "IdentitiesOnly yes" ' . $device['hostname'] . ' echo -e', $out, $ret);
if ($ret != 255) { $ssh_ok = 1; }
}

View File

@@ -4,7 +4,8 @@
include("config.php");
include("includes/functions.php");
$fd = fopen($argv[1],'r');
if ($fd = @fopen($argv[1],'r'))
{
$data = fread($fd,4096);
while (!feof($fd))
{
@@ -17,5 +18,10 @@ foreach (explode("\n", $data) as $line)
# FIXME check query success?
echo("$line \n");
}
}
else
{
echo("ERROR: Could not open file \"$argv[1]\".\n");
}
?>