DCI question
-
-
Create a script DCI and collect the combined value of the DCIs into the script DCI.
Then make the threshold on that DCI.
Sample script attached below.
Save it to script library and call it from the script DCI.val1 = GetDCIValueByDescription($node, "DCI1 description"); val2 = GetDCIValueByDescription($node, "DCI2 description"); val3 = GetDCIValueByDescription($node, "DCI3 description"); val4 = GetDCIValueByDescription($node, "DCI4 description"); if (val1 == null || val2 == null || val3 == null || val4 == null) return 0; return val1 + val2 + val3 + val4; -
tomaskir,
Im almost succesfull at what im trying to achieve but im stuck on figuring out a way to reset values after the polling interval I have four DCI's that collect and increment the values every minute and using your code created an internal DCI which will sum those values every 15min and i want to trigger an alarm based on the totals of the internal DCI but how do I reset the values the DCI's after every poll interval instead of permanently incrementing
-
-
Does any one have any examples of a dci threshold script ? Im trying to trigger a threshold event but only if the threshold is met and secondary dci is true.. example
if (current dci >= 100 and secondary dci is true)
{trigger event
}
else
{
keep on going
}* Does the threshold script need to return a boolean or integer to be evaluated
-
I really recommend reading the script hints, they are available since 2.0+.
Regarding reading another DCI, see this:
https://wiki.netxms.org/wiki/NXSL:GetDCIValueByDescription
https://wiki.netxms.org/wiki/NXSL:GetDCIValueByNameHere is an example... this is a threshold on disk % usage, depending on the size of the disk.
If disk is smaller then 1GB - 80% threshold.
1GB-1TB - 90% threshold.
1TB+ - 95% threshold.storageSize = AgentReadParameter($node, "FileSystem.Total(" . $dci->instance . ")"); if (storageSize == null) return false; if (storageSize < 1099511627776) { // for storageSize under 1TB if (storageSize < 1073741824) { // for storageSize under 1GB, 80% usageThreshold = 80; } else { // for storageSize between 1GB and 1TB, 90% usageThreshold = 90; } } else { // for storageSize above 1TB, 95% threshold usageThreshold = 95; } if ($1 > usageThreshold) return true; return false; -
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