PerfMon 
Author Message
 PerfMon

I have a few counters saved in a pmc file which point to a number of servers
in my enterprise.  The servers I need to monitor changes on a weekly basis
which means I have to open the pmc edit the servers and resave the pmc.
Does anyone know how to automate this process using VBScript or any other
scripting language?

Cheers

--

Ben
_______________________________________________________________
To reply to me personally remove 'unwanted' from the email address



Thu, 07 Oct 2004 23:26:13 GMT  
 PerfMon
Here's a WSH-hosted method.  I assume this is a file that contains the server
names as text content and that it is reasonably small (not more than a few
hundred K or so...)

This just goes through and changes any encountered server name to a new one
where ever it is seen; you can have it go over an entire list of server names
also.

myfile = "C:\temp\list.pmc"
oldserver = "192.168.1.1"
newserver = "192.168.1.2"

sData = f_r(myfile)
sData = Replace(sData,oldserver,newserver)
f_w sData, myfile

Function f_r(FilePath)
  'Given the path to a file, will return entire contents
  f_r = FSO.OpenTextFile(FilePath,1).ReadAll
End Function

Sub f_w(sData,FilePath)
 'strToWrite is data written to file strFilePath
 fileRef = FSO.OpenTextFile(FilePath, 2, True).WriteLine(sData)
End Sub


Quote:
> I have a few counters saved in a pmc file which point to a number of servers
> in my enterprise.  The servers I need to monitor changes on a weekly basis
> which means I have to open the pmc edit the servers and resave the pmc.
> Does anyone know how to automate this process using vbscript or any other
> scripting language?

> Cheers

> --

> Ben
> _______________________________________________________________
> To reply to me personally remove 'unwanted' from the email address



Fri, 08 Oct 2004 00:20:06 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. Perfmon.mof ( Remote Server connecting problems )

2. Enabling Non-Admin Users to Remotely Monitor with PERFMON

3. Email from a Perfmon Alert????

4. Perfmon.mof ( WMI Issue ) Remote Server ( connecting problems )

5. Perfmon Counters via WSH

6. Enabling Non-Admin Users to Remotely Monitor with PERFMON

7. Email from an Perfmon alert ?

8. Perfmon.mof ( WMI Issue ) Remote Server ( connecting problems )

9. Accessing Perfmon Counters

10. Email from a Perfmon Alert????

11. Timestamp_Object & SystemUpTime (PerfMon)

 

 
Powered by phpBB® Forum Software