Ad Widget

Collapse

Using PHP Network WeatherMap with Zabbix

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • nuteric
    Junior Member
    • Mar 2013
    • 4

    #31
    burps thanks for your reminder.
    I've changed the TARGET configuration of the NODE

    NODE HOST_CPU
    LABEL CPU {zabbix:itemid:host:28601}
    TARGET zabbix:itemid:host:28601:28601
    POSITION HOST 0 20

    Links were already working fine but thanks for the reminder for the NODE.
    What I'm trying to do here is showing the CPU load per host.
    With
    LABEL CPU {zabbix:itemid:host:28601} or LABEL CPU {zabbix:itemid:host:28601:28601}
    The only thing I'm getting is Label text. The TARGET is now configuring well.
    Is there a way to display the value in the label?

    Comment

    • sersad
      Senior Member
      • May 2009
      • 518

      #32
      Link Properties edit

      Code:
      Data Source zabbixitem:62-jcore.e:ifHCInOctets[ae24]:62-jcore.e:ifHCOutOctets[ae24]
      Info URL  http://xxx.xxx.xxx.xxx/weathermap_chart.php?host[]={link:this:hostname_in}&item[]={link:this:itemkey_in}&host[]={link:this:hostname_out}&item[]={link:this:itemkey_out}&color[]=009900&color[]=000099&drawtype[]=5&drawtype[]=2&period=86400
      'Hover' Graph URL
      http://xxx.xxx.xxx.xxx/weathermap_chart.php?host[]={link:this:hostname_in}&item[]={link:this:itemkey_in}&host[]={link:this:hostname_out}&item[]={link:this:itemkey_out}&color[]=009900&color[]=000099&drawtype[]=5&drawtype[]=2&height=100&width=400&legend=1&period=43200
      
      
      
      EDIT:
      LINK JMX960-62-JMX80-Alic
      	TEMPLATE Zabbix_link
      	TARGET zabbixitem:62-jcore.e:ifHCInOctets[ae24]:62-jcore.e:ifHCOutOctets[ae24]
      	NODES JMX960-62 JMX80-Vur
      	BANDWIDTH 2G
      	SET hostname_in 62-jcore.e
      	SET itemkey_in ifHCInOctets[ae24]
      	SET hostname_out 62-jcore.e
      	SET itemkey_out ifHCOutOctets[ae24]
      Node Properties
      Code:
      Internal Name  JMX80-Alic 
      Label JMX80-Alic
      
      EDIT:
      
      NODE JMX80-Alic
      	LABEL JMX80-Alic
      	LABELOFFSET s
      	ICON 40 40 images/gigabitswitch.png
      	POSITION 650 840

      Comment

      • stav13
        Member
        • Oct 2013
        • 66

        #33
        Still having issues trying to get the graphs to display on the links.

        Im using the below;

        LINK node04564-node04572
        OVERLIBGRAPH zabbix:keyname:RUN-SR-CAB3-FW1:ethernet1/11
        TARGET zabbix:key_:RUN-SR-CAB3-FW1:ifInOctets[ethernet1/11]:ifOutOctets[ethernet1/11]
        NODES HQ.FW1 HQ.SW1
        INFOURL zabbix:keyname:RUN-SR-CAB3-FW1:ethernet1/11

        The link shows the correct % but when i hover over the link i just get a broken image icon.

        Help!

        Cheers

        Comment

        • nuteric
          Junior Member
          • Mar 2013
          • 4

          #34
          Stav13
          For the overlibgraph you should use
          Code:
          For Global configuration
          SET post_zabbix_graphs enabled
          
          And for the overlibgraph config:
          
          OVERLIBGRAPH zabbix:name:switch-01:GigabitEthernet3/8
          Or
          OVERLIBGRAPH zabbix:graphid:switch-01:600
          Be sure to use name or graphid instead of keyname
          reference:
          PHP Weathermap plugin for Zabbix (using Zabbix API) - amousset/php-weathermap-zabbix-plugin

          Comment

          • stav13
            Member
            • Oct 2013
            • 66

            #35
            Originally posted by nuteric
            Stav13
            For the overlibgraph you should use
            Code:
            For Global configuration
            SET post_zabbix_graphs enabled
            
            And for the overlibgraph config:
            
            OVERLIBGRAPH zabbix:name:switch-01:GigabitEthernet3/8
            Or
            OVERLIBGRAPH zabbix:graphid:switch-01:600
            Be sure to use name or graphid instead of keyname
            reference:
            https://github.com/amousset/php-weat...e#overlibgraph
            Hi,

            Ok, have changed this and still does the same.

            LINK node04564-node04572
            OVERLIBGRAPH zabbix:name:RUN-SR-CAB3-FW1:ethernet1/11
            TARGET zabbix:key_:RUN-SR-CAB3-FW1:ifInOctets[ethernet1/11]:ifOutOctets[ethernet1/11]
            NODES HQ.FW1 HQ.SW1
            INFOURL zabbix:name:RUN-SR-CAB3-FW1:ethernet1/11

            Also tried this but same error

            LINK node04564-node04572
            OVERLIBGRAPH zabbix:graphid:RUN-SR-CAB3-FW1:13522
            TARGET zabbix:key_:RUN-SR-CAB3-FW1:ifInOctets[ethernet1/11]:ifOutOctets[ethernet1/11]
            NODES HQ.FW1 HQ.SW1
            INFOURL zabbix:graphid:RUN-SR-CAB3-FW1:13522

            pic;

            Comment

            • stav13
              Member
              • Oct 2013
              • 66

              #36
              Originally posted by stav13
              Hi,

              Ok, have changed this and still does the same.

              LINK node04564-node04572
              OVERLIBGRAPH zabbix:name:RUN-SR-CAB3-FW1:ethernet1/11
              TARGET zabbix:key_:RUN-SR-CAB3-FW1:ifInOctets[ethernet1/11]:ifOutOctets[ethernet1/11]
              NODES HQ.FW1 HQ.SW1
              INFOURL zabbix:name:RUN-SR-CAB3-FW1:ethernet1/11

              Also tried this but same error

              LINK node04564-node04572
              OVERLIBGRAPH zabbix:graphid:RUN-SR-CAB3-FW1:13522
              TARGET zabbix:key_:RUN-SR-CAB3-FW1:ifInOctets[ethernet1/11]:ifOutOctets[ethernet1/11]
              NODES HQ.FW1 HQ.SW1
              INFOURL zabbix:graphid:RUN-SR-CAB3-FW1:13522

              pic;

              Got it working, had the SET post_zabbix_graph_base_url use my A record name instead of IP and started working

              Cheers for help.

              Comment

              • sersad
                Senior Member
                • May 2009
                • 518

                #37
                stav13 what version you are using?

                Comment

                • stav13
                  Member
                  • Oct 2013
                  • 66

                  #38
                  Originally posted by sersad
                  stav13 what version you are using?
                  Hi,

                  I am using the most up to date software for Zabbix, weathermap and the plugin.

                  Thanks

                  Comment

                  • sersad
                    Senior Member
                    • May 2009
                    • 518

                    #39
                    stav13 2.4.5 rc1?
                    In 2.4.4 overlibgraph not work

                    Comment

                    • stav13
                      Member
                      • Oct 2013
                      • 66

                      #40
                      Originally posted by sersad
                      stav13 2.4.5 rc1?
                      In 2.4.4 overlibgraph not work
                      AH! well i thought the upgrade went ahead to 2.4.4 but looks like it didnt work!

                      We have 2.4.3, looks like i wont bother upgrading to 2.4.4 if they broke that!

                      Thanks for the heads up!

                      Comment

                      • sersad
                        Senior Member
                        • May 2009
                        • 518

                        #41
                        stav13 you can give the configuration?
                        my cfg
                        Code:
                        cat weathermap2.conf 
                        # Automatically generated by php-weathermap v0.97c
                        
                        FONTDEFINE 100 ./VeraIt.ttf 8
                        FONTDEFINE 101 ./Vera.ttf 12
                        FONTDEFINE 102 ./Vera.ttf 9
                        
                        WIDTH 1280
                        HEIGHT 1024
                        HTMLSTYLE overlib
                        KEYFONT 102
                        TITLE Core - no graph, sorry
                        HTMLOUTPUTFILE weathermap2.html
                        IMAGEOUTPUTFILE weathermap2.png
                        TIMEPOS 565 12 Created: %b %d %Y %H:%M:%S
                        
                        KEYPOS DEFAULT 728 924 Traffic Load
                        KEYSTYLE  DEFAULT horizontal
                        KEYTEXTCOLOR 0 0 0
                        KEYOUTLINECOLOR 0 0 0
                        KEYBGCOLOR 255 255 255
                        BGCOLOR 255 255 255
                        TITLECOLOR 0 0 0
                        TIMECOLOR 0 0 0
                        SCALE DEFAULT 0    0.01 222 255 255  
                        SCALE DEFAULT 0.01 0.5  153 255 204  
                        SCALE DEFAULT 0.5  1     51 104 255  
                        SCALE DEFAULT 1    2     51 102 255  
                        SCALE DEFAULT 2    5     92 255  92  
                        SCALE DEFAULT 5    8     31 255  31  
                        SCALE DEFAULT 8    15     0 184   0  
                        SCALE DEFAULT 15   30     0 102   0  
                        SCALE DEFAULT 30   35     0 102  51  
                        SCALE DEFAULT 35   60   255 255   0  
                        SCALE DEFAULT 60   75   255 166  77  
                        SCALE DEFAULT 75   90   204 102  51  
                        SCALE DEFAULT 90   100  255   0   0  
                        SCALE DEFAULT 0    0    192 192 192  
                        SCALE DEFAULT 0    1    255 255 255  
                        SCALE DEFAULT 1    10   140   0 255  
                        SCALE DEFAULT 10   25    32  32 255  
                        SCALE DEFAULT 25   40     0 192 255  
                        SCALE DEFAULT 40   55     0 240   0  
                        SCALE DEFAULT 55   70   240 240   0  
                        SCALE DEFAULT 70   85   255 192   0  
                        SCALE DEFAULT 85   100  255   0   0  
                        
                        SET key_hidezero_DEFAULT 1
                        SET rrd_default_in_ds 1
                        SET rrd_default_out_ds 2
                        
                        # Included files
                        INCLUDE configs/zab_template.conf
                        
                        # End of global section
                        
                        
                        # TEMPLATE-only NODEs:
                        NODE DEFAULT
                        	MAXVALUE 100
                        
                        
                        # TEMPLATE-only LINKs:
                        LINK DEFAULT
                        	WIDTH 2
                        	BWLABEL bits
                        	BANDWIDTH 10G
                        	SET key_hidezero_DEFAULT 1
                        
                        
                        ....
                        NODE JMX80-Por
                        	LABEL JMX80-Por
                        	LABELOFFSET s
                        	ICON 40 40 images/gigabitswitch.png
                        	POSITION 80 740
                        
                        
                        NODE JMX960-55
                        	TEMPLATE Zabbix_node
                        	LABEL JMX960-55
                        	LABELOFFSET w
                        	ICON 40 40 images/gigabitswitch.png
                        	POSITION 450 610
                        	SET hostname 55-jcore.e
                        
                        
                        LINK JMX960-55-JMX80-Por
                        	TEMPLATE Zabbix_link
                        	TARGET zabbixitem:55-jcore.e:ifHCInOctets[ae20]:55-jcore.e:ifHCOutOctets[ae20]
                        	NODES JMX960-55 JMX80-Por
                        	BANDWIDTH 2G
                        	SET hostname_in 55-jcore.e
                        	SET itemkey_in ifHCInOctets[ae20]
                        	SET hostname_out 55-jcore.e
                        	SET itemkey_out ifHCOutOctets[ae20]
                        cat zab_template.conf
                        Code:
                        # TEMPLATE-only NODEs:
                        NODE Zabbix_node
                                MAXVALUE 100
                        	USESCALE none
                        	OVERLIBCAPTION {node:this:label}
                        	LABELOFFSET 0 -20
                        	TARGET zabbixhost:{node:this:hostname}:icmpping
                        
                        # TEMPLATE-only LINKs:
                        LINK Zabbix_link
                                WIDTH 2
                                BWLABEL bits
                                BANDWIDTH 10G
                        	OVERLIBCAPTION {link:this:hostname_in} ({link:this:itemkey_in}) - {link:this:hostname_out} ({link:this:itemkey_out})
                        	OVERLIBGRAPH http://xxx.xxx.xxx.xxx/weathermap_chart.php?host[]={link:this:hostname_in}&item[]={link:this:itemkey_in}&host[]={link:this:hostname_out}&item[]={link:this:itemkey_out}&color[]=009900&color[]=000099&drawtype[]=5&drawtype[]=2&height=100&width=400&legend=1&period=43200
                        	INFOURL http://xxx.xxx.xxx.xxx/weathermap_chart.php?host[]={link:this:hostname_in}&item[]={link:this:itemkey_in}&host[]={link:this:hostname_out}&item[]={link:this:itemkey_out}&color[]=009900&color[]=000099&drawtype[]=5&drawtype[]=2&period=86400
                        	TARGET zabbixitem:{link:this:hostname_in}:{link:this:itemkey_in}:{link:this:hostname_out}:{link:this:itemkey_out}

                        what is your code in weathermap_chart.php

                        Comment

                        • stav13
                          Member
                          • Oct 2013
                          • 66

                          #42
                          Hi sersad

                          my .conf for my test weathermap is;

                          # Automatically generated by php-weathermap v0.97c
                          HTMLSTYLE overlib

                          # General configuration
                          SET zabbix_user
                          SET zabbix_password
                          SET zabbix_url http://127.0.0.1/zabbix/api_jsonrpc.php

                          # Graph configuration
                          SET post_zabbix_graphs 1
                          SET post_zabbix_graph_link 1
                          SET post_zabbix_graph_base_url http://xxx.xxx.xxx.xxx/zabbix/
                          SET post_zabbix_graph_width 600
                          SET post_zabbix_graph_height 150
                          SET post_zabbix_graph_period 86400
                          # End of global section


                          # TEMPLATE-only NODEs:

                          # TEMPLATE-only LINKs:

                          # regular NODEs:
                          NODE hq-ngd
                          LABEL hq-ngd
                          OVERLIBGRAPH zabbix:name:hq-ngd:GigabitEthernet0/1
                          ICON images/WorkgroupSwitch.png
                          POSITION 200 280

                          NODE ngd-hq.
                          LABEL ngd-hq.
                          OVERLIBGRAPH zabbix:name:ngd-hq:GigabitEthernet0/1
                          ICON images/WorkgroupSwitch.png
                          POSITION 600 280


                          # regular LINKs:
                          LINK hq-ngd-ngd-hq
                          OVERLIBGRAPH zabbix:name:hq-ngd:GigabitEthernet0/1
                          TARGET zabbix:key_:hq-ngd:ifInOctets[GigabitEthernet0/1]:ifOutOctets[GigabitEthernet0/1]
                          NODES hq-ngd ngd-hq



                          # That's All Folks!

                          I cannot find the file weathermap_chart.php, where should this be located? I am using the amousset plugin FYI

                          Thanks

                          Comment

                          • sersad
                            Senior Member
                            • May 2009
                            • 518

                            #43
                            I am using https://www.zabbix.com/forum/showthread.php?t=20208 fist post
                            link to the plugin FYI?

                            Comment

                            • stav13
                              Member
                              • Oct 2013
                              • 66

                              #44
                              Originally posted by sersad
                              I am using https://www.zabbix.com/forum/showthread.php?t=20208 fist post
                              link to the plugin FYI?
                              ok, im using a different plugin, I couldn't get that one to work. The only benefit to that plugin is getting the host status which again i couldnt get to work so started using the amousset plugin https://github.com/amousset/php-weat...-zabbix-plugin

                              Comment

                              • sersad
                                Senior Member
                                • May 2009
                                • 518

                                #45
                                stav13 you have done one of two plug-ins?

                                Comment

                                Working...