ndoutils missing output column from nagios_hostchecks table after updating to 1.48

Michael Friedrich michael.friedrich at univie.ac.at
Mon Oct 5 17:56:28 CEST 2009


Hi,

shadih rahman wrote:
> Here is an actual query which is coming as empty.  Please advise on 
> this.  Thanks
>
> INSERT INTO nagios_hostchecks SET instance_id='1', 
> host_object_id='1501', check_type='0', is_raw_check='0', 
> current_check_attempt='1', max_check_attempts='3', state='0', 
> state_type='1', start_time=FROM_UNIXTIME(1254718978), 
> start_time_usec='231137', end_time=FROM_UNIXTIME(0), 
> end_time_usec='0', timeout='30', early_timeout='0', 
> execution_time='0.000000', latency='0.230000', return_code='0', 
> output='', perfdata='(null)', command_object_id='2', command_args='', 
> command_line='/usr/lib64/nagios/plugins/check_fping -H 
> xxxxx\.net\.xxxxxx -w 3000\.0,100% -c 3000\.0,100% -n 1' ON DUPLICATE 
> KEY UPDATE instance_id='1', host_object_id='1501', check_type='0', 
> is_raw_check='0', current_check_attempt='1', max_check_attempts='3', 
> state='0', state_type='1', start_time=FROM_UNIXTIME(1254718978), 
> start_time_usec='231137', end_time=FROM_UNIXTIME(0), 
> end_time_usec='0', timeout='30', early_timeout='0', 
> execution_time='0.000000', latency='0.230000', return_code='0', 
> output='', perfdata='(null)' |
> | 612 | root   | localhost | nagios | Query   |    0 | NULL   | show 
> full processlist
yep that's a bug since the code for query building is missing the 
long_output field.

        if(asprintf(&buf1,"instance_id='%lu', host_object_id='%lu', 
check_type='%d', is_raw_check='%d', current_check_attempt='%d', 
max_check_attempts='%d', state='%d', state_type='%d', start_time=%s, 
start_time_usec='%lu', end_time=%s, end_time_usec='%lu', timeout='%d', 
early_timeout='%d', execution_time='%lf', latency='%lf', 
return_code='%d', output='%s', perfdata='%s'"
                    ,idi->dbinfo.instance_id
                    ,object_id
                    ,check_type
                    ,is_raw_check
                    ,current_check_attempt
                    ,max_check_attempts
                    ,state
                    ,state_type
                    ,ts[0]
                    ,start_time.tv_usec
                    ,ts[1]
                    ,end_time.tv_usec
                    ,timeout
                    ,early_timeout
                    ,execution_time
                    ,latency
                    ,return_code
                    ,es[2]
                    ,es[3]
                   )==-1)
                buf1=NULL;

Regarding the fact that es[3] points to long_output, but is assigned to 
perfdata

        
es[3]=ndo2db_db_escape_string(idi,idi->buffered_input[NDO_DATA_LONGOUTPUT]);
        
es[4]=ndo2db_db_escape_string(idi,idi->buffered_input[NDO_DATA_PERFDATA]);

I remember that I fixed that some while ago in IDOUtils since the 
long_output patch has had some flaws in it.

Latest CVS Head of NDOUtils also contains the bug...

Hf @ Hendrik ;-)

Kind regards,
Michael

------------------------------------------------------------------------------
Come build with us! The BlackBerry® 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/devconf




More information about the Developers mailing list