NODutils: Duplicate lines in servicechecks table for each service check

Øyvind Nordang oyvind.nordang at gmail.com
Mon Nov 2 13:08:29 CET 2009


Hi

OS: Ubuntu 8.10 64bit
Nagios 3.2.0
NDOutils: 1.4b9

When I check the servicechecks table each check of a service is listed
twice, but not with the same information in both rows.

I've pasted two sample rows from my database here. They are both from
the same service check. All fields before start_time is identical, so
I didn't paste them. service_object_id is the same for both rows.

start_time | start_time_usec | end_time | end_time_usec |
command_object_id | command_args | command_line | timeout |
early_timeout | execution_time | latency | return_code output |
long_output | perfdata
2009-11-02 12:53:28 | 124478 | 1970-01-01 01:00:00 | 0 | 21 |
250!400!RSZDT | /usr/local/nagios/libexec/check_procs -w 250 -c 40...
| 60 | 0 | 0 | 0.124 | 0 | PROCS OK: 13 processes with STATE = RSZDT
2009-11-02 12:53:28 | 124478 | 2009-11-02 12:53:28 | 139766 | 0 | | |
60 | 0 | 0.01529 | 0.124 | 0 | PROCS OK: 13 processes with STATE =
RSZDT


In dbhandlers.c on line 1518 all I can think of is that ON DUPLICATE
KEY UPDATE does not work as it should. I haven't had time to look at
the code and programming isn't my strong side.

	if(asprintf(&buf,"INSERT INTO %s SET %s, command_object_id='%lu',
command_args='%s', command_line='%s' ON DUPLICATE KEY UPDATE %s"
		    ,ndo2db_db_tablenames[NDO2DB_DBTABLE_SERVICECHECKS]
		    ,buf1
		    ,command_id
		    ,es[0]
		    ,es[1]
		    ,buf1
		   )==-1)
		buf=NULL;

Hope someone can clarify this for me, is this a bug in nagios, ndoutil
or have I done something wrong...

Thanks in advance.

--
Øyvind Nordang

------------------------------------------------------------------------------
Come build with us! The BlackBerry(R) Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay 
ahead of the curve. Join us from November 9 - 12, 2009. Register now!
http://p.sf.net/sfu/devconference




More information about the Developers mailing list