Ad Widget

Collapse

Count number of operationally up interfaces?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • WazzaZab
    Junior Member
    • May 2014
    • 3

    #1

    Count number of operationally up interfaces?

    All,
    Trying to work out how to count the number of operationally up interfaces. Ideally we would use this as a new item, which we could then trigger against...

    As an example a network switch with 48 ports, if it suddenly looses 10+% of it's ports, we're likely to have a problem somewhere.

    Not quite sure this is "easily" doable directly in Zabbix, but I was thinking that the data itself is in the database, and a creative SQL query could probably get the result?

    Any ideas?

    Thanks,

    Wazza


  • LenR
    Senior Member
    • Sep 2009
    • 1005

    #2
    If your values are 0 for down, 1 for up, you might be able to create a calculated item that summed all interface status items for a switch. The api takes some learning, but you could create that item using the api.

    You could use your database idea with the api also, you just have to schedule the process to run somehow. I wouldn't recommend an external script calling the api due to timeout issues, when I do something like that, I schedule with cron and update the item with zabbix-sender.

    Comment

    • Mike2K
      Member
      • Oct 2018
      • 62

      #3
      Hmm, I'm thinking:

      Create 3 checks:
      1. Check the total number of ports (do a count on the interfaces table)
      2. Count the number of ports that are up (count the interfaces that matches value 'xx' (regexp preprocessing))
      3. Create a dependent item which calculates the difference between the two
      You could also do this with an external script but you'd still have to count the total number of ports and divide that by the number of ports the are up or down.

      One caveat: how do you differentiate between ports that should be down (sometimes not all ports are connected) and ports that went down because of a problem...

      Comment

      Working...