
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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.
Regards,
Sumant Kulkarni


- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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>) {
chomp($host);
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;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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:
http://www.cpan.org/modules/INSTALL.html
Best regards,
Tobias

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content
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