Monitoring software ports in HP Operations Manager i

Hi Team,

Any one knows how to monitor software ports in HP Operations Manager.

we have a requirement in which we need to monitor software ports of servers where the agents sits.



Sumant Kulkarni

Labels (1)
4 Replies
Captain Captain

Exactly what are you looking for? I have a perl script that checks ports, you will need to change the location of the my $hostfile to whatever path you want and then the hash has listed a bunch of well known ports, you can add/remove as many as you want to get the ports you need. 


#!/usr/bin/perl -w
use strict;
use IO::Socket::PortState qw(check_ports);

my $hostfile = '/home/wclinn/hosts.txt';

my %port_hash = (
tcp => {
22 => {},
25 => {},
53 => {},
80 => {},
137 => {},
138 => {},
139 => {},
161 => {},
162 => {},
383 => {},
443 => {},
445 => {},

my $timeout = 5;

open HOSTS, '<', $hostfile or die "Cannot open $hostfile:$!\n";

while (my $host = <HOSTS>) {
my $host_hr = check_ports($host,$timeout,\%port_hash);
print "Host - $host\n";
for my $port (sort {$a <=> $b} keys %{$host_hr->{tcp}}) {
my $yesno = $host_hr->{tcp}{$port}{open} ? "Yes" : "No";
print "$port - $yesno\n";
print "\n";
close HOSTS;


W. C. Linn

Hello W. C. Linn,

Thank you for sharing your script with us in the community.

I have a small question about your solution: Which perl are you using? The Operations Agent Perl? If yes, which perl version does it contain?

My problem is that I cannot find IO::Socket::PortState in my OA provided perl (version 5.16) and I am a bit stumped by it.

Thanks for your help!

Martina Droege

Micro Focus Expert
Micro Focus Expert

Hello Jemima,

The Perl that comes with the OA has a limitted amount of perl modules and while possible, it's not recommended to install additional perl modules in that perl installation.

I would recommend to install standalone perl and then install perl modules using cpan:

Best regards,


Hello Tobias,

Thanks for your kind suggestion. So it seems that it is not possible with OMi infrastructure alone.

I need to consult with the team and customer, if that might be possible.

Best regards,

Martina Droege

The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.