Ad Widget

Collapse

Help with mqqt and zabbix agent2

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • s1979
    Junior Member
    • Jan 2024
    • 1

    #1

    Help with mqqt and zabbix agent2

    Hi,
    I've searched for solutions how to monitor home automation items from mqqt with zabbix but I have some first steps problems so please can someone point me to right direction?

    Here is my setup and wishes:
    I have OpenHabian with Mqqt and Grafana on same Debian linux VM on my NAS to monitor and automate some home stuff. That is wotking fine. Now I installed Zabbix appliance 6.0LTS on separate VM as Zabbix server to monitor some other devices via SNMP. My idea is to connect that Zabbix server to mqqt on my OpenHabian server to collect informations from sensors and put that info on graphs, as Zabbix looks better for that than Grafana.

    I found that zabbix-agent2 have built-in addon for mqqt so I will try to use that. But, problem is that documentation how to actually use it lacks some basic informarions about it...or I don't understand it.
    So here are some questions:
    - in my setup, where do I install zabbix-agent2 ? On my OpenHabian server, or on Zabbix server itself (as it is downloaded as appliance, it does not contain agent2)
    - i tried install agent2 on OpenHabian server and add it to Zabbix server, but Zabbix does not even recognize that agent is installed on OpenHabian host
    - mqqt.config for zabbix-agent2 is not so clear for me what exactly and how to configure as I cannot found any real example. https://www.zabbix.com/integrations/mqtt is not helpfull as there is no working examples so for example, I don't know what <session_name> means and to what should it match; what "Plugins.MQTT.Sessions.<session_name>.Topic" parameter should look like, and should all parameters be in some qoutes or not?

    So, let say that I've have this thing configured in my OpenHabian:

    Thing topic ikeasens_1 "IKEA Sensor #1" {
    Channels:
    Type number : pm25 "IKEASens1 PM25" [stateTopic="tele/tasmota_DBCEE1/SENSOR", transformationPattern="JSONPATH:$['VINDRIKTNING']['PM2.5']"]

    So how would I need to configure Zabbix and zabbix agent2 (and where) to get that data on Zabbix graph?

    Thanks in advance.​
  • cyber
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Dec 2006
    • 4807

    #2

    https://www.zabbix.com/documentation...ns/mqtt_plugin contains a bit more info maybe...
    As Long as I see, that <session_name> is just a "name", however you want to call that particular session. It just helps you to distinguish between different sessions you may have. If you have just one connection there, you may not even need those sessions.

    When you get your agent configured (does not really matter is it on your server or OH, but it would be easier on the server)... you need to configure your items (mqtt.get[...], I would assume, mqtt.get["tcp://<your debian VM>:1883","tele/tasmota_DBCEE1/SENSOR"​). Assign them to that host, which is going to be the poller and then you should get your data... Visible under "latest data". Graphs can be added to Dashboard. Thats really general approach, how things work in Zabbix... I have not done anything with any mqtt thing..:P

    Comment


    • roteki
      roteki commented
      Editing a comment
      i have found this file /etc/zabbix/zabbix_agent2.d/plugins.d/mqtt.conf in which i have configured the options, then idk how to continue the configuration, I have read https://www.zabbix.com/fr/integrations/mqtt#mqtt but I couldn't understand quite well what must I do next
      if you can tell me please in details how to configure the plugin
      I'm using zabbix 7.0.5 btw
      Last edited by roteki; 03-12-2024, 18:07.
Working...