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. Complex container status

Complex container status

Scheduled Pinned Locked Moved Support
5 Posts 2 Posters 16.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.
  • T
    T
    testos
    wrote on last edited by
    #1

    Hi again!

    My network provider supplies me a main 100 Mbs bandwith line (A) and a backup 10 Mbs bandwith line (B) for a given location.  I need status container follow:

    A status		Up	Up	Down	Down
    B status		Up	Down	Up	Down
    Location status		Normal	Normal	Minor	Major
    

    I have created a condition under same container of A and B, with next condition script:

    //trace(0,$1);
    //trace(0,$2);
    if ($1>0){
    	if ($2>0)
    		return 3;	//Return MAJOR
    	else
    		return 2;	// return MINOR
    	}
    return 0;			// return NORMAL
    // blank last line is required for elude:
    // syntax error, unexpected '/', expecting $end
    

    Please, is there any way to change condition active state defined in General tab, from inside script?
    Please, is there another way to get needed states?

    Thanks in advance.

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

      Hi!

      What is A, B, and "Location" - containers? If you need to calculate status of Location based on statuses of subcontainers A and B, the beset way is to use status calculation/propagation rules. If this is the case, tell me what statuses could have A and B, and I'll try to create rules for your requirement.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • T
        T
        testos
        wrote on last edited by
        #3

        Hi.

        A and B are routers nodes.
        "Location" is a container for A and B nodes: the city where they are located.

        Next table show status for "Location" container, based in A and B nodes statuses:

        [tr][td]If node A change to   Normal Normal Critical Critical
        If node B change to   Normal Critical Normal Critical
        Location status must be    Normal    Normal    Minor          Major

        .

        However, I believe that a condition should be able to change his status to the same status returned from his own script.

        Best regards.

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

          Hi!

          Condition can have only two statuses - when it is active and when it is not active. Condition script expected to return true or false - if it returns true, condition considered as "active", and it's status changed appropriately.

          For your case, I see the following solution (not very elegant though):

          1. On nodes A and B, set status propagation to fixed value "Normal" - this will ensure that they will not change status of parent location directly;
          2. Create 2 conditions in same location, each having DCI Status for node A and node B as data (A Status first).
          3. For condition 1, set active status to "Minor" and inactive to "Normal", and use the following script:

          ($1 == 4) && ($2 == 0)

          1. For condition 1, set active status to "Major" and inactive to "Normal", and use the following script:

          ($1 == 4) && ($2 == 4)

          Should work 🙂

          Best regards,
          Victor

          1 Reply Last reply
          0
          • T
            T
            testos
            wrote on last edited by
            #5

            Hi Victor,

            Of course, by using two or more conditions!. I would have never come to mind :-[.

            Now, desired container status work fine.

            Thank you very much again.

            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