Initial import of the nagios probe module
authorZdeněk Šustr <sustr4@cesnet.cz>
Fri, 19 Aug 2011 09:42:24 +0000 (09:42 +0000)
committerZdeněk Šustr <sustr4@cesnet.cz>
Fri, 19 Aug 2011 09:42:24 +0000 (09:42 +0000)
39 files changed:
org.glite.lb.nagios/Makefile [new file with mode: 0644]
org.glite.lb.nagios/project/ChangeLog [new file with mode: 0644]
org.glite.lb.nagios/project/version.properties [new file with mode: 0644]
org.glite.lb.nagios/src/10063_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/10199_notifications.txt [new file with mode: 0644]
org.glite.lb.nagios/src/10329_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/10465_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/10601_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/10738_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/10971_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/11173_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/11321_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/11756_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/11896_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/12072_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/12275_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/12461_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/13005_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/13238_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/13390_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/13541_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/13730_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/13890_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/14039_notifications.txt [new file with mode: 0644]
org.glite.lb.nagios/src/14181_notifications.txt [new file with mode: 0644]
org.glite.lb.nagios/src/14434_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/14588_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/14742_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/14932_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/15076_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/2932_notifications.txt [new file with mode: 0644]
org.glite.lb.nagios/src/3079_notifications.txt [new file with mode: 0644]
org.glite.lb.nagios/src/3283_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/3478_notifications.txt [new file with mode: 0644]
org.glite.lb.nagios/src/3618_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/3840_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/4002_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/9924_jobs_to_purge.txt [new file with mode: 0644]
org.glite.lb.nagios/src/LB-probe [new file with mode: 0755]

