Home All Groups Group Topic Archive Search About

Detect Remote Shutdown

Author
17 Jan 2006 4:25 PM
Chris Johnson
Hey all,

I have a small app I have developed that periodically pings a list of server
and returns their status. Given my environment I have setup the program such
that a server can be down 4 minutes before I get an alert.

My problem now is that is a server is rebooted, it will be back up before
the 4 minute window and I will not be aware that it has rebooted.

I am looking for a way (as an administrator, or not, if possible) to detect
the reboot of a remote machine. I have found code to initiate a local and
remote reboot, but not a way to detect one is happening, can anyone shed
some light here for me?

Thanks!
chrisj

Author
17 Jan 2006 4:39 PM
Patrice
You should be able to get the server boottime using WMI.. Try :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__desktop_management.asp
(how long a computer has been running).

--
Patrice

Show quoteHide quote
"Chris Johnson" <rave***@gmail.com> a écrit dans le message de
news:OKGccK4GGHA.532@TK2MSFTNGP15.phx.gbl...
> Hey all,
>
> I have a small app I have developed that periodically pings a list of
server
> and returns their status. Given my environment I have setup the program
such
> that a server can be down 4 minutes before I get an alert.
>
> My problem now is that is a server is rebooted, it will be back up before
> the 4 minute window and I will not be aware that it has rebooted.
>
> I am looking for a way (as an administrator, or not, if possible) to
detect
> the reboot of a remote machine. I have found code to initiate a local and
> remote reboot, but not a way to detect one is happening, can anyone shed
> some light here for me?
>
> Thanks!
> chrisj
>
>
Author
17 Jan 2006 5:46 PM
Chris Johnson
Patrice,

Not a bad idea. I will try that one for now. If anyone has a way to actually
detect the shutdown even I am also still interested in that.

Thanks again Patrice for the quick response!
chrisj

Show quoteHide quote
"Patrice" <nob***@nowhere.com> wrote in message
news:O08JUS4GGHA.2652@tk2msftngp13.phx.gbl...
> You should be able to get the server boottime using WMI.. Try :
> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__desktop_management.asp
> (how long a computer has been running).
>
> --
> Patrice
>
> "Chris Johnson" <rave***@gmail.com> a écrit dans le message de
> news:OKGccK4GGHA.532@TK2MSFTNGP15.phx.gbl...
>> Hey all,
>>
>> I have a small app I have developed that periodically pings a list of
> server
>> and returns their status. Given my environment I have setup the program
> such
>> that a server can be down 4 minutes before I get an alert.
>>
>> My problem now is that is a server is rebooted, it will be back up before
>> the 4 minute window and I will not be aware that it has rebooted.
>>
>> I am looking for a way (as an administrator, or not, if possible) to
> detect
>> the reboot of a remote machine. I have found code to initiate a local and
>> remote reboot, but not a way to detect one is happening, can anyone shed
>> some light here for me?
>>
>> Thanks!
>> chrisj
>>
>>
>
>
Author
18 Jan 2006 3:18 PM
Richy
Just an idea, you could write a service as that has an OnStop handler, and
will be stopped when the server reboots. In the OnStop Handler you could
send a message via IP Socket to the app running to detect the shut down.



Show quoteHide quote
"Chris Johnson" <rave***@gmail.com> wrote in message
news:eQA3C44GGHA.3700@TK2MSFTNGP15.phx.gbl...
> Patrice,
>
> Not a bad idea. I will try that one for now. If anyone has a way to
> actually detect the shutdown even I am also still interested in that.
>
> Thanks again Patrice for the quick response!
> chrisj
>
> "Patrice" <nob***@nowhere.com> wrote in message
> news:O08JUS4GGHA.2652@tk2msftngp13.phx.gbl...
>> You should be able to get the server boottime using WMI.. Try :
>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__desktop_management.asp
>> (how long a computer has been running).
>>
>> --
>> Patrice
>>
>> "Chris Johnson" <rave***@gmail.com> a écrit dans le message de
>> news:OKGccK4GGHA.532@TK2MSFTNGP15.phx.gbl...
>>> Hey all,
>>>
>>> I have a small app I have developed that periodically pings a list of
>> server
>>> and returns their status. Given my environment I have setup the program
>> such
>>> that a server can be down 4 minutes before I get an alert.
>>>
>>> My problem now is that is a server is rebooted, it will be back up
>>> before
>>> the 4 minute window and I will not be aware that it has rebooted.
>>>
>>> I am looking for a way (as an administrator, or not, if possible) to
>> detect
>>> the reboot of a remote machine. I have found code to initiate a local
>>> and
>>> remote reboot, but not a way to detect one is happening, can anyone shed
>>> some light here for me?
>>>
>>> Thanks!
>>> chrisj
>>>
>>>
>>
>>
>
>
Author
18 Jan 2006 3:29 PM
Chris Johnson
Thats the direction Im going with the project next. Im currently writting my
"jr." application to report into the parent. Might throw some more questions
out once I get a bit farther but thanks for the hint!

chrisj

Show quoteHide quote
"Richy" <subscript***@crosskeysonline.co.uk> wrote in message
news:1137597512.994354@ernani.logica.co.uk...
> Just an idea, you could write a service as that has an OnStop handler, and
> will be stopped when the server reboots. In the OnStop Handler you could
> send a message via IP Socket to the app running to detect the shut down.
>
>
>
> "Chris Johnson" <rave***@gmail.com> wrote in message
> news:eQA3C44GGHA.3700@TK2MSFTNGP15.phx.gbl...
>> Patrice,
>>
>> Not a bad idea. I will try that one for now. If anyone has a way to
>> actually detect the shutdown even I am also still interested in that.
>>
>> Thanks again Patrice for the quick response!
>> chrisj
>>
>> "Patrice" <nob***@nowhere.com> wrote in message
>> news:O08JUS4GGHA.2652@tk2msftngp13.phx.gbl...
>>> You should be able to get the server boottime using WMI.. Try :
>>> http://msdn.microsoft.com/library/default.asp?url=/library/en-us/wmisdk/wmi/wmi_tasks__desktop_management.asp
>>> (how long a computer has been running).
>>>
>>> --
>>> Patrice
>>>
>>> "Chris Johnson" <rave***@gmail.com> a écrit dans le message de
>>> news:OKGccK4GGHA.532@TK2MSFTNGP15.phx.gbl...
>>>> Hey all,
>>>>
>>>> I have a small app I have developed that periodically pings a list of
>>> server
>>>> and returns their status. Given my environment I have setup the program
>>> such
>>>> that a server can be down 4 minutes before I get an alert.
>>>>
>>>> My problem now is that is a server is rebooted, it will be back up
>>>> before
>>>> the 4 minute window and I will not be aware that it has rebooted.
>>>>
>>>> I am looking for a way (as an administrator, or not, if possible) to
>>> detect
>>>> the reboot of a remote machine. I have found code to initiate a local
>>>> and
>>>> remote reboot, but not a way to detect one is happening, can anyone
>>>> shed
>>>> some light here for me?
>>>>
>>>> Thanks!
>>>> chrisj
>>>>
>>>>
>>>
>>>
>>
>>
>
>