|
View previous topic :: View next topic |
Author |
Message |
BoschmanIT
Joined: 16 Jul 2021 Posts: 22
|
Posted: Fri Jan 14, 2022 4:40 am Post subject: Trouble with the Warning status |
|
|
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')) |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
KS-Soft
Joined: 03 Apr 2002 Posts: 12795 Location: USA
|
Posted: Fri Jan 14, 2022 6:57 am Post subject: |
|
|
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 |
|
Back to top |
|
![](templates/subSilver/images/spacer.gif) |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|