Ad Widget

Collapse

Howto create a deep link to show latest data for given hostname?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Thomas1000
    Junior Member
    • Oct 2024
    • 2

    #1

    Howto create a deep link to show latest data for given hostname?

    Hi!
    My company decided to user Grafana as the main display tool (please don't start a discussion about this).
    No I want to use a Grafana data-link to display this host in Zabbix. In Grafana I can only access the hostname, which is something like "my.host123.mydomain.com". Zabbix knows this host, but so far I only managed to display a host in zabbix by host-ID, but Grafana seems not to deal with Zabbix-Host-IDs.

    My experiments with

    https://zabbix.myhost.de/zabbix.php?action=latest.view&filter_hosts=var-Group=All&var-Host=my.host123.mydomain.com

    failed as zabbix shows just the Latest data from some other (the first known) host as a result.

    Does anyone know how to create a deep link into the latest data from a given host with the hostname as a parameter?

    Thanks in advance and greetings from Germany

    Thomas
  • Thomas1000
    Junior Member
    • Oct 2024
    • 2

    #2
    Hello folks?!

    Anybody out there? Is my question that exotic?!

    https://zabbix.myhost.de/zabbix.php?action=latest.view&filter_hosts=my.host .123.mydomain.com

    does not work - any ideas how I could create a deeplink to zabbix?

    Thanks in advance

    Thomas

    Comment

    • ISiroshtan
      Senior Member
      • Nov 2019
      • 324

      #3
      I don't believe you can substitute host.id by hostname in latest.view. Similarly I don't believe grafana plugin to work with Zabbix exposes host.id.

      But I can suggest alternative. Use "action=host.view" instead of "action=latest.view". True - it does not lead directly to latest data information, but it will be a host overview, having links to all of "latest data"/graphs/problems/dashboards". And it accepts hostname in url, as it does search by hostname and not opens data directly by host.id.

      Thinking about it, I would argue the host overview option might end up better then just dropping user into latest data in quite a few cases

      Comment

    • ISiroshtan
      Senior Member
      • Nov 2019
      • 324

      #4
      Right, sorry, my bad
      It seems it should be "&name=my-host". So something like this works on my setup:"https://myzabbix.company.com/zabbix.php?name=myhost-5&action=host.view"

      Also in our setup we use visible name field on hosts, so the value supplied should be a visible name. If you don't use visible name in Zabbix - then the hostname should do the trick.

      Comment


      • Thomas1000
        Thomas1000 commented
        Editing a comment
        Thanks a lot! That did the trick - so easy...

        Now I can jump via link directly to the Hosts-Page, where the Name-Filter shows just the host I set via parameter in the URL - great!

        Do you have an Idea how to display "latest data" like that? Here the Parameter Name sets the wrong filter. Using "host" or "hosts" instead of "name" as parameter-name doesn't work.

        Any trick to accomplish that?!

        Thanks in advance

        Thomas
        Last edited by Thomas1000; 19-11-2024, 10:31. Reason: one more thing...
    • ISiroshtan
      Senior Member
      • Nov 2019
      • 324

      #5
      As I was mentioning in my original message, it's an alternative to what you try to achieve. I don't believe you can do same with latest data as it is select based on hostID, and Zabbix plugin for Grafana seemingly does not expose said information.

      Comment

      Working...