Quote: |
#!/usr/bin/perl -w
# # porttest.pl # # Perl Script to test connection to ports. # Used for checking service / server availability # we want to use sockets use IO::Socket; # test that 2 parameters have been passed to script. If not, quit $ARGC=@ARGV; if ($ARGC !=2) { print "Usage: perl porttest.pl <hostIPaddress> <portnumber> \n"; exit; } # assign cmdline values to vars $remo = $ARGV[0]; $openport = $ARGV[1]; # Test status, if unable to connect, quit with error msg DOWN unless ($so = IO::Socket::INET->new (Proto => "TCP", PeerAddr => $remo, PeerPort => $openport)) { print "DOWN\n"; exit; } # Script got to this point, therefore not down, so write UP, and exit print "UP\n"; close $so; exit; |
Quote: |
<? include ("../common.php"); include ("style2.php"); ?> <font size=+2> <center> <h3>Star-Fury Network Status</h3> <P> <pre> <h3>Merlin</h3> IRC <?system("/usr/local/sbin/porttest.pl merlin.star-fury.com 6667")?> WWW <?system("/usr/local/sbin/porttest.pl merlin.star-fury.com 80")?> <h3>Eclipse</h3> IRC <?system("/usr/local/sbin/porttest.pl 127.0.0.1 6667")?> WWW <?system("/usr/local/sbin/porttest.pl 127.0.0.1 80")?> <h3>Trinity</h3> WWW <?system("/usr/local/sbin/porttest.pl trinity.star-fury.com 80")?> <h3>Oblivion</h3> IRC <?system("/usr/local/sbin/porttest.pl oblivion.star-fury.com 6667")?> </pre> </font> Thanks to <a href=http://www.jason-lambert.com>Jason Lambert</a> for theback end script<P> <? include("footer.php"); |
fastlanwan wrote: |
Seems like alot of typing for ps -ax ? Or am I missing the point? |
output generated using printer-friendly topic mod, All times are GMT + 2 Hours