Monitoring Windows Counters + SQL Server Counters with Check_MK

  • Hi guys...

    I'm trying to perform a very simple task with check_mk, however I've not a way to get it working.

    I need to monitor the Windows counters such as these listed bellow.


    SQLServer:Buffer Manager\Buffer cache hit ratio

    SQLServer:Buffer Manager\Page life expectancy

    SQLServer: SQL Statistics: SQL Re-Compilations/Sec

    Lock Waits / Sec: _Total

    SQLServer: Locks: Lock Waits / Sec: _Total

    System – Processor Queue Length

    \PhysicalDisk(*)\Avg. Disk Read Queue Length


    So, I configured my check_mk.ini like this... I've got the counter codes from counters.ini file


    [winperf]

    # Select counters to extract. The following counters

    # are needed by checks shipped with check_mk.

    # counters = 10332:msx_queues

    counters = 28064:SQLServer_Memory_Manager

    counters = 11822:SQLServer_General_Statistics

    counters = 11884:SQLServer_Databases

    counters = 12062:SQLServer_SQL_Statistics

    counters = 27666:Page_life_expectancy

    counters = 27656:Buffer_cache_hit_ratio

    [logwatch]

    # Testing: output *all* messages from the eventlogs

    sendall = no


    # From application log send only critical messages

    logfile application = off


    # From the security log send all messages

    logfile security = off

    logfile system = off


    # Switch all other logfiles off. Default is warn:

    # send messages of type warn or crit

    logfile * = off


    [mrpe]

    # Run classical Nagios plugins. The word before the command

    # line is the service description for Nagios. Use backslashes

    # in Windows-paths.

    # check = Dummy mrpe\check_crit

    # check = IP_Configuration mrpe\check_ipconfig 1.2.3.4

    # check = Whatever c:\myplugins\check_whatever -w 10 -c 20

    check = MSSQL_SlowQuery powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_slow.ps1"

    check = MSSQL_SlowQuery20 powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_slow20.ps1"

    check = MSSQL_Mirror_State powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_mirroring_status.ps1"

    check = MSSQL_job_history_status_Cliente powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_job_history_status_cliente.ps1"

    check = MSSQL_job_history_status_LWO powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_job_history_status_lwo.ps1"

    check = MSSQL_Autogrowth powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_autogrowth.ps1"

    #check = Page_life_expectancy -- This line makes the service not start... Discard that...


    # check = MSSQL_TransactionLog_Usage powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_Monitor_logsize.ps1"

    # check = MSSQL_File_Group_FreeSpace powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_filegroups.ps1"

    # check = MSSQL_vbs_PLUGIN -file "C:\Program Files\check_mk\plugins_enterprise\mssql.vbs"



    So, I run check_mk_agent.exe test and receive this output...


    <<<winperf_SQLServer_Memory_Manager>>>

    1498668585.60 28064

    18 488 large_rawcount

    28 0 large_rawcount

    14 3024 large_rawcount

    20 15050 large_rawcount

    24 17050 large_rawcount

    8 8651 large_rawcount

    12 8675 large_rawcount

    6 3771000 large_rawcount

    26 0 large_rawcount

    10 0 large_rawcount

    22 992 large_rawcount

    4 1984 large_rawcount

    16 5018272 large_rawcount

    2 1226752 large_rawcount

    <<<winperf_SQLServer_General_Statistics>>>

    1498668585.63 11822

    <<<winperf_SQLServer_Databases>>>

    1498668585.66 11884

    <<<winperf_SQLServer_SQL_Statistics>>>

    1498668585.66 12062

    <<<winperf_Page_life_expectancy>>>

    1498668585.66 27666

    <<<winperf_Buffer_cache_hit_ratio>>>

    1498668585.66 27656


    And finally I run check_mk inventory, however these counters are not shown.


    Am I forgetting some steps? Does anybody have done this checks before and can help-me?


    Best regards


    Eduardo

  • cmk server and agent version?

    Why don't you use the mssql.vbs plugin?


    <<<winperf_SQLServer_General_Statistics>>>

    Having these agent sections won't help because there are no check plugins looking for this sections.

  • Quote

    -- Check_MK 1.2.4p5

    --Check_MK_Agent version 1.2.0p4

    First of all, I would recommend to upgrade to the latest cmk version (1.4.0p7) or at least the latest 1.2.8 build. So we can be sure that all functions of cmk are available for your environment.


    http://mathias-kettner.com/check_mk_download.php?HTML=yes


    !!! But be aware of incompatible werks / the migration notes !!!


    http://mathias-kettner.com/che…&version=1.5.0i1&incomp=1


    Quote

    I've inserted a line on MRPE section mentioning mssql.vbs plugin, however I think I pointed the plugin in a wrong way and nothing happens.

    Shipped CMK-plugins just have to be copied to the plugins folder and don't belong to the MRPE functionality.

    The check_mk_agent.exe executes all scripts located in C:\Program Files\check_mk\plugins\ automatically. It doesn't look into "plugins_enterprise".


    http://mathias-kettner.com/checkmk_windows.html


    Quote

    -- Do you have a sample file that monitors SQL Server and some windows performance counters?


    Update your cmk system and agent, copy the mssql.vbs script (located on your cmk server .../check_mk/agents/windows/plugins/) and re-inventorize the services of the host. If your host provides the correct counters, the services should be added automatically.

  • Hi guys...

    TheLucKy thank you so much for your help, I've been out of this topic for a while due several activities to do, however I'm back and I you ask your help once again. I believe that high now, I doing well, however the results are not the expected yet.

    I'll write my comments between the quotes.

    First of all, I would recommend to upgrade to the latest cmk version (1.4.0p7) or at least the latest 1.2.8 build. So we can be sure that all functions of cmk are available for your environment.


    http://mathias-kettner.com/check_mk_download.php?HTML=yes


    !!! But be aware of incompatible werks / the migration notes !!!


    http://mathias-kettner.com/che…&version=1.5.0i1&incomp=1

    I asked to the team that maintain the check_mk to upgrade system (I'm under database and OS umbrella) , however due the enormous amount of different machines the team told me that a system upgrade is not possible high now. I can upgrade the agent in some machines, actually I have done this upgrade to try some agent versions, but nothing has changed.

    Also, I could not find 1.4.0p7 or 1.2.8 for Windows, in download page there are a list of systems, however Windows is not present in this list. I thought that is pretty hard to find windows agents in "Mathias" website.

    Shipped CMK-plugins just have to be copied to the plugins folder and don't belong to the MRPE functionality.

    The check_mk_agent.exe executes all scripts located in C:\Program Files\check_mk\plugins\ automatically. It doesn't look into "plugins_enterprise".


    I have fixed that...


    Update your cmk system and agent, copy the mssql.vbs script (located on your cmk server .../check_mk/agents/windows/plugins/) and re-inventorize the services of the host. If your host provides the correct counters, the services should be added automatically.


    I've re-inventorized my host, get the properly counters and I changed my vbs plugin for sql.
    I've changed the check_mk.ini and performed local test as I show below. I believe that my local test is Ok, however after I performed a Inventory in my system my dashboard still not showing my new checks.

    Follow my check_mk local test for a specific host.

    Enabld: ffffffff

    <<<check_mk>>>

    Version: 1.2.4p5

    Architecture: 32bit

    AgentOS: windows

    Hostname: IPI-W08CSQL-01

    WorkingDirectory: C:\Program Files\check_mk

    ConfigFile: C:\Program Files\check_mk\check_mk.ini

    AgentDirectory: C:\Program Files\check_mk

    PluginsDirectory: C:\Program Files\check_mk\plugins

    SpoolDirectory: C:\Program Files\check_mk\spool

    LocalDirectory: C:\Program Files\check_mk\local

    ScriptStatistics: Plugin C:0 E:0 T:0 Local C:0 E:0 T:0

    OnlyFrom: 0.0.0.0/0

    <<<uptime>>>

    389933


    ..... cut some text ...


    <<<winperf_Current_Disk_Queue_Length>>>

    1500043895.33 198

    <<<winperf_Avg_Disk_sec/Transfer>>>

    1500043895.39 207

    <<<winperf_Page_life_expectancy_Windows>>>

    1500043895.40 27666

    <<<winperf_Lock_Waits_sec>>>

    1500043895.40 27790

    <<<winperf_Processor_Queue_Length>>>

    1500043895.40 44

    <<<winperf_Avg_Disk_Read_Queue_Length>>>

    1500043895.40 1402

    <<<logwatch>>>

    <<<logwatch>>>

    <<<mssql_versions>>>


    <<<SQL 2016 not found>>>


    <<<SQL 2014 not found>>>


    <<<SQL 2012 not found>>>


    <<<mssql_versions>>>


    MSSQLSERVER 10.53.6000.34


    <<<mssql_counters>>>


    SQLServer:Buffer_Manager buffer_cache_hit_ratio None 22


    SQLServer:Buffer_Manager buffer_cache_hit_ratio_base None 22


    SQLServer:Buffer_Manager lazy_writes/sec None 0


    SQLServer:Buffer_Manager page_life_expectancy None 389905


    SQLServer:SQL_Statistics sql_compilations/sec None 23461


    SQLServer:SQL_Statistics sql_re-compilations/sec None 55


    SQLServer:Memory_Manager target_server_memory_(kb) None 5988464


    SQLServer:Memory_Manager total_server_memory_(kb) None 1061120


    SQLServer:Transactions longest_transaction_running_time None 0


    SQLServer:Transactions free_space_in_tempdb_(kb) None 4191616


    <<<mssql_tablespaces>>>


    MSSQLSERVER aprovaCreditoIpiranga 1954.75 MB 5.81 MB 654016 KB 587048 KB 56528 KB 10440 KB


    MSSQLSERVER aprovakm 163250.00 MB 30523.41 MB 135656024 KB 93082680 KB 41763712 KB 809632 KB


    MSSQLSERVER aprovaPostoVirtualV3 212.94 MB 13.75 MB 152896 KB 123344 KB 20784 KB 8768 KB


    MSSQLSERVER Fcommerce 24.20 MB 0.09 MB 1320 KB 576 KB 648 KB 96 KB


    MSSQLSERVER GtiIpiranga 720.00 MB 110.39 MB 501360 KB 470848 KB 6160 KB 24352 KB


    MSSQLSERVER Historico 1250.00 MB 202.85 MB 1021080 KB 931952 KB 688 KB 88440 KB


    MSSQLSERVER master 700.00 MB 497.20 MB 2872 KB 1248 KB 1224 KB 400 KB


    MSSQLSERVER model 20.06 MB 1.06 MB 1216 KB 488 KB 632 KB 96 KB


    MSSQLSERVER msdb 55.69 MB 2.87 MB 44872 KB 37376 KB 5688 KB 1808 KB


    MSSQLSERVER tempdb 4096.75 MB 4094.51 MB 1528 KB 656 KB 760 KB 112 KB


    <<<mssql_backup>>>


    MSSQLSERVER aprovaCreditoIpiranga 2017-07-14 01:12:51


    MSSQLSERVER aprovakm 2017-07-14 01:12:51


    MSSQLSERVER aprovaPostoVirtualV3 2017-07-14 01:12:50


    MSSQLSERVER Fcommerce 2017-07-14 01:12:50


    MSSQLSERVER GtiIpiranga 2017-07-14 01:12:49


    MSSQLSERVER Historico 2017-07-14 01:12:48


    MSSQLSERVER master 2017-07-14 01:12:43


    MSSQLSERVER model 2017-07-14 01:12:48


    MSSQLSERVER msdb 2017-07-14 01:12:47




    <<<local>>>

    <<<mrpe>>>

    (powershell) MSSQL_SlowQuery 0 OK - No long running querys detected.

    (powershell) MSSQL_SlowQuery20 0 OK - No long running querys detected.

    (powershell) MSSQL_Mirror_State 0 OK - [Bases sincronizadas: ]

    (powershell) MSSQL_job_history_status_Cliente 0 OK - All jobs completed successfully on their last run.

    (powershell) MSSQL_job_history_status_LWO 0 OK - All jobs completed successfully on their last run.

    (powershell) MSSQL_Autogrowth 0 OK - [All databases are AutoGrowth OK.]

    <<<systemtime>>>

    1500043901

  • I'm posting some useful information.
    Follow my check_mk.ini


    [global]

    # [global]

    # Restrict access to certain IP addresses

    # only_from = 127.0.0.1 192.168.56.0/24


    # Do only execute programs and scripts with

    # the following suffixes (in local and plugins).

    # Per default all extensions except txt and dir

    # are being executed.

    execute = exe bat vbs ps1


    # Restrict the following configuration variables

    # in [global] to the following hosts

    # host = winsrv* zab???ad


    # Just output certain sections (e.g. for upper hosts)

    # sections = check_mk plugins df



    [winperf]

    # Select counters to extract. The following counters

    # are needed by checks shipped with check_mk.

    # counters = 10332:msx_queues

    counters = 198:Current_Disk_Queue_Length

    counters = 207:Avg_Disk_sec/Transfer

    counters = 27666:Page_life_expectancy_Windows

    counters = 27790:Lock_Waits_sec

    counters = 44:Processor_Queue_Length

    counters = 1402:Avg_Disk_Read_Queue_Length

    [logwatch]

    # Testing: output *all* messages from the eventlogs

    sendall = no


    # From application log send only critical messages

    logfile application = off


    # From the security log send all messages

    logfile security = off

    logfile system = off


    # Switch all other logfiles off. Default is warn:

    # send messages of type warn or crit

    logfile * = off


    [mrpe]

    # Run classical Nagios plugins. The word before the command

    # line is the service description for Nagios. Use backslashes

    # in Windows-paths.

    # check = Dummy mrpe\check_crit

    # check = IP_Configuration mrpe\check_ipconfig 1.2.3.4

    # check = Whatever c:\myplugins\check_whatever -w 10 -c 20

    check = MSSQL_SlowQuery powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_slow.ps1"

    check = MSSQL_SlowQuery20 powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_slow20.ps1"

    check = MSSQL_Mirror_State powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_mirroring_status.ps1"

    check = MSSQL_job_history_status_Cliente powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_job_history_status_cliente.ps1"

    check = MSSQL_job_history_status_LWO powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_job_history_status_lwo.ps1"

    check = MSSQL_Autogrowth powershell -ExecutionPolicy Bypass -file "C:\Program Files\check_mk\plugins_enterprise\mssql_autogrowth.ps1"

    check = MSSQL_PLUGIN "C:\Program Files\check_mk\plugins\mssql_health_check.vbs"

    #check = MSSQL_PLUGIN "C:\Program Files\check_mk\plugins\mssql_health_check_locaweb.vbs"


    [fileinfo]

    # path = C:\Programs\Foo\*.log

    # path = M:\Bar Test\*.*

  • So what is your problem / question now? Your agent output looks fine now.

    The test output really looks ok, but the counters don't appear on my dashboard...
    Follow the output of a test server and the dashboard screenshot.

    Output:

    UALSVC running/auto User Access Logging Service

    UI0Detect stopped/demand Interactive Services Detection

    UmRdpService running/demand Remote Desktop Services UserMode Port Redirector

    upnphost stopped/disabled UPnP Device Host

    VaultSvc stopped/demand Credential Manager

    vds stopped/demand Virtual Disk

    VGAuthService running/auto VMware Alias Manager and Ticket Service

    vmicguestinterface stopped/demand Hyper-V Guest Service Interface

    vmicheartbeat stopped/demand Hyper-V Heartbeat Service

    vmickvpexchange stopped/demand Hyper-V Data Exchange Service

    vmicrdv stopped/demand Hyper-V Remote Desktop Virtualization Service

    vmicshutdown stopped/demand Hyper-V Guest Shutdown Service

    vmictimesync stopped/demand Hyper-V Time Synchronization Service

    vmicvss stopped/demand Hyper-V Volume Shadow Copy Requestor

    VMTools running/auto VMware Tools

    vmvss stopped/demand VMware Snapshot Provider

    VMware_Physical_Disk_Helper_Service running/auto VMware Physical Disk Helper Service

    VMwareCAFCommAmqpListener stopped/demand VMware CAF AMQP Communication Service

    VMwareCAFManagementAgentHost running/auto VMware CAF Management Agent Service

    VSS stopped/demand Volume Shadow Copy

    W32Time running/demand Windows Time

    Wcmsvc running/auto Windows Connection Manager

    WcsPlugInService stopped/demand Windows Color System

    WdiServiceHost stopped/demand Diagnostic Service Host

    WdiSystemHost stopped/demand Diagnostic System Host

    Wecsvc stopped/demand Windows Event Collector

    WEPHOSTSVC stopped/demand Windows Encryption Provider Host Service

    wercplsupport stopped/demand Problem Reports and Solutions Control Panel Support

    WerSvc stopped/demand Windows Error Reporting Service

    WinHttpAutoProxySvc running/demand WinHTTP Web Proxy Auto-Discovery Service

    Winmgmt running/auto Windows Management Instrumentation

    WinRM running/auto Windows Remote Management (WS-Management)

    wmiApSrv running/auto WMI Performance Adapter

    WPDBusEnum stopped/demand Portable Device Enumerator Service

    WSService stopped/demand Windows Store Service (WSService)

    wuauserv stopped/demand Windows Update

    wudfsvc stopped/demand Windows Driver Foundation - User-mode Driver Framework

    <<<winperf_phydisk>>>

    1500056059.55 234

    3 instances: 0_C: 1_S: _Total

    -36 0 0 0 rawcount

    -34 1593797000 88000 796942500 type(20570500)

    -34 131445296595571038 131445296595571038 131445296595571038 type(40030500)

    1166 1593797000 88000 1593885000 type(550500)

    -32 1275199000 9000 637604000 type(20570500)

    -32 131445296595571038 131445296595571038 131445296595571038 type(40030500)

    1168 1275199000 9000 1275208000 type(550500)

    -30 318598000 79000 159338500 type(20570500)

    -30 131445296595571038 131445296595571038 131445296595571038 type(40030500)

    1170 318598000 79000 318677000 type(550500)

    -28 2282027232 125999 2282153231 average_timer

    -28 29757 5 29762 average_base

    -26 1825852881 12886 1825865767 average_timer

    -26 25065 2 25067 average_base

    -24 456174351 113113 456287464 average_timer

    -24 4692 3 4695 average_base

    -22 29757 5 29762 counter

    -20 25065 2 25067 counter

    -18 4692 3 4695 counter

    -16 724876800 24576 724901376 bulk_count

    -14 651221504 8192 651229696 bulk_count

    -12 73655296 16384 73671680 bulk_count

    -10 724876800 24576 724901376 average_bulk

    -10 29757 5 29762 average_base

    -8 651221504 8192 651229696 average_bulk

    -8 25065 2 25067 average_base

    -6 73655296 16384 73671680 average_bulk

    -6 4692 3 4695 average_base

    1248 17084972000 18251161000 17668066500 type(20570500)

    1248 131445296595571038 131445296595571038 131445296595571038 type(40030500)

    1250 726 0 726 counter

    <<<winperf_processor>>>

    1500056059.66 238

    5 instances: 0 1 2 3 _Total

    -232 17269531250 17317656250 17482656250 17427031250 17374218750 100nsec_timer_inv

    -96 726875000 619531250 559843750 583437500 622421875 100nsec_timer

    -94 420625000 476875000 371562500 403593750 418164062 100nsec_timer

    -90 2147654 2255943 2212521 2217053 8833171 counter

    458 2031250 13750000 1562500 1718750 4765625 100nsec_timer

    460 3437500 6562500 2500000 5625000 4531250 100nsec_timer

    1096 18912 54202 13999 16169 103282 counter

    1098 0 2 0 0 2 rawcount

    1508 17057659171 17025378750 17235856137 17189960663 17127213680 100nsec_timer

    1510 17057659171 17025378750 17235856137 17189960663 17127213680 100nsec_timer

    1512 0 0 0 0 0 100nsec_timer

    1514 0 0 0 0 0 100nsec_timer

    1516 1959334 2002613 1990362 1996721 7949030 bulk_count

    1518 0 0 0 0 0 bulk_count

    1520 0 0 0 0 0 bulk_count

    <<<winperf_if>>>

    1500056059.73 510

    2 instances: vmxnet3_Ethernet_Adapter isatap.lwo.locaweb.com.br

    -122 10008769 0 bulk_count

    -110 37550 0 bulk_count

    -244 21620 0 bulk_count

    -58 15930 0 bulk_count

    10 10000000000 100000 large_rawcount

    -246 5479712 0 bulk_count

    14 17560 0 bulk_count

    16 4060 0 bulk_count

    18 0 0 large_rawcount

    20 0 0 large_rawcount

    22 0 0 large_rawcount

    -4 4529057 0 bulk_count

    26 15894 0 bulk_count

    28 36 0 bulk_count

    30 0 0 large_rawcount

    32 0 0 large_rawcount

    34 0 0 large_rawcount

    1086 0 0 large_rawcount

    1088 0 0 large_rawcount

    1090 0 0 bulk_count

    1092 0 0 bulk_count

    1094 0 0 large_rawcount

    <<<winperf_Current_Disk_Queue_Length>>>

    1500056059.80 198

    <<<winperf_Avg_Disk_sec/Transfer>>>

    1500056059.96 207

    <<<winperf_Page_life_expectancy_Windows>>>

    1500056059.96 8322

    <<<winperf_Lock_Waits_sec>>>

    1500056059.96 8428

    <<<winperf_Processor_Queue_Length>>>

    1500056059.97 44

    <<<winperf_Avg_Disk_Read_Queue_Length>>>

    1500056059.97 1402

    <<<logwatch>>>

    <<<logwatch>>>

    <<<>>>

    <<<mssql_versions>>>

    <<<mssql_versions>>>

    MSSQLSERVER 13.0.1601.5

    <<<mssql_counters>>>

    SQLServer:Buffer_Manager buffer_cache_hit_ratio None 28

    SQLServer:Buffer_Manager buffer_cache_hit_ratio_base None 28

    SQLServer:Buffer_Manager lazy_writes/sec None 0

    SQLServer:Buffer_Manager page_life_expectancy None 1825

    SQLServer:SQL_Statistics sql_compilations/sec None 268

    SQLServer:SQL_Statistics sql_re-compilations/sec None 2

    SQLServer:Memory_Manager target_server_memory_(kb) None 2930576

    SQLServer:Memory_Manager total_server_memory_(kb) None 239816

    SQLServer:Transactions longest_transaction_running_time None 0

    SQLServer:Transactions free_space_in_tempdb_(kb) None 28736

    <<<mssql_tablespaces>>>

    MSSQLSERVER master 7.38 MB 1.92 MB 3536 KB 1440 KB 1392 KB 704 KB

    MSSQLSERVER model 16.00 MB 5.84 MB 2216 KB 888 KB 1024 KB 304 KB

    MSSQLSERVER msdb 21.38 MB 3.22 MB 13408 KB 10056 KB 2584 KB 768 KB

    MSSQLSERVER tempdb 40.00 MB 28.72 MB 3360 KB 1032 KB 1224 KB 1104 KB

    <<<mssql_backup>>>



    <<<>>>

    <<<local>>>

    <<<mrpe>>>

    (powershell) MSSQL_SlowQuery 0 OK - No long running querys detected.

    (powershell) MSSQL_SlowQuery20 0 OK - No long running querys detected.

    (powershell) MSSQL_Mirror_State 0 OK - [Bases sincronizadas: ]

    (powershell) MSSQL_job_history_status_Cliente 0 OK - All jobs completed successfully on their last run.

    (powershell) MSSQL_job_history_status_LWO 0 OK - All jobs completed successfully on their last run.

    (powershell) MSSQL_Autogrowth 0 OK - [All databases are AutoGrowth OK.]

    <<<systemtime>>>

    1500056065


    im2et1.png

  • Here is other example: The counters don't appear on dashboard.


    <<<check_mk>>>

    Version: 1.2.0p4

    AgentOS: windows

    Hostname:

    WorkingDirectory: C:\Program Files\check_mk

    ConfigFile: C:\Program Files\check_mk\check_mk.ini

    AgentDirectory: C:\Program Files\check_mk

    PluginsDirectory: C:\Program Files\check_mk\plugins

    LocalDirectory: C:\Program Files\check_mk\local

    OnlyFrom: 0.0.0.0/0

    <<<uptime>>>

    103102

    <<<df>>>

    W2k8 NTFS 52427772 43447092 8980680 83% C:\

    Data NTFS 314572796 4099744 310473052 2% F:\


    ......


    <<<winperf_phydisk>>>

    1500056777.52 234

    2 instances: 0_C:_S:_T:_F:_L: _Total

    -36 0 0 rawcount

    -34 3488675408 3488675408 type(690cc820570500)

    -34 2944979482 2944979482 type(690cc840030500)

    1166 3488675408 3488675408 type(690cc800550500)

    -32 1251629704 1251629704 type(690cc820570500)

    -32 2944979482 2944979482 type(690cc840030500)

    1168 1251629704 1251629704 type(690cc800550500)

    -30 2237045704 2237045704 type(690cc820570500)

    -30 2944979482 2944979482 type(690cc840030500)

    1170 2237045704 2237045704 type(690cc800550500)

    -28 2359126464 2359126464 average_timer

    -28 1319820 1319820 average_base

    -26 1083330265 1083330265 average_timer

    -26 206632 206632 average_base

    -24 1275796199 1275796199 average_timer

    -24 1113188 1113188 average_base

    -22 1319820 1319820 counter

    -20 206632 206632 counter

    -18 1113188 1113188 counter

    -16 3914792960 3914792960 bulk_count

    -14 1834250752 1834250752 bulk_count

    -12 2080542208 2080542208 bulk_count

    -10 3914792960 3914792960 average_bulk

    -10 1319820 1319820 average_base

    -8 1834250752 1834250752 average_bulk

    -8 206632 206632 average_base

    -6 2080542208 2080542208 average_bulk

    -6 1113188 1113188 average_base

    1248 587596256 587596256 type(690cc820570500)

    1248 2944979482 2944979482 type(690cc840030500)

    1250 267253 267253 counter

    <<<winperf_processor>>>

    1500056778.56 238

    13 instances: 0 1 2 3 4 5 6 7 8 9 10 11 _Total

    -232 2577136602 795348244 2357957318 3962948549 1042973360 3206292170 3065630090 3961181009 1515448153 60532005 561034035 3890980559 3681444273 100nsec_timer_inv

    -96 3826706651 2365808108 3416215077 2932663506 3855461657 138009356 1575871280 3486050582 1692300262 3433946248 2484005337 3762952357 2389585260 100nsec_timer

    -94 2420773403 1368025005 3048572249 1925884581 3921813611 1179731798 4176251242 1369273013 1312540885 1024563039 1472597911 1157423655 2747282082 100nsec_timer

    -90 20434919 11265511 21111250 11158594 13765124 12355831 13146656 12198210 11509938 13616095 11730215 12861042 165153385 counter

    458 280021795 936006 762688889 0 802781146 4212027 688120411 7020045 7176046 176905134 5304034 114192732 237446522 100nsec_timer

    460 191881230 39468253 234001500 50232322 183925179 51168328 131040840 58188373 57876371 163177046 54444349 59436381 106236681 100nsec_timer

    1096 8108260 647168 18546180 612729 2783734 638962 2410457 565386 1131427 2042767 1215630 1443729 40146429 counter

    1098 2 0 3 0 0 0 4 0 0 0 0 2 11 rawcount

    1508 2577136602 795348244 2357957318 3962948549 1042973360 3206292170 3065630090 3961181009 1515448153 60532005 561034035 3890980559 3681444273 100nsec_timer

    1510 22019080 2105672781 577181157 1751483505 3012079580 897179450 3670814297 531151123 3796563243 430979149 538693017 380209953 2549910685 100nsec_timer

    1512 2379188012 514118938 591909381 3914706268 1287925628 4050572861 2866645412 1072393600 2345091850 659485235 1006673310 3787320505 3113411074 100nsec_timer

    1514 0 0 0 0 0 0 0 0 0 0 0 0 0 100nsec_timer

    1516 448237 183907 353433 217318 350795 151377 356143 144520 405820 212950 523085 121698 3469283 bulk_count

    1518 44042772 28413001 35370094 30926328 49648668 32149985 37525600 35177870 32209604 67510743 32996364 34780535 460751564 bulk_count

    1520 0 0 0 0 0 0 0 0 0 0 0 0 0 bulk_count

    <<<logwatch>>>

    <<<mssql_versions>>>

    <<<SQL 2016 not found>>>

    <<<SQL 2014 not found>>>

    <<<SQL 2012 not found>>>

    <<<mssql_versions>>>

    MSSQLSERVER 10.53.6000.34

    <<<mssql_counters>>>

    SQLServer:Buffer_Manager buffer_cache_hit_ratio None 12

    SQLServer:Buffer_Manager buffer_cache_hit_ratio_base None 12

    SQLServer:Buffer_Manager lazy_writes/sec None 0

    SQLServer:Buffer_Manager page_life_expectancy None 97045

    SQLServer:SQL_Statistics sql_compilations/sec None 56912

    SQLServer:SQL_Statistics sql_re-compilations/sec None 216

    SQLServer:Memory_Manager target_server_memory_(kb) None 41813824

    SQLServer:Memory_Manager total_server_memory_(kb) None 378240

    SQLServer:Transactions longest_transaction_running_time None 0

    SQLServer:Transactions free_space_in_tempdb_(kb) None 12972672

    <<<mssql_tablespaces>>>

    MSSQLSERVER master 5.25 MB 1.51 MB 2552 KB 1176 KB 1072 KB 304 KB

    MSSQLSERVER model 20.06 MB 1.14 MB 1136 KB 456 KB 624 KB 56 KB

    MSSQLSERVER msdb 35.06 MB 2.73 MB 26832 KB 21328 KB 3896 KB 1608 KB

    MSSQLSERVER tempdb 12673.00 MB 12670.34 MB 1704 KB 728 KB 848 KB 128 KB

    <<<mssql_backup>>>

    MSSQLSERVER master 2017-07-14 01:12:09

    MSSQLSERVER model 2017-07-14 01:12:15

    MSSQLSERVER msdb 2017-07-14 01:12:15


    <<<local>>>

    <<<mrpe>>>

    (powershell) MSSQL_SlowQuery 0 OK - No long running querys detected.

    (powershell) MSSQL_SlowQuery20 0 OK - No long running querys detected.

    (powershell) MSSQL_Mirror_State 2 ERRO [BD Sem sincronismo OU Sem mirror: RPL_IpirangaFrotas]

    (powershell) MSSQL_job_history_status_Cliente 0 OK - All jobs completed successfully on their last run.

    (powershell) MSSQL_job_history_status_LWO 0 OK - All jobs completed successfully on their last run.

    (powershell) MSSQL_Autogrowth 0 OK - [All databases are AutoGrowth OK.]

    (powershell) MSSQL_Transaction_Log 0 OK - [All databases are logshipping enabled.]

    <<<systemtime>>>

    1500056787



    n4tw9k.png

    2rwvl85.png

  • I really don't know which Services you expect to come up. And please upload your screenshots with the attachment functionality of the forum.

  • I really don't know which Services you expect to come up. And please upload your screenshots with the attachment functionality of the forum.

    Sorry about my screenshots, I'll use the image icon for screenshot insertion.
     
    I'm expecting that the MSSQL plugin counters and perfmon counters listed in my check_mk.ini come up to my dashboard, for instance these ones present in check_mk agent test output (bellow in this post).


    In other words, I need that counters listed bellow appears on mu dashboard.

    Counters listed in my Check_mk.ini

    [winperf]

    # Select counters to extract. The following counters

    # are needed by checks shipped with check_mk.

    # counters = 10332:msx_queues

    counters = 198:Current_Disk_Queue_Length

    counters = 207:Avg_Disk_sec_Transfer

    counters = 8322:Page_life_expectancy_Windows

    counters = 8428:Lock_Waits_sec

    counters = 44:Processor_Queue_Length

    counters = 1402:Avg_Disk_Read_Queue_Length

    counters = 1400:Avg_Disk_Queue_Length

    counters = 146:Context_Switches_sec




    Check_MK agent test output: Here is what I expect and need to see in dashboard

    <<<winperf_Current_Disk_Queue_Length>>>

    1500298551.35 198

    <<<winperf_Avg_Disk_sec_Transfer>>>

    1500298551.54 207

    <<<winperf_Page_life_expectancy_Windows>>>

    1500298551.54 8322

    <<<winperf_Lock_Waits_sec>>>

    1500298551.54 8428

    <<<winperf_Processor_Queue_Length>>>

    1500298551.54 44

    <<<winperf_Avg_Disk_Read_Queue_Length>>>

    1500298551.55 1402

    <<<winperf_Avg_Disk_Queue_Length>>>

    1500298551.55 1400

    <<<winperf_Context_Switches_sec>>>

    1500298551.55 146

    <<<logwatch>>>

    <<<logwatch>>>

    <<<>>>

    <<<mssql_versions>>>

    <<<mssql_versions>>>

    MSSQLSERVER 13.0.1601.5

    <<<mssql_counters>>>

    SQLServer:Buffer_Manager buffer_cache_hit_ratio None 22

    SQLServer:Buffer_Manager buffer_cache_hit_ratio_base None 22

    SQLServer:Buffer_Manager lazy_writes/sec None 0

    SQLServer:Buffer_Manager page_life_expectancy None 366

    SQLServer:SQL_Statistics sql_compilations/sec None 143

    SQLServer:SQL_Statistics sql_re-compilations/sec None 2

    SQLServer:Memory_Manager target_server_memory_(kb) None 3122080

    SQLServer:Memory_Manager total_server_memory_(kb) None 219944

    SQLServer:Transactions longest_transaction_running_time None 0

    SQLServer:Transactions free_space_in_tempdb_(kb) None 28992

    <<<mssql_tablespaces>>>


    After restart the agent service and re-inventory my system, None of these counters come up to the dashboard, as shown in the screenshot bellow.

    2qwpguo.png


    So, the questions is: What should I do to make <<<mssql_counters>>> and <<<winperf_Current_Disk_Queue_Length>>> and etc, that appears on test output come up to my dashboard?


    king Regards


    Eduardo Pin

  • I think you misunterstood the usage of the counter defintions in the check_mk.ini file. The counters you define there are used to add agent sections for the check_mk check plugins. In your case, the counters are passed from agent to server, yes, but cmk does not know what to do with that information because no according check plugins exist on the server and thus, no services are created while running the inventory.


    E.g. the example already given in the check_mk.ini file "counters = 10332:msx_queues" outputs the counters in the agent section "<<<winperf_msx_queues>>>" and will create services on inventory. If you have a look in the check plugin list of your cmk server (cmk -L) you will recognize that there is a check plugin called "winperf_msx_queues" which is responsible for inventorizing services (initial check) and compute the check output (further checks).


    Since there are no check plugins like "winperf_Current_Disk_Queue_Length" or "winperf_Page_life_expectancy_Windows", the agent sections your host sends to the server are of no use. You will have to write your own check plugins if you want to make use of those counters.


    However, at least the "<<<mssql_ ...>>>" agent sections should lead to some services, because there should be check plugins available on your server. Please check this by running:


    Code
    1. # cmk -L | grep msssql


    If there are no such check plugins, I recommend you again to update the cmk version on the server. I do not know at which version the mssql plugins got implemented in cmk.

  • I think you misunterstood the usage of the counter defintions in the check_mk.ini file. The counters you define there are used to add agent sections for the check_mk check plugins. In your case, the counters are passed from agent to server, yes, but cmk does not know what to do with that information because no according check plugins exist on the server and thus, no services are created while running the inventory.

    You're completely correct. I'm pretty new on this tool, and there is no one more experienced to help. So I'm facing some misunderstands .

    I ran cmk -L | grep msssql and there is no "mssql" plugin.
     
    Look my cmk -L result:

    mssql_backup tcp yes yes %s Backup

    mssql_counters.cache_hits tcp yes yes %s

    mssql_counters.file_sizes tcp yes yes %s File Sizes

    mssql_counters.locks tcp yes yes %s Locks

    mssql_counters.transactions tcp yes yes %s Transactions

    mssql_tablespaces tcp yes yes %s Sizes

    mssql_versions tcp no yes %s Version


    I'm going to write to the manager in charge of that requesting a system upgrade.



    Regarding to develop my own plugins to monitor windows counters like "counters = 10332:msx_queues", should I create a powershell plugin? Or something like that? I believe that I'm not the first person in the world that wants to monitor a windows counter, I strongly believe that there are some well done plug-ins already developed. I can start working on that, however I think that I'll expend a lot of time developing plugins since I have no experience on that.


    Thank you so much for your help.


    Eduardo Pin (from Brazil)

  • These are the mssql plugins I was talking about. So it should find some services while inventory because your agent provides the sections <<<mssql_counters>>> So you do not need to upgrade your system if you are fine with that amount of information.


    should I create a powershell plugin?

    No, check plugins are scripts on the check_mk server, located in the "checks" directory and they are written in python syntax.


    however I think that I'll expend a lot of time developing plugins since I have no experience on that.


    Actually it is not that complicated to write your own check plugins. Just check the documentation https://mathias-kettner.de/checkmk_writing_checks.html. Unfortunately it is not updated, but it is enough info to get started with writing own checks.


    I strongly believe that there are some well done plug-ins already developed.


    To know how to handle windows counter information and process them in your own check plugin, just have a look at the built-in plugins which work with windows counters e.g. the mssql_counters plugins mentioned above.