Interface.setStatusPropagationMethod() ?

Started by Staj, October 03, 2018, 12:23:13 PM

Previous topic - Next topic

Staj

In NXShell, would you please consider implementing a AbstractObject.setStatusPropagationMethod or Interface.setStatusPropagationMethod method, or some other implementation that allows us to set status propagation, to allow for things like setting the status propagation of interfaces? Setting this up manually for many interfaces over many nodes is very tedious.

Someone else was, more or less, asking about this back in 2013 as well.

Staj

#1
For those looking to do this in SQL, here is some information:

Relevant data is kept in the object_properties table.
object_properties.status_prop_alg is the Propagate Status Method and acceptable values are defined in nxcldefs.h:307.

Default:
object_properties.status_prop_alg = 0

Unchanged:
object_properties.status_prop_alg = 1

Fixed to value:
object_properties.status_prop_alg = 2
object_properties.status_fixed_val is the Status it will be fixed to, acceptable values are 0 through 4 (netobj.cpp:1682) as defined in nxcldefs.h:138.

Relative with offset:
object_properties.status_prop_alg = 3
object_properties.status_shift is the offset applied to the actual status value.

Severity Based:
object_properties.status_prop_alg = 4
object_properties.status_translation is the mapping of actual status values to propogated ones. It is split into 4 segments of 2 characters which essentially represent the status integer for the respective slot.
First segment is the propagated status for a Warning status.
Second segment is the propagated status for a Minor status.
Third segment is the propagated status for a Major status.
Fourth segment is the propagated status for a Critical status.

So object_properties.status_translation of "00010303" would yield Normal (00 which is 0) being propagated for Warning, Warning (01 which is 1) being propagated for Minor, Major (03 which is 3) being propagated for Major and Major being propagated for Critical.

Example SQL Snippet (MySQL):
Set all matching interfaces (Interfaces with names that starts with "ge-") of node of ID 1234 to propagate status on a severity based (severity translated) basis and use the provided translation mapping:

UPDATE object_properties
INNER JOIN interfaces ON interfaces.id = object_properties.object_id
SET object_properties.status_prop_alg = 4, object_properties.status_translation = "01020303"
WHERE interfaces.node_id = 1234 AND object_properties.name LIKE "ge-%"


If I've made any mistakes, please let me know.

Victor Kirhenshtein

In nxshell you can so whatever is possible from UI. Object modifications should be done via NXCSession.modifyObject method - you set necessary fields in object modification data object and then call modifyObject.

Best regards,
Victor

Staj

#3
I should have looked more closely, even at my old nxshell scripts. Thanks.