Hi,
I have a problem with sending data with zabbix_sender, i will try to explain what i have figured out so far, but i better start with that i have installed zabbix-server-mysql from a debian repository:
i want to push data to my zabbix server from my clients... so now im trying to get zabbix_sender to send data to a zabbix trapper item.
i have the whole setup running on a single host, to make sure that i have made no fun stuff with my firewall..
in use of sending data, i found a sample in the zabbix wiki, i think that this will be the most plain way to send data:
---------------------------
#!/usr/bin/perl -w
use IO::Socket;
use MIME::Base64;
sub zabbix_sender
{
my ($zabbixserver,$hostname,$item,$data) = @_;
my ($result);
my $request=sprintf("<req>\n<host>%s</host>\n<key>%s</key>\n<data>%s</data>\n</req>\n",
encode_base64($hostname),encode_base64($item),enco de_base64($data));
my $sock = new IO::Socket::INET ( PeerAddr => $zabbixserver, PeerPort => '10051', Proto => 'tcp');
die "Could not create socket: $!\n" unless $sock;
$sock->send($request);
$sock->recv($result,1024);
$sock->close();
print "Answer from zabbix server $zabbixserver: $result\n";
}
zabbix_sender('10.1.1.5','marge.example.com','pfr' ,'22');
---------------------------
on the attached image, you can see how i have configured my server...
also with the following command, you can see that my trapper is up and running:
wiki:/home/2fast# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:zabbix_agent *:* LISTEN
tcp 0 0 10.1.1.5:zabbix_trap *:* LISTEN
i hope that someone can get my any closer to a solution, i have read pretty much about this topic, but it does not seems like a big problem to people, so i wonder if it has to do with the debian repository, so again.. have anyone with debian server got a zabbix_sender to work?
or are there anyone how has a hint of what i can do to get it to work?
I have a problem with sending data with zabbix_sender, i will try to explain what i have figured out so far, but i better start with that i have installed zabbix-server-mysql from a debian repository:
i want to push data to my zabbix server from my clients... so now im trying to get zabbix_sender to send data to a zabbix trapper item.
i have the whole setup running on a single host, to make sure that i have made no fun stuff with my firewall..
in use of sending data, i found a sample in the zabbix wiki, i think that this will be the most plain way to send data:
---------------------------
#!/usr/bin/perl -w
use IO::Socket;
use MIME::Base64;
sub zabbix_sender
{
my ($zabbixserver,$hostname,$item,$data) = @_;
my ($result);
my $request=sprintf("<req>\n<host>%s</host>\n<key>%s</key>\n<data>%s</data>\n</req>\n",
encode_base64($hostname),encode_base64($item),enco de_base64($data));
my $sock = new IO::Socket::INET ( PeerAddr => $zabbixserver, PeerPort => '10051', Proto => 'tcp');
die "Could not create socket: $!\n" unless $sock;
$sock->send($request);
$sock->recv($result,1024);
$sock->close();
print "Answer from zabbix server $zabbixserver: $result\n";
}
zabbix_sender('10.1.1.5','marge.example.com','pfr' ,'22');
---------------------------
on the attached image, you can see how i have configured my server...
also with the following command, you can see that my trapper is up and running:
wiki:/home/2fast# netstat -l
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address Foreign Address State
tcp 0 0 *:zabbix_agent *:* LISTEN
tcp 0 0 10.1.1.5:zabbix_trap *:* LISTEN
i hope that someone can get my any closer to a solution, i have read pretty much about this topic, but it does not seems like a big problem to people, so i wonder if it has to do with the debian repository, so again.. have anyone with debian server got a zabbix_sender to work?
or are there anyone how has a hint of what i can do to get it to work?

Comment