Ad Widget

Collapse

Probleme with an SNMP type

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Brice.F
    Junior Member
    • Jun 2006
    • 9

    #1

    Probleme with an SNMP type

    Hello,

    Recently i configured zabbix in order to get some some SNMP data on an embed system. When i try to get an IPAddress Type Information (ex : 1.3.6.1.2.1.4.20.1.1.127.0.0.1), i obtain random information (ex: 0.0.0.0)

    When i check sources i sawsomething strange in poller/checks_snmp.c line 350 :
    Code:
    			else if(vars->type == ASN_IPADDRESS)
    			{
    /*				ip = vars->val.string;
    				snprintf(result_str,MAX_STRING_LEN-1,"%d.%d.%d.%d",ip[0],ip[1],ip[2],ip[3]);*/
    /*				if(item->type == 0)
    				{
    					ret = NOTSUPPORTED;
    				}*/
    				if(item->value_type != ITEM_VALUE_TYPE_STR)
    				{
    					snprintf(error,MAX_STRING_LEN-1,"Cannot store SNMP string value (ASN_IPADDRESS) in item having numeric type");
    					zabbix_log( LOG_LEVEL_ERR, error);
    					SET_MSG_RESULT(value, strdup(error));
    					ret = NOTSUPPORTED;
    				}
    				else
    				{
    					p = malloc(16);
    					if(p)
    					{
    						snprintf(p,MAX_STRING_LEN-1,"%d.%d.%d.%d",ip[0],ip[1],ip[2],ip[3]);
    
    						SET_STR_RESULT(value, p);
    					}
    					else
    					{
    						snprintf(error,MAX_STRING_LEN-1,"Cannot allocate required memory");
    						zabbix_log( LOG_LEVEL_ERR, error);
    						SET_MSG_RESULT(value, strdup(error));
    					}
    				}
    			}
    It seems that ip is never instanciate. What do you think? Is it normal?

    Thanks for your help.
  • Alexei
    Founder, CEO
    Zabbix Certified Trainer
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2004
    • 5654

    #2
    Sorry, I do not understand you question.
    Alexei Vladishev
    Creator of Zabbix, Product manager
    New York | Tokyo | Riga
    My Twitter

    Comment

    • Brice.F
      Junior Member
      • Jun 2006
      • 9

      #3
      I want to poll an snmp value which type is "IpAddress" or ANS_IPADDRES. It displays random data (instead or receiving 127.0.0.1 i had 0.0.0.0 or worst).

      I think that maybe zabbix_server don't poll Ip Address well. In source we have this :
      snprintf(p,MAX_STRING_LEN-1,"%d.%d.%d.%d",ip[0],ip[1],ip[2],ip[3]);

      But i don't see when ip var is intantiate. So before to submt a bug i want to know where it occurs. I hope it's clearer

      Brice Favre

      Comment

      Working...