diff -Nur nagios-business-process-addon-0.9.3/etc/ndo.cfg-sample nagios-business-process-addon-0.9.3.merlin/etc/ndo.cfg-sample
--- nagios-business-process-addon-0.9.3/etc/ndo.cfg-sample	2009-03-16 13:11:14.000000000 +0100
+++ nagios-business-process-addon-0.9.3.merlin/etc/ndo.cfg-sample	2009-07-01 14:55:48.000000000 +0200
@@ -5,9 +5,10 @@
 # in releases up to 0.9.2 this file was called ndo_db_readonly.cfg
 # (because up to this point, the database was the only supported interface)
 
-# tells if NDO data is to be taken from a database (db) or from the filesystem (fs)
-# allowed values are db or fs 
+# tells if NDO data is to be taken from a database (db/merlin) or from the filesystem (fs)
+# allowed values are db, merlin or fs 
 ndo=db
+# ndo=merlin
 # ndo=fs
 
 #
@@ -23,14 +24,14 @@
 ndofs_instance_name=default
 
 #
-# settings if You use ndo=db
+# settings if You use ndo=db or ndo=merlin
 #
 
-# The hostname or IP and the port of the server running Your NDO database
+# The hostname or IP and the port of the server running Your NDO or Merlin database
 ndodb_host=localhost
 ndodb_port=3306
 
-# Name of Your NDO database (instance name)
+# Name of Your NDO or Merlin database (instance name)
 ndodb_database=nagios
 
 # Username and password to connect to the database
@@ -38,8 +39,8 @@
 ndodb_password=dummy
 
 # Prefix
-# all tablenames of Your NDO database start with the same prefix
-# enter this prefix here
+# all tablenames of Your NDO or Merlin database start with the same prefix
+# enter this prefix here (default for NDO: nagios_, for Merlin: NULL)
 # e. g. look for a table calles
 # <something>objects
 # enter <something> here
diff -Nur nagios-business-process-addon-0.9.3/lib/ndodb.pm.in nagios-business-process-addon-0.9.3.merlin/lib/ndodb.pm.in
--- nagios-business-process-addon-0.9.3/lib/ndodb.pm.in	2009-03-16 13:11:14.000000000 +0100
+++ nagios-business-process-addon-0.9.3.merlin/lib/ndodb.pm.in	2009-07-01 14:57:14.000000000 +0200
@@ -122,6 +122,52 @@
 		}
 		close(LIST);
 	}
+	elsif ($dbparam{'ndo'} eq "merlin")
+	{
+		#print "DEBUG2: ndo=db\n";
+	        my $db_prefix = $dbparam{'ndodb_prefix'};
+
+	        $dbh = DBI->connect("DBI:mysql:$dbparam{'ndodb_database'}:$dbparam{'ndodb_host'}:$dbparam{'ndodb_port'}", $dbparam{'ndodb_username'}, $dbparam{'ndodb_password'});
+	        die "Error: $DBI::errstr\n" unless $dbh;
+
+	        #$sql = "select host_name,service_description,last_hard_state,plugin_output from servicestatus";
+	        #$sql = "select ${db_prefix}objects.name1,${db_prefix}objects.name2,${db_prefix}servicestatus.last_hard_state,${db_prefix}servicestatus.output from ${db_prefix}objects,${db_prefix}servicestatus where ${db_prefix}objects.objecttype_id=2 and ${db_prefix}objects.is_active=1 and ${db_prefix}objects.object_id=${db_prefix}servicestatus.service_object_id";
+	        $sql = "select host_name,service_description,last_hard_state,output from service";
+
+		#print STDERR "$sql\n";
+	        $sth = $dbh->prepare($sql);
+	        die "Error: $DBI::errstr\n" if $DBI::err;
+
+	        $sth->execute();
+	        die "Error: $DBI::errstr\n" if $DBI::err;
+
+	        while (@fields = $sth->fetchrow_array())
+	        {
+	                #print join("\t", @fields), "\n";
+	                $hardstates{"$fields[0];$fields[1]"} = $services_state[$fields[2]] || "UNKNOWN";
+	                $statusinfos{"$fields[0];$fields[1]"} = $fields[3];
+	        }
+
+	        #$sql = "select host_name,host_status,plugin_output from hoststatus";
+	        #$sql = "select ${db_prefix}objects.name1,${db_prefix}hoststatus.current_state,${db_prefix}hoststatus.output from ${db_prefix}objects,${db_prefix}hoststatus where ${db_prefix}objects.objecttype_id=1 and ${db_prefix}objects.is_active=1 and ${db_prefix}objects.object_id=${db_prefix}hoststatus.host_object_id";
+	        $sql = "select host_name,last_hard_state,output from host";
+
+	        $sth = $dbh->prepare($sql);
+	        die "Error: $DBI::errstr\n" if $DBI::err;
+
+	        $sth->execute();
+	        die "Error: $DBI::errstr\n" if $DBI::err;
+
+	        while (@fields = $sth->fetchrow_array())
+	        {
+	                #print join("\t", @fields), "\n";
+	                $hardstates{"$fields[0];Hoststatus"} = $host_state[$fields[1]] || "UNKNOWN";
+	                $statusinfos{"$fields[0];Hoststatus"} = $fields[2];
+	        }
+
+	        $sth->finish();
+	        $dbh->disconnect();
+	}
 
 	return(\%hardstates, \%statusinfos);
 }
