Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
Skins
  • Light
  • Brite
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (Flatly)
  • No Skin
Collapse
Brand Logo

NetXMS Forum

  1. Home
  2. Support
  3. Wrong interface speed in DCI threshold script

Wrong interface speed in DCI threshold script

Scheduled Pinned Locked Moved Support
2 Posts 1 Posters 12.1k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S
    S
    simplex
    wrote on last edited by
    #1

    We use this script for interface load threshold

    dci_instance = SplitString($dci->instance, ";");
    node_interface_array = GetNodeInterfaces($node);
    node_interface = node_interface_array[dci_instance[0]];
    interface_speed = node_interface->speed;
    trace(0, "DCI instance:" . dci_instance[0] .
    		" threshold on " . $node->name .
    		" : " . ($2 * interface_speed) . "<=" . $1 .
    		" = " . ($2 * interface_speed)<=$1);
    if (($2 * interface_speed) <= $1)
    	return true;
    return false;
    

    some interfaces have wrong speed = 0.000000

    2019.03.25 13:02:33.767 *I* DCI instance:11 threshold on 34760 : 750000000.000000<=11931472 = 0
    2019.03.25 13:02:33.787 *I* DCI instance:12 threshold on 34760 : 0.000000<=366424 = 1
    2019.03.25 13:02:33.807 *I* DCI instance:14 threshold on 34760 : 0.000000<=8077080 = 1
    2019.03.25 13:02:33.827 *I* DCI instance:18 threshold on 34760 : 750000000.000000<=280684232 = 0
    

    but in database and console has correct speed:

    mysql> SELECT `id`, `speed` FROM interfaces WHERE `node_id` = 34760 AND `if_index` IN (12, 14);
    +-------+------------+
    | id    | speed      |
    +-------+------------+
    | 34772 | 1000000000 |
    | 34774 | 1000000000 |
    +-------+------------+
    2 rows in set
    

    2019-03-25_13-17-01.png

    1 Reply Last reply
    0
    • S
      S
      simplex
      wrote on last edited by
      #2

      we found mistake in array index:

      node_interface = node_interface_array[dci_instance[0] - 1];
      
      1 Reply Last reply
      0

      Hello! It looks like you're interested in this conversation, but you don't have an account yet.

      Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

      With your input, this post could be even better 💗

      Register Login
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      Powered by NodeBB Contributors
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • Users
      • Groups