| | | |
Uploading ....
How to add custom WMI monitors into MSPCenterPlus
Disclaimer: This is a work around procedure. Trying these steps needs some basic knowledge about WMI queries. Please don't attempt it in live setup if you are not very sure of WMI as you might be messing around with some configuration files in the process.
Steps to add WMI monitors into MSPCENTERPLUS
- Write down your WMI Query
- Test your WMI query from command prompt
- Execute db queries to add the WMI monitor into the db
- Add the WMI monitor into template from the central UI
- Execute db queries to manipulate some values of the added monitor
- Associate the monitor to several devices and check if data is getting collected properly
Step1: Write down your WMI query
example :
| Select percentusage from Win32_PerfFormattedData_PerfOS_PagingFile where name ="_Total" |
Step2: Test your WMI Query
Go to central or probe\conf\application\scripts\ and execute the query below
C:\Program Files\AdventNet\ME\probe\conf\application\scripts>cscript wmiget.vbs machinename "domainname\username" "password" ROOT\CIMV2 "SELECT percentusage FROM Win32_PerfFormattedData_PerfOS_PagingFile WHERE name ='_Total'"
|

Step 3: Execute the following queries in central and probe database
- select * from wmiclass where classname like "%put your class name here%"
- if the above query doesnt return any result then do the following, else get the classid from the above query and proceed to step 3
- select max(classid) from wmiclass
- insert into wmiclass set classid=XYZ,namespace='ROOT\\CIMV2',classname="Win32_PerfFormattedData_PerfOS_PagingFile"
- select max(collectdataid) from wmipolleddata
- insert into wmipolleddata set collectdataid="XYZ",
collectdataname="PagingFile Usage", classid=46,
Expression="percentusage", CRITERIA="name ='_Total'",instance=null
* - XYZ - increment the number obtained in earlier step and use here. For example if max(classid) is 45 use 46
Step 4: Go to central user interface and do the following- Open central URL and go to Admin-> Monitoring Templates-> Windows Base WMI Template->New Monitor-> Add Bulk
- Provide the following info
- name= PagingFile Usage
- oid=PagingFile Usage
* - the OID should be the same as collectdataname in the insert query above
- Tabular = no
- Interval = 5 mins
- Units = %
- Thershold = provide if you wish
- Save the Template
- Cancel the final step
Step 5: Execute the following DB queries in both central and probe- update graphdetails set protocolid=(select protocolid from
protocoldetails where protocolname="WMI") where graphname like
"%PagingFile%"
- select * from graphdetails where graphname like "%PagingFile%"
- insert into graphuserprops set graphid=XYZ,propname="GROUPNAME",propvalue="WMI"
* - get the ID from the step above
Step 6: Apply the monitor to device
- Go to the device snapshot page and add the monitor.
- Do a test monitor and see if it shows the data correctly
Example 2: PoolNonPagedBytes
WMI Query : select PoolNonpagedBytes from Win32_PerfFormattedData_PerfOS_Memory
Step1: Add the WMI class
Execute the following queries in your central database ....
| check if the wmiclass is already present | - select * from wmiclass where classname like "%Win32_PerfFormattedData_PerfOS_Memory%"
| | add the wmicclass if it is not present | - select max(classid) from wmiclass
- insert into wmiclass set classid=x+1, namespace='ROOT\\CIMV2', classname="Win32_PerfFormattedData_PerfOS_Memory"
note: x = max(classid)
| notedown the wmiclass id
| - select classid from wmiclass where classname="Win32_PerfFormattedData_PerfOS_Memory"
will be used in next step as z
| add wmimonitor
| - select max(collectdataid) from wmipolleddata
- insert into wmipolleddata set collectdataid="y+1", collectdataname="PoolNonpagedBytes", classid=z,
Expression="PoolNonpagedBytes/1024"
note1: y=max(collectdataid)
note2: z= result of step3 above
| repeat all the steps above in probe
| connect to each probe and do the steps above
|
Step 2: Add a monitor
- Open central URL and go to Admin-> Monitoring Templates-> Windows Base WMI Template->New Monitor-> Add Bulk
- Provide the following info
- name= PoolNonpagedBytes
- oid=PoolNonpagedBytes
* - the OID should be the same as collectdataname in the insert query above
- Tabular = no
- Save the Template
- Cancel the final step
Step 3: Update the monitor details
set the protocal to WMI
| - update graphdetails set protocolid=(select protocolid from
protocoldetails where protocolname="WMI") where graphname like
"%PoolNonpagedBytes%"
| insert into graphuserprops
| - select graphid from graphdetails where graphname like "%PoolNonpagedBytes%"
- insert into graphuserprops set graphid=z,propname="GROUPNAME",propvalue="WMI"
z=result from above select graphid step
| repeat steps in probe
| connect to probe database and repeat the steps above
|
Step 4: Check if everything is OK
Fill the table below before you proceed to this add monitor to the device
Execute this query
| ColumnName
| Central
| Probe
| select * from wmiclass where classname like "%Win32_PerfFormattedData _PerfOS_Memory%" | classid
| 46
| 46
|
| classname
| Win32_PerfFormattedData _PerfOS_Memory | Win32_PerfFormattedData _PerfOS_Memory | select * from wmipolleddata where collectdataname like "%PoolNonpagedBytes%"
| collectdataid
| 199
| 200000000200 (these numbers can be different... not a problem)
|
| collectdataname
| PoolNonpagedBytes | PoolNonpagedBytes |
| classid
| 46
| 46
|
| expression
| PoolNonpagedBytes/1024 | PoolNonpagedBytes/1024 |
| criteria
| null
| null
|
| instance
| null
| null
| select * from graphdetails where graphname like "%PoolNonpagedBytes%"
| graphid
| 1441
| 1441
|
| graphname
| PoolNonpagedBytes | PoolNonpagedBytes |
| protocolid
| 885
| 885
|
| graphtypeid
| 890
| 890
| select * from graphuserprops where graphid=1441
| graphid
| 1441
| 1441
|
| propname
| GROUPNAME
| GROUPNAME
|
| propvalue
| WMI
| WMI
| select * from polleddata where name like "%PoolNonpagedBytes%" and agent like "%device with this monitor%"
| id
| 20000002092 | 20000002092 |
| oid
| PoolNonpagedBytes | PoolNonpagedBytes |
| ISMULTIPLEPOLLEDDATA | false | false |
| GROUPNAME | WMI | WMI |
| SAVEABSOLUTES | false | false |
Step5: Add the monitor to the device
- Go to the device snapshot page and add the monitor.
- Do a test monitor and see if it shows the data correctly
|
|
|
| | | |
|