Friday, March 9, 2012

Method to check the connection status of any Machine on Network

Hello All:
I need to know the connection status of any machine on domain i.e. I want to
check that whether the machine is on or off(alive/dead).
If anyone can tell then I shall be highly grateful
Sincerely,
Adnan KudiyaHi
Try sp_who 'active'
"adnankudiya" <adnankudiya.1nq9tv@.mail.codecomments.com> wrote in message
news:adnankudiya.1nq9tv@.mail.codecomments.com...
> Hello All:
> I need to know the connection status of any machine on domain i.e. I
> want to check that whether the machine is on or off(alive/dead).
> If anyone can tell then I shall be highly grateful
> Sincerely,
> Adnan Kudiya
>
> --
> adnankudiya
> ---
> Posted via http://www.codecomments.com
> ---
>|||Hi
I assume you mean database connection status and not just something like
pinging the client periodically to see if you get a reply? This may be
difficult as you can gather information about when a connection last did
something sysprocesses, but you don't know if they are connected or have
died. If your application has a set timeout and any activity has not happene
d
in that time, I guess you can assume they are dead.
John
"adnankudiya" wrote:

> Hello All:
> I need to know the connection status of any machine on domain i.e. I
> want to check that whether the machine is on or off(alive/dead).
> If anyone can tell then I shall be highly grateful
> Sincerely,
> Adnan Kudiya
>
> --
> adnankudiya
> ---
> Posted via http://www.codecomments.com
> ---
>|||I thought about this a while back and did not come up with a good solution.
One idea was to write a stored procedure - sp_ping and execute that on the
connection:
create proc sp_ping
as
return 0
go
or something trivial and similar - EG
SELECT DateNow = GetDate()
You could run that SP with a timeout that is quite low say 2 seconds.
- Tim
BTW: I do realise sp_ is not a good prefix.
"John Bell" <JohnBell@.discussions.microsoft.com> wrote in message
news:F32C6F92-2896-4F96-9FC5-49D846A434FF@.microsoft.com...
> Hi
> I assume you mean database connection status and not just something like
> pinging the client periodically to see if you get a reply? This may be
> difficult as you can gather information about when a connection last did
> something sysprocesses, but you don't know if they are connected or have
> died. If your application has a set timeout and any activity has not
> happened
> in that time, I guess you can assume they are dead.
> John
> "adnankudiya" wrote:
>

No comments:

Post a Comment