Problem with reply that has decimal.

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).
StevenE
Posts: 97
Joined: Wed Jul 27, 2005 2:23 pm

Problem with reply that has decimal.

Post by StevenE »

We have a few dozen devices PDU and UPS units we poll with SNMP for information. They reply with the load total in the form of a decimal 9.2 and etc.

With a result of 9.2 ( or anything lower than 10.0 )

If we set the "Alert when is > than " to 9.9 it returns normal.

** If we set the "Alert when is > than " to 11 or 11.0 it returns bad.

It seems the decimal is not being processed correctly.

How can I correct this ?

Host Monitor 9.58

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

Post by KS-Soft Europe »

Have you marked "Check OPAQUE data for float numbers" option for "SNMP profile" used for this test?

Quote from manual:
Check OPAQUE data for float numbers
This option tells HostMonitor to check for single and double precision floating-point numbers that can be encoded as OPAQUE SNMP data and compare such numbers with specified value (number that specified as alert condition for each specific test item).
http://www.ks-soft.net/hostmon.eng/mfra ... nmpaccount
StevenE
Posts: 97
Joined: Wed Jul 27, 2005 2:23 pm

Post by StevenE »

Tried that setting with multiple units and still have the problem with the decimals.

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

Post by KS-Soft Europe »

Looks like your device(s) return string (not numeric) values.
That's why HostMonitor compares values as strings.
You may try the following workaround:
1. Make sure, you have set point (.) as decimal separator on Windows system.
2. Change alert condition to Alert when OID is = to <empty sting>
3. Enable "Use Warning status if" option (located on test properties dialog) with expression like the following:
%SuggestedReply_Integer% > 5

Note1: "Treat Warning status as Bad" option should be enabled
Note2: you may check if system decimal separator is correct (set to point (.)), by enabling "Tune up Reply value" option (located on Test properties dialog) with expression:
%SuggestedReply_Integer%
Note3: Only integer values can be used for comparation.
StevenE
Posts: 97
Joined: Wed Jul 27, 2005 2:23 pm

Post by StevenE »

Thank you, that worked.

I had tried so many variables, I must of missed that one.

Thanks Again.
Steven
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

You are welcome.
HD-COT
Posts: 16
Joined: Thu Sep 25, 2014 6:23 am
Location: Nuremberg

Similar Problem but with Text in Reply

Post by HD-COT »

Hi,

I got a similar problem with NAS-Systems which reply RAM-Status via SNMP as the following:

980.9 MB

The SNMP-Value seems to be octetstring.

I managed to remove the "MB" from the string by replacestring-Function, but how to convert the number into an an integer for further monitoring?

%SuggestedReply_Integer% replies 0
OPAQUE-Setting is set.
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

It depends on your system decimal separator.
If your system decimal separator is dot ( . ), you may use:
"Tune up Reply value" option with expression: ['%SuggestedReply%' getword 1]
"Use Warning status if" expression: ('%SuggestedReply%' getword 1)<1000
Where 1000 is threshold value that will trigger Warning status.
Also, please make sure "Treat Warning status as Bad" option is enabled.

Please check for details at:
http://www.ks-soft.net/hostmon.eng/mfra ... ningstatus
HD-COT
Posts: 16
Joined: Thu Sep 25, 2014 6:23 am
Location: Nuremberg

Post by HD-COT »

Thanks for your quick reply!

Decimal Separator is set to "." as you told earlier in this thread.
I can Tune Up the value by your expression, it converts

578.4 MB into 578.4

But it seems like HM cannot calculate with that number.

For instance, when I try division or multiplication by TuneUp ['%SuggestedReply%' getword 1] * 1024
it shows 578.4 * 1024 in the Reply field rather than 592281,6

Also the warning never works, it treats every value that is reported as zero ( 0 )

Please advise :(

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

Post by KS-Soft Europe »

For instance, when I try division or multiplication by TuneUp ['%SuggestedReply%' getword 1] * 1024
it shows 578.4 * 1024 in the Reply field rather than 592281,6
Tune up Reply expression should look like the following:
[('%SuggestedReply%' getword 1) * 1024 ]
HD-COT
Posts: 16
Joined: Thu Sep 25, 2014 6:23 am
Location: Nuremberg

Post by HD-COT »

KS-Soft Europe wrote: Tune up Reply expression should look like the following:
[('%SuggestedReply%' getword 1) * 1024 ]
Reply: Error in expression [('574.5 MB' getword 1) * 1024]: 574.5 is not number.

Here screenhot of my german Windows Server 2003 Region- and Language-Settings:
Image

Thank you very much for your help!
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

Well, this can be corrected with replace() function but I assume you want to start some alerts when reply value is over some threshould?
And this is problem in such case...

This device does not offer any "normal" numeric counter?

Regards
Alex
HD-COT
Posts: 16
Joined: Thu Sep 25, 2014 6:23 am
Location: Nuremberg

Post by HD-COT »

KS-Soft wrote:Well, this can be corrected with replace() function but I assume you want to start some alerts when reply value is over some threshould?
And this is problem in such case...
Isn't it possible to convert the result into numeric counter then set the threshould to like the %LastResult% so it hits the BAD-Status in the second test? Sth like this?
KS-Soft wrote:This device does not offer any "normal" numeric counter?
I am afraid, but it doesnt.
The MIB for this test (SNMP-GET) says there is a test for Free Memory with numeric counter, but NAS seems to not support that OID, getting Error with "no such name"

Every other counter (CPU, Free Disk, Smart etc. is numeric, but not the RAM. :-?
KS-Soft Europe
Posts: 2832
Joined: Tue May 16, 2006 4:41 am
Contact:

Post by KS-Soft Europe »

Looks like HostMonitor is started uder different user account.
Please check HostMonitor user account decimal separator.
HD-COT
Posts: 16
Joined: Thu Sep 25, 2014 6:23 am
Location: Nuremberg

Post by HD-COT »

KS-Soft Europe wrote:Looks like HostMonitor is started uder different user account.
Please check HostMonitor user account decimal separator.
Crazy! This is the reason!
Hostmonitor is working in local system context which (cause of the german OS) seems to be the cause for this problem! Fantastic!

But...

Since I set the service credentials to the user that I am logged in with, the tray icon showing the running HM-Service is gone.
How to work with HM now, Stop the Service and Start Application Mode everytime I work with it?

or

Is there any option to work directly with the service? Without restarting?
(I do not want to work with RCC as it is quite slow sometimes...)

Thanks a lot!
Chris.
Post Reply