MSSQL в Nagios

image_pdfimage_print

Появилась задача — мониторинг состояние MSSQL сервера средствами Nagios.

был выбран плагин check_mssql_health (https://labs.consol.de/nagios/check_mssql_health/)

для работы были уставлен модуль Perl

cpan
install DBD::Sybase

на сервера БД был добавлен пользователь nagiosadmin , с паролем nagiosadmin и правами serveradmin

 

В command.cfg добавляем команду проверки:

# ' check_mssql_health' command definition
define command{
command_name check_mssql_health
command_line $USER1$/check_mssql_health --server=$HOSTADDRESS$ --username=nagiosadmin --password=nagiosadmin --mode=$ARG1$ --commit --units=$ARG2$ --warning=$ARG3$ --critical=$ARG4$
}

В проверку хоста добавляем

define service{
        use                     generic-service
        host_name               srv-1c-db01
        service_description     MSSQL transactions
        check_command           check_mssql_health!transactions!B!40000!50000
        }

define service{
        use                     generic-service
        host_name               srv-1c-db01
        service_description     MSSQL connected-users
        check_command           check_mssql_health!connected-users!B!150!200
        }

define service{
        use                     generic-service
        host_name               srv-1c-db01
        service_description     MSSQL cpu-busy
        check_command           check_mssql_health!cpu-busy!B!80!90
        }

define service{
        use                     generic-service
        host_name               srv-1c-db01
        service_description     MSSQL io-busy
        check_command           check_mssql_health!io-busy!B!80!90
        }

define service{
        use                     generic-service
        host_name               srv-1c-db01
        service_description     MSSQL full-scans
        check_command           check_mssql_health!full-scans!B!800!900
        }

define service{
        use                     generic-service
        host_name               srv-1c-db01
        service_description     MSSQL locks-waits
        check_command           check_mssql_health!locks-waits!B!80!90
        }

define service{
        use                     generic-service
        host_name               srv-1c-db01
        service_description     MSSQL total-server-memory
        check_command           check_mssql_health!total-server-memory!GB!80!90
        }

В итоге получаем :

Оставьте комментарий