Xymon Mailing List Archive search

http response time

6 messages in this thread

list Ralph Mitchell · Wed, 7 May 2008 16:12:49 -0500 ·
I've just been asked if it's possible to alert on the response time recorded
in the built-in http test.  Anybody know??  I don't see anything in the
manual pages that would suggest it can be done.

Thanks,

Ralph Mitchell
list Rolf Schrittenlocher · Thu, 08 May 2008 08:01:44 +0200 ·
Hi Ralph,

I don't think there is something like that in hobbit. But you might want to create a custom script including something like (perl)

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

##################################################################
# Check Website
##################################################################
#
system("wget -o /dev/null -O /tmp/ \"$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;
}

regards
Rolf
quoted from Ralph Mitchell
I've just been asked if it's possible to alert on the response time recorded in the built-in http test.  Anybody know??  I don't see anything in the manual pages that would suggest it can be done.

Thanks,

Ralph Mitchell
-- 

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 Maik Heinelt · Thu, 08 May 2008 16:34:08 +0900 ·
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
 I have used the bbwin version 0.9 on all our Windows server.
All the bbwin configs were  updated from the Hobbit server using the bbwinupdate.

Now, I have updated to the bbwin 0.11 version and wanted to use the same way like before.
But after the client is started, there are no bbwin.cfg.work and also no bbwin.cfg.update at the tmp folder.

At the new configuration, the bbwinupdate.dll also will be loaded and also the config path at the hobbit server was set like before.

Any ideas, what`s wrong there?

Maik

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.6 (MingW32)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
 iD8DBQFIIqzwr4r+EhimPOURAqOBAKCie1105j17q2Q9XtQ7604Y5wrosACg1QkZ
81kpVvKDDtuxDhTRLGV0lAo=
=iLMy
-----END PGP SIGNATURE-----
list Ralph Mitchell · Thu, 8 May 2008 10:11:48 -0500 ·
On Thu, May 8, 2008 at 1:01 AM, Rolf Schrittenlocher <
quoted from Rolf Schrittenlocher
user-ea9d95bffcf0@xymon.invalid> wrote:
Hi Ralph,

I don't think there is something like that in hobbit. But you might want
to create a custom script including something like (perl)

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

##################################################################
# Check Website
##################################################################
#
system("wget -o /dev/null -O /tmp/ \"$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;
}

Thanks for that.  If I have to I'll do something similar in bash with curl,
as I'm more familiar with that:

   elapsed=`curl -s -S -L -w '%{time_total}' http://server.domain.com`

which gives me time in seconds, with millisecond resolution.

I'd like to get the graphs as well, without having to fiddle with the
message format.

Ralph Mitchell
list Ralph Mitchell · Fri, 9 May 2008 15:45:17 -0500 ·
On Thu, May 8, 2008 at 10:11 AM, Ralph Mitchell <user-00a5e44c48c0@xymon.invalid>
quoted from Ralph Mitchell
wrote:
On Thu, May 8, 2008 at 1:01 AM, Rolf Schrittenlocher <
user-ea9d95bffcf0@xymon.invalid> wrote:
Hi Ralph,

I don't think there is something like that in hobbit. But you might want
to create a custom script including something like (perl)

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

##################################################################
# Check Website
##################################################################
#
system("wget -o /dev/null -O /tmp/ \"$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;
}

Thanks for that.  If I have to I'll do something similar in bash with curl,
as I'm more familiar with that:

   elapsed=`curl -s -S -L -w '%{time_total}' http://server.domain.com`

which gives me time in seconds, with millisecond resolution.

I'd like to get the graphs as well, without having to fiddle with the
message format.

Ralph Mitchell
OK, so it wasn't as hard as I thought to replicate the http built-in test.
This script does everything I need right now, though it could do with
refining:

  #!/bin/bash

  # Format in bb-hosts:  1.2.3.4 server.domain.com  # httpplus:warn:alert
  # warn and alert values are expressed in milliseconds, just because we can

  bbhostgrep httpplus\* | while read line
  do
    set $line
    TESTHOST=$2

    httpplus=`echo $line | $SED -e 's/^.* httpplus://' -e 's/ .*//' -e 's/:/
/g'`
    set $httpplus
    WARNVAL=$1
    ALERTVAL=$2

    URL="http://$TESTHOST/";
    res=`/usr/bin/curl -I -s -S -w 'Seconds:\t%{time_total}' $URL`
    ret=$?

    elapsed=`echo "$res" | $GREP Seconds: | $SED -e 's/^.*        //'`
    elapsed=`echo $elapsed \* 1000 | /usr/bin/bc | $SED -e 's/\..*//'`

    if [ "$elapsed" -gt "$ALERTVAL" ]; then
      COLOR=red
      STATUS="Server too slow"
    elif [ "$elapsed" -gt "$WARNVAL" ]; then
      COLOR=yellow
      STATUS="Server response degraded"
    else
      COLOR=green
      STATUS="OK"
    fi

    MACHINE=`echo $TESTHOST | $SED -e 's/\./,/g'`
    LINE="status $MACHINE.http $COLOR `date`: $STATUS
  &$COLOR $URL - $STATUS

  $res

  WARN at ${WARNVAL}ms, ALERT at ${ALERTVAL}ms"

    $BB $BBDISP "$LINE"
  done

It assumes that it's OK to use the hostname field for the url, and picks up
the WARN and ALERT times from the "httpplus" tag in the bb-hosts file.  It
also ignores any curl errors, such as timeout due to the server not
responding.

Ralph Mitchell
list Etienne Grignon · Mon, 26 May 2008 17:47:08 +0200 ·
Hello Maik,

2008/5/8 Maik Heinelt <user-4ab5eb34adb2@xymon.invalid>:
quoted from Maik Heinelt
I have used the bbwin version 0.9 on all our Windows server.
All the bbwin configs were  updated from the Hobbit server using the
bbwinupdate.

Now, I have updated to the bbwin 0.11 version and wanted to use the same way
like before.
But after the client is started, there are no bbwin.cfg.work and also no
bbwin.cfg.update at the tmp folder.

At the new configuration, the bbwinupdate.dll also will be loaded and also
the config path at the hobbit server was set like before.

Any ideas, what`s wrong there?

Could you post your bbwin.cfg ? There is no change on bbwinupdate
since 0.9, only some minor bug fix. I have made new tests on BBWin
0.11 and it works fine.

Thank you,

-- 
Etienne GRIGNON