Ad Widget

Collapse

Total Bandwidth Calculation for Cisco Switches

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • consultorpc
    Junior Member
    • Apr 2008
    • 16

    #1

    Total Bandwidth Calculation for Cisco Switches

    Hello All,

    We are using zabbix 1.6.2 and we have a couple of cisco switches which is monitored using SNMP. I have followed this : http://www.zabbix.com/forum/showthread.php?t=10606 , and created an .xml file. The import works great and now I would like to know how I can calculate total bandwidth for each ports on the switch? Is it possible to create a separate item to do this, to show total bandwidth usage per day, week, month and year basis?

    I have read some posts in zabbix forum, and all are talking about creating graphs for this, but graphs only can show max, min and last values, how can we use this for total bandwidth calculation? Please help me to understand how I can use zabbix for total bandwidth calculation of each ports on the cisco switch.

    Thanks in Advance,

    consultorpc
  • MrKen
    Senior Member
    • Oct 2008
    • 652

    #2
    Originally posted by consultorpc
    Hello All,

    We are using zabbix 1.6.2 and we have a couple of cisco switches which is monitored using SNMP. I have followed this : http://www.zabbix.com/forum/showthread.php?t=10606 , and created an .xml file. The import works great and now I would like to know how I can calculate total bandwidth for each ports on the switch? Is it possible to create a separate item to do this, to show total bandwidth usage per day, week, month and year basis?

    Maybe you would be better posting to that thread. They are the ones who created the script.


    Originally posted by consultorpc
    I have read some posts in zabbix forum, and all are talking about creating graphs for this, but graphs only can show max, min and last values, how can we use this for total bandwidth calculation? Please help me to understand how I can use zabbix for total bandwidth calculation of each ports on the cisco switch.

    Thanks in Advance,

    consultorpc

    You can put your IfInOctets and IfOutOctets in a 'Stacked' graph.

    MrKen
    Disclaimer: All of the above is pure speculation.

    Comment

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

      #3
      I've written a script which can generate a weekly total bandwidth report. If you're interested please let me know. I will warn you, it's development grade code right now, however I'm starting to see more traction and need to improve it. Let me know if you're interested and I can help you get it working.

      Here is a sample of what the report looks like:
      Code:
      Bandwidth Report External Procurve 2009-01-11 00:00hrs - 2009-01-18 00:00hrs
       +-------------------------------------------------------------------+
       | interface | total_readable | outbound_readable | inbound_readable |
       +-------------------------------------------------------------------+
       | if_01     | 28.28G         | 12.78G            | 15.5G            |
       | if_02     | 28.15G         | 28.15G            | 831.0B           |
       | if_03     | 2.59G          | 1.77G             | 835.29M          |
       | if_04     | 30.95G         | 4.09G             | 26.86G           |
       | if_05     | 46.58G         | 37.03G            | 9.55G            |
       | if_06     | 0.0B           | 0.0B              | 0.0B             |
       | if_07     | 0.0B           | 0.0B              | 0.0B             |
       | if_08     | 1.85G          | 1.78G             | 70.81M           |
       +-------------------------------------------------------------------+
      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

      • consultorpc
        Junior Member
        • Apr 2008
        • 16

        #4
        Yes, I am really interested to get the script and would like to test it.

        Thanks

        consultorpc

        Comment

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

          #5
          I sent you a private message.
          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

          • BlackRabbit
            Junior Member
            • Apr 2009
            • 15

            #6
            I'm interested as well ;-)

            Comment

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

              #7
              Send me a message, there is some work involved to get it to happen, but I'm making some tweaks to make it easier to use overall.
              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

              • BlackRabbit
                Junior Member
                • Apr 2009
                • 15

                #8
                Originally posted by MrKen
                You can put your IfInOctets and IfOutOctets in a 'Stacked' graph.
                Actually, this is far from nice:
                - the 'legend' of the graph becomes huge when adding a lot of ports (eg on a 24port or 48port switch)
                - the graph becomes slow to render
                - the graph shows artifacts (when some ports are not used, the lines of '0' height are darker than the rest of the filled graph)
                - adding 24/48 items to a graph is a lot of work (even when done directly in XMl files)


                Is it possible to fix this with ZABBIX_aggregate items? Just create 1 item to collect data from some other items, then create a graph from the 1 collecting item?
                I've tried this, but can't figure out how to do this really.

                Comment

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

                  #9
                  Originally posted by BlackRabbit
                  Is it possible to fix this with ZABBIX_aggregate items? Just create 1 item to collect data from some other items, then create a graph from the 1 collecting item?
                  I've tried this, but can't figure out how to do this really.
                  Unfortunately no. You cannot aggregate within a host, however if you have the same key on multiple hosts you can aggregate that. The best workaround is to build an external script on the Zabbix host that will provide you with a sum of the last values for a specific list of items. It's not elegant but it does work.
                  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

                  • BlackRabbit
                    Junior Member
                    • Apr 2009
                    • 15

                    #10
                    Originally posted by nelsonab
                    Unfortunately no. You cannot aggregate within a host, however if you have the same key on multiple hosts you can aggregate that. The best workaround is to build an external script on the Zabbix host that will provide you with a sum of the last values for a specific list of items. It's not elegant but it does work.
                    Thanks for your reply. The developers should enable such aggragation-functions within a host

                    Comment

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

                      #11
                      It's been asked for for a while now. :-)

                      Originally posted by BlackRabbit
                      Thanks for your reply. The developers should enable such aggragation-functions within a host
                      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

                      • josea.munoz
                        Junior Member
                        • Apr 2008
                        • 7

                        #12
                        Script

                        Hi,

                        Is it possible to get the script you are talking about?

                        Regards

                        Comment

                        • francis.forget
                          Junior Member
                          • Sep 2011
                          • 1

                          #13
                          CISCO MDS template

                          Maybe this addition to this post will help people having to monitor MDS CISCO switches.

                          It works perfectly for the following switches:

                          CISCO MDS9148
                          CISCO MDS9509

                          Comment

                          • ranforward
                            Junior Member
                            • Feb 2012
                            • 3

                            #14
                            Guys, you can use calculated item. I created a calculated item for that interface by adding in both input and output key on this item. and it works.

                            But I did have a bit of problem initially because the calculated value seems "lag" behind the real-time in/out value. So I changed the "Update Interval" to 5 seconds (from default 30), it looks better now. However we need to monitor the performance impact...
                            Attached Files

                            Comment

                            • josea.munoz
                              Junior Member
                              • Apr 2008
                              • 7

                              #15
                              Perfect!!!

                              Thanks, that was exactly what I was looking for.

                              Comment

                              Working...