Trouble with the Warning status

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
BoschmanIT
Posts: 43
Joined: Fri Jul 16, 2021 4:08 am

Trouble with the Warning status

Post by BoschmanIT »

Hi Alex,

Question. I have a test script that is checking how long my server is online since the last reboot. It displays this in TotalHours:MinutesUntilNextFullHour. This works fine, but I want the test to be bad if between 0 and 24 hours since last reboot and in warning when between 24 and 72 hours between last reboot.

I use the following expression in the warning status but still the test stays in bad status. Can you help me understand?
(('%SuggestedReply%'>'24:00') AND ('%SuggestedReply%'<72:00'))
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

1) Probably you don't need a script?
SNMP Get test may check uptime (OID 1.3.6.1.2.1.1.3.0) and will use much less system resources than external script, that's important when you need to check 1000 or 50,000 servers.

2) 24:00 cannot be compared as number, its a string. So 24:00 and 72:00 should be compared correctly, 05:05 will be compared correctly as well. But if you have values like 5:00 (not 05:00) then you should keep in mind "5:00" string has greater value than "15:00".

You may
a) check the script and make sure it adds leading 0 for hours and minuted and there are no replies like "2 days" or "5:01" or "5:9" (because "2 days" string has lower value than "3:00")

b) or modify "Use Warning status" expression. E.g.
(('%SuggestedReply%' getnumber 1)>=24) AND (('%SuggestedReply%' getnumber 1)<=72)
this expression will work when %SuggestedReply% returns values like hh:mm or h:mm or h:m or hh:m

Regards
Alex
Post Reply