How to test if a server is running before connecting?

If I have a Socket trying to open a connection to a certain IP, is there a way to test this first before I use a new Socket and it throws an Exception? Like I would like to try to connnect 5 times to a server before giving up.

Hi,
Just try to connect in a loop, and break out of it if connect succeeds.
/Kaj

Similar Messages

  • How can i check that server still running?

    Hi everybody,
    How can i check that server still running before sending post?

    There are several ways of verifying if server is still running
    1) Through JCMon command line tool on server
    Call jcmon as <sid>adm using following command
    jcmon pf=/usr/sap/<sid>SYS/profile/<sid>_<instance>_<host>
    jcmon displays the server processes in status "Running" if all applications have started successfully. Otherwise it displays the appropriate status message
    2) Through SAP MMC which again shows the graphical status as Green
    3) On NWDS using J2EE view
    4) If telnet port is enabled on J2EE Engine, then you can remotely check the status of server using telnet command

  • How to find out which server is running on which port

    hi all,
    how to find out which server is running on which port, i want to know both
    from front end and backend?
    thanks and regards
    srikanth

    The best source to get all the ports you have is the Context Files.
    All ports are defined in the Context Files through "AutoConfig Variable". You can get the list of those variables by referring to the following note under "What is the port pool? What if I want to give a specific value to a Server Port?"
    Note: 216664.1 - FAQ: Cloning Oracle Applications Release 11i
    https://metalink.oracle.com/metalink/plsql/ml2_documents.showDocument?p_database_id=NOT&p_id=216664.1
    You can also get that list via OAM.
    Referring to the installation log file should also be helpful (Unless you have changed any of the ports after the installation).

  • How to find the SQL Server Instances running across the given activer directory domain?

    How to find the SQL Server Instances running across the given activer directory domain?
    I have though of OSQL -L , Microsoft Assessment and Planning ( MAP ) tool and SQLPing3 (SQLSecurity) might help me.
    I would appreciate if there any other way of finding the SQL Servers / Instances running across the given active directory domain.
    Sivaprasad S
    http://sivasql.blogspot.com
    Please click the Mark as Answer button if a post solves your problem!

    Dear ,
    Very simple u find all instances through the customized sp which is get all details about inventory. Like i put the sp bellow. This is without any tool. 
    USE [master]
    GO
    /****** Object:  StoredProcedure [dbo].[DBStatus]    Script Date: 08-01-2015 19:46:11 By Damodar Patle Sr. DBA Mumbai India ******/
    SET ANSI_NULLS ON
    GO
    SET QUOTED_IDENTIFIER ON
    GO
    ALTER PROCEDURE [dbo].[DBStatus] 
    AS
    SELECT 
    SERVERPROPERTY('servername') AS ServerName,
    ConnectionProperty('local_net_address') AS 'local_net_address',
    ConnectionProperty('local_tcp_port') AS 'local_tcp_port',
    CONVERT(VARCHAR(25), @@VERSION) as  VERSIONSQL,
    SERVERPROPERTY('ErrorLogFileName') AS ErrorLogFilePath,
    database_id,
    CONVERT(VARCHAR(25), DB.name) AS DBName,
    CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'status')) AS [Status],
    CONVERT(VARCHAR(10), DATABASEPROPERTYEX(name, 'Recovery')) AS [Recovery_Model],
    create_date as DBCreate_Date, --physical_device_name,
     (SELECT COUNT(1) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS DataFiles,
     (SELECT SUM((size*8)/1024) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS [Data MB],
     (SELECT COUNT(1) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS LogFiles,
     (SELECT SUM((size*8)/1024) FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS [Log MB],
     (SELECT physical_name FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'rows') AS MDF_File_Location,
     (SELECT physical_name FROM sys.master_files WHERE DB_NAME(database_id) = DB.name AND type_desc = 'log') AS  LDF_File_Location,
       user_access_desc
       FROM sys.databases DB
       ORDER BY dbName, [Log MB] DESC, NAME

  • How to test oracle is up and running in remote machine using shell script

    Hello,
    I need help to write an linux script.
    I have a java application server running on machine 192.168.5.20 and our oracle 10g standard 1.0.2 is running on machine 192.168.5.21.
    I have found script to start oracle when computer is turned on.
    But I cannot start my application server automatically since it depends on whether oracle is up and running or not on the remote machine.
    Therefore, in case of power failure or maintenance, our client has to call us to start application server.
    I would be grateful if someone can help me "How can I write script to check oracle is up and running in machine 192.168.5.21 from machine 192.168.5.20.
    For your information, I have no oracle installed in application server. So tnsping won't work.
    What I want is when power is back, application server script automatically and tesing for oracle server is up and running. If it is up, script will start application server.
    Thanking you.

    Hi,
    It's not failover or experimental. My application server uses JBOSS and JBOSS needs database name to start up. My enviroment is LAN. My database is in different machine as I mentioned before. So In case of power failure, I need to start my application server (JBoss) manually, because I need to confirm that oracle is already running before start app server.
    I want an automated script (when power is just on) to start my application server which will wait to check if the datbase server is up I will start application server.
    The scripts given above It works if appserver and db server in the same machine (my development machine).
    But when I test the script in my production applicaiton server, It shows sqlplus command not found (my app server does not have any oracle client installed).
    About hostname yes My applicaiton server hostname is hostapp1 and dabase server hostname is hostdat1.
    Do you think Is it possible to test the script without oracle client not installed. or It has to be done writing code like java program and test using jdbc connection.
    Best regards.

  • How to configure Mountain Lion Server to run Web2py with wsgi?

    I am trying to config Mountain Lion Server to run Web2py with mod_wsgi. I get an error saying: "Premature end o scritp Header" wsgihandler.py (which is the wsgi file for Web2py).
    I had it working fine in Snow Leopard and Lion Servers but not in Mountain Lion Server.
    Thanks for your help.
    Flavio.

    I don't run web2py framework so can't tell you specifically.
    That error means your script is not writing an http header to the browser so the browser can't decode whatever string it is getting. Your script is running as a plain old Python script. This is most likely because the Server.app in 10.8 now includes mod_wsgi built-in and configured from the GUI.
    You can insert an intercept anywhere in your code to check any variable by saying this:
    ##########   PROGRAMMING HERE  ###############
    print("Content-type:text/plain\n\n")
    print(someVariable)
    # raise SystemExit
    The above sends an "http header" so the browser knows what to do. These headers are invisible in the browser window. But depending on your Python version, the pring statement may not work (I am running Python3). The SystemExit statement is optional, just in case your script crashes downstream.
    WSGI sends a header like this:
    startResponse("200 OK", [("Content-Type", "text/plain")])
    but it sounds like mod_wsgi is not even being invoked. Normally your WSGI script is named *.wsgi and your Apache is set up to run the Python script as CGI under the mod_wsgi handler using this directive:
    AddHandler wsgi-script .wsgi
    The file having the config is located at
    /Library/Server/Web/Config/apache2/httpd_wsgi.webapp.conf
    where webapp is the name of your webapp. I would suggest copying the file called httpd_wsgi.conf and renaming it to your webapp name. When Server.app is configured properly, you enable wsgi webapps in the GUI Advanced wndow for your domain.

  • Inso filter...not sure how to test config. on server

    I am running oracle 8.1.6 on a solaris 2.6 machine and I have created a table, inserted blob data in, but can't seem to get my index to return any rows....
    I have modified the $path and the $home environment varibles in my oracle user profile, should I have done this as the system (root) user?? How can I make sure that my configuration on the server is correct...I need to narrow down my problem and think this is the best place to start! HELP!!! :)

    Ok, here is my scripts to create the table and the index, my objective is to store word doc. into a blob, then be able to use the inso filter to search the text....
    CREATE TABLE resume
    (resume_id NUMBER(10)
    ,resume_text BLOB);
    ALTER TABLE resume
    ADD CONSTRAINT pk_resume PRIMARY KEY (resume_id);
    BEGIN
    ctx_ddl.drop_preference
    (preference_name => 'inso_filter_pref');
    END;
    BEGIN
    ctx_ddl.create_Preference ( preference_name =>
    'INSO_FILTER_PREF', object_name => 'INSO_FILTER' );
    END;
    CREATE INDEX i_resume1 ON resume ( resume_text )
    INDEXTYPE IS ctxsys.context
    PARAMETERS ('filter inso_filter_pref')
    null

  • How to Test Cliams Work Flow during run time in SWDD Tcode

    Hi Gurus,
    I want to test my Claim Work Flow(WS99900044) in SWDD Tcode by Hard coding values to Work Flow Container Elements. How can I do this, kindly pls advice me.

    I want to test my Claim Work Flow(WS99900044) in SWDD Tcode by
    Hard coding values to Work Flow Container Elements
    you must be aware of execute button in the same txn SWDD, being a workflow designer.......

  • How to select on which server to run the restore job?

    Hello gurus!
    We run OSB 10.4.0.2.0 (Solaris)
    There are several media-servers in configuration one of them is temporaroly unavailable.
    When I issue a restore job on the admin server it tries to be execured on that media server which is unavailable, see the output of lsjob -l:
    admin/3:
    Type: restore 1 item
    Restore to host: istore
    Media file number: 198
    Volume: OSB-CATALOG-MF-000014
    Restore original path:
    To path: /tmp/111
    Scheduled time: none
    State: retryable at 2012/12/12.13:18 ("lsjob --log admin/3" for details)
    Priority: 100
    Privileged op: no
    Run on host: mxdb-fin-2
    Attempts: 0
    I was unable to find any option which may tell OSB to run on istore server. Could you suggest any?

    You could simply take the media server out of service which means OSB won't try to use it. When it is available again, you can put it back in service.
    Or, you could restrict the backup to specific media server and tape drives.
    Donna

  • How to add another Planning Server to the Shared Connections?

    Hi,
    This is for version 11.1.2.1.103
    Currently all of our users use Planning in Prod environment. I would like to open the UAT environment to a smaller set of users. UAT environment is in our Test environment. I couldn't figure it how to add the UAT environment to the current Prod Shared Connections. I was hoping it would be as easy as right click on the Prod Planning Server > click on Add > Add the UAT server > Click OK.
    Instead I had to follow couple of steps to add the UAT environment to the SV:
    1. SmartView > Options > Advanced > Edit Shared Connections URL with UAT environment URL > Click OK
    2. Connect to Shared Connections > Planning
    3. Right click on the Plan Type > Click on Add to Private Connections
    4. Follow the same steps for the PROD Plan Type.
    Now, I do have two environments under Private Connections and I do not need to follow the first step every time I want to switch between environments.
    Was it a overkill or I did it right?
    Thanks,
    Mehmet
    p.s. I just noticed that in Shared Connections, you can add another Essbase Server, but that's not an option for Planning.
    Edited by: Mehmet Sevinc on May 8, 2012 2:48 PM

    Hi Again,
    following up my previous comment on this, you can create a macro and assign to an event or macro in the excel to change shared connection URL.
    Declare Function HypSetSharedConnectionsURL Lib "HsAddin" (ByVal vtAPSURL As Variant) As Long
    Sub SubHypSetSharedConnectionsURLTest()
    Dim lRet As Long
    lRet = HypSetSharedConnectionsURL("http://UATserver:19000/workspace/SmartViewProviders")
    End Sub
    http://docs.oracle.com/cd/E17236_01/epm.1112/sv_user/ch17s01s08s10.html
    Hope this helps,
    Ahmet

  • How to reach a web server with a GPRS connection?

    Hello,
    We have developed a cRio Datalogger and we control it by a remote panel with the cRio connected in our LAN.
    Now we want to do the same connecting the cRio with a GPRS Modem-Router from Multitech (a Multimodem with DynDns capabilities). The problem is that our provider of GPRS service give a private IP, so we can't access the cRio from internet.
    We did a test with an example that comes with Labview, a multiclient TCP connection, we run the client vi in a PC connected to internet with the GPRS Modem and the server in another PC in our LAN. The example runs perfect. In the client vi we added some indicators to show the network address an the remote port, but we can't open a remote panel of the client vi from the PC running the server vi, using the information collected. The network address it isn't a IP number is a name and for our surprise the remote port number is diferent that the port used by the example.
    Conclusion, we can do a TCP/IP connection if the communication is started by the Device with the GPRS Modem but we can't do the opposite. The problem is the same to have a web server running in a PC in a LAN and want to reach it from internet without having access to the router configuration.
    And because the remote front panel connection is started by the PC who want to open it we can't make it work.
    Any idea, is possible what we want to do? 
    Using:
    LV 8.5.1
    Thanks
    Solved!
    Go to Solution.

    Hello,
    We solved the problem using a SIM with movil wide band enabled. With that service, the cell phone company give a public IP address (here in Argentine).

  • How do you update your server when its not connected to the internet?

    This is actually a Windows Update question.
    My OS is Windows Server 2008 Standard, Service Pack 2.  It is a stand alone system.
    Crazy, I know, but I want to keep my server updated with the latest security patches, Software Patches, etc., even though it will soon not be connected to the internet.  Right now it is and I am making certain it's completely updated prior to removing
    its connection.
    How would I do that?  I realize that I will have to do what "Window's Update" does, but do it manually.
    Please help! I'm new to servers and I will need this to be very much a step by step. Don't be surprised at to what I don't know at this point.  I am learning though!
    Thanks in advance.  Any and all help will be very much appreciated.

    Hi TimothyJohn,
    You either,
    - Setup a disconnected Wsus in the same LAN than your server. See Wsus documentation to see how to do that and how to update a disconnected Wsus.
    - Use a third party tool like "Wsus Offline" :
    http://download.wsusoffline.net/
    David COURTEL
    IT Technician
    Wsus Third-Party Softwares Publishing :
    http://wsuspackagepublisher.codeplex.com

  • Exchange 2010 - Outlook Anywhere trying to connect to internal server name first before connecting to proxy server

    Hello,
    I have an Exchange 2010 question which I will post in the Exchange 2013 section since the Ask a question button in the legacy Exchange Servers section of technet takes me back to the part of Technet where I can only ask questions regarding Exchange 2013.
    If someone can point me to a part where I can place a question in an Exchange 2010 forum please let me know.
    We have Exchange 2010 setup with a CAS array listening to outlook.internaldomain.com
    We have TMG 2010 setup with a rule for Outlook Anywhere, the rule listens to mail.externaldomain.com and traffic that meets this rule is let through to outlook.internaldomain.com.
    When I fire up my laptop, which is connected to the internet, and start Outlook and let it configure my profile through autodiscover it sets it up correct and fills the Outlook profile with a servername stating outlook.internaldomain.com and a proxyserver
    to be used stating mail.externaldomain.com. After initial setup when my Outlook starts it almost immediatly prompts me for a username and a password so this is working fine.
    At the office we have an internal network segment where DHCP is servicing the connecting clients and giving them our internal DNS servers because they need connection to some other network segments which are not available to the internet. This network segment
    does not have access to our internal Exchange environment but has full access to the internet. Clients in this network segment do want to use Outlook so using Outlook Anywhere for them is the logical way to go. When I connect my laptop to this network segment
    I get handed an IP address and our internal DNS servers, when I start Outlook it takes about two minutes before a the credential prompt pops up and another 2 to 6 minutes after entering credentials before it says all folders are in sync. This is quite long
    and our clients find this unacceptable.
    I started testing what might be going on here and I have found that when I manually enter external DNS servers the Outlook password prompt will popup in seconds and all is working as expected so it seems Outlook is trying to connect to the internal servername
    when using our internal DNS servers (which can resolve outlook.internalnetwork.com) instead of directly going to the proxy server which is to be used for Outlook Anywhere.
    When I start a network monitor trace my thoughts are confirmed because when I am connected to the internal network segment OUTLOOK.EXE first tries to connect to outlook.internaldomain.com, it almost immediately gets a response stating that this route is
    inaccessible but OUTLOOK.EXE keeps on trying to connect untill some sort of time out is reached (somewhere around two minutes) after which it connects to mail.externaldomain.com and Outlook shows the credential prompt.
    So to round it up, when connected to DNS servers that can resolve the internal servername Outlook tries to connect to the internal servername in stead of the external name, Outlook does not reckognize the answer from the network that the internal route is
    not acessible (or it does but does nothing with this information).
    Has anybody experienced this behaviour in Outlook?
    Does anyone have a solution in where I can force Outlook to connect to it's proxyserver and disregard the internal servername?

    Thank you for your reply.
    The client computers that are experiencing the issues are not domain joined, the only reason I can think of why this is occurring is because the DNS servers are able to resolve the internal hostname of the server, but I would expect Outlook to always use
    the proxy server that has been set in the configuration of the Outlook profile. Or at least acknowledging the answer that the initially tried route is inaccessible and immediately continue to the proxy server.
    For setting the same hostname for internal and external use, we use different namespaces internally and externally, do you mean setting the external hostname on the CAS array for internal use ? Wouldn't that push all internal communication to the internet
    and to the outside interface of the TMG where the server is published with that hostname ?

  • How to know whether tomcat server is up or not..?

    I have developed a java webstart application.In that,I need to include a component in a frame that shows whether the appplication is connected to the server(tomcat) or not.If it is connected to server,then a green light is up,if not red light is up.It should show the connection status althrough the application.I browsed through the apache documentation of Catalina class, http://tomcat.apache.org/tomcat-4.1-oc/catalina/docs/api/org/apache/catalina/startup/Catalina.html ,thinking that it could help me out.But I couldn't find it useful.So,I need a way to know whether the application is connected to server or not.Is there anyway to do it?Thanks in advance..!

    hell2heaven wrote:
    Yes I need both first and second case,there exists some server listening on a particular port and he can send some request and get some response from it.Well, the second implies the first, so unless you're interested in "The port is active, but the server isn't running properly," testing the second is sufficient--the first won't provide any additional information.
    Here my server is apache tomcat and it is running on port 8085.Actually,what happens in the application is when user inputs data via text field,a connection is opened to the appropriate servlet and object is passed to the servlet through that established connection.then servlet returns another object reporting the result,what happened on the server side.I want user to feel sure that he can send data to the servlet running on tomcat successfully.Am I clear enough now..?
    Not really.
    And if you're saying, "I want to see if the server is running before the user sends a request," that's pointless. Just send the request. If it succeeds, the server is running. If it fails, the server is not running or is unreachable or had some error. If you test first and it comes back good, the server can still go down between your test and the "real" request.

  • Error when I run report RSCMST to test the content server.

    when I run report "RSCMST" to test the my content server.    I get the error:
    header        HTTP/1.1 401 Authorization Required
                  date: Fri, 05 Dec 2008 20:20:45 GMT
                  server: Apache/1.3.41 (Unix) SAPCS/640
                  x-servertime: 20:20:45
                  x-query: create&pVersion=0046&contRep=ZTEST001&docId=020D3949CA03445AE10000000A14022B&compId=data&docPro ..
                  t=rud&accessMode=c&authId=CN%3DCPJ&expiration=20081205142027&secKey=MIH3BgkqhkiG9w0BBwKggekwgeYC
                  x-serverdate: 2008-12-05
                  x-pversion: 0046
                  x-errordescription: URI signature has expired
                  x-serverid: server="content01.ivo.com.cn";serverPort="1090"
                  x-servertype: SAP HTTP Content Server
                  content-length: 752
                  connection: close
                  content-type: text/plain
                  ~remote_addr:
                  ~uri_scheme_expanded: NONE
    want                 201
    bad           401
    time              17.974
    It seems that the "bad 401" means a http error.    I do not know how to configure it ?
    my content server uses the maxdb,  and http is apache, they are all running on redhat linux ese 5
    who can give me some advices?  thanks

    Victor,
            Looks like a web server authentication issue. I suggest you raise this issue in a basis/ web application server forum,
    Sojan

Maybe you are looking for