BUG in utils.c - nagios 3.0a4 - processing passive checks
Ethan Galstad
nagios at nagios.org
Wed May 30 23:41:20 CEST 2007
Thanks guys - patch is now in CVS. :-)
Hendrik Bäcker wrote:
> Hi Roman,
>
> you are right. There is a small problem when there are more than one
> check result in a file.
> Another user told me and he tried your changes and seems to be happy
> right now.
>
> But I think there is a better way to determine the end of a check
> result... I will try to work out another solution and would like to now
> if you would give it a chance when I am ready?
>
> But to make it easier to Ethan, here are your changes as a handle patch
> file ;)
>
> Kind regards,
> Hendrik
>
>
> Roman Trylski schrieb:
>> Hi all,
>>
>> There is a bug in Nagios 3.0a4, utils.c, function process_check_result_file.
>>
>> It's impossible to process result list having more then one result output.
>> eg. submitting many service checks in one moment causes creating temporary
>> file (in /usr/local/nagios/var/spool/checkresults) which contains several
>> records divided by '\n'. Function process_check_result_file which process
>> this file is looking for a '\x0' as a record divider, but there is no such
>> line.
>> Result: function process_check_result_file returns only one last record in
>> file.
>>
>> Remedy: replace '\x0' for '\n' in:
>>
>> /* whitespace indicates end of record */
>> else if(input[0]=='\x0'){
>>
>> It should work fine, it's working for me :)
>>
>> I'm not familiar with nagios architecture, maybe there is other solution for
>> this problem (putting whitespace between records? maybe?).
>>
>> have fun
>> Roman Trylski
>>
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>> _______________________________________________
>> Nagios-devel mailing list
>> Nagios-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/nagios-devel
>>
>>
>>
>> ------------------------------------------------------------------------
>>
>> diff -Naur nagios3-clean/base/utils.c nagios3/base/utils.c
>> --- nagios3-clean/base/utils.c 2007-05-25 22:10:32.000000000 +0200
>> +++ nagios3/base/utils.c 2007-05-30 18:19:56.000000000 +0200
>> @@ -4125,8 +4125,8 @@
>> if(input[0]=='#')
>> continue;
>>
>> - /* whitespace indicates end of record */
>> - else if(input[0]=='\x0'){
>> + /* newline at beginning of the line indicates end of record */
>> + else if(input[0]=='\n'){
>>
>> /* we have something... */
>> if(new_cr){
>>
>> ------------------------------------------------------------------------
>>
>> -------------------------------------------------------------------------
>> This SF.net email is sponsored by DB2 Express
>> Download DB2 Express C - the FREE version of DB2 express and take
>> control of your XML. No limits. Just data. Click to get it now.
>> http://sourceforge.net/powerbar/db2/
>>
>> ------------------------------------------------------------------------
>>
>> _______________________________________________
>> Nagios-devel mailing list
>> Nagios-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/nagios-devel
--
Ethan Galstad,
Nagios Developer
---
Email: nagios at nagios.org
Website: http://www.nagios.org
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
More information about the Developers
mailing list