viniciusbo / zabbix-emqtt Goto Github PK
View Code? Open in Web Editor NEWZabbix monitoring for EMQTT
Zabbix monitoring for EMQTT
Isn't there supposed to be a shell script & command in the agent.conf
?
Hello, I'm trying to fix this to work with current API v3. https://github.com/elcreator/zabbix-emqtt/blob/master/externalscripts/emqtt.sh
Currently it correctly parses the values from the first (and single one for me) node in the cluster.
Problem that I have is when I launch this even manually from the command line
$ zabbix_sender -z 127.0.0.1 -s 127.0.0.1 -k 'emqtt[messages/retained]' -o 3
Response from "127.0.0.1:10051": "processed: 0; failed: 1; total: 1; seconds spent: 0.000018"
sent: 1; skipped: 0; total: 1
it don't works. Trappers was configured and exists, host is reachable and allowed.
jq: error (at :1): Cannot index array with string "result"
what is the reason for this?
My MQTT version is 3.0
My configuration:
stats=$(curl --basic -u "$2:$3" -k -s "http://$4:18083/api/v3/stats/")
metrics=$(curl --basic -u "$2:$3" -k -s "http://$4:18083/api/v3/metrics/")
for key in "${STATS_KEYS[@]}"
do
out="$(jq -r --arg arg "$(printf '%s' $key)" '.result[]|.["emq@'"$1"'"]? | .[$arg]' <<< $stats)"
zabbix_sender -z 127.0.0.1 -s $1 -k "emqtt[$key]" -o $out > /dev/null 2>&1
done
for key in "${METRICS_KEYS[@]}"
do
out="$(jq -r --arg arg "$(printf '%s' $key)" '.result[]|.["emq@'"$1"'"]? | .[$arg]' <<< $metrics)"
zabbix_sender -z 127.0.0.1 -s $1 -k "emqtt[$key]" -o $out > /dev/null 2>&1
done
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.