Ad Widget

Collapse

Graph from Screen on external page

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • shabo
    Junior Member
    • May 2006
    • 6

    #1

    Graph from Screen on external page

    Hi,

    Just wanted to include some graph from zabbix screen but it says that no permissions if I am not logged in. How can I bypass this issue ?

    I want to show some graphs from zabbix to users that have no account in zabbix on internal information page.

    Any help greatly appreciated.

    Regards,
    Lukasz
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #2
    You must set the guest user to have permissions to that host. Go to Administration->users select groups from the dropdown and select the guest group, then click on user rights (show).

    Ok this is tricky and someone please correct me where I'm wrong. You can only add host groups to the permissions. Individual hosts that are not part of a group cannot be added.

    With that said say you have a host "system" and it's part of "somegroup". If you add read only permissionis to the group "guest" for "somegroup" you will be able to view all host related data for that group. However if you have a graph which takes some items from "system" and "anothersystem" yet "anothersystem" is not part of the group "somegroup" you will be given a permissions denied error on the graph as you do not have permissions for "anothersystem". I have not tried this, but that's my understanding of the source code.

    Ok hopefully I'm making some sense. Now for something really cool with your embedded graph. If you take the URL to the graph and append &fullscreen=1 you will now get only the graph, no header, no footer. It's quite nice!

    Hope this helps point you in the right direction.
    RHCE, author of zbxapi
    Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
    Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

    Comment

    • shabo
      Junior Member
      • May 2006
      • 6

      #3
      thanks for the hints. i will try it tomorrow as i am at home right now

      cheers

      Comment

      • rolandsym
        Member
        • Jul 2007
        • 76

        #4
        Question

        Is there a way just to grab the PNG from this or is that asking to much? Would that be calling a particular function? This would be a great way to pop something in screens just don't need the tool bars.

        Rolandsym

        Comment

        • nelsonab
          Senior Member
          Zabbix Certified SpecialistZabbix Certified Professional
          • Sep 2006
          • 1233

          #5
          I don't see why you can't just point to the code that generates your graphs. If you look at the source for the page, or properties for the graph you'll see a link to chart2.php or some other chart related function. I would suggest you append "fullscreen=1" instead and use it in an iframe or something. That will give you only the selection dropdown if applicable and the time selection dropdowns if applicable.
          RHCE, author of zbxapi
          Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
          Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

          Comment

          • rolandsym
            Member
            • Jul 2007
            • 76

            #6
            works great

            Did that and it works great in the screens. I'd rather not have the drop downs in the final result. In the end, my "want" is just personal aesthetics. I appreciate your post. It helped. My eyes skipped over the php form url results.

            Rolandsym

            Comment

            • nelsonab
              Senior Member
              Zabbix Certified SpecialistZabbix Certified Professional
              • Sep 2006
              • 1233

              #7
              One thing to be careful of is that you have the proper permissions set for that graph. If you open zabbix and log in then surf over to your custom overview or whatever page all will be good as you'll be using your logged in session. However if you use a different machine or one that isn't logged into zabbix first you'll get a permissions error unless guest has access to the hosts referenced by the graph.
              RHCE, author of zbxapi
              Ansible, the missing piece (Zabconf 2017): https://www.youtube.com/watch?v=R5T9NidjjDE
              Zabbix and SNMP on Linux (Zabconf 2015): https://www.youtube.com/watch?v=98PEHpLFVHM

              Comment

              Working...