The Laughing Cow
03-21-2002, 12:06 PM
I know that server monitoring is a often discussed & rediscussed topic here at WHT, so I was interested at seeing what you guys used for monitoring?
I have been thinking that I want to setup a system that logs the uptime for various servers but I am trying to think of a way to do this. Can anybody point me in the right direction?
I would be wanting to store this in a database or text file of some sort so that I could record the uptimes for various domains.
What's the easiest way to do this? Is there some kind of built in function to maybe ping or connect to a box in PHP or ASP? Perl?
Opinions welcome.
Wolfy
03-21-2002, 02:02 PM
I've been thinking along the same lines - mainly because NetStatus monitor does not really like W2k.
W2k does have a built in 'uptime' function, but it's got a bug and dosn't very well. Linux does have an 'uptime' function that you can call from your .php - so you're job there is a little easier, if you can run the script locally on the machine. If you can't run the script locally, or if its W2k, then things get a little more tricky.
You could simply have a 'time counter' in your database, that updates every time that the server is checked. If the server is 'down' when it's checked, then the 'time counter' resets itself. The problem with this senario is that the server is probably only checked every 5 mins .. and it would be easy to miss a reboot. Again if you have 'control' of the servers you are monitoring, you could sent a 'trip' to reset the counter when the server reboots. But that's not going to help if your watching other people's servers.
Ping -t works 'well', but I doubt anyone would like a constant stream of pings to their server. ;)
But I'm rambling, and I'm not sure if I'm answering your question anyway .. so I'll be quiet now. ;)
As for 'what to use for monitoring' .. I've been playing with Demarc a bit recently, its got some useful features.
The Laughing Cow
03-21-2002, 02:22 PM
I have something that works for Windows
Dim days, hours, minutes, seconds, startTime, runTime, days_text, hours_text, minutes_text, seconds_text, Percent_Seconds, value_seconds
' Read the start time from the Application variable
startTime = CDate(Application("startTime"))
' Take the difference
runTime = CDate(Now - startTime)
' Calculate the time
If DateDiff("d", startTime, Now) = 0 Then
days = 0
Else
days = Day(runTime)
End If
hours = Hour(runTime)
minutes = Minute(runTime)
seconds = Second(runTime)
Combined with the Application on start within Global ASA it works.
The only flaw is that you need to run it all on the server, which is by far not what I want.
To be honest I do not see what would be so wrong with pinging one datagram every 30mins to a server maybe?
bitserve
03-21-2002, 05:08 PM
So really. What're the uptime stats like on your windows servers? :)
The Laughing Cow
03-21-2002, 07:50 PM
I'm not sure whether that is a genuine question or not but i'll answer :D
I'm reading 21 days, 23 hours 54 minutes
Hey that's quite ironic I would check at this time.
I will be configuring my monitoring script soon for it.
The Laughing Cow
03-21-2002, 07:58 PM
To update, i have developed he ping and now need to extract the data to see if a host is up.
Wolfy
03-21-2002, 10:50 PM
Originally posted by The Laughing Cow
<snip>
The only flaw is that you need to run it all on the server, which is by far not what I want.
To be honest I do not see what would be so wrong with pinging one datagram every 30mins to a server maybe?
While pinging the server every 30mins or so will tell you if the server is up or down. It won't tell you if the server has been rebooted in that time - which is I thought what you are looking at monitoring?