Dick Applebaum wrote:

> when i run netstat w/o any parms, it does not show some ports that I
> know are active (80, 9090, etc)
>
> lost?
>
interesting...not sure why that would be.

I run a farm of linux servers and the following worked fine for me on my
systems:

netstat -alpn | grep (my port here)

so your main goal is just to see if the service is running?

why not just run the cfstat utility?  or are really trying to get the
port too?

you can also check the jrun.xml file to see what port it is setup to run
on here:
/opt/coldfusionmx/runtime/servers/default/SERVER-INF/jrun.xml

Hope that helps!

-Josh

> Dick
>
> Richard:~ richard$ netstat
> Active Internet connections
> Proto Recv-Q Send-Q  Local Address          Foreign Address        
> (state)
> tcp4       0      0  10.0.1.2.54157         idisk.mac.com.http     
> ESTABLISHED
> tcp4       0      0  10.0.1.2.54156         adsl-67-124-145-.hp-pd
> SYN_SENT
> tcp4       0      0  10.0.1.2.53939         mail.mac.com.imap      
> ESTABLISHED
> tcp4       0      0  localhost.ipp          localhost.53844        
> ESTABLISHED
> tcp4       0      0  localhost.53844        localhost.ipp         
> ESTABLISHED
> tcp4       0      0  localhost.53843        localhost.ipp         
> CLOSE_WAIT
> tcp4       0      0  localhost.53490        localhost.51004        
> CLOSE_WAIT
> tcp4       0      0  localhost.53489        localhost.51004        
> CLOSE_WAIT
> tcp4       0      0  localhost.53353        localhost.51004        
> CLOSE_WAIT
> tcp4       0      0  localhost.53352        localhost.51004        
> CLOSE_WAIT
> tcp4       0      0  10.0.1.2.62793         idisk.mac.com.http     
> CLOSE_WAIT
> tcp4       0      0  10.0.1.2.61312         mail.mac.com.imap      
> ESTABLISHED
> tcp4       0      0  localhost.59549        localhost.ipp         
> CLOSE_WAIT
> tcp4       0      0  localhost.59548        localhost.ipp         
> CLOSE_WAIT
> tcp4       0      0  10.0.1.2.49357         mail.mac.com.imap      
> ESTABLISHED
> tcp4       0      0  localhost.netinfo-loca localhost.972         
> ESTABLISHED
> tcp4       0      0  localhost.972          localhost.netinfo-loca
> ESTABLISHED
> udp4       0      0  localhost.53331        localhost.1023
> udp4       0      0  *.50421                *.*
> udp4       0      0  *.*                    *.*
> udp4       0      0  *.svrloc               *.*
> udp4       0      0  *.*                    *.*
> udp4       0      0  *.*                    *.*
> udp4       0      0  localhost.49160        localhost.1022
> udp4       0      0  localhost.49159        localhost.1022
> udp4       0      0  localhost.1022         *.*
> udp4       0      0  localhost.1023         *.*
> udp4       0      0  10.0.1.2.ntp           *.*
> udp4       0      0  localhost.ntp          *.*
> udp4       0      0  *.ntp                  *.*
> udp4       0      0  *.mdns                 *.*
> udp4       0      0  *.ipp                  *.*
> udp4       0      0  *.bootpc               *.*
> udp4       0      0  localhost.netinfo-loca *.*
> udp4       0      0  *.syslog               *.*
> udp6       0      0  *.514                  *.*
> icm6       0      0  *.*                    *.*
> icm6       0      0  *.*                    *.*
> Active LOCAL (UNIX) domain sockets
> Address  Type   Recv-Q Send-Q    Inode     Conn     Refs  Nextref Addr
>   2f7fdc8 stream   4781      0        0        0        0        0
>   2f7f5b0 stream      0      0        0        0        0        0
>   2f7f9d8 stream      0      0        0  2f7f9a0        0        0
>   2f7f9a0 stream      0      0        0  2f7f9d8        0        0
>   2f7fe70 stream      0      0        0        0        0        0
>   2f7f620 stream      0      0        0        0        0        0
>   2f7fb60 stream      0      0        0        0        0        0
>   1d69460 stream      0      0        0        0        0        0
>   2f7fd58 stream      0      0        0        0        0        0
>   2f7fd20 stream      0      0        0        0        0        0
>   2f7f930 stream      0      0        0        0        0        0
>   2f7fc78 stream      0      0        0        0        0        0
>   2f7ffc0 stream      0      0        0        0        0        0
>   1d69150 stream      0      0        0        0        0        0
>   2f7fc40 stream      0      0        0        0        0        0
>   2f7fa48 stream      0      0        0  2f7fce8        0        0
>   2f7fce8 stream      0      0        0  2f7fa48        0        0
>   2f7fcb0 stream      0      0        0        0        0        0
>   2f7fa10 stream      0      0        0  2f7fab8        0        0
>   2f7fab8 stream      0      0        0  2f7fa10        0        0
>   2f7ff18 stream      0      0        0  1d69038        0        0
>   1d69038 stream      0      0        0  2f7ff18        0        0
>   1d69188 stream      0      0  2b82bf0        0        0        0
> /tmp/webdavDtD2qQ
>   2f7fd90 stream      0      0        0  1d69498        0        0
> /var/tmp/SCDynamicStoreNotifyFileDescriptor-19715
>   1d69498 stream      0      0        0  2f7fd90        0        0
>   1d690e0 stream      0      0        0  2f7fe38        0        0
>   2f7fe38 stream      0      0        0  1d690e0        0        0
>   2f7fb28 stream      0      0        0  2f7fbd0        0        0
>   2f7fbd0 stream      0      0        0  2f7fb28        0        0
>   2f7fee0 stream      0      0        0  1d690a8        0        0
>   1d690a8 stream      0      0        0  2f7fee0        0        0
>   2f7ff50 stream      0      0  270b1e8        0        0        0
> /tmp/mysql.sock
>   1d691f8 stream      0      0        0  1d69230        0        0
>   1d69230 stream      0      0        0  1d691f8        0        0
>   1d69268 stream      0      0        0  1d692a0        0        0
>   1d692a0 stream      0      0        0  1d69268        0        0
>   1d692d8 stream      0      0        0  1d69310        0        0
>   1d69310 stream      0      0        0  1d692d8        0        0
>   1d69348 stream      0      0        0  1d69380        0        0
>   1d69380 stream      0      0        0  1d69348        0        0
>   1d693b8 stream      0      0  26bc398        0        0        0
> /tmp/stuffit_avr_ipc
>   1d694d0 stream      0      0        0  1d69508        0        0
> /var/run/pppconfd
>   1d69508 stream      0      0        0  1d694d0        0        0
>   1d69540 stream      0      0        0  1d69578        0        0
> /var/run/pppconfd
>   1d69578 stream      0      0        0  1d69540        0        0
>   1d69738 stream      0      0        0  1d695b0        0        0
> /var/run/pppconfd
>   1d695b0 stream      0      0        0  1d69738        0        0
>   1d69658 stream      0      0        0  1d69690        0        0
> /var/run/pppconfd
>   1d69690 stream      0      0        0  1d69658        0        0
>   1d69700 stream      0      0  2465988        0        0        0
> /tmp/slp_ipc
>   1d69818 stream      0      0        0  1d697e0        0        0
>   1d697e0 stream      0      0        0  1d69818        0        0
>   1d69770 stream      0      0        0  1d69850        0        0
>   1d69850 stream      0      0        0  1d69770        0        0
>   1d698c0 stream      0      0        0  1d698f8        0        0
>   1d698f8 stream      0      0        0  1d698c0        0        0
>   1d69b60 stream      0      0        0  1d69af0        0        0
>   1d69af0 stream   8192      0        0  1d69b60        0        0
>   1d69b98 stream      0      0        0  1d69b28        0        0
>   1d69b28 stream   7200      0        0  1d69b98        0        0
>   1d699a0 stream      0      0        0  1d69930        0        0
>   1d69930 stream      0      0        0  1d699a0        0        0
>   1d699d8 stream      0      0        0  1d69a80        0        0
>   1d69a80 stream      0      0        0  1d699d8        0        0
>   1d69bd0 stream      0      0        0  1d69968        0        0
>   1d69968 stream      0      0        0  1d69bd0        0        0
>   1d69c40 stream      0      0  2151c90        0        0        0
> /var/run/mDNSResponder
>   1d69d58 stream      0      0  20d1ef8        0        0        0
> /var/run/pppconfd
>   2f7f968 dgram       0      0        0  1d69fc0        0  2f7f700
>   2f7f7a8 dgram       0      0        0  2f7f690  2f7f690        0
>   2f7f690 dgram       0      0        0  2f7f7a8  2f7f7a8        0
>   2f7f700 dgram       0      0        0  1d69fc0        0  2f7fea8
>   2f7fea8 dgram       0      0        0  1d69fc0        0  1d691c0
>   1d69070 dgram       0      0        0  1d69118  1d69118        0
>   1d69118 dgram       0      0        0  1d69070  1d69070        0
>   1d691c0 dgram       0      0        0  1d69fc0        0  1d697a8
>   1d693f0 dgram       0      0        0  1d69428  1d69428        0
>   1d69428 dgram       0      0        0  1d693f0  1d693f0        0
>   1d69620 dgram       0      0        0  1d695e8  1d695e8        0
>   1d695e8 dgram       0      0        0  1d69620  1d69620        0
>   1d697a8 dgram       0      0        0  1d69fc0        0  1d69d90
>   1d69d90 dgram       0      0        0  1d69fc0        0  1d696c8
>   1d696c8 dgram       0      0        0  1d69fc0        0  1d69ea8
>   1d69ea8 dgram       0      0        0  1d69fc0        0  1d69888
>   1d69888 dgram       0      0        0  1d69fc0        0  1d69ce8
>   1d69ce8 dgram       0      0        0  1d69fc0        0  1d69a10
>   1d69a10 dgram       0      0        0  1d69fc0        0  1d69a48
>   1d69a48 dgram       0      0        0  1d69fc0        0  1d69ab8
>   1d69ab8 dgram       0      0        0  1d69fc0        0  1d69cb0
>   1d69cb0 dgram       0      0        0  1d69fc0        0  1d69dc8
>   1d69c08 dgram       0      0        0  1d69c78  1d69c78        0
>   1d69c78 dgram       0      0        0  1d69c08  1d69c08        0
>   1d69dc8 dgram       0      0        0  1d69fc0        0  1d69d20
>   1d69ee0 dgram       0      0        0  1d69e00  1d69e00        0
>   1d69e00 dgram       0      0        0  1d69ee0  1d69ee0        0
>   1d69d20 dgram       0      0        0  1d69fc0        0  1d69f18
>   1d69f18 dgram       0      0        0  1d69fc0        0  1d69f88
>   1d69f88 dgram       0      0        0  1d69fc0        0  1d69e38
>   1d69e38 dgram       0      0        0  1d69fc0        0  1d69e70
>   1d69e70 dgram       0      0        0  1d69fc0        0  1d69f50
>   1d69f50 dgram       0      0        0  1d69fc0        0        0
>   1d69fc0 dgram       0      0  1d9b0b8        0  2f7f968        0
> /var/run/syslog
> Richard:~ richard$
>
> On Sep 6, 2004, at 12:31 PM, Josh wrote:
>
> > Dick,
> >
> >  use the man pages to see the options for netstat...I don't run OSX or
> >  I'd give you the fix.
> >
> >  just type:
> >  man netstat
> >
> >  HTH
> >
> >  -Josh
> >
> >  Dick Applebaum wrote:
> >
> >  > On Sep 6, 2004, at 9:02 AM, Thomas Chiverton wrote:
> >  >
> >  > > On Saturday 04 Sep 2004 03:08 am, Dick Applebaum wrote:
> >  > >  > I want to write a 'Nix shell script to see if a cf server
> > instance
> >  > > is
> >  > >  > running (accepting requests) an a given port - say 8101
> >  > >
> >  > >  netstat -alpn | grep 8101
> >  > >  then pipe to something like 'awk {print $8}' that will get you
> > the
> >  > > process
> >  > >  name, just grep for whatever your cf server shows up as when you
> > run
> >  > > the
> >  > >  script by hand.
> >  > >
> >  >
> >  > On OS X, if I use the above I get:
> >  >
> >  > Richard:~ richard$ netstat -alpn | grep 8101
> >  > netstat: n: unknown or uninstrumented protocol
> >  > Richard:~ richard$
> >  >
> >  > So I try
> >  >
> >  > Richard:~ richard$ netstat -alp | grep 8101
> >  > netstat: option requires an argument -- p
> >  > usage: netstat [-Aan] [-f address_family] [-M core] [-N system]
> >  >         netstat [-bdghimnrs] [-f address_family] [-M core] [-N
> > system]
> >  >         netstat [-bdn] [-I interface] [-M core] [-N system] [-w
> > wait]
> >  >         netstat -m [-M core] [-N system]
> >  > Richard:~ richard$
> >  >
> >  > So, I listed the protocols -- & I don't know which one(s) to check
> > for.
> >  >
> >  > What I am trying to do is write a script that automates CF startup,
> > and
> >  > sleeps (or loops) until CF is up and the port is accepting http
> >  > requests.
> >  >
> >  > I have modified an example I found to do this by invoking a Perl
> > script
> >  > that, in turn, interacts with telnet  ( apparently shell scripts
> > have
> >  > difficulty interacting ).
> >  >
> >  > #!/usr/bin/perl
> >  > use Net::Telnet;
> >  > $telnet = new Net::Telnet ( Timeout=>30, Port=>8081,
> > Errmode=>'die');
> >  > $telnet->open('localhost');
> >  > $telnet->waitfor('/220/');
> >  > $telnet->print('hello just-testing.org');
> >  > ($output)=$telnet->waitfor('/250/');
> >  > $telnet->print('quit');
> >  >
> >  > I'd rather not use an additional Perl script if possible)
> >  >
> >  > I can brute force a delay using a long sleep, but this is not very
> >  > elegent
> >  >
> >  > Maybe the expect command will allow me to script telnet interaction.
> >  >
> >  > If you could point me in the right direction, I will appreciate it.
> >  >
> >  > TIA
> >  >
> >  > Dick
> >  >
> >
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to