37
37
init_result(result);
39
zabbix_log( LOG_LEVEL_DEBUG, "In get_value_simple([%s]", item->key);
39
zabbix_log( LOG_LEVEL_DEBUG, "In get_value_simple([%s]",
41
42
if(0 == strncmp(item->key,"service.ntp",11))
43
l=strstr(item->key,"[");
44
r=strstr(item->key,"]");
44
l=strchr(item->key,'[');
45
r=strrchr(item->key,']');
45
46
if(l==NULL || r==NULL)
46
snprintf(c,sizeof(c)-1,"net.tcp.service[%s]",item->key);
47
zbx_snprintf(c,sizeof(c),"net.tcp.service[%s]",
49
51
zbx_strlcpy( param,l+1, r-l-1);
53
snprintf(c,sizeof(c)-1,"net.tcp.service[%s,%s]",item->key,item->ip);
54
zbx_snprintf(c,sizeof(c),"net.tcp.service[%s,%s]",
57
snprintf(c,sizeof(c)-1,"net.tcp.service[%s,%s]",item->key,item->host);
60
zbx_snprintf(c,sizeof(c),"net.tcp.service[%s,%s]",
65
l=strstr(item->key,"[");
66
r=strstr(item->key,"]");
70
l=strchr(item->key,'[');
71
r=strrchr(item->key,']');
67
72
if(l==NULL || r==NULL)
68
snprintf(c,sizeof(c)-1,"%s",item->key);
73
zbx_snprintf(c,sizeof(c),"%s",
71
77
zbx_strlcpy( param,l+1, r-l-1);
73
/* snprintf(c,sizeof(c)-1,"dns[%s,%s]",item->ip,param);*/
74
snprintf(c,sizeof(c)-1,"dns[%s]",param);
78
/* zbx_snprintf(c,sizeof(c),"dns[%s,%s]",item->ip,param);*/
79
zbx_snprintf(c,sizeof(c),"dns[%s]",
79
snprintf(error,MAX_STRING_LEN-1,"You must use IP address in Host %s definition", item->host);
80
zabbix_log( LOG_LEVEL_WARNING, "%s", error);
85
zbx_snprintf(error,sizeof(error),"You must use IP address in Host %s definition",
87
zabbix_log( LOG_LEVEL_WARNING, "%s",
81
89
result->str=strdup(error);
82
90
return NOTSUPPORTED;
113
snprintf(error,MAX_STRING_LEN-1,"Port number must be numeric in [%s]", item->key);
114
zabbix_log( LOG_LEVEL_WARNING, "%s", error);
121
zbx_snprintf(error,sizeof(error),"Port number must be numeric in [%s]",
123
zabbix_log( LOG_LEVEL_WARNING, "%s",
115
125
result->str=strdup(error);
116
126
ret = NOTSUPPORTED;
121
snprintf(error,MAX_STRING_LEN-1,"Too many parameters in [%s]", item->key);
122
zabbix_log( LOG_LEVEL_WARNING, "%s", error);
131
zbx_snprintf(error,sizeof(error),"Too many parameters in [%s]",
133
zabbix_log( LOG_LEVEL_WARNING, "%s",
123
135
result->str=strdup(error);
124
136
ret = NOTSUPPORTED;
146
158
if(port_int == 0)
148
snprintf(c,sizeof(c)-1,"%s[%s,%s]",service_sysinfo,service,ip);
160
zbx_snprintf(c,sizeof(c),"%s[%s,%s]",
152
snprintf(c,sizeof(c)-1,"%s[%s,%s,%d]",service_sysinfo,service,ip,port_int);
167
zbx_snprintf(c,sizeof(c),"%s[%s,%s,%d]",
154
zabbix_log( LOG_LEVEL_DEBUG, "Sysinfo [%s]", c);
173
zabbix_log( LOG_LEVEL_DEBUG, "Sysinfo [%s]",
164
184
if(item->useip==1)
166
snprintf(c,sizeof(c)-1,"net.tcp.service[%s,%s]",item->key,item->ip);
186
zbx_snprintf(c,sizeof(c),"net.tcp.service[%s,%s]",item->key,item->ip);
170
snprintf(c,sizeof(c)-1,"net.tcp.service[%s,%s]",item->key,item->host);
190
zbx_snprintf(c,sizeof(c),"net.tcp.service[%s,%s]",item->key,item->host);
179
199
if(item->useip==1)
181
snprintf(c,sizeof(c)-1,"net.tcp.service.perf[%s,%s]",s,item->ip);
201
zbx_snprintf(c,sizeof(c),"net.tcp.service.perf[%s,%s]",s,item->ip);
185
snprintf(c,sizeof(c)-1,"net.tcp.service.perf[%s,%s]",s,item->host);
205
zbx_snprintf(c,sizeof(c),"net.tcp.service.perf[%s,%s]",s,item->host);
190
210
if(process(c, 0, result) == NOTSUPPORTED)
192
snprintf(error,MAX_STRING_LEN-1,"Simple check [%s] is not supported", c);
193
zabbix_log( LOG_LEVEL_WARNING, "%s", error);
212
zbx_snprintf(error,sizeof(error),"Simple check [%s] is not supported",
214
zabbix_log( LOG_LEVEL_WARNING, "%s",
194
216
result->str=strdup(error);
195
217
ret = NOTSUPPORTED;