<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>GreenO &#187; Uncategorized</title>
	<atom:link href="http://blog.chrisgreenough.com/category/uncategorized/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chrisgreenough.com</link>
	<description>GreenO from Technical to Personal and everything in between!</description>
	<lastBuildDate>Fri, 26 Feb 2010 19:53:35 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Tcl Script to Probe SSH Connections for Cisco ACE Router</title>
		<link>http://blog.chrisgreenough.com/2010/02/tcl-script-to-probe-ssh-connections-for-cisco-ace-router/</link>
		<comments>http://blog.chrisgreenough.com/2010/02/tcl-script-to-probe-ssh-connections-for-cisco-ace-router/#comments</comments>
		<pubDate>Fri, 26 Feb 2010 19:48:52 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=110</guid>
		<description><![CDATA[We were having problems with default TCP probes on port 22 from our Cisco ACE Load Balancer showing up in our logs as bad SSH connections. I modified a Cisco TCL script for checking SSL to send a greeting to a SSH server and check that a SSH greeting is returned. It by no means [...]]]></description>
			<content:encoded><![CDATA[<p>We were having problems with default TCP probes on port 22 from our Cisco ACE Load Balancer showing up in our logs as bad SSH connections. I modified a Cisco TCL script for checking SSL to send a greeting to a SSH server and check that a SSH greeting is returned. It by no means does a complete login, but it does check to make sure the SSH service is alive. Tested on RedHat and Ubuntu. Let me know if this works on other services.</p>
<p>Ubuntu</p>
<pre>
root@***:/var/log# uname -a
Linux ***2.6.31-19-generic-pae #56-Ubuntu SMP Thu Jan 28 02:29:51 UTC 2010 i686 GNU/Linux
root@***:/var/log# ssh -V
OpenSSH_5.1p1 Debian-6ubuntu2, OpenSSL 0.9.8g 19 Oct 2007
</pre>
<p>Redhat</p>
<pre>
[root@*** root]# uname -a
Linux *** 2.4.21-63.ELsmp #1 SMP Wed Oct 28 23:15:46 EDT 2009 i686 i686 i386 GNU/Linux
[root@*** root]# ssh -V
OpenSSH_3.6.1p2, SSH protocols 1.5/2.0, OpenSSL 0x0090701f
</pre>
<p>sshProbe.tcl<br />
<a href='http://blog.chrisgreenough.com/wp-content/uploads/2010/02/SSH_PROBE_SCRIPT.tcl_.txt'>SSH_PROBE_SCRIPT.tcl</a></p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
</pre></td><td class="code"><pre class="tcl" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">#!name = SSH_PROBE_SCRIPT</span>
<span style="color: #808080; font-style: italic;">########################################################################################</span>
<span style="color: #808080; font-style: italic;"># </span>
<span style="color: #808080; font-style: italic;"># Description :</span>
<span style="color: #808080; font-style: italic;">#    Script connects sends a connect request to a SSH server to see if its alive.</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># ACE version :</span>
<span style="color: #808080; font-style: italic;">#   1.0+</span>
<span style="color: #808080; font-style: italic;">#    </span>
<span style="color: #808080; font-style: italic;"># Author :</span>
<span style="color: #808080; font-style: italic;">#   Chris Greenough (Chris.Greenough@nau.edu)</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Parameters :</span>
<span style="color: #808080; font-style: italic;">#   [debugFlag]</span>
<span style="color: #808080; font-style: italic;">#     debug  - default 0. Do NOT turn on while multiple probes are configured</span>
<span style="color: #808080; font-style: italic;">#</span>
<span style="color: #808080; font-style: italic;"># Example config :</span>
<span style="color: #808080; font-style: italic;">#       probe sshProbe script</span>
<span style="color: #808080; font-style: italic;">#           script SSH_PROBE [0]</span>
<span style="color: #808080; font-style: italic;"># </span>
<span style="color: #808080; font-style: italic;">########################################################################################</span>
<span style="color: #808080; font-style: italic;">#-------------------------------------------</span>
<span style="color: #808080; font-style: italic;"># debug procedure</span>
<span style="color: #808080; font-style: italic;"># set the EXIT_MSG environment varaible to help debug</span>
<span style="color: #808080; font-style: italic;"># also print the debug message when debug flag is on</span>
<span style="color: #808080; font-style: italic;">#-------------------------------------------</span>
<span style="color: #ff7700;font-weight:bold;">proc</span> ace_debug <span style="color: #483d8b;">{ msg }</span> <span style="color: black;">&#123;</span> 
    <span style="color: #ff7700;font-weight:bold;">global</span> debug ip port EXIT_MSG
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">set</span> EXIT_MSG <span style="color: #ff3333;">$msg</span>
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">{ [ info exists ip ] &amp;&amp; [ info exists port ] }</span> <span style="color: black;">&#123;</span> 
	<span style="color: #ff7700;font-weight:bold;">set</span> EXIT_MSG <span style="color: #483d8b;">&quot;[ info script ]:$ip:$port: $EXIT_MSG &quot;</span>
    <span style="color: black;">&#125;</span>  
    <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">{ [ info exists debug ] &amp;&amp; $debug }</span> <span style="color: black;">&#123;</span> 
	<span style="color: #008000;">puts</span> <span style="color: #ff3333;">$EXIT_MSG</span>
    <span style="color: black;">&#125;</span> 
<span style="color: black;">&#125;</span> 
&nbsp;
<span style="color: #808080; font-style: italic;">#-------------------------------------------</span>
<span style="color: #808080; font-style: italic;"># main </span>
<span style="color: #808080; font-style: italic;">#-------------------------------------------</span>
&nbsp;
ace_debug <span style="color: #483d8b;">&quot;initializing varaible&quot;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> EXIT_MSG <span style="color: #483d8b;">&quot;Error config:  script SSH_PROBE  &lt;debug(0|1)&gt;&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> ip <span style="color: #ff3333;">$scriptprobe_env</span><span style="color: black;">&#40;</span>realIP<span style="color: black;">&#41;</span> 
<span style="color: #ff7700;font-weight:bold;">set</span> port <span style="color: #ff3333;">$scriptprobe_env</span><span style="color: black;">&#40;</span>realPort<span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">## if port is 0 , use default port 22</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">{ $port == 0 }</span> <span style="color: black;">&#123;</span>
    <span style="color: #ff7700;font-weight:bold;">set</span> port <span style="color: #ff4500;">22</span>
<span style="color: black;">&#125;</span> 
<span style="color: #ff7700;font-weight:bold;">set</span> debug <span style="color: black;">&#91;</span> <span style="color: #008000;">lindex</span> <span style="color: #ff3333;">$argv</span> <span style="color: #ff4500;">0</span> <span style="color: black;">&#93;</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">{ $debug == &quot;&quot; }</span> <span style="color: black;">&#123;</span>
    <span style="color: #ff7700;font-weight:bold;">set</span> debug <span style="color: #ff4500;">0</span>
<span style="color: black;">&#125;</span> 
<span style="color: #808080; font-style: italic;"># open connection </span>
ace_debug <span style="color: #483d8b;">&quot;opening socket&quot;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> sock <span style="color: black;">&#91;</span> <span style="color: #008000;">socket</span> <span style="color: #ff3333;">$ip</span> <span style="color: #ff3333;">$port</span> <span style="color: black;">&#93;</span>
&nbsp;
ace_debug <span style="color: #483d8b;">&quot;setting fconfigure to binary&quot;</span>
<span style="color: #008000;">fconfigure</span> <span style="color: #ff3333;">$sock</span> -translation <span style="color: #008000;">binary</span> 
&nbsp;
ace_debug <span style="color: #483d8b;">&quot;sending ssh client hand-shake message&quot;</span>
<span style="color: #808080; font-style: italic;"># Sending SSH-2.0-SecureCRT_6.5.0 (build 335) SecureCRT??</span>
<span style="color: #ff7700;font-weight:bold;">set</span> ssh_hello <span style="color: #483d8b;">&quot;5353482d322e302d5365637572654352545f362e352e3020286275696c642033333529205365637572654352540d0a&quot;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">set</span> ssh_length  <span style="color: black;">&#91;</span> <span style="color: #008000;">string</span> length <span style="color: #ff3333;">$ssh_hello</span> <span style="color: black;">&#93;</span>
<span style="color: #008000;">puts</span> -nonewline <span style="color: #ff3333;">$sock</span> <span style="color: black;">&#91;</span> <span style="color: #008000;">binary</span> <span style="color: #008000;">format</span> <span style="color: #483d8b;">&quot;H${ssh_length}&quot;</span> <span style="color: #ff3333;">$ssh_hello</span> <span style="color: black;">&#93;</span>
<span style="color: #008000;">flush</span> <span style="color: #ff3333;">$sock</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#  read frist 100 bytes from server</span>
ace_debug <span style="color: #483d8b;">&quot;receiving response&quot;</span>
<span style="color: #ff7700;font-weight:bold;">set</span> lines <span style="color: black;">&#91;</span> <span style="color: #008000;">read</span> <span style="color: #ff3333;">$sock</span> <span style="color: #ff4500;">100</span> <span style="color: black;">&#93;</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#  close connection</span>
ace_debug <span style="color: #483d8b;">&quot;closing socket&quot;</span>
<span style="color: #008000;">close</span> <span style="color: #ff3333;">$sock</span>
&nbsp;
<span style="color: #808080; font-style: italic;">#  parsing the 1st 3 bytes from the ssh headers </span>
<span style="color: #808080; font-style: italic;">#  if it is not a ssh hand shake successful message. failed the probe with exit 30002</span>
<span style="color: #808080; font-style: italic;"># If the server responds with its SSH info then it must be alive</span>
<span style="color: #ff7700;font-weight:bold;">set</span> ssh_header <span style="color: #483d8b;">&quot;SSH&quot;</span>
&nbsp;
ace_debug <span style="color: #ff3333;">$lines</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">{ ![ binary scan $lines &quot;@0a3&quot; res ] }</span> <span style="color: black;">&#123;</span> 
    ace_debug <span style="color: #483d8b;">&quot;probe fail : ssh server response parsing failure&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">exit</span> <span style="color: #ff4500;">30002</span>
<span style="color: black;">&#125;</span> 
ace_debug <span style="color: #ff3333;">$res</span>
<span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #483d8b;">{ $res != $ssh_header }</span> <span style="color: black;">&#123;</span> 
    ace_debug <span style="color: #483d8b;">&quot;probe fail : ssh hand shake failure with $res !&quot;</span>
    <span style="color: #ff7700;font-weight:bold;">exit</span> <span style="color: #ff4500;">30002</span>
<span style="color: black;">&#125;</span> 
&nbsp;
<span style="color: #808080; font-style: italic;">#  Everything went fine. probe exit with success exit_code 30001</span>
ace_debug <span style="color: #483d8b;">&quot;probe success&quot;</span>
<span style="color: #ff7700;font-weight:bold;">exit</span> <span style="color: #ff4500;">30001</span></pre></td></tr></table></div>

]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2010/02/tcl-script-to-probe-ssh-connections-for-cisco-ace-router/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Check out the Garden!?!?</title>
		<link>http://blog.chrisgreenough.com/2008/08/check-out-the-garden/</link>
		<comments>http://blog.chrisgreenough.com/2008/08/check-out-the-garden/#comments</comments>
		<pubDate>Tue, 19 Aug 2008 17:57:32 +0000</pubDate>
		<dc:creator>GreenO</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://blog.chrisgreenough.com/?p=9</guid>
		<description><![CDATA[I don&#8217;t know if I am getting old or what but I am REALLY excited about how my garden is doing! My first attempt at a green thumb (Or I guess GreenO thumb)&#8230; Just hope it does not Freeze before all the tomatoes are ripe!]]></description>
			<content:encoded><![CDATA[<p>I don&#8217;t know if I am getting old or what but I am REALLY excited about how my garden is doing! My first attempt at a green thumb (Or I guess GreenO thumb)&#8230; Just hope it does not Freeze before all the tomatoes are ripe!</p>
<p><a href="http://blog.chrisgreenough.com/wp-content/uploads/2008/08/img_0080.jpg"><img class="alignnone size-medium wp-image-10" title="img_0080" src="http://blog.chrisgreenough.com/wp-content/uploads/2008/08/img_0080-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p><a href="http://blog.chrisgreenough.com/wp-content/uploads/2008/08/img_0081.jpg"><img class="alignnone size-medium wp-image-11" title="img_0081" src="http://blog.chrisgreenough.com/wp-content/uploads/2008/08/img_0081-225x300.jpg" alt="" width="225" height="300" /></a></p>
<p><a href="http://blog.chrisgreenough.com/wp-content/uploads/2008/08/img_0082.jpg"><img class="alignnone size-medium wp-image-12" title="img_0082" src="http://blog.chrisgreenough.com/wp-content/uploads/2008/08/img_0082-225x300.jpg" alt="" width="225" height="300" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.chrisgreenough.com/2008/08/check-out-the-garden/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.402 seconds -->
