DCI Treshold

Started by DW, January 20, 2024, 10:41:59 PM

Previous topic - Next topic

DW

Hi,

im new to NetXMS and have troubles doing a treshold calculation

im using "System.Update.LastInstallTime" to get the last installed Windows Updates and it transforms it into Date and Time - perfect!

But now im trying to do a treshold checking for getting an alarm when Updates are not installed within the last 30 days (so 1 month in the past from now).

Can anyone help me?

Thank you in advance!

Filipp Sudanov

You probably have "Epoch time" units selected for that DCI, which makes it display as Date and Time. But the actual value is Unix time - if you open history for that DCI, you would see the values. Threshold operation is happening with that unix time value.

So there's two ways how to do things:
a) in transformation script of that DCI:
return time() - $1;this way the DCI will have value of how many seconds ago the update last happened. You can use "Uptime" units to display that. And in threshold you would want to check if the value is bigger then 2592000   (which is 60 * 60 * 24 * 30).

b) or you can have it without any transformation, and use script threshold:
return time() - $1 > 2592000;
or even
return time() - $1 > $2 * 3600 * 24;
and specify the threshold value in days in "Value" field of threshold properties.

DW

Hi,

thank you so if i want to display and want to get an alarm i should geht 2 DCI for that.

i think my second question is also answered with that - having 1 DCI for Uptime (transformed) and 1 for treshold calculation? (sorry i wrote that down there before i read your post :))

2)
i want to know if a system is rebooting so i get the "System.Uptime" Value - this is converted with "SecondsToUptime($1)" to a readable format.
When not using the "SecondsToUptime($1)" i get the value in seconds and i can use the <= 600 and get a alarm.
But when using the readable format i think the $1 is converted before into a string and the "<= 600" isnt working also i cant use "0 days,  0:10" for that.

Filipp Sudanov

Historically SecondsToUptime() function was introduced before measurement units were added. So currently you can select  "Uptime" in measurement units and have it without transformation script. Threshold <= 600 should work.

Also, you can try threshold with function "Diff with previous value", 1 sample, < 0.