Problem with DCI transform script
-
Hey guys,
I have a problem trying to transform a value which has been calculated from a script.
The script calculates the average CPU load over multiple CPUs.It returns a float value (e.g. 41.34444444) which is the CPU load in percentage.
For displaying the data I want to transform this value so that it is displayed as "41.34444444 %".Unfortunately the transformation doen't seem to work properly so in the object overview and in the view of last values I just see "41.34444444" (without "%").
Do you know what I configured wrong?
Thanks in advance.
Best regards,
Danny -
@dkoppenhagen said in Problem with DCI transform script:
Hey guys,
I have a problem trying to transform a value which has been calculated from a script.
The script calculates the average CPU load over multiple CPUs.It returns a float value (e.g. 41.34444444) which is the CPU load in percentage.
For displaying the data I want to transform this value so that it is displayed as "41.34444444 %".Unfortunately the transformation doen't seem to work properly so in the object overview and in the view of last values I just see "41.34444444" (without "%").
Do you know what I configured wrong?
Thanks in advance.
Best regards,
DannyWhat is shown depends on the type of the DCI, so "41.34444444 %" is no more a floating point value, so you have to set it as a string and in your transformation script you have to do something like this:
string($1)." %"
in this case $1 is the value collected, change with the result of your calculation.
Regards,
Marco -
Hi Marco thanks for your answer.
I tried this. But it's the same result. So the "Data Type" in configuration section "General" is the type of the final values which is returned after my transformation script runs on collected data? Or is this the type if the raw data which comes from my script?
Another thing is that I need a float value for displaying the values in performance tab.
I thought it's like the following:
1.) The script runs and returns value.
2.) The returned values typse is selected in "Data Type".
3.) The value is processed in performance tab.
4.) Transformation script runs over the last value.
5.) The transformed value is shown in overview and "last values" secion.So the main problem is: I need a float for performance tab and a string for object overview.
So probably I have to leave it as it is and I change just the value description from "CPU" to "CPU (%)".
Bets regards,
Danny -
@dkoppenhagen said in Problem with DCI transform script:
I tried this. But it's the same result. So the "Data Type" in configuration section "General" is the type of the final values which is returned after my transformation script
runs on collected data? Or is this the type if the raw data which comes from my script?As per my knowledge it is the type of the final value.
@dkoppenhagen said in Problem with DCI transform script:
So the main problem is: I need a float for performance tab and a string for object overview.
So probably I have to leave it as it is and I change just the value description from "CPU" to "CPU (%)".
Since you need the same result with different data type, I suggest to leave it as float and change the description (you won't be able to show in performance graph if it is a string). Another solution is to duplicate the DCI and keep one as string and the other as float, the DCI of type string can be shown in overview and the float in the performance tab, but honestly if you have many nodes in my opinion is a waste of resources.
Regards,
Marco
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