DX Application Performance Management

Network HealthCheck 

07-08-2015 08:28 AM


This is distributed under the Apache License, v2.0, January 2004.



EPAgent plugin that monitors servers and ports by ping and socket connection.



Setup the plugin as stateless with a minimum delay of 15 seconds, keeping in mind the number of ports to be tested per server.

If you have a large number of servers and ports to check, start with a 60 second delay.


You are required to pass the name and location of datafile.txt to the plugin. This file is included in the distribution.

Edit the file to identify the servers and ports to be tested. Place the file with the plugin.


There is a special note for Windows servers in the header of the plugin. Please read it carefully.



Perl - v5.06+ (recommend v5.10+)

Perl modules - Net::Ping, IO::Socket::INET

0 Favorited
1 Files
zip file
HealthCheck.zip   1K   1 version
Uploaded - 05-29-2019

Tags and Keywords


05-24-2016 09:37 AM

Hi Hiko


Good Morning, I made a small change to your solution. I have a datafile with 2 entries, online server and offline server


server01.AD.TIAA-CREF.ORG 3389

server02.AD.TIAA-CREF.ORG 3389


Change made

# Read in file which has the server/IPs & ports

my @testList = do { open my $fh, '<', $ARGV[0]; <$fh>; };

#my @testList = do { open my $fh, '<', $_[0]; <$fh>; };



Here is my output


-bash-3.2$ perl netCheck_updt.pl datafile.txt

<metric type="IntCounter" name="NetCheck|server01.AD.TIAA-CREF.ORG:Availability" value="0" />

<metric type="IntCounter" name="NetCheck|server02.AD.TIAA-CREF.ORG|3389:Status" value="0" />

<metric type="IntCounter" name="NetCheck|server02.AD.TIAA-CREF.ORG:Availability" value="1" />


Server 02 is offline. Ping and port monitor should fail and status should be 0 for both correct. for server01 is online and ping and port monitor status should report as 1. How do we get this corrected




05-18-2016 02:18 PM

Not on this machine, I am trying on a different machine and the same no output. meanwhile i was working on a port monitor using

IO::Socket::PortState - Perl extension for checking the open or closed status of a port. Making sure if it can used to check the RDP port availability.

#import our modules

use FindBin;use lib ("$FindBin::Bin", "$FindBin::Bin/../lib/perl");

use Wily::PrintMetric;

use Net::Ping;

use strict;

use IO::Socket::PortState qw(check_ports);

my $proto = 'tcp';

my $port = '3389';

my $service = 'telnet port';

my $address = '';

my($section, $ping_timeout, %porthash);

$porthash{$proto}{$port}{'name'} = $section;

check_ports($address, $ping_timeout, \%porthash);

my $open = $porthash{$proto}{$port}{'open'};

if ($open) {

Wily::PrintMetric::printMetric( type        => 'IntCounter',

resource    => 'PORT',

subresource => 'CHALBWINS01.AD.TIAA-CREF.ORG',

name        => 'PortStatus',

value       => 1,



else {

        #printMetric("IntCounter", "portcheck", $open, "Availability", 0);

Wily::PrintMetric::printMetric( type        => 'IntCounter',

resource    => 'PORT',

subresource => 'CHALBWINS01.AD.TIAA-CREF.ORG',

name        => 'PortStatus',

value       => 0,



05-18-2016 01:10 PM

Not even any message when you run it standalone?

05-18-2016 01:07 PM

I don't see any error messages ( even in debug). No output when i execute the perl program from the plugins directory

05-18-2016 12:49 PM

What do you see if you just execute the Perl program from its directory in 'epaplugins'? Does it give you any error messages?

05-18-2016 12:46 PM

Are you seeing any error message in the EPA log?

05-18-2016 12:21 PM

this is test server. Thank you

05-18-2016 11:54 AM


Don't run EPA from the MOM server.

Use a different server. Don't steal CPU cycles from your MOM.

05-18-2016 11:52 AM

I'll take a look at then.

I'll let you know what I find.

05-18-2016 11:27 AM

I am looking for to monitor server hung status using port monitoring :  you can enable Rdp port or any common port monitoring for server.

create a epagent script base monitor to read list of the server in text file on watcher and check Port availability. I believe your solution fits into my requirement

05-18-2016 11:20 AM

ye please. it has following entry

#host/ip    port1,port2,etc 3389,80

05-18-2016 11:07 AM

Did you update datafile.txt?

05-18-2016 11:05 AM

Hi H Davis


when i try to run this, there is no output. what i am missing?


perl epaplugins/netcheck/netCheck.pl "/wilymom/MOM/epagent/epaplugins/netcheck/datafile.txt"




02-01-2016 07:32 PM

This fieldpack is now available for download and comments over at GitHub => https://github.com/CA-APM/ca-apm-fieldpack-epa-netcheck

07-08-2015 09:38 AM


07-08-2015 09:27 AM

Can you share it on GitHub, too?

07-08-2015 09:18 AM

If you like, I just updated it a few minutes ago.

I thought about if users placed spaces between the comma-separated list of ports and I didn't account for that.

It's now updated to handle that case.

07-08-2015 09:13 AM

Looks really good, I'll have a look at this later.

Thanks, Pete

Related Entries and Links

No Related Resource entered.