[scom] To obtain disk space data for scom monitoring

Source: Internet
Author: User

Core : Almost all data in scom is stored in DB;
difficulties : DB table structure, field Association, multi-Table association;
scenario: obtained from DB;

In general, if you are only looking for data, because the Management Pack comes with these monitors, simply view the appropriate dashboard directly from the Scom console, with the tree node path as follows: "Monitoring-microsoftwindows server-Health monitoring-disk Health" You can see the logical disk capacity size in the display. ( Of course, it also comes with dashboards such as operating systems, clusters, network health, and so on, this article only describes logical disk space.) ) such as

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/76/38/wKioL1ZNZETAEdvTAAEn9Nz3sHk732.png "title=" Scom console view. png "alt=" Wkiol1znzetaedvtaaen9nz3shk732.png "/>

If third-party tools are going to fetch data from scom in real time and process it and find that third-party tools are not able to invoke the monitor directly, there may be another way: create a rule ( while rules are used to obtain data using WMI, third-party tools can directly invoke WMI to work ).

However, there are some problems, such as whether scom is repeatedly monitored: if the capacity of the disk is alerted, the self-brought monitor will alarm, and if there is a custom rule for simultaneous alarms.

Scom alert rules need to be shut down manually, which is the biggest difference for alert monitors, and in real-world environments most of the monitors can be used as much as possible. The use of a monitor is a real-time feedback object of the positive anomalies, and secondly, to reduce the workload of operators.

Since the data captured by scom monitoring is stored in the Operationsmanager database, consider allowing third-party tools to get the required data directly from the database. Operationsmanager data table structure is unclear, is there some tables and fields to hold the logical disk size?

You can then query through SQL statements and understand the relationship between table structure and fields

Get all table names

SELECT Name from DatabaseName. SysObjects Where xtype= ' U ' ORDER by Name

Xtype= ' U ': represents all user tables;
Xtype= ' S ': denotes all system tables;

Get all field names

SELECT Name from syscolumns WHERE id=object_id (' TableName ')

Get primary key field

Select name from syscolumns where id=object_id (' table name ') and colid= (select top 1 keyno from Sysindexkeys where id=object_id (' Table name '))

The following list is found in db for scom by analysis :

Summary General formula:mt_microsoft$ OS type $ version $logicaldisk.

Note: There are differences between Microsoft and open source operating system tables

mt_microsoft$aix$5$3$logicaldiskmt_microsoft$aix$6$1$logicaldiskmt_microsoft$aix$7$logicaldiskmt_microsoft$ Linux$rhel$4$logicaldiskmt_microsoft$linux$rhel$5$logicaldiskmt_microsoft$linux$rhel$6$logicaldiskmt_microsoft $Linux $sles$10$logicaldiskmt_microsoft$linux$sles$11$logicaldiskmt_microsoft$linux$sles$9$logicaldiskmt_ microsoft$linux$universal$logicaldiskmt_microsoft$windows$server$2000$logicaldiskmt_microsoft$windows$server$ 2003$logicaldiskmt_microsoft$windows$server$2008$logicaldiskmt_microsoft$windows$server$6$2$logicaldisk


Related tables:

[Operationsmanager]. [dbo]. [Basemanagedentity] [Operationsmanager]. [dbo]. [Mt_microsoft$windows$server$2000$logicaldisk]

SQL Core statement:

SELECT T1. Path, T2000. [Filesystem_0d653b7c_3f9d_0ea1_6ff0_3cef476dbed5] as ' file System ', T2000. [DEVICEID_DF2FF114_783D_E8EC_DC76_0FC98EF70DB4] as ' logical partitioning ', T2000. [size_f703d24d_cd51_eafe_9356_70a323192928] as ' size (bytes) ' into #TempTB1 from [Operationsmanager]. [dbo]. [Mt_microsoft$windows$server$2000$logicaldisk] T2000,[operationsmanager]. [dbo]. [Basemanagedentity] T1 WHERE T1. Basemanagedentityid = T2000. Basemanagedentityid

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/76/38/wKioL1ZNZGbQy4ebAAB5-TPqL3o015.png "title=" Sql.png "alt=" Wkiol1znzgbqy4ebaab5-tpql3o015.png "/>
with SQL statement:

