Ad Widget

Collapse

Agent 1.4 net.if item supported if dont exist

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • juampe
    Junior Member
    • Apr 2007
    • 17

    #1

    Agent 1.4 net.if item supported if dont exist

    Using templates, I supose if a element don't exist agent returns ZBX_NOTSUPPORTED
    and ZBX forget it. But I found a case that agent returns some trash and the item is showed as supported.
    The followting host does not have cip0 or hme0, but eri0 does

    SunOS asra1 5.9 Generic_118558-06 sun4u sparc SUNW,Sun-Fire-280R

    root@asra1:[13:34:59]:/#zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf -t agent.version
    agent.version [s|1.4]

    root@asra1:[13:29:11]:/#ifconfig -a
    lo0: flags=1000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4> mtu 8232 index 1
    inet 127.0.0.1 netmask ff000000
    eri0: flags=1000843<UP,BROADCAST,RUNNING,MULTICAST,IPv4> mtu 1500 index 2
    inet 192.168.134.12 netmask ffffff00 broadcast 192.168.134.255
    ether 0:3:ba:16:e5:50
    root@asra1:[13:29:27]:/#zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf -t net.if.out[cip0,bytes]
    net.if.out[cip0,bytes] [u|4290759072] [m|ZBX_NOTSUPPORTED]
    root@asra1:[13:35:17]:/#zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf -t net.if.out[hme0,bytes]
    net.if.out[hme0,bytes] [u|4290759072] [m|ZBX_NOTSUPPORTED]
    root@asra1:[13:31:34]:/#zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf -t net.if.out[eri0,bytes]
    net.if.out[eri0,bytes] [u|66873639671]
    Last edited by juampe; 11-06-2007, 10:35.
  • juampe
    Junior Member
    • Apr 2007
    • 17

    #2
    Only for SunOS

    The problem is only fo SunOS

    root@sira:[13:50:02]:/$ uname -a
    Linux sira 2.6.18-3-686 #1 SMP Thu Nov 23 20:49:23 UTC 2006 i686 GNU/Linux
    root@sira:[13:50:37]:/$ zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf -t net.if.out[hme0,bytes]
    net.if.out[hme0,bytes] [m|ZBX_NOTSUPPORTED]
    root@sira:[13:51:06]:/$ zabbix_agentd -c /etc/zabbix/zabbix_agentd.conf -t net.if.out[eth0,bytes]
    net.if.out[eth0,bytes] [u|2767286527]

    Comment

    • juampe
      Junior Member
      • Apr 2007
      • 17

      #3
      I neet someone help me to dig into source

      I believe tha the following code is related to the problem.I dig into it an aparently is all OK.
      libs/zbxsysinfo/solaris/solaris.c
      libs/zbxsysinfo/solaris/net.c

      Someone can give me a quick workflow about how agent get and print a item?

      Comment

      • juampe
        Junior Member
        • Apr 2007
        • 17

        #4
        gdb to the problem

        I'm going closer to the problem's root.
        The unwised output comes from gdb 314 if(result.type & AR_UINT64) in zbxsysinfo/sysinfo.c

        (result.type & AR_UINT64) and (result.type & AR_MESSAGE) are true at the same time

        process (in_command=0x374b8 "net.if.out[eri0]", flags=1, result=0xffbfe7f0) at sysinfo.c:517
        517 if(err == SYSINFO_RET_FAIL)
        (gdb)
        525 err = NOTSUPPORTED;
        (gdb)
        528 if(flags & PROCESS_TEST)
        (gdb)
        530 printf("%s", usr_cmd);
        (gdb)
        531 if(commands[i].flags & CF_USEUPARAM)
        (gdb)
        535 } else i = 0;
        (gdb)
        533 printf("[%s]", param);
        (gdb)
        534 i = (int)strlen(param)+2;
        (gdb)
        536 i += (int)strlen(usr_cmd);
        (gdb)
        539 i = i > COLUMN_2_X ? 1 : (COLUMN_2_X - i);
        (gdb)
        536 i += (int)strlen(usr_cmd);
        (gdb)
        539 i = i > COLUMN_2_X ? 1 : (COLUMN_2_X - i);
        (gdb)
        541 printf("%-*.*s", i, i, " "); /* print spaces */
        (gdb)
        544 if(err == NOTSUPPORTED)
        (gdb)
        546 if(!(result->type & AR_MESSAGE))
        (gdb)
        548 SET_MSG_RESULT(result, strdup("ZBX_NOTSUPPORTED"));
        (gdb)
        550 ret = NOTSUPPORTED;
        (gdb)
        562 }
        (gdb)
        test_parameter (key=0xfffffffe <Address 0xfffffffe out of bounds>) at sysinfo.c:310
        310 if(result.type & AR_DOUBLE)
        (gdb)
        314 if(result.type & AR_UINT64)
        (gdb)
        316 printf(" [u|" ZBX_FS_UI64 "]", result.ui64);
        (gdb)
        318 if(result.type & AR_STRING)
        (gdb)
        322 if(result.type & AR_TEXT)
        (gdb)
        326 if(result.type & AR_MESSAGE)
        (gdb)
        328 printf(" [m|%s]", result.msg);
        (gdb)
        331 free_result(&result);
        (gdb)
        332 printf("\n");
        (gdb)
        net.if.out[eri0] [u|0] [m|ZBX_NOTSUPPORTED]
        334 fflush(stdout);

        Comment

        • juampe
          Junior Member
          • Apr 2007
          • 17

          #5
          Patch for unknow-not supported net device in solaris

          This fix the problem exposed
          Attached Files

          Comment

          Working...