Ssh Error Timeout Phpseclib

I’m trying to put in my view information on a remote Linux pdv. Until then I can do it via SSH with phpseclib plugin.

However, as I have more than one, in my view I create a div to list information. If a pdv is offline

the current state is showing the error 110 timeout.

What I need is to handle this error and put into the field in div table as type "No Connection". Below is the code of the control and view



public function actionPDV($ip)



			$ssh = Yii::app()->phpseclib->createSSH2($ip);


				if (!$ssh->login('root', 'senha'))


					exit('Falha no login');




				$eth0= $ssh->exec("cat /root/direcao/dpdv/dpdv_client.conf | grep -n ^ | grep ^4: | cut -d: -f2");

				$pdv = substr($eth0, 10, 3);

				echo $pdv;






	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

	<meta name="language" content="en" />


	<link rel="stylesheet" type="text/css" href="<?php echo Yii::app()->request->baseUrl; ?>/css/tabela.css" />



	<div class="container">

		<div class="barra_titulo">

			<div class="coluna">PDV</div>

			<div class="coluna">IP</div>

			<div class="coluna">Gateway</div>

			<div class="coluna">Status</div>


		<!-- PDV 1 -->

		<div class="linha">

			<div class="coluna"><?php $this->actionPDV('');?></div>

			<div class="coluna"><?php $this->actionIP('');?></div>

			<div class="coluna"><?php $this->actionGateway('');?></div>

			<div class="coluna"><?php $this->actionStatus('');?></div>





I appreciate the help.