Kaseya Community

Monitor a port at a hostname or IP address

  • PortMonitor.zip
    The pair of scripts in the attached zip file provides an example on how you can use any Agent to monitor a port on any machine that the Agent can access.

    The zip file contains "Port Monitor 1" and "Port Monitor 2". kPrtPng.exe is an executable file that is included with the Agent installation. The script executes kPrtPng.exe to attempt a TCP connection to the port on the specified hostname or IP address. Import the scripts and edit them as follows:

    Edit "Port Monitor 1":
    1) Edit Step 1 to put in the hostname or IP Address you wish to monitor.
    2) Edit Step 2 to put in the port number you wish to monitor.
    3) Edit Step 3 to put in the list of comma separated email addresses to receive an email when the port fails to respond to a network connection attempt.
    4) Edit Step 9 to insure that it executes the script "Port Monitor 2" after importing both scripts.

    Edit "Port Monitor 2":
    1) Edit the subject line and email body to meet your needs.

    On a machine of your choice, schedule "Port Monitor 1" on a recurring basis at an interval that meets your needs. An email will be sent each time the port does not respond to a connection attempt.

    Legacy Forum Name: Monitor a port at a hostname or IP address,
    Legacy Posted By Username: PWong
  • So then you just schedule this to run every 15 min.

    Legacy Forum Name: System Administration Scripts,
    Legacy Posted By Username: sourceminer