{"id":20482,"date":"2022-11-17T13:49:41","date_gmt":"2022-11-17T12:49:41","guid":{"rendered":"https:\/\/www.dbi-services.com\/blog\/?p=20482"},"modified":"2022-11-17T13:49:41","modified_gmt":"2022-11-17T12:49:41","slug":"dbachecks-how-to-add-your-own-checks","status":"publish","type":"post","link":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/","title":{"rendered":"dbachecks: how to add your own checks"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">As a DBA I used more and more the <a href=\"https:\/\/dbachecks.readthedocs.io\/\">dbachecks<\/a> at customer place to validate environments. It became part of our DBA toolkit at the same place than its famous brother the <a href=\"https:\/\/dbatools.io\/\">dbatools<\/a>.<br>My colleague Steven Naudet did a <a href=\"https:\/\/www.dbi-services.com\/blog\/validate-your-sql-server-infrastructure-with-dbachecks\/\">blog-post<\/a> some weeks ago about it and today I will show you how is it possible to add your own checks if you cannot find the one you need in the quite long list available for the moment and which is continuously growing.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Before to create your own checks you can read this <a href=\"https:\/\/github.com\/dataplat\/dbachecks\/wiki\">wiki<\/a> which is dedicated to dbachecks development and available on the dbachecks main page. It will give you some advice and standard development guidelines.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To create my new checks I will first create a new file which will contain those checks, lets name it SelfChecks.Tests.ps1.<br>I would like to add two checks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The first one will check the health of my Availability Groups which have to be synchronized and healthy.<br>I will tag this check DBinAG.<\/li>\n<\/ul>\n\n\n\n<ul class=\"wp-block-list\">\n<li>The second one will check that all the user databases of my instance are part of an Availability Group with exception of some specifics ones like our dbi_tools database for example.<br>I will tag this one DBHealthyInAG.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">The PowerShell script will be the following:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>$filename = $MyInvocation.MyCommand.Name.Replace(\".Tests.ps1\", \"\")\n\n$DBinAG = \"IF (SERVERPROPERTY ('IsHadrEnabled') = 1)\nBEGIN\n\tSELECT  name, state_desc\n\tFROM    sys.databases\n\tWHERE    name    NOT IN\n\t\t(   SELECT  DISTINCT\n\t\t\t\t\tdrcs.database_name              AS name\n\t\t\tFROM                master.sys.availability_groups                      AS ag\n\t\t\t\tLEFT OUTER JOIN master.sys.dm_hadr_availability_group_states        AS ags\n\t\t\t\t\t\t\tON    ag.group_id       = ags.group_id\n\t\t\t\tINNER JOIN      master.sys.availability_replicas                    AS ar\n\t\t\t\t\t\t\tON   ag.group_id        = ar.group_id\n\t\t\t\tINNER JOIN      master.sys.dm_hadr_availability_replica_states      AS ars\n\t\t\t\t\t\t\tON     ar.replica_id    = ars.replica_id\n\t\t\t\t\t\t\tAND    ars.is_local     = 1\n\t\t\t\tINNER JOIN      master.sys.dm_hadr_database_replica_cluster_states  AS drcs\n\t\t\t\t\t\t\tON     ars.replica_id   = drcs.replica_id\n\t\t\t\tLEFT OUTER JOIN master.sys.dm_hadr_database_replica_states          AS dbrs\n\t\t\t\t\t\t\tON      drcs.replica_id         = dbrs.replica_id\n\t\t\t\t\t\t\tAND     drcs.group_database_id  = dbrs.group_database_id\n\t\t\tWHERE   ISNULL(ars.role, 3)                 = 1\n\t\t\tOR      ISNULL(drcs.is_database_joined, 0)  = 1\n\t\t)\n\t--AND     dbid  \n\tAND     name    NOT IN  ('master'\n\t\t\t\t\t\t\t,'tempdb'\n\t\t\t\t\t\t\t,'model'\n\t\t\t\t\t\t\t,'msdb'\n\t\t\t\t\t\t\t-- add below your exceptions\n\t\t\t\t\t\t\t,'dbi_tools'\n\t\t\t\t\t\t\t)\n\tAND     state_desc  != 'OFFLINE'\n\tORDER BY\n\t\t\tname    ASC\nEND\";\n\n(Get-Instance).ForEach{\n\n    Describe \u2013Name \"All databases should be in an AG\" -Tags DBinAG, $filename {\n        Context \u2013Name \"All databases should be in an AG on $psitem\" {\n            It \"should have 0 database outide of an AG\" {\n                Invoke-DbaQuery -SqlInstance $psitem -Query $DBinAG |  \n                Measure-Object |\n                    Select-Object \u2013ExpandProperty Count |\n                    Should -Be 0 \u2013Because \"All databases should be in an AG\"\n            }\n        }\n    }\n}\n\n$DBHealthyInAG = \"IF (SERVERPROPERTY ('IsHadrEnabled') = 1)\nBEGIN\nSELECT  ag.name                             AS &#091;AGName]\n        ,adc.&#091;database_name]                AS &#091;DBName]\n        ,ar.replica_server_name             AS &#091;ReplicaServerName]\n        ,drs.synchronization_state_desc     AS &#091;SynchronizationState]\n        ,drs.synchronization_health_desc    AS &#091;SynchronizationHealth]\n        ,drs.is_local                       AS &#091;IsLocal]\n        ,ar.availability_mode_desc          AS &#091;AvailabilityMode]\nFROM    sys.dm_hadr_database_replica_states                 AS drs WITH (NOLOCK)\n        INNER JOIN sys.availability_databases_cluster       AS adc WITH (NOLOCK)\n            ON  drs.group_id            = adc.group_id\n            AND drs.group_database_id   = adc.group_database_id\n        INNER JOIN sys.availability_groups                  AS ag WITH (NOLOCK)\n            ON  ag.group_id             = drs.group_id\n        INNER JOIN sys.availability_replicas                AS ar WITH (NOLOCK)\n            ON  drs.group_id            = ar.group_id\n            AND drs.replica_id          = ar.replica_id\nWHERE   1=1\nAND NOT (   drs.synchronization_state_desc  = 'SYNCHRONIZED'\n        AND drs.synchronization_health_desc = 'HEALTHY'\n        )\nORDER BY\n        ag.name\n        ,ar.replica_server_name\n        ,adc.&#091;database_name]        OPTION (RECOMPILE)\nEND\";\n\n(Get-Instance).ForEach{\n\n    Describe \u2013Name \"All databases should be synchronized and healthy in an AG\" \u2013Tags DBHealthyInAG, $filename {\n        Context \u2013Name \"All databases should be synchronized and healthy in an AG on $psitem\" {\n            It \"should have 0 unsynchronized and unhealthy databases\" {\n                Invoke-DbaQuery -SqlInstance $psitem -Query $DBHealthyInAG |  \n                Measure-Object |\n                    Select-Object \u2013ExpandProperty Count |\n                    Should -Be 0 \u2013Because \"All databases need to be synchronized and healthy\"\n            }\n        }\n    }\n}<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">When we install the dbachecks, Pester tests &amp; checks are stored in a particular folder and to find where we can run the cmdlet:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Get-DbcConfig -Name app.checkrepos<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Result is:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"751\" height=\"85\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture1.png\" alt=\"\" class=\"wp-image-20483\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture1.png 751w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture1-300x34.png 300w\" sizes=\"auto, (max-width: 751px) 100vw, 751px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To add my checks to the list of the available checks I need to add the location of my file to this configuration value.<br>I can do it with the cmdlet:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Set-DbcConfig -Name app.checkrepos -Value 'C:\\dbachecks\\OwnChecks\\' -Append<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Now, my folder has been added to the check repo:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"752\" height=\"90\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture2.png\" alt=\"\" class=\"wp-image-20484\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture2.png 752w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture2-300x36.png 300w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">I&#8217;m able to call my two new tags as I would do for &#8220;existing&#8221; ones and the result is:<\/p>\n\n\n\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"752\" height=\"257\" src=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture3.png\" alt=\"\" class=\"wp-image-20487\" srcset=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture3.png 752w, https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture3-300x103.png 300w\" sizes=\"auto, (max-width: 752px) 100vw, 752px\" \/><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">All my databases are part of an Always On Availability Group and my AG are healthy &amp; synchronized \ud83d\ude09<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">I was able to add my two new checks and if I need another ones, I can add them to my file.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">Quite easy no?<\/p>\n","protected":false},"excerpt":{"rendered":"<p>As a DBA I used more and more the dbachecks at customer place to validate environments. It became part of our DBA toolkit at the same place than its famous brother the dbatools.My colleague Steven Naudet did a blog-post some weeks ago about it and today I will show you how is it possible to&hellip;&nbsp;<\/p>\n","protected":false},"author":21,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":"","neve_meta_reading_time":"","_themeisle_gutenberg_block_has_review":false,"footnotes":""},"categories":[4133],"tags":[2169,1888,272],"class_list":["post-20482","post","type-post","status-publish","format-standard","category-database","tag-dbachecks","tag-dbatools","tag-powershell"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v28.9 (Yoast SEO v28.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>dbachecks: how to add your own checks - dbi services Blog<\/title>\n<meta name=\"description\" content=\"dbachecks new checks dbatools sql server powershell\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"dbachecks: how to add your own checks\" \/>\n<meta property=\"og:description\" content=\"dbachecks new checks dbatools sql server powershell\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/\" \/>\n<meta property=\"og:site_name\" content=\"dbi services Blog\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/dbiservices\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-11-17T12:49:41+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture1.png\" \/>\n\t<meta property=\"og:image:width\" content=\"751\" \/>\n\t<meta property=\"og:image:height\" content=\"85\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"St\u00e9phane Savorgnano\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:site\" content=\"@dbiservices\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"St\u00e9phane Savorgnano\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/\"},\"author\":{\"name\":\"St\u00e9phane Savorgnano\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/adf6293d8bc8a7a26490acfe2918b6d7\"},\"headline\":\"dbachecks: how to add your own checks\",\"datePublished\":\"2022-11-17T12:49:41+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/\"},\"wordCount\":353,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/Picture1.png\",\"keywords\":[\"dbachecks\",\"dbatools\",\"PowerShell\"],\"articleSection\":[\"Database\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/\",\"name\":\"dbachecks: how to add your own checks - dbi services Blog\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/Picture1.png\",\"datePublished\":\"2022-11-17T12:49:41+00:00\",\"description\":\"dbachecks new checks dbatools sql server powershell\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/Picture1.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/11\\\/Picture1.png\",\"width\":751,\"height\":85},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/dbachecks-how-to-add-your-own-checks\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"dbachecks: how to add your own checks\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/\",\"name\":\"dbi services Blog\",\"description\":\"#BeSharing\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/#organization\",\"name\":\"dbi services\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2026\\\/09\\\/dbi-services-logo.png\",\"width\":512,\"height\":512,\"caption\":\"dbi services\"},\"image\":{\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"},\"sameAs\":[\"https:\\\/\\\/www.facebook.com\\\/dbiservices\\\/\",\"https:\\\/\\\/x.com\\\/dbiservices\",\"https:\\\/\\\/www.linkedin.com\\\/company\\\/dbi-services\\\/\",\"https:\\\/\\\/www.youtube.com\\\/user\\\/dbiservices\"],\"description\":\"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.\",\"email\":\"info@dbi-services.com\",\"telephone\":\"+41 32 422 96 00\",\"legalName\":\"dbi services SA\"},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/#\\\/schema\\\/person\\\/adf6293d8bc8a7a26490acfe2918b6d7\",\"name\":\"St\u00e9phane Savorgnano\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/STS_web-min-scaled.jpg\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/STS_web-min-scaled.jpg\",\"contentUrl\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/wp-content\\\/uploads\\\/2022\\\/10\\\/STS_web-min-scaled.jpg\",\"caption\":\"St\u00e9phane Savorgnano\"},\"description\":\"St\u00e9phane Savorgnano has more than 20 years of experience in Microsoft software development and SQL Server database solutions, specializing in SQL Server installation, performance analysis, and best practices. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server 2012 through 2017, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. Prior to dbi services, he was a software engineer at Ciba Specialty Chemicals in Basel. He holds a Master's degree in Informatics from the University of Mulhouse. His industry experience covers banking and financial services, chemicals, and pharmaceuticals.\",\"url\":\"https:\\\/\\\/www.dbi-services.com\\\/blog\\\/author\\\/stephane-savorgnano\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"dbachecks: how to add your own checks - dbi services Blog","description":"dbachecks new checks dbatools sql server powershell","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/","og_locale":"en_US","og_type":"article","og_title":"dbachecks: how to add your own checks","og_description":"dbachecks new checks dbatools sql server powershell","og_url":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/","og_site_name":"dbi services Blog","article_publisher":"https:\/\/www.facebook.com\/dbiservices\/","article_published_time":"2022-11-17T12:49:41+00:00","og_image":[{"width":751,"height":85,"url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture1.png","type":"image\/png"}],"author":"St\u00e9phane Savorgnano","twitter_card":"summary_large_image","twitter_creator":"@dbiservices","twitter_site":"@dbiservices","twitter_misc":{"Written by":"St\u00e9phane Savorgnano","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/#article","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/"},"author":{"name":"St\u00e9phane Savorgnano","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/adf6293d8bc8a7a26490acfe2918b6d7"},"headline":"dbachecks: how to add your own checks","datePublished":"2022-11-17T12:49:41+00:00","mainEntityOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/"},"wordCount":353,"commentCount":0,"publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture1.png","keywords":["dbachecks","dbatools","PowerShell"],"articleSection":["Database"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/","url":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/","name":"dbachecks: how to add your own checks - dbi services Blog","isPartOf":{"@id":"https:\/\/www.dbi-services.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/#primaryimage"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/#primaryimage"},"thumbnailUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture1.png","datePublished":"2022-11-17T12:49:41+00:00","description":"dbachecks new checks dbatools sql server powershell","breadcrumb":{"@id":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/#primaryimage","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture1.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/11\/Picture1.png","width":751,"height":85},{"@type":"BreadcrumbList","@id":"https:\/\/www.dbi-services.com\/blog\/dbachecks-how-to-add-your-own-checks\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.dbi-services.com\/blog\/"},{"@type":"ListItem","position":2,"name":"dbachecks: how to add your own checks"}]},{"@type":"WebSite","@id":"https:\/\/www.dbi-services.com\/blog\/#website","url":"https:\/\/www.dbi-services.com\/blog\/","name":"dbi services Blog","description":"#BeSharing","publisher":{"@id":"https:\/\/www.dbi-services.com\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.dbi-services.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.dbi-services.com\/#organization","name":"dbi services","url":"https:\/\/www.dbi-services.com\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2026\/09\/dbi-services-logo.png","width":512,"height":512,"caption":"dbi services"},"image":{"@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/dbiservices\/","https:\/\/x.com\/dbiservices","https:\/\/www.linkedin.com\/company\/dbi-services\/","https:\/\/www.youtube.com\/user\/dbiservices"],"description":"Swiss IT consulting and services company specialized in efficient data infrastructures and platforms: databases, application servers, cloud, DevOps, digitalization, analytics, data quality and monitoring. Headquartered in Del\u00e9mont with offices in Nyon, Basel, Bern and Zurich.","email":"info@dbi-services.com","telephone":"+41 32 422 96 00","legalName":"dbi services SA"},{"@type":"Person","@id":"https:\/\/www.dbi-services.com\/blog\/#\/schema\/person\/adf6293d8bc8a7a26490acfe2918b6d7","name":"St\u00e9phane Savorgnano","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/10\/STS_web-min-scaled.jpg","url":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/10\/STS_web-min-scaled.jpg","contentUrl":"https:\/\/www.dbi-services.com\/blog\/wp-content\/uploads\/2022\/10\/STS_web-min-scaled.jpg","caption":"St\u00e9phane Savorgnano"},"description":"St\u00e9phane Savorgnano has more than 20 years of experience in Microsoft software development and SQL Server database solutions, specializing in SQL Server installation, performance analysis, and best practices. He holds Microsoft Certified Solutions Associate (MCSA) and Expert (MCSE) for SQL Server 2012 through 2017, MCTS, MCITP for SQL Server 2008, and ITIL V3 Foundation certifications. Prior to dbi services, he was a software engineer at Ciba Specialty Chemicals in Basel. He holds a Master's degree in Informatics from the University of Mulhouse. His industry experience covers banking and financial services, chemicals, and pharmaceuticals.","url":"https:\/\/www.dbi-services.com\/blog\/author\/stephane-savorgnano\/"}]}},"_links":{"self":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/20482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/users\/21"}],"replies":[{"embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/comments?post=20482"}],"version-history":[{"count":0,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/posts\/20482\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/media?parent=20482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/categories?post=20482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.dbi-services.com\/blog\/wp-json\/wp\/v2\/tags?post=20482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}