> /var/log/lg.log"); ?> >Looking Glass
MIK telecom
Looking glass
Router Ping


>
Traceroute


>
Show ip bgp summary

>
Show ip bgp neighbors

>
Show ip bgp

>
Whois


>
Nslookup


>
MTR


>
  >  AS        
Packets  Size  Resolve  >Query:  
0 && $router==1 )
	{
		if ( $dns==1 ) $dns='';
		else $dns='-n';
		#echo "$param\n";
		switch($tquery)
		{
			case 3:
				system("( echo zeBra ; echo 'term length 0' ;echo sh ip bgp su ; echo quit ; sleep 1 ) | telnet gw 2605 | grep -A20 Neighbor | grep -B20 'Total number of neighbors'" );
				break;
			case 4:
				system("( echo zeBra ; echo 'term length 0' ;echo 'show ip bgp neighbors $param' ; sleep 1; echo ''; sleep 2 ) | telnet gw 2605 | grep -A2000 'show ip bgp neighbors'" );
				break;
			case 5:
				if( strlen($param)>7 )
					system("( echo zeBra ; echo 'term length 0' ;echo 'show ip bgp $param' ; sleep 2 ) | telnet gw 2605 | grep -A2000 'show ip bgp '" );
				else
					echo "wrong query.";
				
				break;
			default:
				echo "unsupported request";
				break;
		}



	}
	if(strlen($tquery)>0 && $router==2 )
	{
		if ( $dns==1 ) $dns='';
		else $dns='-n';
		#echo "$param\n";
		switch($tquery)
		{
			case 1:
				system("/usr/bin/rsh -l nobody 10.99.1.1 ping $param");
				break;
			case 2:
				system("/usr/bin/rsh -l nobody 10.99.1.1 traceroute $param");
				break;
			case 3:
				system("/usr/bin/rsh -l nobody 10.99.1.1 sh ip bgp sum");
				break;
			case 4:
				system("/usr/bin/rsh -l nobody 10.99.1.1 sh ip bgp neig $param");
				break;
			case 5:
				system("/usr/bin/rsh -l nobody 10.99.1.1 sh ip bgp $param");
				break;
			default:
				echo "unsupported request";
				break;
		}

	}

	if(strlen($tquery)>0 && $router==3 )
	{
		if ( $dns==1 ) $dns='';
		else $dns='-n';
		#echo "$param\n";
		switch($tquery)
		{
			case 1:
				$size=$size-8;
				system("/usr/local/bin/sudo ping $dns -c '$count' -s '$size' '$param'");
				break;
			case 2:
				if ( $as==1 ) $as="-A ";
				else $as='';
				system("/usr/local/sbin/ntraceroute $dns $as '$param'");
				break;
			case 6:


				system("/usr/bin/whois -h $wn[$whoisserv] '$param'");
				#echo "/usr/bin/whois -h $wn[$whoisserv] '$param'";
				break;
			case 7:
				system("nslookup '-q=$nq' '$param'");
				break;
			case 8:
				if ( $dns=='-n' ) $dns='--no-dns';
				system("/usr/local/sbin/mtr --report-cycles '$count' $dns --psize $size --report '$param'");
				break;
			default:
				echo "unsupported request";
				break;
		
		}



	}


	/* EDGE1 cisco2811 */
	if(strlen($tquery)>0 && $router==4 )
	{
		if ( $dns==1 ) $dns='';
		else $dns='-n';
		#echo "$param\n";
		switch($tquery)
		{
			case 1:
				system("/usr/bin/rsh -l nobody edge1 ping $param");
				break;
			case 2:
				system("/usr/bin/rsh -l nobody edge1 traceroute $param");
				break;
			case 3:
				system("/usr/bin/rsh -l nobody edge1 sh ip bgp sum");
				break;
			case 4:
				system("/usr/bin/rsh -l nobody edge1 sh ip bgp neig $param");
				break;
			case 5:
				system("/usr/bin/rsh -l nobody edge1 sh ip bgp $param");
				break;
			default:
				echo "unsupported request";
				break;
		}

	}

	/* EDGE2 catalyst 3750 metro */
	if(strlen($tquery)>0 && $router==5 )
	{
		if ( $dns==1 ) $dns='';
		else $dns='-n';
		#echo "$param\n";
		switch($tquery)
		{
			case 1:
				system("/usr/bin/rsh -l nobody edge2 ping $param");
				break;
			case 2:
				system("/usr/bin/rsh -l nobody edge2 traceroute $param");
				break;
			case 3:
				system("/usr/bin/rsh -l nobody edge2 sh ip bgp sum");
				break;
			case 4:
				system("/usr/bin/rsh -l nobody edge2 sh ip bgp neig $param");
				break;
			case 5:
				system("/usr/bin/rsh -l nobody edge2 sh ip bgp $param");
				break;
			default:
				echo "unsupported request";
				break;
		}

	}



?>