473,472 Members | 2,155 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

Another way to do this?

I have a function I've written that monitors an application (server). If it
goes down, I send out an email SMTP within our WAN.

Is there a way to monitor this app from a different PC witihin our WAN?
Here's the function I've been using:

Private Function IsProcessRunning(ByVal sProcessName As String) As Boolean
Dim pr As System.Diagnostics.Process

IsProcessRunning = False
For Each pr In Process.GetProcesses
Try
If Trim(UCase(pr.ProcessName)) = Trim(UCase(sProcessName))
Then
If Not pr.HasExited() AndAlso pr.Responding Then
IsProcessRunning = True
End If
End If
Catch ex As Exception
'Handle error
End Try
Next pr
End Function

How would I specify to check running processes on a different PC in our
network?

Nov 22 '05 #1
2 1283
Billg_sd <Bi*****@discussions.microsoft.com> wrote:
I have a function I've written that monitors an application (server). If it
goes down, I send out an email SMTP within our WAN.

Is there a way to monitor this app from a different PC witihin our WAN?
Here's the function I've been using:

Private Function IsProcessRunning(ByVal sProcessName As String) As Boolean
Dim pr As System.Diagnostics.Process

IsProcessRunning = False
For Each pr In Process.GetProcesses
Try
If Trim(UCase(pr.ProcessName)) = Trim(UCase(sProcessName))
Then
If Not pr.HasExited() AndAlso pr.Responding Then
IsProcessRunning = True
End If
End If
Catch ex As Exception
'Handle error
End Try
Next pr
End Function

How would I specify to check running processes on a different PC in our
network?


Note that you can call GetProcessesByName to find all processes with a
specific name, so that you don't have to loop through. Both
GetProcessesByName and GetProcess have overloads which allow you to
specify a remote computer name.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too
Nov 22 '05 #2
Jon,

I didn't realize there were overloads.

Thanks.

"Jon Skeet [C# MVP]" wrote:
Billg_sd <Bi*****@discussions.microsoft.com> wrote:
I have a function I've written that monitors an application (server). If it
goes down, I send out an email SMTP within our WAN.

Is there a way to monitor this app from a different PC witihin our WAN?
Here's the function I've been using:

Private Function IsProcessRunning(ByVal sProcessName As String) As Boolean
Dim pr As System.Diagnostics.Process

IsProcessRunning = False
For Each pr In Process.GetProcesses
Try
If Trim(UCase(pr.ProcessName)) = Trim(UCase(sProcessName))
Then
If Not pr.HasExited() AndAlso pr.Responding Then
IsProcessRunning = True
End If
End If
Catch ex As Exception
'Handle error
End Try
Next pr
End Function

How would I specify to check running processes on a different PC in our
network?


Note that you can call GetProcessesByName to find all processes with a
specific name, so that you don't have to loop through. Both
GetProcessesByName and GetProcess have overloads which allow you to
specify a remote computer name.

--
Jon Skeet - <sk***@pobox.com>
http://www.pobox.com/~skeet
If replying to the group, please do not mail me too

Nov 22 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Matt | last post by:
I want to submit the form to the server without opening another page. When we do the following, it will submit the form data in myform to the IIS, and open page2.asp. <form name="myform"...
1
by: SC G | last post by:
Hi, I use a web application that has 120 checkboxes on it for me to select from before I submit a form. I have to select boxes in groups of 40 (1-40,41-80,81-120). Each submission generates a...
27
by: Javier Martinez | last post by:
Hi I have asp application in a machine with a virtual directory referring a shared directory in another machine When I try to load any aspx page of my portal I get the following error: ...
3
by: Sin Jeong-hun | last post by:
It seems like the Protect() uses the Windows accout information to encrypt data. If I know the user name and the password, can I decrypt it on another PC? If it is not, how about the exported key?...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
1
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
muto222
php
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.