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 :
It seems that ip is never instanciate. What do you think? Is it normal?
Thanks for your help.
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));
}
}
}
Thanks for your help.

Comment