All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
I'm calling Linux shell script "SYSTEM: Average Load for past 5 minutes". It returns the system load without a decimal point. For example, if system load is "1.14", script returns "114".
To restore original decimal point, I have used the following TUNE UP string:
[%SuggestedReply% div 100].[%SuggestedReply% mod 100]
This works well UNLESS fractional part of the system load is between 0.01 and 0.09. For example, system load of 1.08 becomes 1.8
What is the easiest way to restore my missing decimal point?
You may modify Shell Script
#!/bin/sh
if [ $# -ge 1 ]
then
uptime | awk '{load=substr($(NF-1),1,4)remove *100; if (load>'$1') {printf("ScriptRes:Bad:%2.2f\n",load)} else {printf("ScriptRes:Ok:%2.2f\n",load)}; exit;}'
else
echo 'ScriptRes:Unknown:not enough parameters specified'
fi
Another solution, use "Tune up reply" option. Expression should look like
['%SuggestedReply%' div 100].['%SuggestedReply%' mod 100 div 10]['%SuggestedReply%' mod 10]