Tune up Reply value - calculating with decimal numbers?

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).
Post Reply
mp1
Posts: 199
Joined: Tue Mar 07, 2006 3:24 am

Tune up Reply value - calculating with decimal numbers?

Post by mp1 »

Hi,

I have a shell script which will return as reply a decimal number, f.e. 20.4
I would like to use the "Tune up Reply value" function to monitor, if the values will be increase since the last check.

Is it possibile to calculate with decimal numbers?

I try to use ['%SuggestedReply%' - '%SuggestedLastReply%'] altough this isn't working.

Any idea?

Thank you in advance

Martin
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Is it possibile to calculate with decimal numbers?
I try to use ['%SuggestedReply%' - '%SuggestedLastReply%'] altough this isn't working.
Each calculation will be rounded to integer number.
You may use the following expression to display difference with one decimal number:
if (('%SuggestedReply%'*'10'-'0%SuggestedLastReply%'*'10')>=0) [('%SuggestedReply%'*10-'%SuggestedLastReply%'*10) div 10].[('%SuggestedReply%'*10-'%SuggestedLastReply%'*10) mod 10]; else -[('-%SuggestedReply%'*10+'%SuggestedLastReply%'*10) div 10].[('-%SuggestedReply%'*10+'%SuggestedLastReply%'*10) mod 10]
Please note, your system decimal separator should be the same, as returned by your script.

If you need to use "Use Warning status if" or "Use Normal status if" expressions to determinate value growth, you may use expression like this:
('%SuggestedReply%'*10-'0%SuggestedLastReply%'*10)>4
Please note: this expression becomes true when Reply grows more than 0.4
mp1
Posts: 199
Joined: Tue Mar 07, 2006 3:24 am

Post by mp1 »

Thanks for the quick reply.
Unfortuantely I will get this error:

Code: Select all

Error in expression [('-27.3'+10'27.4) div 10): '-27.3' is not number
The script return a decimal separator a dot (f.e 27.3 or 27.4 ...)

Thanks,

Martin
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

This means, you have decimal separator on the system that differs from [ . ] (e.g. [ , ])
You may:
1. Change default system decimal separator to [ . ] (Control Panel> Region and Language> Format tab > Additional Settings>)
2. Modify script to return values with decimal separator that corresponds to system settings.

Also, your error should look exactly like this:

Code: Select all

Error in expression [('-27.3'*10+'27.4'*10) div 10]: '-27.3' is not number
Otherwise you have used incorrect expression (different, than I have provided in previous post.)
mp1
Posts: 199
Joined: Tue Mar 07, 2006 3:24 am

Post by mp1 »

I changed the decimal seperator now to [.] and also restartet the server (Windows Server 2008 R2, English). Unfortunately the same problem, the error looks exactly like this:

Code: Select all

Error in expression [('-31.7'*10+'31.7'*10) div 10]: '-31.7' is not number
Any other idea?
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

HostMonitor version?

Regards
Alex
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

HostMonitor started as Service ?
Then you'll probably need to change Decimal Separator for Local system account:
1. Check/Change Decimal Separator for current user account (Control Panel> Region and Language> Format tab > Additional Settings)
2. Click the Administrative Tab
3. Click 'Copy to reserved accounts'
4. Select 'System accounts (local system, local service, and network service)'.
5. Click OK/Apply
6. Restart HosrMonitor Service.
mp1
Posts: 199
Joined: Tue Mar 07, 2006 3:24 am

Post by mp1 »

HostMonitor started as Service ?
Then you'll probably need to change Decimal Separator for Local system account:
1. Check/Change Decimal Separator for current user account (Control Panel> Region and Language> Format tab > Additional Settings)
2. Click the Administrative Tab
3. Click 'Copy to reserved accounts'
4. Select 'System accounts (local system, local service, and network service)'.
5. Click OK/Apply
6. Restart HosrMonitor Service.
Thanks, that's it ... :-)
HM is running as Service
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You are welcome :)
Post Reply