Sending Arduino data to Zabbix ( zabbixsender / zabbixtrapper)

Hello Zabbix users
I find a way to send data straight from the arduino to zabbix.
I tested it with zabbix version 2.0

Make a host named : “arduinocounter” with item : “counter” of type “Zabbix Trapper” Type of information “Numeric”

copy/past the code below , change ip’s

//*****************************************************************************************
//* Purpose : Zabbix Sender *
//* Author : Schotte Vincent *
//
//
// we are going to send a counter to zabbix
//
// create a hostname : arduinocounter
// item/key : counter Type : Zabbix trapper
// Type of Information : Numeric
//

//-----------------INCLUDES--------------------
#include <SPI.h>
#include <Ethernet.h>
#include <Base64.h>

//--------------------------------------------
byte mac = { 0xDE, 0xAA, 0xBB, 0xEF, 0xFE, 0x92 };

IPAddress ip(192, 168, 1, 92); // ip address arduino
IPAddress gateway(255, 255, 255, 1);
IPAddress subnet(192, 168, 1, 1);

IPAddress zabbix(192,168,1,142); // you’re zabbix server

char host = “arduinocounter”; // hostname zabbix
char base64host[200];

char key1 = “counter”; // item zabbix
char base64key1[200];

char value1[10]; // value of counter
char base64value1[200];

int counter;

EthernetClient zabclient ;

void setup()
{

counter = 1 ; // init the counter
Ethernet.begin(mac, ip, gateway, subnet);
Serial.begin(9600);
}

void loop()

{
sendzabbix(); // send counter value to zabbix
delay(60000); // wait one minute
counter = counter + 1;

}

//--------------------------------------------

void sendzabbix()
{
if (zabclient.connect(zabbix,10051))
{
base64_encode(base64host , host , sizeof(host)-1);
base64_encode(base64key1 , key1 , sizeof(key1)-1);

itoa(counter,value1,10); // transform int to char

base64_encode(base64value1 , value1 , sizeof(value1)-1);

Serial.println(“Connected with zabbix , sending info”);

zabclient.write("\n");
zabclient.write(" “);
zabclient.write(base64host);
zabclient.write(”\n");
zabclient.write(" “);
zabclient.print(base64key1);
zabclient.write(”\n");
zabclient.write(" “);
zabclient.write(base64value1);
zabclient.write(”\n");
zabclient.write("\n");
delay(1);
zabclient.stop();
}
}

// end of code , have fun

Arduinovini:
Hello Zabbix users
I find a way to send data straight from the arduino to zabbix.
I tested it with zabbix version 2.0

Make a host named : “arduinocounter” with item : “counter” of type “Zabbix Trapper” Type of information “Numeric”

copy/past the code below , change ip’s

//*****************************************************************************************
//* Purpose : Zabbix Sender *
//* Author : Schotte Vincent *
//
//
// we are going to send a counter to zabbix
//
// create a hostname : arduinocounter
// item/key : counter Type : Zabbix trapper
// Type of Information : Numeric
//

//-----------------INCLUDES--------------------
#include <SPI.h>
#include <Ethernet.h>
#include <Base64.h>

//--------------------------------------------
byte mac = { 0xDE, 0xAA, 0xBB, 0xEF, 0xFE, 0x92 };

IPAddress ip(192, 168, 1, 92); // ip address arduino
IPAddress gateway(255, 255, 255, 1);
IPAddress subnet(192, 168, 1, 1);

IPAddress zabbix(192,168,1,142); // you’re zabbix server

char host = “arduinocounter”; // hostname zabbix
char base64host[200];

char key1 = “counter”; // item zabbix
char base64key1[200];

char value1[10]; // value of counter
char base64value1[200];

int counter;

EthernetClient zabclient ;

void setup()
{

counter = 1 ; // init the counter
Ethernet.begin(mac, ip, gateway, subnet);
Serial.begin(9600);
}

void loop()

{
sendzabbix(); // send counter value to zabbix
delay(60000); // wait one minute
counter = counter + 1;

}

//--------------------------------------------

void sendzabbix()
{
if (zabclient.connect(zabbix,10051))
{
base64_encode(base64host , host , sizeof(host)-1);
base64_encode(base64key1 , key1 , sizeof(key1)-1);

itoa(counter,value1,10); // transform int to char

base64_encode(base64value1 , value1 , sizeof(value1)-1);

Serial.println(“Connected with zabbix , sending info”);

zabclient.write("\n");
zabclient.write(" “);
zabclient.write(base64host);
zabclient.write(”\n");
zabclient.write(" “);
zabclient.print(base64key1);
zabclient.write(”\n");
zabclient.write(" “);
zabclient.write(base64value1);
zabclient.write(”\n");
zabclient.write("\n");
delay(1);
zabclient.stop();
}
}

// end of code , have fun

i have ardunio uno R3 and arduino wiznet w5100 shield.

I try this and there is no effect.

I never seen this…
Serial.println(“Connected with zabbix , sending info”);

Zabbix(2.4.5) server host,key is configured properly as:
zabbix trapper, numeric, host have same name.

My net settings…

IPAddress ip(192, 168, 0, 111); // ip address arduino
IPAddress gateway(192, 168, 0, 1);
IPAddress subnet(255, 255, 255, 0);
IPAddress zabbix(188,120,XXX,195); // you’re zabbix server

0.111 have ping answer… And i have no idea WHAT IS THIS?

Pls help me!

Mb anybody have complete zabbix passive agent…

best regards!
z00m4eGG