Ad Widget

Collapse

screen cell customization

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • zabbix_gunner
    Member
    • Feb 2015
    • 38

    #1

    screen cell customization

    hello,
    I have some keys defined that I want to display as a table inside a single screen cell. Is this possible in zabbix 2.4 ?
    Having all keys in separate cells make the screen look a bit clumsy.

    regards

    AK
  • steveboyson
    Senior Member
    • Jul 2013
    • 582

    #2
    Sure, let your item create HTML code and use a cell type of "plain text", tick "show test as HTML" and specify "show lines = 1".

    Comment

    • steveboyson
      Senior Member
      • Jul 2013
      • 582

      #3
      Event that works:

      Comment

      • zabbix_gunner
        Member
        • Feb 2015
        • 38

        #4
        that looks like an option... however I am using sender to send keys to the server after extracting data from a csv. How can i send an html file ( or for that matter any file ) , as a key value to zabbix , through sender ?

        regards

        AK

        Comment

        • steveboyson
          Senior Member
          • Jul 2013
          • 582

          #5
          The same way as if would be a regular zabbix item.

          Make sure you are using an item type "text" and not "char". Type "char" is limited to 255 bytes so it will most probably be too short.

          Comment

          • zabbix_gunner
            Member
            • Feb 2015
            • 38

            #6
            yes got it... thanks Steve for your help.

            Comment

            • zabbix_gunner
              Member
              • Feb 2015
              • 38

              #7
              coming back to the html parsing by zabbix , there seems to be some difference in the way zabbix parses and displays html. If the same html code is run as a standalone html in a browser it appears very different to the way zabbix displays it.
              attaching 2 screenshots for the same html code ( for a small table ).
              Any pointers ?
              Attached Files

              Comment

              • steveboyson
                Senior Member
                • Jul 2013
                • 582

                #8
                Have a look at the various CSS files in /usr/share/zabbix/styles/ directory.
                The look'n'feel of Zabbix is defined there.
                Inspect the tables' CSS with Chrome (or similar) and change zabbix' CSS definitions (not the best idea) or simply define your own CSS attributes for your HTML output.

                Comment

                • zabbix_gunner
                  Member
                  • Feb 2015
                  • 38

                  #9
                  I am using css styling in my html code ( for e.g. to have table cells as separate cells )... however it looks like they are not being used at all.
                  i went through the FF inspector and could see that the style tag was simply not being used.

                  Comment

                  • steveboyson
                    Senior Member
                    • Jul 2013
                    • 582

                    #10
                    Then you most probably have a type in your CSS/HTML code.

                    I use something like

                    Code:
                    <style type="text/css">
                    .mystyle {
                    table { border-spacing: 5px; border-collapse: collapse; font-family: Arial, Helvetia, sans-serif; }
                    tr { vertical-align:top; text-align:left; }
                    }
                    table.mystyle tr:hover  { background-color: lightgray; }
                    th { padding: 5px; display:table-cell; vertical-align:top; text-align:left; color:white; background-color:#000099; }
                    td { padding: 5px; display:table-cell; vertical-align:top; text-align:left; }
                    </style>
                    and later
                    Code:
                    <table class="mystyle" border="1"><tr class="mystyle">...</tr></table>
                    and so on. Maybe even for the
                    Code:
                    <th>
                    and
                    Code:
                    <td>
                    you might need to specify the CSS class.
                    Attached Files

                    Comment

                    • zabbix_gunner
                      Member
                      • Feb 2015
                      • 38

                      #11
                      awesome ! thanks a ton Steve... got exactly what i was looking for.

                      Comment

                      • steveboyson
                        Senior Member
                        • Jul 2013
                        • 582

                        #12
                        Cheers and you're welcome.

                        Comment

                        • zabbix_gunner
                          Member
                          • Feb 2015
                          • 38

                          #13
                          sorry for diggging up an old thread but my new issue is kind of related to this...
                          I am using style tag for custom css styling my table. Now I want to use the sorttable.js ( from http://www.kryogenix.org/code/browser/sorttable/ ) to make my table columns sortable..
                          However merely putting the script tag in head tag ans using it does not work , with zabbix screen. Any clue as to how I can include the js in the style tag itself ? or another workaround ?

                          regards

                          AK

                          Comment

                          • zabbix_gunner
                            Member
                            • Feb 2015
                            • 38

                            #14
                            Steve , anything on this , please ?

                            regards

                            AK

                            Comment

                            • steveboyson
                              Senior Member
                              • Jul 2013
                              • 582

                              #15
                              Hmmm. Works here as described on the link you posted.
                              Unfortunately "sortable" gets a little bit confused on float values.
                              But works basically.

                              Comment

                              Working...