@@ -212,6 +258,29 @@
 
 		$return = "$lastservicecheck_local[5]-$lastservicecheck_local[4]-$lastservicecheck_local[3] $lastservicecheck_local[2]:$lastservicecheck_local[1]:$lastservicecheck_local[0]";
 	}
+	elsif ($dbparam{'ndo'} eq "merlin")
+	{
+        	$db_prefix = $dbparam{'ndodb_prefix'};
+        	$dbh = DBI->connect("DBI:mysql:$dbparam{'ndodb_database'}:$dbparam{'ndodb_host'}:$dbparam{'ndodb_port'}", $dbparam{'ndodb_username'}, $dbparam{'ndodb_password'});
+	        die "Error: $DBI::errstr\n" unless $dbh;
+
+	        $sql = "select max(last_check) from ${db_prefix}service";
+
+	        $sth = $dbh->prepare($sql);
+	        die "Error: $DBI::errstr\n" if $DBI::err;
+
+	        $sth->execute();
+	        die "Error: $DBI::errstr\n" if $DBI::err;
+
+	        while (@fields = $sth->fetchrow_array())
+	        {
+	                #print join("\t", @fields), "\n";
+			$return = $fields[0];
+		}
+
+	        $sth->finish();
+	        $dbh->disconnect();
+	}
 
 	return($return);
 }
@@ -235,13 +304,13 @@
         close(IN);
 
 	# set defaults, if we did not get values form config
-	$dbparam{'ndo'}="db" if ($dbparam{'ndo'} ne "fs");
+	$dbparam{'ndo'}="db" if ($dbparam{'ndo'} eq "");
 	$dbparam{'ndofs_basedir'}="/tmp/ndo2fs" if ($dbparam{'ndofs_basedir'} eq "");
 	$dbparam{'ndofs_instance_name'}="default" if ($dbparam{'ndofs_instance_name'} eq "");
 	$dbparam{'ndodb_host'}="localhost" if ($dbparam{'ndodb_host'} eq "");
 	$dbparam{'ndodb_port'}="3306" if ($dbparam{'ndodb_port'} eq "");
 	$dbparam{'ndodb_database'}="nagios" if ($dbparam{'ndodb_database'} eq "");
-	$dbparam{'ndodb_prefix'}="nagios_" if ($dbparam{'ndodb_prefix'} eq "");
+	$dbparam{'ndodb_prefix'}="" if ($dbparam{'ndodb_prefix'} eq "");
 
 	return (%dbparam);
 }

