summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/zabbix_sucker/zabbix_sucker.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/zabbix_sucker/zabbix_sucker.c b/src/zabbix_sucker/zabbix_sucker.c
index aadd770b..895e6727 100644
--- a/src/zabbix_sucker/zabbix_sucker.c
+++ b/src/zabbix_sucker/zabbix_sucker.c
@@ -263,7 +263,14 @@ int get_value_SNMPv1(double *result,DB_ITEM *item)
* */
snmp_sess_init( &session ); /* set up defaults */
session.version = SNMP_VERSION_1;
- session.peername = item->host;
+ if(item->useip==1)
+ {
+ session.peername = item->ip;
+ }
+ else
+ {
+ session.peername = item->host;
+ }
session.community = item->snmp_community;
session.community_len = strlen(session.community);