Skip to content

Commit

Permalink
add log
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdeface committed Sep 16, 2021
1 parent e3630a0 commit a928c50
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
14 changes: 7 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,16 @@ To send data you should make http Get request with these query parameters: ["ser
```

### (launch parameters) Параметры запуска

Таблица ниже отображает доступные параметры запуска и их приоритеты.

The table bellow shows possible launch parameters and their priority.

| Highest priority | Middle priority | Lowest priority | Description |
|------------------------|---------------------|-------------------|---------------------------|
| **Command parameters** | **Env variables** | **Predefined values** | |
| zabbix-server | ZABBIX_SERVER | 127.0.0.1 | set zabbix server address |
| zabbix-port | ZABBIX_PORT | 10051 | set zabbix server port |
| http-port | HTTP_PORT | 8080 | http server port |
| Highest priority | Middle priority | Lowest priority | Description |
|--------------------------|---------------------|-----------------------|---------------------------|
| **Cmd arguments** | **Env variables** | **Predefined values** | |
| --zabbix-server | ZABBIX_SERVER | 127.0.0.1 | set zabbix server address |
| --zabbix-port | ZABBIX_PORT | 10051 | set zabbix server port |
| --http-port | HTTP_PORT | 8080 | http server port |

### Прием данных в zabbix
Просто создайте элемент данных с типом zabbix trapper. Трапперы используются для приема данных которые пушатся из вне,
Expand Down
Binary file modified dist/zabbix-http
Binary file not shown.
Binary file modified dist/zabbix-http.exe
Binary file not shown.
2 changes: 2 additions & 0 deletions internal/zabbix/zabbix.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package zabbix
import (
"encoding/binary"
"encoding/json"
"log"
"time"
)

Expand Down Expand Up @@ -63,6 +64,7 @@ func (zp *Packet) Prepare() []byte {
}
func (zp *Packet) ResponseDecode(response []byte) []byte {
if len(response) <= HeaderLength+DataLength {
log.Printf("%v", response)
return response
}
return response[HeaderLength+DataLength:]
Expand Down

0 comments on commit a928c50

Please sign in to comment.