performancecounter object and remote server

S

SalamElias

Has anybody worked with performancecounter object to access counters on
remote machine?
I managed to write code that retrieves counters categories froma remote
machine, when I try another remote machine I get
"System.ComponentModel.Win32Exception" error. Error message is
"The network path was not found."
I have checked running services (RPC, Remote registery.....) on both
machines and they are exactly the same.
I am wondering if there is anything to configure to allow access to counters
remotly that I am missing on the 2nd machine.
The scenarion is as follows :
I have a workgroup,not a domain, 1 XP laptop (where I have VS 2005), 2
virtual win2k3 machines. when runing the code, the mentioned error happens at
the following line

Dim AllCountersCategories As PerformanceCounterCategory() =
PerformanceCounterCategory.GetCategories(strServerName)

Regarding network connection, I can map a connection to both servers in
windows explorer. the user and password I use to log tomy XP machine are also
created on both machines.

The error message really doesn't give any clue why I am not able to retrieve
the 2nd machines counters whereas it it works like a charm with the other
server.
Thanksd in advance
 
S

Steven Cheng [MSFT]

Hi Salam,

From your description, you're using the .NET performance counter to open
counters on remote machine, however, you got the following error, correct?
"System.ComponentModel.Win32Exception" error. Error message is
"The network path was not found."

based on my research, so far for remote performance counter accessing, the
following blog entry has mentioned some information:

#How to Read Performance Counters Without Administrator Privileges [Ryan
Byington]
http://blogs.msdn.com/bclteam/archive/2006/09/08/746900.aspx

Also, as you mentioned the non-domain environment, I think it is also
related to the problem. I've performenced tests on my side, in a domain
environment, I can get the code you provided run correctly(event if I try
running under a local account, has same username/password on both machine).
Are you running through an account has same username/password on both
machine and is it an administrator account?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
 
S

SalamElias

Thanks Steven, I read the blog which has interesting information but it
doesn't apply to my context.
Yes, I am running through an account has same username/password on 3 mac
hines and which are all declared in administrators group.
So, I think I should not need to apply instructions mentioned in the blog

Steven Cheng said:
Hi Salam,

From your description, you're using the .NET performance counter to open
counters on remote machine, however, you got the following error, correct?
"System.ComponentModel.Win32Exception" error. Error message is
"The network path was not found."

based on my research, so far for remote performance counter accessing, the
following blog entry has mentioned some information:

#How to Read Performance Counters Without Administrator Privileges [Ryan
Byington]
http://blogs.msdn.com/bclteam/archive/2006/09/08/746900.aspx

Also, as you mentioned the non-domain environment, I think it is also
related to the problem. I've performenced tests on my side, in a domain
environment, I can get the code you provided run correctly(event if I try
running under a local account, has same username/password on both machine).
Are you running through an account has same username/password on both
machine and is it an administrator account?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?U2FsYW1FbGlhcw==?= <[email protected]>
Subject: performancecounter object and remote server
Date: Tue, 27 May 2008 01:24:00 -0700
Has anybody worked with performancecounter object to access counters on
remote machine?
I managed to write code that retrieves counters categories froma remote
machine, when I try another remote machine I get
"System.ComponentModel.Win32Exception" error. Error message is
"The network path was not found."
I have checked running services (RPC, Remote registery.....) on both
machines and they are exactly the same.
I am wondering if there is anything to configure to allow access to counters
remotly that I am missing on the 2nd machine.
The scenarion is as follows :
I have a workgroup,not a domain, 1 XP laptop (where I have VS 2005), 2
virtual win2k3 machines. when runing the code, the mentioned error happens at
the following line

Dim AllCountersCategories As PerformanceCounterCategory() =
PerformanceCounterCategory.GetCategories(strServerName)

Regarding network connection, I can map a connection to both servers in
windows explorer. the user and password I use to log tomy XP machine are also
created on both machines.

