How can i get my system name / IP address in JAVA

Hi i need to get the system name / IP address of the machine where the JAVA program is running. Please help me in this.

Try this
java.net.InetAddress addr = java.net.InetAddress.getLocalHost();
System.out.println(addr.getCanonicalHostName());
System.out.println(addr.getHostName());
System.out.println(addr.getHostAddress());Col

Similar Messages

  • How can I get Sender Display Name using Get-MessageTrackingLog?

    Hi, could you please help me. We have got a monitoring system at work which monitors some devices, so if something wrong happening with these devices email is sent from MASTER email (Customer Name <[email protected]>) to us. I'm trying to get a list
    of all emails of that monitoring mailbox using PoweShell command
    Get-MessageTrackingLog and export them to CSV file. In the end of the day I need CSV file with 3 columns: TimeStamp, MessageSubject and SenderDisplayName! Yes, I need Sender Display Name cause all emails are sent from one MASTER email
    (Customer Name <[email protected]>) and only difference between them is sender Display Name which is cexactly what I need.   
    This is the code I'm using:
    Get-MessageTrackingLog -EventId Receive | Select Timestamp, MessageSubject, Sender | Export-CSV C:\NagiosAlerts.csv
    –NoTypeInformation
    So how can I get sender Display Name(Customer Name) using Get-MessageTrackingLog insted of Sender email (<[email protected]>)? 

    The DisplayName is not recorded in the Logs only the EmailAddresses are so there Is nothing you can do with Message Tracking to get this the way you want. You need to look at another property may soureIP or include something in the Subject
    of the Email (eg a customerId in the Subject is a much better option) to give you some differentiation. Otherwise you need to access the Email directly from the Mailbox it was sent to and then extract the DisplayName from the message (or use a journaling
    on those emails etc)
    Cheers
    Glen

  • How can I get the system date in mm/dd/yyyy,

    how can I get the system date in mm/dd/yyyy, i need to compare system date with some other date,continuosly using threads,can U plz help me.
    With Some code
    Thanks In advnace
    Mahiiii

    Hi,
    You can use SimpleDateFormat class under java.text package.
    SimpleDateFormat formatter = new SimpleDateFormat("dd-MMM-yy h:mm a z", new Locale());
    //formatter.setTimeZone(timezone);
    String dateTime = formatter.format(new Date());

  • How can I get the infoset name by giving the name of a program of a query?

    How can I get the infoset name by giving the name of a program of a SAP Query?
    Regards,
    Subho

    Use FM RSAQ_DECODE_REPORT_NAME.
    You can also use AQLQCAT table.

  • How can i get "nearby(city name)" if update my status on Facebook?

    How can i get "nearby(city name)" if update my status on Facebook?

    On Sun, 3 Feb 2008 22:55:19 +0000 (UTC), "kai1111"
    <[email protected]> wrote:
    >I've recently finished my webpage
    (kensingtonconcertseries.com),.....then my
    >client wanted to change the name of one of his pages from
    'Marold Duo' to
    >'Rodewald-Morebello Duo.' All of my links to that page
    are to the original
    >page(MaroldDuo.html). Arrrhhhhh!!! Is there anyway I can
    change the name of
    >the page and have all the links within the website update
    automatically?
    If you change a file name within Dw's File manager - it will
    offer to
    update all pages linked to it, accept that invitation
    ~Malcolm N....
    ~

  • C Programming: How can we get the filesystem name for a given file-path?

    C Programming: How can we get the filesystem name for a given file-path?
    Say I have a filepath=/mnt1/file1
    Using some OS API like stat, can I get the Filesystem /mnt ?
    Thanks in advance,
    -V

    Enter the command up to the point of entering the file path and add a space, then drag the file into the terminal window. It will fill out the path.
    If you need to go further into the contents of the Application package, you can continue with /Contents...
    Another way is to start typing and then hit Tab to auto-complete. It will stop where it can't determine the next letter.
    So, type /App tab and it will fill in /Applications. Type a / and start with the name of the app, then tab and it should complete. Continue till you have the correct path.
    Spaces will be replaced with \<space>, so, App Store would end up as /Applications/App\ Store.app

  • How can i get the system language of machine in script

    Hi,
    During postinstall, i want to install file based on the system language.
    How can i get the system language of machine in script ?
    Thanks,

    Michael Conniff wrote:
    I don't get it: what you posted gives a list of all the languages (and I don't see what awk brings to the party).
    Hmm. On my laptop the first bit gets me the list of languages as they appear in the listing in the International preferences pane:
    (en, de, es, ja, fr, it, nl, sv, nb, da, fi, pt, "zh-Hans", "zh-Hant", ko)
    So I piped that to awk to pull out just the first one (they're ordered just like they are in the prefs pane, with the current language first). But that gives me some extra text:
    (en,
    So I piped that to sed to remove the comma and parenthesis. That gives me the current code, which in my case was "en" (or "de" if I switched the language).
    defaults read -g AppleLocale
    gives me en_GB. So maybe this last is better for you?
    Well, sure, if you want to do it the easy way. But where's the fun in that? Seriously though, I get en_US, which is a more accurate and complete view of my settings...
    charlie

  • How can I get my MacBook wi-fi address ?

    Hello
    I need help !! How can I get my MacBook wi-fi address ?! Because am trying to register in a local network and I need my wi-fi address to add it .
    Thanks

    Hamed Rashed,
    I'm not sure if you typed the proper term, I think it should be "MacBook MAC Address"? If this is what you mean then just go to Apple > System Preferences > Network > WiFi > Advanced > Hardware
    Cheers.

  • How can I get the last updated email address of the customer ??

    Dear All,
    Please let me know, How can I get the last updated email address of the customer ??
    Also, I am trying to read CDHDR table where OBJECTCLAS is ADRESSE, however what value should be passed into OBJECTID field, looks like it is ADRNR with a Suffix BP.
    Please confirm me what value should be passed into OBJECTID field.
    Thank you.
    Anitha

    Hi Anitha,
      Check if this is something that helps you:
    Change documents in BAS
    CDHDR
    address type 1
    objectclass = ADRESSE             
    objectid = addrgroup + addrnumber     (ADRC-ADDR_GROUP + ADDRNNUMBER) !!
                     'BP  000xxxxxx'
    private address (address type 2)
    objectclass = ADRESSE2
    objectid =  'BP  000xxxxxx000yyyyyyy'   
                            persnumber+adrnr private
    address type 3
    objectclass = ADRESSE3
    objectid =  'BP  000xxxxxx000zzzzzzz'
                              persnumber +comp.address
    The above details is from the link: http://wiki.sdn.sap.com/wiki/display/ERPLO/LO-MD-BP
    Regards,
    Swarna Munukoti

  • How can I get the inbox name of exchange?

    I wanna get the letters from exchange server, the code i writed below:
    Session session1 = Session.getInstance(new Properties(), null);
    session1.setDebug(true);
    Store store = session1.getStore("pop3");
    store.connect(pop,-1,popuser,poppwd);
    Folder folder = store.getDefaultFolder();
    folder = folder.getFolder("INBOX");
    folder.open(Folder.READ_WRITE);
    the erro report displayed:
    "no such mailbox in this server"
    and i don't know how can i know the mailbox name in my exchange server? is it "INBOX"?
    any idea?
    thank you!

    You can use the following to get a list of the folders that are on the server. I don't know what rules Exchange uses when accessed through POP3 to name its inbox but you should be able to get a complete list this way.
    =======================================================================
    Folder rf = store.getDefaultFolder();
    if ((rf.getType() & Folder.HOLDS_FOLDERS) != 0)
    Folder[] f = rf.list("%");
    int count1 = 0;
    for (int i = 0; i < f.length; i++)
    System.out.println(f.getName);

  • How can i get the System Time from the other host

    I want to get the System Time from the other host in the LAN,How can I get the Time using Java.
    Such as I am in WIN 2000 and I have a Unix host in LAN, I want to get unix host System time, How can I do it.

    Open a socket to port 13 and read a string with the time.
    -or-
    Open a socket to port 27 and read 4 bytes that are a network order timestamp
    Assuming that your UNIX machine has those services running, most do

  • How can we get the table name...

    Hi All,
    How can we get the actual table name for an argument if its datatype is %ROWTYPE.
    For Ex :
    function ACCOUNT_UPDATE (account_no number,
    person person%rowtype,
    amounts dbms_describe.number_table,
    trans_date date)
    return accounts.balance%type;
    In the above function 'ACCOUNT_UPDATE', for argument person the datatype is 'person%rowtype'.
    Is there any way to get the name from Data Dictionary tables.
    I tried using All_Arguments and DBMS_DESCRIBE, I can able to get all the individual fields of %ROWTYPE by I could not able to know the exact table name thru the DD.
    my requirement is dynamically I need to declare a variable for the argument datatype.
    Your help is highly appreciated.
    Thanks

    hi vinay,
    this is the easiest way to find the tablename of a particular field.
    t.code:XD01.
    enter.
    select the kunnr field.
    press F1.
    the top of the screen u will get 'Technical setting icon.
    select that one.then u will get tablename,fieldname,parameter id also.
    if helps give the rewards.
    regards,
    akash.k

  • How can i get the column names in CSV file.

    Hi,
    After execution of infospoke i can not see the column names in that file.How can i get column of respective infoprovider?
    Thanks,
    Gananadha Lenka

    Hello Gana,
    Actually while exporting the data using Info Spoke, we have the possibility to modify the data that we send. This is possible using transformations.
    In your Info Spoke, you have a tab called Transformations.
    Here you need to create an implementation and then use BADi to populate data.
    Check if you can write a start routine sort of thing here and insert a new record into the internal table by hardcoding with your field headings.
    Let me know if you dont know how to create transformations.
    Kris...

  • How can I get the query name in webitem method ?

    Hello,
    I have defined a new web item but I can't retrieved parameter of my webitem in the RENDER method for instance. I have declared a parameter in the RSRRENDERATR table like this :
    REN_NAME : MY_WEBITEM
    ATR_NAME : MY_PARAM
    ATR TYP : TEXT
    CHR MAX LEN : 50
    How can I do this ? How can I get the MY_PARAM value in the RENDER method ?
    Thanks a lot
    GC.
    Edited by: CoGr on Feb 11, 2008 12:10 PM

    Hi ,
    data l_r_view type ref cl_rsr_www_view.
    data l_t_text_symbols type rrx1_t_txt_symbols.
    l_r_view =? n_r_data_provider.
    CALL METHOD L_R_VIEW->n_r_request->TEXT_ELEMENTS_GET
      IMPORTING
        E_T_TXT_ELEMENTS = l_t_text_symbols.
    l_t_text_symbols contains all DP information like Query technical name, or Report text last load etc.
    best regards,
    kai

  • Junit : How can I get the method name (say testMyAddress) that failed

    My code is below
              TestSuite masterSuite = new TestSuite(testClass);
              TestResult result = new TestResult();
              masterSuite.run(result);
                   Enumeration errors = result.errors();
                   while (errors.hasMoreElements())
                        TestFailure error = (TestFailure)errors.nextElement();
                        Test test = error.failedTest();
    /*will give me the class name but how can I get the method that threw the exception.
    I can get fName (that contains the method name) field to get the method,but being private I cannot hold of the field.
    Wondering if there is any easy way to get the method name that threw exception,without writing unneccessary code
                        Class c1 = test.getClass();
    thx
    m

    getting all methods is no good!
    My test class looks like this
    MyTestClass{
    testGoodData(){
    asserttrue(.....);
    testBadData(){
    asserttrue(.....);
    testNullData(){
    asserttrue(.....);
    someHelperMethod(){
    thx
    m

Maybe you are looking for

  • 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 new version of Firefox, 18.02, will not load any pages. Why not?

    I attempted to open Firefox and was told it would load when the updates were applied, which was nothing new. It loaded fine and there were no incompatible add-ons, but it will not load any web pages. I'm on the same computer using Chrome to send this

  • FRM-40010 cannot read from maninda.fmx

    My form works once when I run it from a new startup of my fmx file however when i use the service or run it again i get the above error from the run form on the web and HTML error on oracle forms developer as follows: <html> <head> ORACLE FORMS.</hea

  • Edit Actions and Advanced Actions in some kind of text editor

    Is there any way to edit Actions and Advanced Actions in some kind of text editor? The built-in GUI is fine for little tweaks, but trying to use it for anything real is a almost impossible. Can Creative Suite open a Captivate project and give access

  • Some elements not working

    Hey Using Windows 7 SP1 x64 - Internet Explorer 8 x86 - Newest Flash version On several machines (approx 1000) the following occurs Go to: http://skabvenner.redbarnet.dk/#/sierra-leone Click at the books -> Click at the "tank" picture Then it should