Socket check on multiple addresses

Hey there,
I would like to build a script that checks a port on a server IP address using the System.Net.Sockets.TCPClient namespace. I have tested against one address adding the server and port to the argument list but I need to test against a second
server also on a different port. I am running it in PRTG and only need to output a value of 2 to stdout if both servers don't respond. I am not sure how to parameterize it to test both.

Scripts already exist for what you want to do in the repository:
http://gallery.technet.microsoft.com/scriptcenter/Test-RemotePorts-for-cdeb7f87
That one doesn't output to stdout but you can convert/evaluate the output as necessary.
The gist of what you want to do is to loop through the array of your servers, perform the test, count the success or failure, then evaluate the total successes and/or failures when the loop through the array is finished.
I hope this post has helped!

Similar Messages

  • Sending email to multiple address using Utl_Smtp

    Hi,
    I want to send email to multiple address using the Utl_Smtp feature.
    When I am sending email to one email address in the To:Field it works fine.However, when I send
    to multiple address I am getting the below error.I am using a table(Email_test) to store all email id.
    Error report:
    ORA-29279: SMTP permanent error: 501 5.1.3 Invalid address
    ORA-06512: at "SYS.UTL_SMTP", line 20
    ORA-06512: at "SYS.UTL_SMTP", line 98
    ORA-06512: at "SYS.UTL_SMTP", line 240
    ORA-06512: at line 48
    29279. 00000 - "SMTP permanent error: %s"
    *Cause:    A SMTP permanent error occurred.
    *Action:   Correct the error and retry the SMTP operation.
    I am trying two options both ways I am getting error
    Option 1:
    Selecting two email id indivually in the select query as below
    select email into v_Recipient1 from Email_test where Key_name='U1';
    select email into v_Recipient2 from Email_test where Key_name='U2';
    v_Recipient := v_Recipient1||';'||v_Recipient2;
    Option 2:
    Is there a way to use option
    select email into v_Recipient1 from Email_test where Key_name='U4';
    ===========================================================
    Create table Script
    ===========================================================
    create table Email_test (Email varchar2(100),Key_name varchar2(10));
    insert into Email_test values ('[email protected]','U1');
    insert into Email_test values ('[email protected]','U2');
    insert into Email_test values ('[email protected]','U3')
    insert into Email_test values ('[email protected];[email protected];[email protected]','U4');
    select * from Email_test
    [email protected]                         U1
    [email protected]                         U2
    [email protected]                         U3
    [email protected];[email protected];[email protected]     U4
    select * from Email_test where Key_name in ('U1','U2','U3')
    [email protected]     U1
    [email protected]     U2
    [email protected]     U3
    select * from Email_test where Key_name='U4'
    [email protected];[email protected];[email protected]
    =======================================================
    PL/SQL Block
    ===========================================================
    declare
    v_From VARCHAR2(80) := '[email protected]';
    v_cc VARCHAR2(80);
    v_Recipient VARCHAR2(80) ;
    v_Recipient1 VARCHAR2(80) ;
    v_Recipient2 VARCHAR2(80) ;
    v_Subject VARCHAR2(80);
    v_Mail_Host VARCHAR2(50);
    v_Mail_Conn utl_smtp.Connection;
    crlf VARCHAR2(2) := chr(13)||chr(10);
    begin
    --Mail Host name
    select VALUE into v_Mail_Host from Server_info where server_name = 'SMTPServer';
    select email into v_Recipient1 from Email_test where Key_name='U1';
    select email into v_Recipient2 from Email_test where Key_name='U2';
    v_Recipient := v_Recipient1||';'||v_Recipient2;
    --for CC
    select email into v_cc from Email_test where Key_name='U3';
    v_Mail_Conn := utl_smtp.Open_Connection(v_Mail_Host, 25);
    utl_smtp.Helo(v_Mail_Conn, v_Mail_Host);
    utl_smtp.Mail(v_Mail_Conn, v_From);
    utl_smtp.Rcpt(v_Mail_Conn, v_Recipient);
    utl_smtp.Rcpt(v_Mail_Conn, v_cc); -- To CC recepient
    utl_smtp.Rcpt(v_Mail_Conn, v_BCC); To BCC recepient
    utl_smtp.Data(v_Mail_Conn,
    'Date: ' || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf ||
    'From: ' || v_From || crlf ||
    'Subject: '|| v_Subject || crlf ||
    'To: ' || v_Recipient || crlf ||
    'Cc: ' || v_cc || crlf ||
    'Content-Type: text/html;' ||crlf ||
    --'Hello this is a test email');
    crlf || to_char(sysdate, 'Dy, DD Mon YYYY hh24:mi:ss') || crlf );
    utl_smtp.Quit(v_mail_conn);
    end;
    Any suggestion how to approach this issue.
    Thank you

    Simple Mail Transfer Protocol RFC 5321 specifications.
          RCPT TO:<forward-path> [ SP <rcpt-parameters> ] <CRLF>
       The first or only argument to this command includes a forward-path
       (normally a mailbox and domain, always surrounded by "&gt;" and "&lt;"
       brackets) identifying one recipient.In other words, you can only define a SINGLE mailbox address at a time. Multiple addresses requires multiple repeats of this command verb, once per maibox.
    Do not confuse this and the To: tag line in the Mime header that contains a comma delimited list of recipients. That tag line can contain anything - it is not parsed, not checked, and not verified as matching the actual recipient mailboxes as specified via the RCPT TO verb.

  • How to pass multiple addresses per vendor in PO create BAPI?

    Hi Experts,
    We have a requirement to pass multiple addresses for one time Vendor in a PO creation BAPI. But when I checked BAPIs there is a table for partners and address details are not present in that (type BAPIEKKOP).
    Is there any way where I can pass these multiple phone nos, emails, etc for one time Vendor through BAPI?
    These multiple phone nos, emails etc should be available in ME23N -> Header -> Partners (VN) ->details in communication.
    Please suggest a way to achieve this.
    Thanks,
    Anand

    Hi,
    Vendor address details are coming from Vendor data. While you checking the vendor details from ME23N it navigate to FK03.
    So if need to change any thing any vendor address then you need do that first then create the PO.
    This address not related to PO.
    Thanks
    Subhankar.

  • In PO to display multiple address

    Hi Experts,
    I have a requirement,  when Purchase order is creating plant is entered, based on the plant in the PO item level in the delivery address is populating .Client needs dropdown box in the Name place in the delivery address to choose multiple addresses option(Because for single plant they plans to maintain multiple addresses). Could anybody please assists is there any user exit or BADI for this. Thanks in advance.
    Thanks & Regards
    Prasad

    Doug, Thank you for your quick response.
    Sorry for not making myself quite clear. You are right if the form is based on a table, the check box item will be displayed correctly providing the value in database is something like “WIN7:OSX:BEOS:WIN95” as you suggested.
    In my case, I have an interactive report based on multiple tables, one column contains values of “WIN7:OSX:BEOS:WIN95”. To display all information on a procedure based form “Asset Details” (because clients want to information from different tables to be presented to them as one form), I have to use APEX function to link a key in the report to my form “Asset Details” and copy values from reports to items in the form. Here is where problem is. The checkbox in the form only shows “WIN7” rather than all of them in the list of “WIN7:OSX:BEOS:WIN95”.
    I just found that APEX may take “:” as a delimiter and only copy value of the first bit before “:” when using “set value with other value” function. I proved myself by changing “WIN7:OSX:BEOS:WIN95” to “WIN7-OSX-BEOS-WIN95” in the database first after the change, the value can be copied correctly across. This still not solve my problem to display them as multiple choice in checkbox except I have to something to reset the values back to “WIN7:OSX:BEOS:WIN95”.

  • Create multiple addresses in master data

    Hi all,
    Can anyone tell me if it's possible to create in the master data multiple addresses for the same supplier?
    Thanks in advance,
    Ana

    Hi,
    Please check if you can use partner function in the supplier master data.
    Check SAP link which details about it
    http://help.sap.com/erp2005_ehp_05/helpdata/en/75/ee1fa755c811d189900000e8322d00/frameset.htm
    Regards
    K.R

  • How to make "check for multiple logons" mandatory in webdynpro application.

    Hi SDN members,
    Im having a problem with an application developed in webdynpro abap.
    We require that  end-user only have a session per computer (ip address),
    I already tried to achieve this by configuring the webdynpro application throguh SICF and going to Error Pages -> Logon Errors --> System Logon and mark the checkbox Check for multiple logons.
    This configurations give only a warning when the user logs multiple times, and show a checkbox letting the user decide to end or not the previous sessions.
    How to make end previuos sessions mandatory ??
    Regards,
    Franklin Cedillo

    You would have to enforce this at the application level. You can get the IP address of the current client from the framework - IF_WD_APPLICATION method GET_REMOTE_ADDRESS.
    You could write an entry with the IP address into a temporary table during WDDOINIT.  You could clear the entry in the WDDOEXIT.  Also during the WDDOINIT, check to see if there is already an entry for this IP address.  If so, then fire an exit nagivation plug to a static MIME object or BSP page that explains why the user can only be logged in once.

  • Multiple addresses in master data

    Hi all,
    Can anyone tell me if it's possible to create in the master data multiple addresses for the same supplier?
    Thanks in advance,
    Ana Mendes

    I think you have posted the thread in the wrong forum!!
    However, it is possible to store multiple address of a supplier as different types of addresses: Shipping address, bill-to address, delivery address etc.
    Check the following thread for further reading:
    Multiple Vendor Addresses to be Maintained

  • 522 IP REPUTATION BAD (please check for IP address...

    Hello,
    We are a big hosting provider within the UK with multiple servers and thousands of hosted websites.
    We have recently migrated a shared hosting server to new hardware and a new set of IPv4 IP addresses (freshly assigned by RIPE).
    Customers hosted on this new server are trying to send emails to @btinternet and @btopenworld mailboxes using our smtp email server but they receive a bounce back stating "522 IP REPUTATION BAD (please check for IP address listing on reputation services)"
    I have checked our shared IP address that is used to send email and it comes back squeeky clean!
    What I need help with is who can I speak to to find out why our IP address was blocked and how to go about getting it removed again.
    I tried BT's automated telephone service who put me through the the broadband team - They were helpful but kept giving me new numbers of departments I needed to phone which sent me on a wild goose chase returning me back to the same department again.
    There must be a BT Yahoo email postmaster department I can get ahold / speak to regarding this...
    Any help or advise please?

    I am also getting this error today when I wasn't getting it yesterday sending from and to the same email addresses from the same location I now get the error 
    This message was created automatically by mail delivery software.
    A message that you sent could not be delivered to one or more of its
    recipients. This is a permanent error. The following address(es) failed:
        SMTP error from remote mail server after initial connection:
        host mx.bt.lon5.cpcloud.co.uk [65.20.0.49]: 522 IP REPUTATION BAD  (please check for IP address listing on reputation services)
    ------ This is a copy of the message, including all the headers. ------
    Return-path: 
    Received: from [93.157.219.252] (helo=[192.168.1.56])
    by mx1uk.supremebox.com with esmtpa (Exim 4.72)
    (envelope-from )
    id 1VMvWR-0002So-Gl
    for ; Fri, 20 Sep 2013 11:53:04 +0400
    User-Agent: Microsoft-MacOutlook/14.3.6.130613
    Date: Fri, 20 Sep 2013 08:53:00 +0100
    if i try to send from by bt account to the bt account i get this error
    Your message has not been sent as you are accessing your email over an unsecure or untrusted connection. Visit www.bt.com/emailcodes  for advice on using secure connections.

  • How to select from multiple addresses of account in IC Web Client

    Hi all,
    We are implementing a B2C scenario for IC Web Client. We have customers with multiple addresses. However, when we search the acount, only standard address comes to screen.  We want to be able select the related address, and then confirm the acount with that address.
    Is there any way to customize the Web Client in order to be able to select from multiple addresses of the acount?
    Thanks in advance.
    Edited by: Danisman Danisman on Aug 31, 2010 2:52 PM

    Thanks for the answer. Yes, we are using 7.0 but in the account identification screen, there is no personalize button ( I assume you are suggesting adding an addres block by using that button, right?).
    We checked the necessary customizing : there is an entry for fucntional profile PERSONALIZATION : ALL_ENABLED.
    Should we do something else to show the button?
    Thanks again.

  • Smart mailbox with multiple addresses

    It seams that creating a Smart Mailbox with "From" multiple addresses (comma separated) conditions works with INBOX emails... but the same idea does not work if it applies to SENT emails... any help?

    Hi Sanjay,
    Outlook would resolve the SMTP to Displayname if object is found in the GAL, hence no option for you to get that directly visible to the user, if he is accessing the email there.
    Quick way to find out would be checking the header info on the email
    To:  Field should essentially contain the email ID to which email was directed to.
    As an admin you can check this on the message tracking logs for the user.
    Sample Message Header below:
    Message-ID: <[email protected]>
    Received: from [158.143.113.49] by web60003.mail.yahoo.com via HTTP; Tue, 15 Jul 2003 12:14:24 BST
    Date: Tue, 15 Jul 2003 12:14:24 +0100 (BST)
    From: "Daniel Simpson" <[email protected]>
    Reply-To: <[email protected]>
    Subject: Test Email
    To: <[email protected]>
    MIME-Version: 1.0
    Content-Type: multipart/alternative;
    boundary="0-710479544-1058267664=:1719"
    Content-Transfer-Encoding: 8bit
    Return-Path: <[email protected]>
    Regards,
    Satyajit
    Please “Vote As Helpful”
    if you find my contribution useful or “Mark As Answer” if it does answer your question. That will encourage me - and others - to take time out to help you.

  • How do I use multiple addresses at one time?

    Shouldn't the Adobe server page that allows for the entry of a recipients address tell users how to add another address?  Do we separate them with semicolons? Commas?  Or is it even possible to use multiple addresses?

    Yes, Adobe Send.
    Unfortunately, it is NOT spelled out on the page where you enter email addresses of recipients, nor is it revealed if you click on the question mark box by email address.
    Frank
    =========================
    Frank Schmalleger, Ph.D.
    Distinguished Professor Emeritus
    The University of North Carolina
    Website: www.schmalleger.com
    Amazon Author Page: http://tinyurl.com/78nly4s
    Mailing Address:
    Ste 203-332
    4300 S. U.S. Hwy 1
    Jupiter, FL 33477
    Ph. 561.225.1760

  • How to select multiple addresses from the contacts list to send an email?

    How do I select multiple addresses from the contacts list at one time to send an email. Each time I select one, the address book closes and I have to touch the "+" key to open it back to select another address. Is there a way to select all of them at one time instead of making a group? Thanks.

    Yes, once you select a person from your Contacts app, you either need to select more from the '+' button or you can tap in the 'to:' field and type in the first few letters of a contact and select from the list. Kinda bummer but gotta make do.

  • Is there some way to add multiple addresses to an email I am sending that doesn't close the contact list after I click on an address?  This necessitates constantly going back to click the + sign to add each address separately.

    Is there some way to add multiple addresses to an email I am sending that doesn't close the contact list after I click on an address?  This necessitates constantly going back to click the + sign to add each address separately.  Is there some way I can open the contact list, click on all of the individual addresses to which I want to send the email without the list closing between each address entry, and have all of my address entries be listed to the email at one time?  Something like it works in Gmail.  I do not want to use set lists, I want to enter different addresses each time I send an email.  And I am a very slow typist, so I don't want to type the first few letters of each recipient's name.  It is much faster for me to just click on the e-mail addresses in the list as a group.  It doesn't make any sense to me to have to reopen the contact list for each address, when it should be so easy to click on all of the addresses I want at one time and then click once to add them all to the email as a group.  If there is a solution to this, please tell me.  Thanks.

    Vatlily,
    Try this:
    1. Select Mail>File>New Message.
    2. Select Mail>Window>Address Panel.
    3. Use (command+click) on the desired addressees in the Address Panel to create the list.
    4. Click "To:" on the top left of the Address Panel.
    The group that you selected will be added to the "To" field in your New Message.

  • How do I add multiple addresses/contacts in an email tread to my contact list without having to enter each at a time?

    How do I add multiple addresses/contacts in an email tread to my contact list without having to enter each at a time? I have AppleScript but don't see "add address" in any of the boxes/drop-downs. 

    Sorry, but Address Book does not allow you to select more than one email address to send to in a group. There's really no reason why people need multiple copies of a message, anyway; they have the option of forwarding email to another email address of theirs.
    Mulder

  • I have an Apple ID with a single  e mail address. I want to set multiple addresses in the same ID. Can I? If so how?

    I have an Apple ID with a single  e mail address. I want to set multiple addresses in the same ID. Can I? If so how?

    Howdy there johnzcarp,
    As I understand it you want to have more than 1 email address under your Apple ID. You can have what are called Alternate Email addresses associated with your Apple ID and this article will help you get those setup:
    Manage your Apple ID primary, rescue, alternate, and notification email addresses
    Alternate email address
    You can add one or more alternate email addresses for use with Apple services such as Game Center, FaceTime, Find My Friends, iMessage, and OS X notifications.
    Go to My Apple ID (appleid.apple.com).
    Select “Manage your Apple ID” and sign in.
    Add an alternate address:
    Select Add Email Address, then enter your alternate address. Apple will send a verification email to that address. Didn't receive the email?
    Follow the instructions in the email to verify the address.
    Edit an alternate address:
    Select Edit next to the address, then enter the new address. Apple will send a verification email to that address. Didn't receive the email?
    Follow the instructions in the email to verify the address.
    Delete an alternate address: Select Delete next to the address.
    Thank you for using Apple Support Communities.
    Take care,
    Sterling

Maybe you are looking for

  • Oracle.jbo.NoDefException: JBO-25002: Definition oracle.webcenter.search.model.DataControls of type null is not found.

    Hi experts, I am trying to deploy a new version of a WC Portal application and when the deployment finishes successfully I cannot see the web page. The error is: Error 500--Internal Server Error oracle.jbo.NoDefException: JBO-25002: Definition oracle

  • My catalog is suddenly blank?  It's still listed, I can still open it, but there's nothing in it.

    I had lots of trouble getting my old Album catalog to convert to Photoshop elements 8, so I eventually circumvented the problem by simply re-creating my catalog from scratch.  Unfortunately took a fair bit of time, without giving the details.  I've b

  • Date range in the view

    Hi Team, I created one sales report but here my requirement is it as to show the date range i.e (1-07-2012 To 30-07-2012) in the title view. Is this possible by using variables can any one send clear steps how to achieve this. Thanks,

  • Latest processing RAW from Canon 40 D

    I am aware that the previous thread was closed but I wanted to share what I have experienced and what Canon told me. I have an iMac and had after installing DPP 3.1.5 latest version found that what you all already know can't recognize/process RAW. I

  • OS 9 and Internet ?

    I've been thinking of picking up a G3 iBook and just using Mac OS 9 since I just want the computer for using it around the house. But I was wondering if I use iCab or Mozilla for OS 9 can I view YouTube Videos ? I looked around and on Puremac is vers