see this
http://www.phpclasses.org/browse/package/4282.html
2009/12/28 robert mena :
> Hi,
>
> I need to develop an interface that will, for example, ping IPs from a
> remote server. So the php script will be hosted in a server with ssh access
> (key) to the remote server.
>
> I can make it work f
better try using ssh2_* functions
http://www.php.net/manual/en/function.ssh2-tunnel.php
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php
If you are just checking to see if the IP is pingable, but don't care about
the output you could just test against the exit code:
$host = 'hostorip';
$sshhost = 'hostorip';
$alive = trim( shell_exec( 'ssh ' . $sshhost . ' ping -q -n -c 5 -W 2 ' .
$host . ' \>/dev/null 2\>\&1 \&\& echo "Alive"' ) )
On 12/27/2009 10:53 PM, robert mena wrote:
Hi,
I need to develop an interface that will, for example, ping IPs from a
remote server. So the php script will be hosted in a server with ssh access
(key) to the remote server.
I can make it work from the console but when I try
$cmd = "ssh remote-se
Hi,
I need to develop an interface that will, for example, ping IPs from a
remote server. So the php script will be hosted in a server with ssh access
(key) to the remote server.
I can make it work from the console but when I try
$cmd = "ssh remote-server 'ping -c 4 ip'"
exec($cmd, $ouput);
the
5 matches
Mail list logo