KS-Soft. Network Management Solutions
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister    ProfileProfile    Log inLog in 

Trouble with the Warning status

 
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting
View previous topic :: View next topic  
Author Message
BoschmanIT



Joined: 16 Jul 2021
Posts: 22

PostPosted: Fri Jan 14, 2022 4:40 am    Post subject: Trouble with the Warning status Reply with quote

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
View user's profile Send private message
KS-Soft



Joined: 03 Apr 2002
Posts: 12790
Location: USA

PostPosted: Fri Jan 14, 2022 6:57 am    Post subject: Reply with quote

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
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    KS-Soft Forum Index -> Configuration, Maintenance, Troubleshooting All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
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

KS-Soft Forum Index