diff --git a/org.glite.lb.nagios/Makefile b/org.glite.lb.nagios/Makefile
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/org.glite.lb.nagios/project/ChangeLog b/org.glite.lb.nagios/project/ChangeLog
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/org.glite.lb.nagios/project/version.properties b/org.glite.lb.nagios/project/version.properties
new file mode 100644 (file)
index 0000000..3d509b5
--- /dev/null
@@ -0,0 +1,3 @@
+# $Header
+module.version=1.0.0
+module.age=0
diff --git a/org.glite.lb.nagios/src/10063_jobs_to_purge.txt b/org.glite.lb.nagios/src/10063_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..0ba4b29
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/fYTf8M2Cn4lF7cCdun3atg
diff --git a/org.glite.lb.nagios/src/10199_notifications.txt b/org.glite.lb.nagios/src/10199_notifications.txt
new file mode 100644 (file)
index 0000000..e60cc25
--- /dev/null
@@ -0,0 +1,13 @@
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Ready   /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Ready   /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Ready   /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Ready   /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Scheduled       /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Running /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/DZAoYrCBgMmRfbImWfPSTw        Done    /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
diff --git a/org.glite.lb.nagios/src/10329_jobs_to_purge.txt b/org.glite.lb.nagios/src/10329_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..eddb209
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/nRujgDLLhNdVZxmYiE8cLg
diff --git a/org.glite.lb.nagios/src/10465_jobs_to_purge.txt b/org.glite.lb.nagios/src/10465_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..b5c89f0
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/Als4z_HzS-kEz0Gp5hBJew
diff --git a/org.glite.lb.nagios/src/10601_jobs_to_purge.txt b/org.glite.lb.nagios/src/10601_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..4977bc7
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/hgKjhUeADdbCUQ9oBJfOLg
diff --git a/org.glite.lb.nagios/src/10738_jobs_to_purge.txt b/org.glite.lb.nagios/src/10738_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..bfbfe5f
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/lQ7TmC9euqZL_QgmL0uCjA
diff --git a/org.glite.lb.nagios/src/10971_jobs_to_purge.txt b/org.glite.lb.nagios/src/10971_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..8d45aa6
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/89OibvS0546aO0DvO4jVRA
diff --git a/org.glite.lb.nagios/src/11173_jobs_to_purge.txt b/org.glite.lb.nagios/src/11173_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..bfb767b
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/C58EAu_FoViq7uTfyM0NOw
diff --git a/org.glite.lb.nagios/src/11321_jobs_to_purge.txt b/org.glite.lb.nagios/src/11321_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..5c36868
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/mURGyjGNQlZrnpgQmFTO2Q
diff --git a/org.glite.lb.nagios/src/11756_jobs_to_purge.txt b/org.glite.lb.nagios/src/11756_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..c431ab6
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/xSRky2MpEqRgc_EL8jB3ZQ
diff --git a/org.glite.lb.nagios/src/11896_jobs_to_purge.txt b/org.glite.lb.nagios/src/11896_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..9cab161
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/rPPog2UCgKK6K_1aNJYKVQ
diff --git a/org.glite.lb.nagios/src/12072_jobs_to_purge.txt b/org.glite.lb.nagios/src/12072_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..6ab5f25
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/e_8u8kgPUUJPYjD18YLC5g
diff --git a/org.glite.lb.nagios/src/12275_jobs_to_purge.txt b/org.glite.lb.nagios/src/12275_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..5c7d420
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/bwR40dhkZ6WJiTF_wvNE8A
diff --git a/org.glite.lb.nagios/src/12461_jobs_to_purge.txt b/org.glite.lb.nagios/src/12461_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..dbd2c1a
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/5YW4tBqvDIGfMnEuh-RVGg
diff --git a/org.glite.lb.nagios/src/13005_jobs_to_purge.txt b/org.glite.lb.nagios/src/13005_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..48d1b7c
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/VsGF7afcEFLZhh8IZOgaoA
diff --git a/org.glite.lb.nagios/src/13238_jobs_to_purge.txt b/org.glite.lb.nagios/src/13238_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..0311393
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/Es_O4am57LVo6-obwqVcZg
diff --git a/org.glite.lb.nagios/src/13390_jobs_to_purge.txt b/org.glite.lb.nagios/src/13390_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..1979660
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/tXV1gqJg9uUh40r1IVckmQ
diff --git a/org.glite.lb.nagios/src/13541_jobs_to_purge.txt b/org.glite.lb.nagios/src/13541_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..0e1c218
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/vosn_F8UysVaapcaeXItjQ
diff --git a/org.glite.lb.nagios/src/13730_jobs_to_purge.txt b/org.glite.lb.nagios/src/13730_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..74e8b30
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/zVOIJDXQGRfEu00e4cdZCg
diff --git a/org.glite.lb.nagios/src/13890_jobs_to_purge.txt b/org.glite.lb.nagios/src/13890_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..3cdeb02
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/-R-Q95lSnMr3p9_op1uuvw
diff --git a/org.glite.lb.nagios/src/14039_notifications.txt b/org.glite.lb.nagios/src/14039_notifications.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/org.glite.lb.nagios/src/14181_notifications.txt b/org.glite.lb.nagios/src/14181_notifications.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/org.glite.lb.nagios/src/14434_jobs_to_purge.txt b/org.glite.lb.nagios/src/14434_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..b1bdfb5
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/M5NUNaHvQ9QbVjrBixY4fA
diff --git a/org.glite.lb.nagios/src/14588_jobs_to_purge.txt b/org.glite.lb.nagios/src/14588_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..e1bea5a
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/45fAfmyhIHXfofrUaU7Quw
diff --git a/org.glite.lb.nagios/src/14742_jobs_to_purge.txt b/org.glite.lb.nagios/src/14742_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..0e1cc04
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/zxFjqvrm5UVE9sazSM_wfg
diff --git a/org.glite.lb.nagios/src/14932_jobs_to_purge.txt b/org.glite.lb.nagios/src/14932_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..c54a14d
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/ttL0h_V1Si_vgbb5ZFsaNg
diff --git a/org.glite.lb.nagios/src/15076_jobs_to_purge.txt b/org.glite.lb.nagios/src/15076_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..7d311b4
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/QQmDuXO4xZ4cESKZETUbyw
diff --git a/org.glite.lb.nagios/src/2932_notifications.txt b/org.glite.lb.nagios/src/2932_notifications.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/org.glite.lb.nagios/src/3079_notifications.txt b/org.glite.lb.nagios/src/3079_notifications.txt
new file mode 100644 (file)
index 0000000..e69de29
diff --git a/org.glite.lb.nagios/src/3283_jobs_to_purge.txt b/org.glite.lb.nagios/src/3283_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..354b8be
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/mL1ESvS7vRM1KltTmI4AIA
diff --git a/org.glite.lb.nagios/src/3478_notifications.txt b/org.glite.lb.nagios/src/3478_notifications.txt
new file mode 100644 (file)
index 0000000..7d5508a
--- /dev/null
@@ -0,0 +1,13 @@
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Waiting /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Ready   /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Ready   /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Ready   /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Ready   /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Scheduled       /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Running /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
+https://scientific65.zcu.cz:9010/6F03Iqat6fCz-zp6HqubFg        Done    /DC=org/DC=terena/DC=tcs/C=CZ/O=CESNET/CN=Zdenek Sustr 4040     
diff --git a/org.glite.lb.nagios/src/3618_jobs_to_purge.txt b/org.glite.lb.nagios/src/3618_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..7b36883
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/VZ-xxyOBJ8qt2ZA8ZJNikQ
diff --git a/org.glite.lb.nagios/src/3840_jobs_to_purge.txt b/org.glite.lb.nagios/src/3840_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..cab19de
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/AHk-nYqWWtkv4askrvsRAA
diff --git a/org.glite.lb.nagios/src/4002_jobs_to_purge.txt b/org.glite.lb.nagios/src/4002_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..95723e7
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/ItM-hszaRQwOHsfZyfIcIA
diff --git a/org.glite.lb.nagios/src/9924_jobs_to_purge.txt b/org.glite.lb.nagios/src/9924_jobs_to_purge.txt
new file mode 100644 (file)
index 0000000..8c8723a
--- /dev/null
@@ -0,0 +1 @@
+https://scientific65.zcu.cz:9010/ieV6f2QOyVsxkBc2IWmdxQ
diff --git a/org.glite.lb.nagios/src/LB-probe b/org.glite.lb.nagios/src/LB-probe
new file mode 100755 (executable)
index 0000000..3df7d84
--- /dev/null
@@ -0,0 +1,223 @@
+#!/bin/bash
+#
+# Copyright (c) Members of the EGEE Collaboration. 2004-2010.
+# See http://www.eu-egee.org/partners for details on the copyright holders.
+# 
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+# 
+#     http://www.apache.org/licenses/LICENSE-2.0
+# 
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+#
+
+# show help and usage
+progname=`basename $0`
+showHelp()
+{
+cat << EndHelpHeader
+Script for testing notification delivery
+
+Prerequisities:
+   - LB server
+   - Event logging chain
+   - Notification delivery chain (notification interlogger)
+   - environment variables set:
+
+     GLITE_WMS_QUERY_SERVER
+     GLITE_WMS_NOTIF_SERVER
+
+Tests called:
+
+    job registration
+    notification registration
+    logging events
+    receiving notifications
+
+Returned values:
+    Exit TEST_OK: Test Passed
+    Exit TEST_ERROR: Test Failed
+    Exit 2: Wrong Input
+
+EndHelpHeader
+
+       echo "Usage: $progname [OPTIONS]"
+       echo "Options:"
+       echo " -h | --help            Show this help message."
+       echo " -t | --text            Format output as plain ASCII text."
+       echo " -c | --color           Format output as text with ANSI colours (autodetected by default)."
+       echo " -x | --html            Format output as html."
+}
+
+function check_exec()
+{
+        if [ -z $1 ]; then
+                set_error "No binary to check"
+                return 1
+        fi
+        # XXX: maybe use bash's command type?
+        local ret=`which $1 2> /dev/null`
+        if [ -n "$ret" -a -x "$ret" ]; then
+                return 0
+        else
+                return 1
+        fi
+}
+
+function check_binaries()
+{
+        local ret=0
+        for file in $@
+        do
+                check_exec $file
+                if [ $? -gt 0 ]; then
+                        printf "\nfile $file not found\n"
+                        ret=1
+                fi
+        done
+        return $ret
+}
+
+function try_purge()
+{
+                        joblist=$1
+
+                        printf "\nPurging test job (Trying the best, result will not be tested)\n"
+
+                        glite-lb-purge -j ${joblist}
+                        rm ${joblist}
+}
+
+while test -n "$1"
+do
+       case "$1" in
+               "-h" | "--help") showHelp && exit 2 ;;
+               "-t" | "--text")  setOutputASCII ;;
+               "-c" | "--color") setOutputColor ;;
+               "-x" | "--html")  setOutputHTML ;;
+       esac
+       shift
+done
+
+##
+#  Starting the test
+#####################
+
+{
+printf "[LB Probe] Starting test"
+
+EXITCODE=0
+
+# check_binaries
+printf "\n[LB Probe] Testing if all binaries are available"
+check_binaries grid-proxy-info grep sed awk glite-lb-notify glite-lb-job_reg glite-lb-job_status glite-lb-done.sh glite-lb-purge
+if [ $? -gt 0 ]; then
+       printf "\n[LB Probe] Some Commands are unavailable\n\n"
+       exit 3
+fi
+
+printf "\n[LB Probe] Testing credentials"
+
+timeleft=`grid-proxy-info | grep -E "^timeleft" | sed "s/timeleft\s*:\s//"`
+
+if [ "$timeleft" = "" ]; then
+        printf "\n[LB Probe] Test failed -- No credentials\n\n"
+       exit 3
+else
+        if [ "$timeleft" = "0:00:00" ]; then
+                printf "\n[LB Probe] Test failed -- Credentials expired"
+               exit 3
+        else
+
+               # Register job:
+               printf "\n[LB Probe] Registering testing job "
+               jobid=`glite-lb-job_reg -m ${GLITE_WMS_QUERY_SERVER} -s application 2>&1 | grep "new jobid" | awk '{ print $3 }'`
+
+               if [ -z $jobid ]; then
+                       printf " Failed to register job"
+                       printf "\n[LB Probe] Test failed \n\n--- JOB REGISTRATION FAILED LOCALLY ---\n\n"
+                       exit 2
+               else
+                       printf "${jobid}"
+
+                       jobstate=`glite-lb-job_status ${jobid} | grep "state :" | awk '{print $3}'`
+                       if [ "${jobstate}" = "Submitted" ]; then
+                               printf ", server side OK"
+                        else
+                               printf "\n[LB Probe] Test failed -- Job has not been submitted to server\n\n--- L&B SERVER NOT RUNNING ---\n\n"
+                               exit 2
+                        fi
+               fi
+       
+
+               # Register notification:
+               printf "\n[LB Probe] Registering notification "
+
+               notifid=`glite-lb-notify new -j ${jobid} | grep "notification ID" | awk '{ print $3 }'`
+
+               if [ -z $notifid ]; then
+                       printf "\n[LB Probe] Test failed -- Failed to register notification\n\n--- L&B SERVER NOT RUNNING ---\n\n"
+                       exit 2
+               else
+                       printf "${notifid}"
+
+                       printf "\n[LB Probe] Logging events resulting in state Done"
+                       glite-lb-done.sh -j ${jobid} > /dev/null 2> /dev/null
+
+                       glite-lb-notify receive -a 147.228.52.90:`expr $RANDOM+2000` -i 5 ${notifid} > $$_notifications.txt 2> /dev/null 
+
+                       printf "\n[LB Probe] Checking job state"
+
+                       jobstate=`glite-lb-job_status ${jobid} | grep "state :" | awk '{print $3}'`
+                       if [ "${jobstate}" = "Submitted" ]; then
+                               printf "\n[LB Probe] Test failed -- Job state has not changed\n\n--- EVENT DELIVERY CHAIN (LOGGER/INTERLOGGER) NOT RUNNING ---\n\n"
+                               exit 2
+                        else
+                               printf " -- ${jobstate}"
+                               if [ "${jobstate}" != "Done" ]; then
+                                       printf ", not Done. A Warning will be returned."
+                                       EXITCODE=1
+                               fi
+                        fi
+
+                       printf "\n[LB Probe] Checking if notifications were delivered"
+
+                       grep ${jobid} $$_notifications.txt > /dev/null
+
+                       if [ $? = 0 ]; then
+                               printf ", OK"
+                       else
+                               printf "\n[LB Probe] Test failed -- Notifications were not delivered\n\n--- NOTIFICATION INTERLOGGER NOT RUNNING ---\n\n"
+                               exit 2
+                       fi
+
+                       rm $$_notifications.txt
+
+                       #Drop notification
+                       printf "\n[LB Probe] Dropping the test notification (${notifid})"
+                       dropresult=`glite-lb-notify drop ${notifid} 2>&1`
+                       if [ -z $dropresult ]; then
+                               printf "\n[LB Probe] Test OK"
+                       else
+                               printf "\n[LB Probe] Test failed"
+                               printf " Failed to drop notification ${dropresult}"
+                       fi
+
+                       #Purge test job
+                       joblist=$$_jobs_to_purge.txt
+                       echo $jobid > ${joblist}
+#                      try_purge ${joblist}
+
+               fi
+       fi
+fi
+
+printf "\n[LB Probe] Test finished\n\n"
+} 
+exit $EXITCODE
+