Use operationsmanagerselect    t1. path    ,t2000. [filesystem_0d653b7c_3f9d_0ea1_6ff0_3cef476dbed5] as  ' file system '    ,t2000. [deviceid_df2ff114_783d_e8ec_dc76_0fc98ef70db4] as  ' logical partition '    ,t2000. [size_f703d24d_cd51_eafe_9356_70a323192928] as  ' size (bytes) '   into  #TempTB1  from  [operationsmanager]. [dbo]. [Mt_microsoft$windows$server$2000$logicaldisk] t2000,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. basemanagedentityid = t2000. basemanagedentityidinsert into  #TempTB1  select    t1. path    ,t2003. [Filesystem_0d653b7c_3f9d_0ea1_6ff0_3cef476dbed5]    ,t2003. [Deviceid_df2ff114_783d_e8ec_dc76_0fc98ef70db4]    ,t2003. [size_f703d24d_cd51_eafe_9356_70a323192928] From [operationsmanager]. [dbo]. [Mt_microsoft$windows$server$2003$logicaldIsk] t2003  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1 where t1. basemanagedentityid = t2003. basemanagedentityid insert into  #TempTB1  select    t1. path    ,t2008. [Filesystem_0d653b7c_3f9d_0ea1_6ff0_3cef476dbed5]    ,t2008. [Deviceid_df2ff114_783d_e8ec_dc76_0fc98ef70db4]    ,t2008. [size_f703d24d_cd51_eafe_9356_70a323192928] From [operationsmanager]. [dbo]. [Mt_microsoft$windows$server$2008$logicaldisk] t2008  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1 where t1. basemanagedentityid = t2008. basemanagedentityid insert into  #TempTB1  select    t1. path    ,t2012. [filesystem_0d653b7c_3f9d_0ea1_6ff0_3cef476dbed5]    ,t2012. [deviceid_df2ff114_783d_e8ec_dc76_0fc98ef70db4]    ,t2012. [size_f703d24d_cd51_eafe_9356_70a323192928]  from [operationsmanager]. [dbo]. [Mt_microsoft$windows$server$6$2$logicaldisk] t2012  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. basemanagedentityid = t2012. basemanagedentityid insert into  #TempTB1  select    t1. Path    ,taix53. [Filesystem_33c79158_2d36_06fa_faf1_27bb8f983a0c]    ,taix53. [Deviceid_76fe57d8_f808_15e1_edc0_e929fba69def]    ,taix53. [Size_57a31d54_6a9d_8ae2_087a_9563c8508a5d]  from [operationsmanager]. [dbo]. [Mt_microsoft$aix$5$3$logicaldisk] taix53  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. Basemanagedentityid = taix53. basemanagedentityid insert into  #TempTB1  select    t1. Path    ,taix61. [filesystem_33c79158_2d36_06fa_faf1_27bb8f983a0c]&Nbsp;   ,taix61. [Deviceid_76fe57d8_f808_15e1_edc0_e929fba69def]    ,taix61. [Size_57a31d54_6a9d_8ae2_087a_9563c8508a5d]  from [operationsmanager]. [dbo]. [Mt_microsoft$aix$6$1$logicaldisk] taix61  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. Basemanagedentityid = taix61. basemanagedentityid insert into  #TempTB1  select    t1. path    ,taix7. [FILESYSTEM_33C79158_2D36_06FA_FAF1_27BB8F983A0C]    ,TAIX7. [DEVICEID_76FE57D8_F808_15E1_EDC0_E929FBA69DEF]    ,TAIX7. [Size_57a31d54_6a9d_8ae2_087a_9563c8508a5d]  from [operationsmanager]. [dbo]. [Mt_microsoft$aix$7$logicaldisk] taix7  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. basemanagedentityid = taix7. basemanagedentityid insert into  #TempTB1 &nbsP Select    t1. Path    ,trhel4. [Filesystem_33c79158_2d36_06fa_faf1_27bb8f983a0c]    ,trhel4. [Deviceid_76fe57d8_f808_15e1_edc0_e929fba69def]    ,trhel4. [Size_57a31d54_6a9d_8ae2_087a_9563c8508a5d]  from [operationsmanager]. [dbo]. [Mt_microsoft$linux$rhel$4$logicaldisk] trhel4  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. Basemanagedentityid = trhel4. basemanagedentityid insert into  #TempTB1  select    t1. Path    ,trhel5. [Filesystem_33c79158_2d36_06fa_faf1_27bb8f983a0c]    ,trhel5. [Deviceid_76fe57d8_f808_15e1_edc0_e929fba69def]    ,trhel5. [Size_57a31d54_6a9d_8ae2_087a_9563c8508a5d]  from [operationsmanager]. [dbo]. [Mt_microsoft$linux$rhel$5$logicaldisk] trhel5  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. Basemanagedentityid = trhel5. basemanagedentityid insert into  #TempTB1  select    t1. Path    ,trhel6. [Filesystem_33c79158_2d36_06fa_faf1_27bb8f983a0c]    ,trhel6. [Deviceid_76fe57d8_f808_15e1_edc0_e929fba69def]    ,trhel6. [Size_57a31d54_6a9d_8ae2_087a_9563c8508a5d]  from [operationsmanager]. [dbo]. [Mt_microsoft$linux$rhel$6$logicaldisk] trhel6  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. Basemanagedentityid = trhel6. basemanagedentityid insert into  #TempTB1  select    t1. Path    ,trhel6. [Filesystem_33c79158_2d36_06fa_faf1_27bb8f983a0c]    ,trhel6. [Deviceid_76fe57d8_f808_15e1_edc0_e929fba69def]    ,trhel6. [SIZE_57A31D54_6A9D_8AE2_087A_9563C8508A5D]  FROM&NBSp [Operationsmanager]. [dbo]. [Mt_microsoft$linux$rhel$6$logicaldisk] trhel6  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. Basemanagedentityid = trhel6. basemanagedentityid insert into  #TempTB1  select    t1. Path    ,tsles9. [FILESYSTEM_33C79158_2D36_06FA_FAF1_27BB8F983A0C]    ,TSLES9. [DEVICEID_76FE57D8_F808_15E1_EDC0_E929FBA69DEF]    ,TSLES9. [Size_57a31d54_6a9d_8ae2_087a_9563c8508a5d]  from [operationsmanager]. [dbo]. [Mt_microsoft$linux$sles$9$logicaldisk] tsles9  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. Basemanagedentityid = tsles9. basemanagedentityid insert into  #TempTB1  select    t1. Path    ,tsles10. [Filesystem_33c79158_2d36_06fa_faf1_27bb8f983a0c]    ,tsles10. [Deviceid_76fe57d8_f808_15e1_edc0_e929fba69def]    ,tsles10. [Size_57a31d54_6a9d_8ae2_087a_9563c8508a5d]  from [operationsmanager]. [dbo]. [Mt_microsoft$linux$sles$10$logicaldisk] tsles10  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. Basemanagedentityid = tsles10. basemanagedentityidinsert into  #TempTB1  select    t1. Path    ,tsles11. [FILESYSTEM_33C79158_2D36_06FA_FAF1_27BB8F983A0C]    ,TSLES11. [DEVICEID_76FE57D8_F808_15E1_EDC0_E929FBA69DEF]    ,TSLES11. [Size_57a31d54_6a9d_8ae2_087a_9563c8508a5d]  from [operationsmanager]. [dbo]. [Mt_microsoft$linux$sles$11$logicaldisk] tsles11  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. Basemanagedentityid = tsles11. basemanagedentityid insert into  #TempTB1  SELECT&NBSp;   t1. Path    ,tuniversal. [Filesystem_33c79158_2d36_06fa_faf1_27bb8f983a0c]    ,tuniversal. [Deviceid_76fe57d8_f808_15e1_edc0_e929fba69def]    ,tuniversal. [Size_57a31d54_6a9d_8ae2_087a_9563c8508a5d]  from [operationsmanager]. [dbo]. [Mt_microsoft$linux$universal$logicaldisk] tuniversal  ,[operationsmanager]. [dbo]. [Basemanagedentity] t1   where t1. basemanagedentityid = tuniversal.basemanagedentityid  ----Output Data select * from   #TempTB1  ORDER by  ' PATH '----Delete temporary table drop table  #TempTB1

This article from "Heart" blog, reproduced please contact the author!

[scom] To obtain disk space data for scom monitoring

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.