Xymon Mailing List Archive search

conn test

5 messages in this thread

list Christian Rehberger · Thu, 5 Feb 2009 08:53:45 +0100 ·
Hi all,

I want to set an alarm when the connection time of the conn test to a server exceeds i.e.
50 ms.

Is there a possibility for this?

Thanx 

Chris

-- 
Christian Rehberger
Internal IT / Technical Services Consultant · OCLC GmbH
Grünwalder Weg 28g · 82041 Oberhaching · Germany
t +49-(0)89-61308 333 · f +49-(0)89-61308 399 
e user-a00c6a8f1936@xymon.invalid · w http://www.oclcpica.org

OCLC GmbH
Geschäftsführer:
Christine Magin-Weeger, Norbert Weinberger
Sitz der Gesellschaft: Oberhaching, HRB München: 113261
list Larry Barber · Thu, 5 Feb 2009 13:36:38 -0600 ·
You would have to do a little scripting, but it could definitely be done.

Thanks,
Larry Barber

On Thu, Feb 5, 2009 at 1:53 AM, Christian Rehberger <
quoted from Christian Rehberger
user-a00c6a8f1936@xymon.invalid> wrote:
Hi all,

I want to set an alarm when the connection time of the conn test to a
server exceeds i.e.
50 ms.

Is there a possibility for this?

Thanx

Chris

--
Christian Rehberger
Internal IT / Technical Services Consultant · OCLC GmbH
Grünwalder Weg 28g · 82041 Oberhaching · Germany
t +49-(0)89-61308 333 · f +49-(0)89-61308 399
e user-a00c6a8f1936@xymon.invalid · w http://www.oclcpica.org

OCLC GmbH
Geschäftsführer:
Christine Magin-Weeger, Norbert Weinberger
Sitz der Gesellschaft: Oberhaching, HRB München: 113261

list Rolf Schrittenlocher · Fri, 06 Feb 2009 08:03:31 +0100 ·
Hi Christian,

we have something similiar for the tests of OPAC reponses. Shouldn't be 
too difficult to adapt.

kind regards
Rolf

#!/usr/bin/perl
#
##################################################################
# Parameter
##################################################################
# Parameter fuer Testabfrage an PICA-Webopac
$REQUEST = "<URL>";

$BB_DISP = "<bb-servername>"; # BB-Server zur Anzeige
$BB_PORT=1984;          # Portnummer von BB
$THISHOST=$ENV{MACHINE};
$INDENT="opc4";         # Testkennung

# Art der Meldung mit Gueltigkeitsdauer in Minuten
# Wenn nach x Minuten keine neue Nachicht kommt meckert BB
$GUELTIG="status+20";

# Aktuelles Datum
$t0          = time;
$ZEITSTEMPEL = localtime($t0);

$FEHLER  = "red";
$WARNUNG = "yellow";
$OPTIMAL = "green";


##################################################################
# WEBOPAC Testen
##################################################################
#
system("wget -o /dev/null -O /tmp/opc4 \"$REQUEST\" 2>/dev/null");

# Bestimmung des Ergebnissstatuses aus der Antwortzeit.
$elapsed = time - $t0;
if ( $elapsed <= 6 ){
  $STATUS = $OPTIMAL;
}
elsif ( $elapsed <= 12 ){
  $STATUS = $WARNUNG;
}
else {
  $STATUS = $FEHLER;
}


##################################################################
# TCP Verbindung (ToBB) oeffnen und Text versenden.
##################################################################
use Socket;
$SIG{'INT'} = 'interrupted';

sub unbuffer {
    local($channel) = @_;
    local($oldchannel);

    $oldchannel = select($channel);
    $| = 1;
    select($oldchannel);
}

sub interrupted {
    print STDERR "\nClosing connection to peer (interrupt)\n";
    close(ToBB);
    exit 1;
}

# Ermittle IP-Adresse des Servers aus Hostnamen
($name, $aliases, $type, $len, @srvaddr) = gethostbyname($BB_DISP);
$sockaddr = 'S n a4 x8';
$server = pack($sockaddr, &AF_INET, $BB_PORT, $srvaddr[0]);
# (1) TCP socket anfordern
socket(ToBB, &AF_INET, &SOCK_STREAM, 0) ||
    die "Cannot create socket: $!\n";
# (2) Verbindung aufbauen
connect(ToBB, $server) ||
    die "Cannot connect: $!\n";
# (3) Verbindung ist hergestellt
print STDERR "Connected to $BB_DISP, port #$BB_PORT\n";
# kein I/O buffering auf dem socket
unbuffer(ToBB);

# Versenden der Nachicht.
# 1. Zeile: Statusinfos und Ueberschrift
#    wird '<h3>' formatiert.
# 2..n. Zeile: Erklaerender Text
#    wird als '<pre>' ausgegeben.

print ToBB "$GUELTIG $THISHOST.$INDENT $STATUS $ZEITSTEMPEL\n";
print ToBB "Verbindungstest OPC4 von $THISHOST.\n";
print ToBB "$EXTAMSG\n";
print ToBB "Dauer = $elapsed\n";
close (ToBB);

# ENDE #
quoted from Larry Barber
Hi all,

I want to set an alarm when the connection time of the conn test to a server exceeds i.e.
50 ms.

Is there a possibility for this?

Thanx 

Chris

  
-- 

Mit freundlichen Gruessen
Rolf Schrittenlocher

Bitte beachten Sie die neue Emailadresse!

HeBIS-IT, Senckenberganlage 31, 60054 Frankfurt
Tel: (XX) XX - XXX XXXXX   Fax: (XX) XX XXX XXXXX
LBS: user-1e39a1813094@xymon.invalid
Persoenlich: user-ea9d95bffcf0@xymon.invalid
list Ger Maguire · Thu, 3 Nov 2011 15:39:56 +0000 ·
Hi,

I am monitoring multiple systems that use a satellite connection which is causing me an issue with the conn tests as the first ping will almost always be 1200-1500ms but then subsequent pings will be a "stable" 700ms.

Is there any way that I can get the hobbitping to ignore the first ping result received and use the 2nd instead ? I was thinking of using a shell script to do this but this would be a last resort as it adds extra overhead into the conn testing for the system performance.

Any ideas welcome.

Thanks,
Ger.
list Josh Luthman · Thu, 3 Nov 2011 11:41:05 -0400 ·
I would think Smokeping is a better application if all you want to do
is monitor pings.

Josh Luthman
Office: XXX-XXX-XXXX
Direct: XXX-XXX-XXXX
XXXX Wayne St
Suite XXXX
Troy, OH XXXXX
quoted from Ger Maguire


On Thu, Nov 3, 2011 at 11:39 AM, Ger Maguire <user-5c7847c052d3@xymon.invalid> wrote:
Hi,


I am monitoring multiple systems that use a satellite connection which is
causing me an issue with the conn tests as the first ping will almost always
be 1200-1500ms but then subsequent pings will be a “stable” 700ms.


Is there any way that I can get the hobbitping to ignore the first ping
result received and use the 2nd instead ? I was thinking of using a shell
script to do this but this would be a last resort as it adds extra overhead
into the conn testing for the system performance.


Any ideas welcome.


Thanks,

Ger.