sample NXSL script that calculates the object status

Started by Nagav, July 13, 2015, 04:11:55 PM

Previous topic - Next topic

Nagav

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 ?

Victor Kirhenshtein

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

Nagav

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

Nagav

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.

Victor Kirhenshtein

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.

Nagav

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 

Victor Kirhenshtein

Hi,

do you mean tooltips on network map?

Best regards,
Victor

Nagav

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