Ad Widget

Collapse

Zabbix Trapper, Debian

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hollo
    Junior Member
    • Oct 2007
    • 20

    #1

    Zabbix Trapper, Debian

    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?
    Attached Files
  • hollo
    Junior Member
    • Oct 2007
    • 20

    #2
    Fix

    Hmm... im kind of disappointed about the respons on this forum.. but anyway.. i like the software...

    here is the fix... actually you should be able to find the solution in from the info that i have:

    the thing that i did wrong was i did NOT use the Host Name, as the help message said.. but somehow i got confused.. so i would like to request the developers to change the text from:

    zabbix_sender --help to,

    -s --host <Hostname> Specify host name. Host IP address and DNS name will NOT work.

    so for everyone, remember you have to specify the HOST NAME that you specify in the host list, and not the HOSTNAME for the actually computer... unless that it the same

    bye

    Comment

    Working...