monitoring/NOCpulsePlugins/Oracle/TNSping.pm | 9 +++++----
1 file changed, 5 insertions(+), 4 deletions(-)
New commits:
commit 73256c087eb6aa5c1e0e0f9a7bb16d56eab1cd34
Author: Miroslav Suchý <msuchy(a)redhat.com>
Date: Wed Jun 3 16:30:30 2009 +0200
502595 - use ip instead of hostname
(cherry picked from commit f04ed5d3cde75f9135beca831b4a5396ff78dadb)
diff --git a/monitoring/NOCpulsePlugins/Oracle/TNSping.pm
b/monitoring/NOCpulsePlugins/Oracle/TNSping.pm
index 4c21abf..7c2fc87 100644
--- a/monitoring/NOCpulsePlugins/Oracle/TNSping.pm
+++ b/monitoring/NOCpulsePlugins/Oracle/TNSping.pm
@@ -44,12 +44,13 @@ sub tnscmd {
my ($sendbuf) = pack("C*", @packet);
- my ($tns_sock) = IO::Socket::INET->new(
+ my $tns_sock = IO::Socket::INET->new(
PeerAddr => $hostname,
PeerPort => $port,
Proto => 'tcp',
Type => SOCK_STREAM,
- Timeout => $timeout) or return (-1, '');
+ Timeout => $timeout);
+ return (-1, '') unless $tns_sock; #could not connect
$tns_sock->autoflush(1);
my $count = length($sendbuf);
@@ -79,11 +80,11 @@ sub run {
my $start= Time::HiRes::time();
my ($code, $response)=tnscmd("(CONNECT_DATA=(COMMAND=ping))",
- $params{'hostname'}, $params{'port'},
$params{'timeout'});
+ $params{'ip'}, $params{'port'}, $params{'timeout'});
my $time=Time::HiRes::time()-$start;
if ($code <= 0) {
- $result->item_critical("Could not connect to host ",
$params{'hostname'});
+ $result->item_critical("Could not connect to host $params{'ip'}
on port $params{'port'}");
} elsif ($response =~ /\(ERR=\d+\)/) {
$result->context("TNS Listener");
$result->metric_value('latency', $time, '%.3f');
Show replies by date