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. NXLS state and runtimeFlags in v3.0

NXLS state and runtimeFlags in v3.0

Scheduled Pinned Locked Moved Support
3 Posts 2 Posters 29.6k 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.
  • B
    B
    Borgso
    wrote on last edited by
    #1

    Hi

    After upgrading from 2.2.17 to 3.0.2292 runtimeFlags and state in NXLS does not show correct values.

    Debugging with a Dummy dci on nodes and return $node->runtimeFlags + $node->state gives this results:

    Node with active alarm, not responding to ICMP (dead) and only ICMP poll:
    $node->runtimeFlags = 4
    $node->state = 5

    Node with no active alarm, responding to ICMP and only ICMP poll :
    $node->runtimeFlags = 4
    $node->state = 4

    Node with no active alarm, responding to ICMP and nxagent+ICMP poll:
    $node->runtimeFlags = 4
    $node->state = 0

    How can i stable check whetever Node is dead or not within NXLS?
    We are using this on dummy/external+proxy DCI's to prevent them raising alarms when node is dead(not responding to ICMP or Agent)

    We used this before:

    if ($node->runtimeFlags & 0x0004) {
    Ā  Ā  return true;
    }

    1 Reply Last reply
    0
    • V
      V
      Victor Kirhenshtein
      wrote on last edited by
      #2

      Hi,

      now you should use state attribute to determine node state. For convenience server version 3.0 defines constants for each state:

      NodeState::Unreachable
      NodeState::NetworkPathProblem
      NodeState::AgentUnreachable
      NodeState::SNMPUnreachable
      NodeState::CacheModeNotSupported

      ClusterState::Unreachable
      ClusterState::NetworkPathProblem
      ClusterState::Down

      SensorState::Unreachable
      SensorState::NetworkPathProblem
      SensorState::Provisioned
      SensorState::Registered
      SensorState::Active
      SensorState::PendingConfigUpdate

      So equivalent of 2.2.x

      if ($node->runtimeFlags & 0x0004)
      

      will be

      if ($node->state & NodeState::Unreachable)
      

      State bit 4 is not used and it's presence is a bit of a mystery. Probably something goes wrong during DB upgrade. You can left it as is - it will not affect anything, or clean it up in database while server is stopped using the following queries:

      UPDATED object_properties SET state=0 WHERE state=4;
      UPDATED object_properties SET state=1 WHERE state=5;

      This will clean it up for most common flag combinations.

      If you are using PostgreSQL you should be able to do this in one query using bitwise AND:

      UPDATED object_properties SET state=state & ~4;

      Best regards,
      Victor

      1 Reply Last reply
      0
      • B
        B
        Borgso
        wrote on last edited by
        #3

        Thanks for the clarifications, this helped me alot šŸ™‚

        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