The error message really doesn't give any clue why I am not able to retrieve
the 2nd machines counters whereas it it works like a charm with the other
server.
Thanksd in advance
 
S

SalamElias

To be 100% sure, and in spite of the fact the the user is in admin group, I
added the user in the PERF mon group on the machine where I have problems, I
get exactly the same error

Steven Cheng said:
Hi Salam,

From your description, you're using the .NET performance counter to open
counters on remote machine, however, you got the following error, correct?
"System.ComponentModel.Win32Exception" error. Error message is
"The network path was not found."

based on my research, so far for remote performance counter accessing, the
following blog entry has mentioned some information:

#How to Read Performance Counters Without Administrator Privileges [Ryan
Byington]
http://blogs.msdn.com/bclteam/archive/2006/09/08/746900.aspx

Also, as you mentioned the non-domain environment, I think it is also
related to the problem. I've performenced tests on my side, in a domain
environment, I can get the code you provided run correctly(event if I try
running under a local account, has same username/password on both machine).
Are you running through an account has same username/password on both
machine and is it an administrator account?

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscriptions/support/default.aspx.
==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.

--------------------
From: =?Utf-8?B?U2FsYW1FbGlhcw==?= <[email protected]>
Subject: performancecounter object and remote server
Date: Tue, 27 May 2008 01:24:00 -0700
Has anybody worked with performancecounter object to access counters on
remote machine?
I managed to write code that retrieves counters categories froma remote
machine, when I try another remote machine I get
"System.ComponentModel.Win32Exception" error. Error message is
"The network path was not found."
I have checked running services (RPC, Remote registery.....) on both
machines and they are exactly the same.
I am wondering if there is anything to configure to allow access to counters
remotly that I am missing on the 2nd machine.
The scenarion is as follows :
I have a workgroup,not a domain, 1 XP laptop (where I have VS 2005), 2
virtual win2k3 machines. when runing the code, the mentioned error happens at
the following line

Dim AllCountersCategories As PerformanceCounterCategory() =
PerformanceCounterCategory.GetCategories(strServerName)

Regarding network connection, I can map a connection to both servers in
windows explorer. the user and password I use to log tomy XP machine are also
created on both machines.

The error message really doesn't give any clue why I am not able to retrieve
the 2nd machines counters whereas it it works like a charm with the other
server.
Thanksd in advance
 
S

Steven Cheng [MSFT]

Thanks for your reply Salam,

So the problem on your side is not specific to account's security
permission. Have you had a chance to test the same code on some machines
with domain setup? If possible, you can test it to see whether the problem
does be specific to the non-domain environment. And we can continue to
concentrate on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?U2FsYW1FbGlhcw==?= <[email protected]>
References: <[email protected]>
Subject: RE: performancecounter object and remote server
Date: Wed, 28 May 2008 02:27:01 -0700
Thanks Steven, I read the blog which has interesting information but it
doesn't apply to my context.
Yes, I am running through an account has same username/password on 3 mac
hines and which are all declared in administrators group.
So, I think I should not need to apply instructions mentioned in the blog

Steven Cheng said:
Hi Salam,

From your description, you're using the .NET performance counter to open
counters on remote machine, however, you got the following error, correct?
"System.ComponentModel.Win32Exception" error. Error message is
"The network path was not found."

based on my research, so far for remote performance counter accessing, the
following blog entry has mentioned some information:

#How to Read Performance Counters Without Administrator Privileges [Ryan
Byington]
http://blogs.msdn.com/bclteam/archive/2006/09/08/746900.aspx
 
S

SalamElias

Steven, currently I am working for a small size customer and he doesn't have
a domain. He has a workgroup of 8 servers.
I will see if I can setup a domain somewhere.
Isn't there a way to have more explicit information about the error itself
in VS?

Steven Cheng said:
Thanks for your reply Salam,

