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. sample NXSL script that calculates the object status

sample NXSL script that calculates the object status

Scheduled Pinned Locked Moved Support
8 Posts 2 Posters 64.4k 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.
  • N
    N
    Nagav
    wrote on last edited by
    #1

    Hi
    Can any one provide me sample NXSL script that calculates the object status as neede
    I need to change status of condition object based not only based on Active/Inactive status

    That is based on some value, I need to change status of conditional object status to Normal, Warning, Minor, Major, Critical

    Example
    if the value is > 100 change stataus to normal
            value is < = 100 and > 91 change status to Warning
            value is 90 <= and >81 change status to Minor
            --- etc
    Please provide sample script that I can refer to
    From net can see there is something like setStatusCalculation, but I could not get examples on using it
    Is it possible to use setStatusCalculation in condition object's status script ?

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

      Hi,

      condition object is limited to have only two possible statuses. However, you can create node object without IP address, then create script DCI on it that will return status as a number from 0 (normal) to 4 (critical) and mark this DCI as "status DCI". You'll have node with status based only on value provided by your script.

      Best regards,
      Victor

      1 Reply Last reply
      0
      • N
        N
        Nagav
        wrote on last edited by
        #3

        Thanks Victor for response, now I could create object with required status

        1 Reply Last reply
        0
        • N
          N
          Nagav
          wrote on last edited by
          #4

          I did created note object/status DCI as suggested by you, however the status symbol is not changes based on status value
          I have attached screenshot of it for your reference, kindly advise me if I have make anyother changes to get appropriate status symbol
          Also I do not want tooltip to display default info (255.255.255.255...etc), is it possible to give my own comments based on status value.


          Node and its property.docx

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

            I mean a bit different thing. Try to do the following:

            1. Create script in script library that will calculate status as you need it.
            2. Create script source DCI, select your script as source, check "use for status calculation" option.
            3. Don't forget to remove "use for status calculation" option from internal status DCI.

            Best regards,
            Victor

            P.S. also, you should use address 0.0.0.0 to create node without IP address.

            1 Reply Last reply
            0
            • N
              N
              Nagav
              wrote on last edited by
              #6

              Excellent, it is working
              Now I want some details to be displayed in tooltip based on status value, may I know how to do it ?
              Is there any NXSL function available which I use to set Node object's tooltip based on status value
              I tried to use Comments, but it is same for all status

              I have requirement to discribe the steps that the operator need to perform based on status of node

              Please help

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

                Hi,

                do you mean tooltips on network map?

                Best regards,
                Victor

                1 Reply Last reply
                0
                • N
                  N
                  Nagav
                  wrote on last edited by
                  #8

                  Hi

                  I need to change tooltip of object ( in my case node) that has been added to map
                  I need to change tooltip based on status value of object.

                  Regards
                  Naga

                  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