Ad Widget

Collapse

Weathermap

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sersad
    Senior Member
    • May 2009
    • 518

    #31
    На 2.4 кто нить пробовал прикрутить?

    UPD: Карту заставил рисовать, но вот графики не победил
    в include/classes/api/clients/CLocalApiClient.php закоментить 94 строку


    Code:
    // the nopermission parameter must not be available for external API calls.
    //unset($params['nopermissions']);
    Last edited by sersad; 24-10-2014, 18:19.

    Comment

    • sersad
      Senior Member
      • May 2009
      • 518

      #32
      АПну, кто либо использует с версией 2.4?

      Comment

      • ndvuser
        Junior Member
        • Jan 2014
        • 3

        #33
        Хотелось бы видеть данный функционал в 3.0 и без костылей.

        Comment

        • sersad
          Senior Member
          • May 2009
          • 518

          #34
          подведу итог, для работы в 2.4 необходимо использовать файл weathermap_chart.php в корне www zabbix

          в include/classes/api/clients/CLocalApiClient.php закоментить 94 строку
          // the nopermission parameter must not be available for external API calls.
          //unset($params['nopermissions']);


          Данные дергаются так
          zabbixitem:core:ifHCInOctets["xe-0/1/1"]:core:ifHCOutOctets["xe-0/1/1"]

          графики так
          http://zabbix/weathermap_chart.php?host[]=Kan_ME3400&item[]=ifHCInOctets.GigabitEthernet0-1&host[]=Kan_ME3400&item[]=ifHCOutOctets.GigabitEthernet0-1&color[]=009900&color[]=000099&drawtype[]=5&drawtype[]=2&height=100&width=400&legend=1


          кусок конфга
          cat /var/www/weathermap/configs/weathermap2.conf
          Code:
          # 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
          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
          
          
          # regular NODEs:
          NODE JMX960-62
          	TEMPLATE Zabbix_node
          	LABEL JMX960-62
          	LABELOFFSET e
          	ICON 40 40 images/gigabitswitch.png
          	POSITION 850 610
          	SET hostname 62-jcore.xxx
          
          NODE JMX80-Kug
          	LABEL JMX80-Kug
          	LABELOFFSET e
          	ICON 40 40 images/gigabitswitch.png
          	POSITION 1170 300
          
          
          LINK JMX960-62-JMX80-Kug
          	TEMPLATE Zabbix_link
          	TARGET zabbixitem:62-jcore.ххх:ifHCInOctets[ae10]:62-jcore.ххх:ifHCOutOctets[ae10]
          	NODES JMX960-62 JMX80-Kug
          	BANDWIDTH 2G
          	SET hostname_in 62-jcore.ххх
          	SET itemkey_in ifHCInOctets[ae10]
          	SET hostname_out 62-jcore.ххх
          	SET itemkey_out ifHCOutOctets[ae10]

          cat /var/www/weathermap/configs/zab_template.conf
          Code:
          FONTDEFINE 100 ./VeraIt.ttf 8
          FONTDEFINE 101 ./Vera.ttf 12
          FONTDEFINE 102 ./Vera.ttf 9
          
          KEYFONT 102
          
          LINK DEFAULT
          	BANDWIDTH 100M
          	BWLABEL bits
          	BWFONT 2
          
          SET key_hidezero_DEFAULT 1
          
          # End of global section
          
          # 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://noc.ххх.ххх/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=150&width=600&legend=1&period=43200
          	INFOURL http://noc.ххх.ххх/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}
          Attached Files
          Last edited by sersad; 25-06-2015, 15:07.

          Comment

          • stav13
            Member
            • Oct 2013
            • 66

            #35
            Hi,

            I have this working in 2.4.4 however I find I cannot pull through sub interfaces for some reason.

            This code works for interface TenGigabitEthernet 0/1
            # 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
            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

            # regular NODEs:
            NODE RUN-CAB3-VDX1
            TEMPLATE Zabbix_node
            LABEL RUN-CAB3-VDX1
            LABELOFFSET e
            ICON 40 40 images/Router.png
            POSITION 850 610
            SET hostname RUN-CAB3-VDX1

            NODE RUN-CAB3-VDX2
            LABEL RUN-CAB3-VDX2
            LABELOFFSET e
            ICON 40 40 images/Router.png
            POSITION 1170 300

            LINK RUN-CAB3-VDX1-RUN-CAB3-VDX2
            TEMPLATE Zabbix_link
            TARGET 'zabbixitem:RUN-CAB3-VDX1:ifHCInOctets[TenGigabitEthernet 0/1]:RUN-CAB3-VDX1:ifHCOutOctets[TenGigabitEthernet 0/1]'
            NODES RUN-CAB3-VDX1 RUN-CAB3-VDX2
            BANDWIDTH 2G
            SET hostname_in RUN-CAB3-VDX1
            SET itemkey_in ifHCInOctets[TenGigabitEthernet 0/1]
            SET hostname_out RUN-CAB3-VDX1
            SET itemkey_out ifHCOutOctets[TenGigabitEthernet 0/1] 2

            however this code doesn't work for TenGigabitEthernet 0/50:1
            # 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
            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

            # regular NODEs:
            NODE RUN-CAB3-VDX1
            TEMPLATE Zabbix_node
            LABEL RUN-CAB3-VDX1
            LABELOFFSET e
            ICON 40 40 images/Router.png
            POSITION 850 610
            SET hostname RUN-CAB3-VDX1

            NODE RUN-CAB3-VDX2
            LABEL RUN-CAB3-VDX2
            LABELOFFSET e
            ICON 40 40 images/Router.png
            POSITION 1170 300

            LINK RUN-CAB3-VDX1-RUN-CAB3-VDX2
            TEMPLATE Zabbix_link
            TARGET 'zabbixitem:RUN-CAB3-VDX1:ifHCInOctets[TenGigabitEthernet 0/50:1]:RUN-CAB3-VDX1:ifHCOutOctets[TenGigabitEthernet 0/50:1]'
            NODES RUN-CAB3-VDX1 RUN-CAB3-VDX2
            BANDWIDTH 2G
            SET hostname_in RUN-CAB3-VDX1
            SET itemkey_in ifHCInOctets[TenGigabitEthernet 0/50:1]
            SET hostname_out RUN-CAB3-VDX1
            SET itemkey_out ifHCOutOctets[TenGigabitEthernet 0/50:1] 2

            This gives the below error;

            ZabbixItem ReadData: Not found item for host 'RUN-CAB3-VDX1:ifHCInOctets[TenGigabitEthernet 0/50:1]' and key_ 'RUN-CAB3-VDX1'ZabbixItem ReadData: Not found item for host 'ifHCOutOctets[TenGigabitEthernet 0/50' and key_ '1]'ZabbixItem ReadData: Not found history for item at host 'RUN-CAB3-VDX1:ifHCInOctets[TenGigabitEthernet 0/50:1]' and key_ 'RUN-CAB3-VDX1'ZabbixItem ReadData: Not found history for item at host 'ifHCOutOctets[TenGigabitEthernet 0/50' and key_ '1]'ZabbixItem ReadData: Returning (NULL,NULL,)
            WARNING: configs/test.conf: ReadData: LINK RUN-CAB3-VDX1-RUN-CAB3-VDX2, target: zabbixitem:RUN-CAB3-VDX1:ifHCInOctets[TenGigabitEthernet 0/50:1]:RUN-CAB3-VDX1:ifHCOutOctets[TenGigabitEthernet 0/50:1] on config line 84 of configs/test.conf had no valid data, according to WeatherMapDataSource_zabbixitem
            ZabbixHost ReadData: Returning (1,1,1443481929)


            I'm so close to getting this working correctly now but keep getting stuck at the end. looks like an issue using a : in the line of code.

            Any ideas please?


            Many Thanks

            Comment

            • sersad
              Senior Member
              • May 2009
              • 518

              #36
              stav13, my howto

              Comment

              • stav13
                Member
                • Oct 2013
                • 66

                #37
                Originally posted by sersad
                Hi Sersad,

                I did use your "howto" to get it to work so thankyou for that however my issue appears to be focus on just sub interfaces eg TenGigabitEthernet 0/50:1

                When I use a standard interface (same device) TenGigabitEthernet 0/1 the map is produced and all works fine.

                I was wondering if there is a way to search through the DB or use the API to list all of the items for a host to see whether or not this interface is indeed "Not found item for host" however I can clearly see the item within zabbix web gui and make graphs from it.

                As I have already said, I have been battling to get weathermap working for ages now as the current zabbix maps just completely lack in functionality (biggest draw back to zabbix in my opinion!) so if I can get this to work would make me very happy!!

                Thanks

                Comment

                • sersad
                  Senior Member
                  • May 2009
                  • 518

                  #38
                  maybe the problem is symbol ":" in the name of the key

                  Comment

                  • stav13
                    Member
                    • Oct 2013
                    • 66

                    #39
                    Originally posted by sersad
                    maybe the problem is symbol ":" in the name of the key
                    very good point!

                    Would you know how I can get around this?

                    Thanks

                    Comment

                    • sersad
                      Senior Member
                      • May 2009
                      • 518

                      #40
                      Your template is based on the LLD?

                      Comment

                      • stav13
                        Member
                        • Oct 2013
                        • 66

                        #41
                        it is yes, I guess I could filter out those interfaces and manually add them in without the ":" symbol?

                        I will try that out and let you know how it goes.

                        Thanks for the help so far!

                        Cheers

                        Comment

                        • DeeZ
                          Member
                          • Aug 2015
                          • 82

                          #42
                          Originally posted by stav13
                          it is yes, I guess I could filter out those interfaces and manually add them in without the ":" symbol?
                          I will try that out and let you know how it goes.
                          There is #snmpvalue is used by default instead of #snmpindex. I suppose it is wrong.
                          I've change all templates to use index.


                          so... might it be help you if you will use other ID (Index instread of ifName).

                          I hope I undestand the question correct )

                          Comment

                          • stav13
                            Member
                            • Oct 2013
                            • 66

                            #43
                            All working now! only had 16 interfaces to add so did them manually in the end.

                            I do however have another question which is in regards to host status. Ideally i would like the node icon to change if the status goes to down. When i run the weathermap script i get the below output;

                            ZabbixItem ReadData: Returning (8205560,1435512,1443560709)
                            ZabbixHost ReadData: Returning (1,1,1443560769)
                            ZabbixHost ReadData: Returning (1,1,1443560768)
                            ZabbixHost ReadData: Returning (1,1,1443560766)
                            ZabbixHost ReadData: Returning (0,0,0)

                            the ZabbixHost which is returning all 0's is actually a host which is down for test purposes. I then noticed the below line of code within the zab_template.conf stating;

                            TARGET zabbixhost:{node:this:hostname}:icmpping

                            Do any of these allow me to change the node's icon when it goes down?


                            Many Thanks

                            Comment

                            Working...