[ZBX-10126] Fail on sensors.c when compiling on linux 2.4.x kernel Created: 2015 Nov 30  Updated: 2017 May 30  Resolved: 2015 Dec 13

Status: Closed
Project: ZABBIX BUGS AND ISSUES
Component/s: Agent (G)
Affects Version/s: 2.4.7
Fix Version/s: 2.2.12rc1, 2.4.8rc1, 3.0.0alpha5

Type: Incident report Priority: Blocker
Reporter: Javier Barroso Assignee: Unassigned
Resolution: Fixed Votes: 0
Labels: regression, sensors
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Attachments: File ZBX-10126.patch    

 Description   

Hello,

Trying to compile on Suse 8.1 (kernel 2.4.19-64GB-SMP)
I had to copy sensor.c from zabbix 2.0.4 (the version that was installed before than 2.4.7), and modify include/sysinfo.h like it is show in next quote:

# diff zabbix-2.4.7/include/sysinfo.h zabbix-2.4.7-mod/include/sysinfo.h
213c213,214
< int	GET_SENSOR(AGENT_REQUEST *request, AGENT_RESULT *result);
---
> int	GET_SENSOR(const char *cmd, const char *param, unsigned flags, AGENT_RESULT *result);
> /*int	GET_SENSOR(AGENT_REQUEST *request, AGENT_RESULT *result);*/

I have not the log , but it was telling about "locations" was not found , more or less

Thank you



 Comments   
Comment by Volker Fröhlich [ 2015 Nov 30 ]

Maybe a regression from ZBX-8899?

Comment by Aleksandrs Saveljevs [ 2015 Nov 30 ]

Tried it on our Linux 2.4 and this is the actual compilation error message:

sensors.c: In function `sysfs_read_attr':
sensors.c:97: `locations' undeclared (first use in this function)
sensors.c:97: (Each undeclared identifier is reported only once
sensors.c:97: for each function it appears in.)
Comment by Aleksandrs Saveljevs [ 2015 Nov 30 ]

This is indeed a regression from ZBX-8899. Thanks for the pointer, Volker!

Comment by Glebs Ivanovskis (Inactive) [ 2015 Dec 01 ]

Fix is very simple. Functions sysfs_read_attr() and get_device_info() in sensors.c are used for kernel > 2.6 related code only, therefore should be placed inside

#ifndef KERNEL_2_4
...
#endif

I tried not to affect kernel 2.4 related code as hard as I could, but apparently sensors.c is way too complicated and I failed. Please consider voting for ZBXNEXT-2929 if you are interested in sensor monitoring.

Attached the patch.

Comment by Glebs Ivanovskis (Inactive) [ 2015 Dec 02 ]

Fix for version 2.2 is available in development branch svn://svn.zabbix.com/branches/dev/ZBX-10126-22 revision 56960.

Comment by Aleksandrs Saveljevs [ 2015 Dec 04 ]

Please take a look at #if fix in r57014 before merging.

Comment by Glebs Ivanovskis (Inactive) [ 2015 Dec 04 ]

Fixed in pre-2.2.12rc1 r57016, pre-2.4.8rc1 r57018, pre-3.0.0alpha5 (trunk) r57019.

Generated at Thu Apr 25 08:16:52 EEST 2024 using Jira 9.12.4#9120004-sha1:625303b708afdb767e17cb2838290c41888e9ff0.