Ad Widget

Collapse

Generate Reports

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nelsonab
    Senior Member
    Zabbix Certified SpecialistZabbix Certified Professional
    • Sep 2006
    • 1233

    #16
    An FYI, when you're first testing out your reports, try and limit the data set you're working with. I'm working my way through trying to figure out how to create a line graph and I had to limit my dataset to 100 rows to see that I had it wrong otherwise Jasper seemed to hang as it was spending a whole lot of time processing.
    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

    • abhi238
      Junior Member
      • Aug 2007
      • 15

      #17
      Hi,

      I couldnt understand the value stored in clock field value int(11)

      Usually the date format in mysql is datetime, date ..etc

      The clock field in history table stores a 10 digit number which i could not understand:

      ex.

      +--------+------------+--------+
      | itemid | clock | value |
      +--------+------------+--------+
      | 23775 | 1208235192 | 0.0800 |
      | 23775 | 1208235195 | 0.0800 |


      Thanks
      Abhi

      Comment

      • Aly
        ZABBIX developer
        • May 2007
        • 1126

        #18
        unix timestamp - current time measured in the number of seconds since the Unix Epoch (January 1 1970 00:00:00 GMT)
        Zabbix | ex GUI developer

        Comment

        • Palmertree
          Senior Member
          • Sep 2005
          • 746

          #19
          I use something like this in my mysql query statement in IReports:

          Code:
          SELECT
               hosts.`host` AS hosts_host,
               CONVERT_TZ(FROM_UNIXTIME(trends.`clock`),'+00:00','-05:00') AS trends_clock,
               trends.`value_min` AS trends_value_min,
               trends.`value_avg` AS trends_value_avg,
               trends.`value_max` AS trends_value_max,
               trends.`num` AS trends_num,
               items.`description` AS items_description
          FROM
               `items` items INNER JOIN `trends` trends ON items.`itemid` = trends.`itemid`
               INNER JOIN `hosts` hosts ON items.`hostid` = hosts.`hostid`
          WHERE
               items.`itemid` = "100100000068028"
           AND (FROM_UNIXTIME(trends.`clock`) >= STR_TO_DATE('$P!{Begin_DateTime}','%Y-%c-%d %k:%i:%s.0'))
           AND (FROM_UNIXTIME(trends.`clock`) <= STR_TO_DATE('$P!{End_DateTime}','%Y-%c-%d %k:%i:%s.0'))
          ORDER BY
               CONVERT_TZ(FROM_UNIXTIME(trends.`clock`),'+00:00','-05:00') ASC

          '$P!{Begin_DateTime}' is type java.sql.timestamp and is a parameter with "prompt" turned on. Another words, the user is asked from a pop up prompt starting and ending time using a GUI calendar selection box.
          Last edited by Palmertree; 10-05-2008, 14:36.

          Comment

          • abhi238
            Junior Member
            • Aug 2007
            • 15

            #20
            Is it possible to generate report for a Host Group using a similar query?
            example: If I need to get the most heavily loaded servers in a group of 20 for a week or so ....?

            sorry but its taking me time for understanding the db schema for zabbix
            thanks, I tested the query which works for a single host

            thank you,
            Abhi
            Last edited by abhi238; 12-05-2008, 15:45.

            Comment

            • abhi238
              Junior Member
              • Aug 2007
              • 15

              #21
              Is it possible to generate report for a Host Group using a similar query?
              example: If I need to get the most heavily loaded servers in a group of 20 for a week or so ....?

              sorry but its taking me time for understanding the db schema for zabbix
              thanks, I tested the query which works for a single host

              thank you,
              Abhi

              Comment

              • ericb
                Junior Member
                • Jul 2006
                • 24

                #22
                quick and dirty way is to add the following to your SQL statement.

                you will need to know the host group ID which can be found by looking in the DB at the following tables

                hosts_group
                this assigns hostid to groupid

                groups
                assigns a name to groupid

                or you can find the group id by looking at the url when you are in the zabbix website
                Configuration,Hosts,Host Groups then hover your mouse over the group name and look at the url for groupid=NUMBER

                add the following to your SQL
                SELECT
                hosts_groups.`groupid` AS group_id,
                FROM
                `hosts_groups` host_groups,
                WHERE
                AND hosts_groups.`groupid` = "NUMBER WE GOT FROM EARLIER"

                could probably do with tidying up though with some joins so dont test on your live database
                im using
                INNER JOIN `hosts_groups` hosts_groups ON items.`hostid` = hosts_groups.`hostid`
                instead of
                `hosts_groups` host_groups,
                Last edited by ericb; 26-05-2008, 23:53. Reason: INNER JOIN example

                Comment

                • tighep
                  Senior Member
                  • Dec 2007
                  • 124

                  #23
                  I've been tasked with creating some detailed reports from Zabbix, and I see the solution to be Jasper, but the documentation has been weak to help me get it started. Would someone here who is a bit more experienced be willing to lend a hand in getting it configured?

                  Zabbix 1.5.2
                  RHEL 4
                  MySQL 4.1.20

                  Comment

                  • Palmertree
                    Senior Member
                    • Sep 2005
                    • 746

                    #24
                    Jasper is the reporting engine. There are nice GUI interfaces like IReports that help configure the jasper engine for creating reports. There is a nice manual for ireports and some of the users in the Zabbix forums in this thread have found discounts for the manual online.

                    Comment

                    • abhi238
                      Junior Member
                      • Aug 2007
                      • 15

                      #25
                      Yes I-reports are good and free and you can easily generate reports in pdf/excel formats. But if you need to generate graphs then you may have to buy their documentation.

                      Comment

                      • tangel
                        Junior Member
                        • Feb 2008
                        • 18

                        #26
                        Did anyone make much progress integrating JasperReports and Zabbix? I'm looking for a set of SQL queries to get started...

                        Comment

                        • morhaven
                          Junior Member
                          • Apr 2010
                          • 22

                          #27
                          anyone have a basic instruction how to setup reports with i reports + zabbix.


                          Looking for a quick example. or a link to assist me.

                          zabbix 1.8
                          Ireports 3.2
                          JASpereports

                          Ubuntu 9.10

                          Comment

                          • akamit
                            Junior Member
                            • Sep 2010
                            • 2

                            #28
                            Zabbix reports design with iReports

                            Hi!
                            I've created a little post in a blog with step-by-step instructions.
                            Check it out.

                            Comment

                            • zabbix_zen
                              Senior Member
                              • Jul 2009
                              • 426

                              #29
                              Welcome akamit.

                              Nice work.
                              Thanks !

                              Comment

                              • bartroff
                                Junior Member
                                • Jan 2012
                                • 3

                                #30
                                Calculating uptime using ireports

                                Hi all,

                                Found this thread with some good examples, however, I'm still looking for some guidance in order to calculate uptime on hosts or groups (i.e. 99,98%) and also taking maintenance periods into account.

                                Can anyone point me in the right direction with some examples?

                                Thanks in advance

                                Allan

                                Comment

                                Working...