{"id":277,"date":"2019-09-18T22:47:22","date_gmt":"2019-09-18T19:47:22","guid":{"rendered":"http:\/\/meekconsulting.com\/?p=277"},"modified":"2022-01-08T16:26:32","modified_gmt":"2022-01-08T13:26:32","slug":"port-check-with-perl","status":"publish","type":"post","link":"https:\/\/meekconsulting.com\/?p=277","title":{"rendered":"port check with perl"},"content":{"rendered":"<p>If you are on a machine without telnet you can use this perl script to check connectivity.<\/p>\n<blockquote>\n<p>#!\/usr\/bin\/perl<br>#&nbsp;<br># nettest.pl<br>#<\/p>\n<p>use IO::Socket;<br>use Errno;<br>$| = 1;<\/p>\n<p>$host = shift;<br>$port = shift;<br>$type = shift || &#8220;tcp&#8221;;<br>die &#8220;No Host parameter!&#8221; if !$host;<br>die &#8220;No Port parameter!&#8221; if !$port;<\/p>\n<p>my $rc = new IO::Socket::INET<br>PeerAddr =&gt; $host,<br>PeerPort =&gt; $port,<br>Proto =&gt; $type,<br>Timeout =&gt; 5 or die &#8220;\\nCan&#8217;t bind : $@\\n&#8221;;<\/p>\n<p>print &#8220;\\nSuccessfully bound to $host on port $port\\n&#8221;;<\/p>\n<\/blockquote>\n\n\n<p class=\"wp-block-paragraph\"><\/p>\n","protected":false},"excerpt":{"rendered":"<p>If you are on a machine without telnet you can use this perl script to check connectivity. #!\/usr\/bin\/perl#&nbsp;# nettest.pl# use IO::Socket;use Errno;$| = 1; $host = shift;$port = shift;$type = shift || &#8220;tcp&#8221;;die &#8220;No Host parameter!&#8221; if !$host;die &#8220;No Port &hellip; <a href=\"https:\/\/meekconsulting.com\/?p=277\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-277","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/posts\/277","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=277"}],"version-history":[{"count":6,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/posts\/277\/revisions"}],"predecessor-version":[{"id":291,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=\/wp\/v2\/posts\/277\/revisions\/291"}],"wp:attachment":[{"href":"https:\/\/meekconsulting.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=277"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=277"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/meekconsulting.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=277"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}