|
From: Jean-Baptiste M. <jbm...@pr...> - 2003-08-04 14:30:02
|
Hi !
I tried to execute zabbix_sender in a short C program : here is the source.
#include <stdio.h>
#include <unistd.h>
int main(int argc, char* argv[])
{
int i;
i =
execl("/usr/local/zabbix/bin/zabbix_sender","192.168.128.208","10001","Tests:trap","foo",NULL);
printf("%d\n",i);
return 0;
}
I compile it with gcc and then I execute it.
Here is the error I get :
Boul6m:/home/mariotte# ./trap2zabbix
Usage: zabbix_sender <Zabbix server> <port> <server:key> <value>
If no arguments are given, zabbix_sender expects list of parameters
from standard input.
It is as if I made a mistake typing the command.
But when I type it directly in the shell, no problem, I receive a "OK"
and it is correctly transmited in Zabbix :
Boul6m:/home/mariotte# /usr/local/zabbix/bin/zabbix_sender
192.168.128.208 10001 Traps:trap "foo"
OK
I think the error comes from zabbix_sender, that's why I'm telling you.
Thanks for your help,
Jean-Baptiste
|