Ad Widget

Collapse

PATCH: openfiles support for Linux

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Petya
    Member
    • Dec 2007
    • 37

    #1

    PATCH: openfiles support for Linux

    Patch against trunk but could be easily adopted for older versions.

    Together with support for openfiles under Linux
    it contains fix for obvious typo:

    Index: C:/myprj/zabbix.com/trunk/src/libs/zbxsysinfo/linux/kernel.c
    ================================================== =================
    --- C:/myprj/zabbix.com/trunk/src/libs/zbxsysinfo/linux/kernel.c (revision 5756)
    +++ C:/myprj/zabbix.com/trunk/src/libs/zbxsysinfo/linux/kernel.c (working copy)
    @@ -36,7 +36,7 @@

    if(NULL != ( f = fopen("/proc/sys/fs/file-max","r") ))
    {
    - if(fgets(line,MAX_STRING_LEN,f) != NULL);
    + if(fgets(line,MAX_STRING_LEN,f) != NULL)
    {
    if(sscanf(line,ZBX_FS_UI64 "\n", &value) == 1)
    {
    Attached Files
  • otheus
    Member
    • Mar 2009
    • 53

    #2
    This seems to work in Zabbix 1.6.3 for Kernels 2.6.9 and greater. What does not work is "kernel.maxproc". The definition of that can be found in the same source file, around line 68:

    Code:
            mib[0]=CTL_KERN;
            mib[1]=KERN_MAXPROC;
    
            len=sizeof(maxproc);
    
            if(sysctl(mib,2,&maxproc,(size_t *)&len,NULL,0) != 0)
    In my linux/sysctl.h, that parameter (KERN_MAXPROC) does not appear. These do, however:
    Code:
            KERN_PIDMAX=55,         /* int: PID # limit */
            KERN_MAX_THREADS=39,    /* int: Maximum nr of threads in the system */
    I imagine the "interesting" number is the lesser of these two.

    Autoconfigure seems to my think it has "KERN_MAXPROC" even when it does not.

    Comment

    Working...