diff -rbuN monit/l.l monit.gpsd/l.l
--- monit/l.l	2009-05-21 17:15:27.000000000 +0200
+++ monit.gpsd/l.l	2009-05-21 18:15:31.000000000 +0200
@@ -221,6 +221,7 @@
 tns               { return TNS; }
 pgsql             { return PGSQL; }
 sip               { return SIP; } 
+gps               { return GPS; } 
 target            { return TARGET; }
 maxforward        { return MAXFORWARD; }
 mode              { return MODE; }
diff -rbuN monit/p.y monit.gpsd/p.y
--- monit/p.y	2009-05-21 17:15:27.000000000 +0200
+++ monit.gpsd/p.y	2009-05-21 18:15:31.000000000 +0200
@@ -278,7 +278,7 @@
 %token ALERT NOALERT MAILFORMAT UNIXSOCKET SIGNATURE
 %token TIMEOUT RESTART CHECKSUM EVERY 
 %token DEFAULT HTTP APACHESTATUS FTP SMTP POP IMAP CLAMAV NNTP NTP3 MYSQL DNS
-%token SSH DWP LDAP2 LDAP3 RDATE RSYNC TNS PGSQL POSTFIXPOLICY SIP LMTP
+%token SSH DWP LDAP2 LDAP3 RDATE RSYNC TNS PGSQL POSTFIXPOLICY SIP LMTP GPS
 %token <string> STRING PATH MAILADDR MAILFROM MAILSUBJECT
 %token <string> MAILBODY SERVICENAME STRINGNAME
 %token <number> NUMBER PERCENT LOGLIMIT CLOSELIMIT DNSLIMIT KEEPALIVELIMIT 
@@ -1028,6 +1028,9 @@
                 | PROTOCOL LMTP  {
                     portset.protocol = addprotocol(P_LMTP);
                   }
+                | PROTOCOL GPS  {
+                    portset.protocol = addprotocol(P_GPS);
+                  }
                 | sendexpectlist {
                     portset.protocol = addprotocol(P_GENERIC);
                   }
@@ -2494,6 +2497,7 @@
   case P_PGSQL:         return create_pgsql();
   case P_SIP:           return create_sip();
   case P_LMTP:          return create_lmtp();
+  case P_GPS:          return create_gps();
   }
 
   return create_default();
diff -rbuN monit/protocols/gps.c monit.gpsd/protocols/gps.c
--- monit/protocols/gps.c	1970-01-01 01:00:00.000000000 +0100
+++ monit.gpsd/protocols/gps.c	2009-05-21 19:10:56.000000000 +0200
@@ -0,0 +1,74 @@
+/*
+ * Copyright (C) 2009 Tildeslash Ltd. All rights reserved.
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License version 3.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program.  If not, see <http://www.gnu.org/licenses/>.
+ *
+ * In addition, as a special exception, the copyright holders give
+ * permission to link the code of portions of this program with the
+ * OpenSSL library under certain conditions as described in each
+ * individual source file, and distribute linked combinations
+ * including the two.
+ *
+ * You must obey the GNU General Public License in all respects
+ * for all of the code used other than OpenSSL.  If you modify
+ * file(s) with this exception, you may extend this exception to your
+ * version of the file(s), but you are not obligated to do so.  If you
+ * do not wish to do so, delete this exception statement from your
+ * version.  If you delete this exception statement from all source
+ * files in the program, then also delete it here.
+ */
+
+#include <config.h>
+
+#include "protocol.h"
+
+/**
+ *  Check gpsd status.
+ *  There is a project site for gpsd at <http://gpsd.berlios.de/>.
+ *
+ *  @author Sébastien Debrard, <sebastien.debrard@gmail.com>
+ *
+ *  @version \$Id: default.c,v 1.19 2009/02/13 09:18:19 hauk Exp $
+ *
+ *  @file
+ */
+int check_gps(Socket_T s) {
+	char buf[STRLEN];
+	const char *ok_gps_device="GPSD,G=GPS";
+	const char *ok_rtcm104_device="GPSD,G=RTCM104";
+	const char *ok_rtcm104v2_device="GPSD,G=RTCM104v2";
+
+	ASSERT(s);
+
+	if(socket_print(s, "G\r\n") < 0) {
+		LogError("GPS: error sending data -- %s\n", STRERROR);
+		return FALSE;
+	}
+
+	if(!socket_readln(s, buf, sizeof(buf))) {
+		LogError("GPS: error receiving data -- %s\n", STRERROR);
+		return FALSE;
+	}
+
+	Util_chomp(buf);
+	if(strncasecmp(buf, ok_gps_device, strlen(ok_gps_device)) != 0) {
+		if(strncasecmp(buf, ok_rtcm104v2_device, strlen(ok_rtcm104v2_device)) != 0) {
+			if(strncasecmp(buf, ok_rtcm104_device, strlen(ok_rtcm104_device)) != 0) {
+				LogError("GPS error (no device): %s\n", buf);
+				return FALSE;
+			}
+		}
+	}
+	
+	return TRUE;
+}
+
diff -rbuN monit/protocols/protocol.c monit.gpsd/protocols/protocol.c
--- monit/protocols/protocol.c	2009-05-21 17:15:27.000000000 +0200
+++ monit.gpsd/protocols/protocol.c	2009-05-21 18:15:31.000000000 +0200
@@ -68,6 +68,7 @@
 static Protocol_T mytns= NULL;
 static Protocol_T mypgsql= NULL;
 static Protocol_T mysip= NULL;
+static Protocol_T mygps= NULL;
 
 
 /**
@@ -111,7 +112,7 @@
   FREE(mytns);
   FREE(mypgsql);
   FREE(mysip);
-
+  FREE(mygps);
 }
 
 
@@ -351,3 +352,12 @@
   return mypgsql;
 }
 
+void *create_gps() {
+  if(mygps == NULL) {
+    NEW(mygps);
+    mygps->name= "GPS";
+    mygps->check= check_gps;
+  }
+  return mygps;
+}
+
diff -rbuN monit/protocols/protocol.h monit.gpsd/protocols/protocol.h
--- monit/protocols/protocol.h	2009-05-21 17:15:27.000000000 +0200
+++ monit.gpsd/protocols/protocol.h	2009-05-21 18:15:31.000000000 +0200
@@ -61,6 +61,7 @@
 #define P_CLAMAV         22
 #define P_SIP            23
 #define P_LMTP           24
+#define P_GPS            25
 
 void  gc_protocols();
 
@@ -89,6 +90,7 @@
 void* create_pgsql();
 void* create_sip();
 void* create_lmtp();
+void* create_gps();
 
 /* "Package" locale Protocol routines */
 int check_apache_status(Socket_T);
@@ -115,6 +117,7 @@
 int check_pgsql(Socket_T);
 int check_sip(Socket_T);
 int check_lmtp(Socket_T);
+int check_gps(Socket_T);
 
 
 #endif