So the problem on your side is not specific to account's security
permission. Have you had a chance to test the same code on some machines
with domain setup? If possible, you can test it to see whether the problem
does be specific to the non-domain environment. And we can continue to
concentrate on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?U2FsYW1FbGlhcw==?= <[email protected]>
References: <[email protected]>
Subject: RE: performancecounter object and remote server
Date: Wed, 28 May 2008 02:27:01 -0700
Thanks Steven, I read the blog which has interesting information but it
doesn't apply to my context.
Yes, I am running through an account has same username/password on 3 mac
hines and which are all declared in administrators group.
So, I think I should not need to apply instructions mentioned in the blog

Steven Cheng said:
Hi Salam,

From your description, you're using the .NET performance counter to open
counters on remote machine, however, you got the following error, correct?

"System.ComponentModel.Win32Exception" error. Error message is
"The network path was not found."

based on my research, so far for remote performance counter accessing, the
following blog entry has mentioned some information:

#How to Read Performance Counters Without Administrator Privileges [Ryan
Byington]
http://blogs.msdn.com/bclteam/archive/2006/09/08/746900.aspx
 
S

SalamElias

I did more investigation on my 1st (the one which I manage to access) and 2nd
server (the one I can not access) and it seems that the problem is related to
PerformanceCounterCategory class .
I have setup a 3rd server, run my code against and it was successfull.
In my application I have a combo box which contains a list of servers with
which I like to work with.
So I had this 3rd server server as item(0) in combobox, the 2nd is the old
one (1st) which I always managed to access

So when I change the combobox to the 2nd server, I get exactly the same
error as for the server (2nd) that I was not able to access.

Here is the code I execute when item in combobox changes

Private Sub GetCounters()
Try
Dim strServerName =
cboServersList.Items(cboServersList.SelectedIndex).ToString.Replace("\", "")
Dim AllCountersCategories As PerformanceCounterCategory() =
PerformanceCounterCategory.GetCategories(strServerName)

'''Code taken for ease of read

Catch ex As Exception

Dim rethrow As Boolean = ExceptionPolicy.HandleException(ex,
"ComponentModel Policy")
If (rethrow) Then
' Throw original exception.
Throw
End If

End Try

End Sub

So it seems there is somwhere some context issues so the
PerformanceCounterCategory class is not able to update itself with counters
from another server.
I tried t play with the method clear but it didn't help.
So whats happening is the following : code execute correcely for 1st server
but not swicthing to another server

Steven Cheng said:
Thanks for your reply Salam,

So the problem on your side is not specific to account's security
permission. Have you had a chance to test the same code on some machines
with domain setup? If possible, you can test it to see whether the problem
does be specific to the non-domain environment. And we can continue to
concentrate on this.

Sincerely,

Steven Cheng

Microsoft MSDN Online Support Lead


Delighting our customers is our #1 priority. We welcome your comments and
suggestions about how we can improve the support we provide to you. Please
feel free to let my manager know what you think of the level of service
provided. You can send feedback directly to my manager at:
(e-mail address removed).

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.aspx#notif
ications.

==================================================
This posting is provided "AS IS" with no warranties, and confers no rights.
--------------------
From: =?Utf-8?B?U2FsYW1FbGlhcw==?= <[email protected]>
References: <[email protected]>
Subject: RE: performancecounter object and remote server
Date: Wed, 28 May 2008 02:27:01 -0700
Thanks Steven, I read the blog which has interesting information but it
doesn't apply to my context.
Yes, I am running through an account has same username/password on 3 mac
hines and which are all declared in administrators group.
So, I think I should not need to apply instructions mentioned in the blog

Steven Cheng said:
Hi Salam,

From your description, you're using the .NET performance counter to open
counters on remote machine, however, you got the following error, correct?

"System.ComponentModel.Win32Exception" error. Error message is
"The network path was not found."

based on my research, so far for remote performance counter accessing, the
following blog entry has mentioned some information:

#How to Read Performance Counters Without Administrator Privileges [Ryan
Byington]
http://blogs.msdn.com/bclteam/archive/2006/09/08/746900.aspx
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top