{"id":180,"date":"2017-09-18T13:18:15","date_gmt":"2017-09-18T16:18:15","guid":{"rendered":"http:\/\/docs.unitplatform.io\/?p=180"},"modified":"2018-05-02T12:22:37","modified_gmt":"2018-05-02T15:22:37","slug":"using-custom-plugins-with-netwall-direct-agent","status":"publish","type":"post","link":"https:\/\/docs.unitplatform.io\/en\/using-custom-plugins-with-netwall-direct-agent\/","title":{"rendered":"Using custom plugins with Netwall Direct Agent","raw":"Using custom plugins with Netwall Direct Agent"},"content":{"rendered":"<p>In this post, we&#8217;ll explain how to use a plugin with the Netwall Direct Agent. As an example, we&#8217;ll create a plugin that verifies the existence of any particular file on a Windows server.<\/p>\n<p>First, install the Netwall Direct Agent on a Windows server. The download links are available on the platform under <strong>Multisite Monitoring<\/strong> &gt; <strong>Network management<\/strong> &gt; <strong>Agent-based monitoring<\/strong>.<\/p>\n<p>The code below is written in VBScript and verifies if a file exists or not. We&#8217;ll call this file <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">my_first_plugin_vbs.vbs<\/code>.<\/p>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">file = wscript.arguments(0)\r\n\r\nSet Fso = WScript.CreateObject(\"Scripting.FileSystemObject\")\r\nIf (Fso.FileExists(file) = true ) Then\r\n\tWScript.echo file+\"|exist\"\r\nElse\r\n\tWScript.echo file+\"|does not exist\"\r\nEnd If\r\nSet FSO = nothing\r\n<\/pre>\n<p>To upload the plugin, follow <a href=\"http:\/\/docs.unitplatform.io\/en\/using-custom-plugins\/\" target=\"_blank\" rel=\"noopener\">these<\/a>\u00a0instructions, with only one difference though: this time we&#8217;ll use the &#8220;Agent&#8221; credential type:<\/p>\n<div id=\"attachment_189\" style=\"width: 1329px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-189\" class=\"wp-image-189 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows.png\" alt=\"\" width=\"1319\" height=\"996\" \/><\/a><p id=\"caption-attachment-189\" class=\"wp-caption-text\">Plugin upload<\/p><\/div>\n<p>The items 4 and 5 (&#8220;Add parameter&#8221; and extra options) will be used to add the entry argument required by the plugin, i.e. the filename to be verified. Add the &#8220;$arg1$&#8221; argument in the field &#8220;Command line arguments&#8221; as shown above.<\/p>\n<p>Finally, click on &#8220;Test plugin&#8221;.<\/p>\n<div id=\"attachment_190\" style=\"width: 1360px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows2.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-190\" class=\"wp-image-190 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows2.png\" alt=\"\" width=\"1350\" height=\"625\" \/><\/a><p id=\"caption-attachment-190\" class=\"wp-caption-text\">Plugin test<\/p><\/div>\n<p>After running the tests successfully, finish registering the plugin. Choose the Output type on the next step. In this case, the plugin will return a text output.<\/p>\n<div id=\"attachment_191\" style=\"width: 1359px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows3.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-191\" class=\"wp-image-191 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows3.png\" alt=\"\" width=\"1349\" height=\"421\" \/><\/a><p id=\"caption-attachment-191\" class=\"wp-caption-text\">Plugin output<\/p><\/div>\n<p>On step 3, create a rule specifying that if the plugin doesn&#8217;t exist, the service status will be defined as CRITICAL:<\/p>\n<div id=\"attachment_192\" style=\"width: 1360px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows4.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-192\" class=\"wp-image-192 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows4.png\" alt=\"\" width=\"1350\" height=\"476\" \/><\/a><p id=\"caption-attachment-192\" class=\"wp-caption-text\">Monitoring rules<\/p><\/div>\n<p>The default rule specifies that if the file exists, the service will be shown as OK.<\/p>\n<div id=\"attachment_193\" style=\"width: 1359px\" class=\"wp-caption alignnone\"><a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows5.png\"><img loading=\"lazy\" decoding=\"async\" aria-describedby=\"caption-attachment-193\" class=\"wp-image-193 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows5.png\" alt=\"\" width=\"1349\" height=\"473\" \/><\/a><p id=\"caption-attachment-193\" class=\"wp-caption-text\">Default monitoring rule<\/p><\/div>\n<p>Click Finish to end the last step. Now create a new service using the plugin as described <a href=\"http:\/\/docs.unitplatform.io\/en\/using-custom-plugins\/\" target=\"_blank\" rel=\"noopener\">here in this post<\/a>.<\/p>\n","protected":false,"raw":"In this post, we'll explain how to use a plugin with the Netwall Direct Agent. As an example, we'll create a plugin that verifies the existence of any particular file on a Windows server.\r\n\r\nFirst, install the Netwall Direct Agent on a Windows server. The download links are available on the platform under <strong>Multisite Monitoring<\/strong> &gt; <strong>Network management<\/strong> &gt; <strong>Agent-based monitoring<\/strong>.\r\n\r\nThe code below is written in VBScript and verifies if a file exists or not. We'll call this file <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">my_first_plugin_vbs.vbs<\/code>.\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">file = wscript.arguments(0)\r\n\r\nSet Fso = WScript.CreateObject(\"Scripting.FileSystemObject\")\r\nIf (Fso.FileExists(file) = true ) Then\r\n\tWScript.echo file+\"|exist\"\r\nElse\r\n\tWScript.echo file+\"|does not exist\"\r\nEnd If\r\nSet FSO = nothing\r\n<\/pre>\r\nTo upload the plugin, follow <a href=\"http:\/\/docs.unitplatform.io\/en\/using-custom-plugins\/\" target=\"_blank\" rel=\"noopener\">these<\/a>\u00a0instructions, with only one difference though: this time we'll use the \"Agent\" credential type:\r\n\r\n[caption id=\"attachment_189\" align=\"alignnone\" width=\"1319\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows.png\"><img class=\"wp-image-189 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows.png\" alt=\"\" width=\"1319\" height=\"996\" \/><\/a> Plugin upload[\/caption]\r\n\r\nThe items 4 and 5 (\"Add parameter\" and extra options) will be used to add the entry argument required by the plugin, i.e. the filename to be verified. Add the \"$arg1$\" argument in the field \"Command line arguments\" as shown above.\r\n\r\nFinally, click on \"Test plugin\".\r\n\r\n[caption id=\"attachment_190\" align=\"alignnone\" width=\"1350\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows2.png\"><img class=\"wp-image-190 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows2.png\" alt=\"\" width=\"1350\" height=\"625\" \/><\/a> Plugin test[\/caption]\r\n\r\nAfter running the tests successfully, finish registering the plugin. Choose the Output type on the next step. In this case, the plugin will return a text output.\r\n\r\n[caption id=\"attachment_191\" align=\"alignnone\" width=\"1349\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows3.png\"><img class=\"wp-image-191 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows3.png\" alt=\"\" width=\"1349\" height=\"421\" \/><\/a> Plugin output[\/caption]\r\n\r\nOn step 3, create a rule specifying that if the plugin doesn't exist, the service status will be defined as CRITICAL:\r\n\r\n[caption id=\"attachment_192\" align=\"alignnone\" width=\"1350\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows4.png\"><img class=\"wp-image-192 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows4.png\" alt=\"\" width=\"1350\" height=\"476\" \/><\/a> Monitoring rules[\/caption]\r\n\r\nThe default rule specifies that if the file exists, the service will be shown as OK.\r\n\r\n[caption id=\"attachment_193\" align=\"alignnone\" width=\"1349\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows5.png\"><img class=\"wp-image-193 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows5.png\" alt=\"\" width=\"1349\" height=\"473\" \/><\/a> Default monitoring rule[\/caption]\r\n\r\nClick Finish to end the last step. Now create a new service using the plugin as described <a href=\"http:\/\/docs.unitplatform.io\/en\/using-custom-plugins\/\" target=\"_blank\" rel=\"noopener\">here in this post<\/a>."},"excerpt":{"rendered":"<p>Learn how to use a custom plugin with the Netwall Direct Agent<\/p>\n","protected":false,"raw":"Learn how to use a custom plugin with the Netwall Direct Agent"},"author":1,"featured_media":545,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_pt_post_content":"Neste post veremos como usar um plugin com o Netwall Direct Agent. Usaremos como exemplo um plugin que verifica a exist\u00eancia de um determinado arquivo em um servidor Windows.\r\n\r\nPrimeiramente, instale o Netwall Direct Agent em um servidor Windows. Os links para download ficam em <strong>Multisite Monitoring<\/strong> &gt; <strong>Gerenciamento de rede<\/strong> &gt; <strong>Monitoramento por Agentes<\/strong>.\r\n\r\nNo exemplo abaixo, o plugin foi escrito em VBS e tem como objetivo verificar se existe um determinado arquivo no servidor Windows. O arquivo \u00e9 chamado de \"my_first_plugin_vbs.vbs\".\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">file = wscript.arguments(0)\r\n\r\nSet Fso = WScript.CreateObject(\"Scripting.FileSystemObject\")\r\nIf (Fso.FileExists(file) = true ) Then\r\n\tWScript.echo file+\"|exist\"\r\nElse\r\n\tWScript.echo file+\"|does not exist\"\r\nEnd If\r\nSet FSO = nothing\r\n<\/pre>\r\nO cadastramento do plugin segue as mesmas instru\u00e7\u00f5es descritas <a href=\"http:\/\/docs.unitplatform.io\/cadastro-de-plugins-personalizados\/\" target=\"_blank\" rel=\"noopener\">neste post<\/a>, apenas com uma diferen\u00e7a: ao especificar um tipo de credencial, usaremos o tipo \"Agent\":\r\n\r\n[caption id=\"attachment_189\" align=\"alignnone\" width=\"1319\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows.png\"><img class=\"size-full wp-image-189\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows.png\" alt=\"\" width=\"1319\" height=\"996\" \/><\/a> Cadastro de plugin windows[\/caption]\r\n\r\nOs itens 4 e 5 (Adicionar par\u00e2metro e Op\u00e7\u00f5es extras) servem para adicionar o argumento necess\u00e1rio do plugin, nome do arquivo que ser\u00e1 verificado se existe ou n\u00e3o. Preencher conforme as informa\u00e7\u00f5es exibidas na imagem.\r\n\r\nPor \u00faltimo, adicionar o argumento \"$arg1$\" no campo dos argumentos da linha de comando.\r\n\r\n<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows2.png\"><img class=\"alignnone size-full wp-image-190\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows2.png\" alt=\"\" width=\"1350\" height=\"625\" \/><\/a>\r\n\r\nNa tela seguinte escolher o tipo de sa\u00edda. Nesse caso ser\u00e1 do tipo texto, pois o plugin devolve o status do arquivo em forma textual.\r\n\r\n<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows3.png\"><img class=\"alignnone size-full wp-image-191\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows3.png\" alt=\"\" width=\"1349\" height=\"421\" \/><\/a>\r\n\r\nNo passo 3, crie uma regra especificando que se o arquivo n\u00e3o existe, o estado do servi\u00e7o dever\u00e1 ser CRITICAL:\r\n\r\n<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows4.png\"><img class=\"alignnone size-full wp-image-192\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows4.png\" alt=\"\" width=\"1350\" height=\"476\" \/><\/a>\r\n\r\nA regra padr\u00e3o especificar\u00e1 que se o arquivo existir, o servi\u00e7o ser\u00e1 exibido como OK:\r\n\r\n<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows5.png\"><img class=\"alignnone size-full wp-image-193\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows5.png\" alt=\"\" width=\"1349\" height=\"473\" \/><\/a>\r\n\r\nClique em \"Finalizar\" para encerrar o cadastro do plugin. Feito isso, basta adicionar criar um novo servi\u00e7o no monitoramento, conforme descrito <a href=\"http:\/\/docs.unitplatform.io\/cadastro-de-plugins-personalizados\/\" target=\"_blank\" rel=\"noopener\">neste post<\/a>.","_pt_post_name":"usando-plugins-personalizados-com-o-netwall-direct-agent","_pt_post_excerpt":"Aprenda como usar um plugin personalizado com o Netwall Direct Agent.","_pt_post_title":"Usando plugins personalizados com o Netwall Direct Agent","_en_post_content":"In this post, we'll explain how to use a plugin with the Netwall Direct Agent. As an example, we'll create a plugin that verifies the existence of any particular file on a Windows server.\r\n\r\nFirst, install the Netwall Direct Agent on a Windows server. The download links are available on the platform under <strong>Multisite Monitoring<\/strong> &gt; <strong>Network management<\/strong> &gt; <strong>Agent-based monitoring<\/strong>.\r\n\r\nThe code below is written in VBScript and verifies if a file exists or not. We'll call this file <code class=\"EnlighterJSRAW\" data-enlighter-language=\"null\">my_first_plugin_vbs.vbs<\/code>.\r\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"shell\">file = wscript.arguments(0)\r\n\r\nSet Fso = WScript.CreateObject(\"Scripting.FileSystemObject\")\r\nIf (Fso.FileExists(file) = true ) Then\r\n\tWScript.echo file+\"|exist\"\r\nElse\r\n\tWScript.echo file+\"|does not exist\"\r\nEnd If\r\nSet FSO = nothing\r\n<\/pre>\r\nTo upload the plugin, follow <a href=\"http:\/\/docs.unitplatform.io\/en\/using-custom-plugins\/\" target=\"_blank\" rel=\"noopener\">these<\/a>\u00a0instructions, with only one difference though: this time we'll use the \"Agent\" credential type:\r\n\r\n[caption id=\"attachment_189\" align=\"alignnone\" width=\"1319\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows.png\"><img class=\"wp-image-189 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows.png\" alt=\"\" width=\"1319\" height=\"996\" \/><\/a> Plugin upload[\/caption]\r\n\r\nThe items 4 and 5 (\"Add parameter\" and extra options) will be used to add the entry argument required by the plugin, i.e. the filename to be verified. Add the \"$arg1$\" argument in the field \"Command line arguments\" as shown above.\r\n\r\nFinally, click on \"Test plugin\".\r\n\r\n[caption id=\"attachment_190\" align=\"alignnone\" width=\"1350\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows2.png\"><img class=\"wp-image-190 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows2.png\" alt=\"\" width=\"1350\" height=\"625\" \/><\/a> Plugin test[\/caption]\r\n\r\nAfter running the tests successfully, finish registering the plugin. Choose the Output type on the next step. In this case, the plugin will return a text output.\r\n\r\n[caption id=\"attachment_191\" align=\"alignnone\" width=\"1349\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows3.png\"><img class=\"wp-image-191 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows3.png\" alt=\"\" width=\"1349\" height=\"421\" \/><\/a> Plugin output[\/caption]\r\n\r\nOn step 3, create a rule specifying that if the plugin doesn't exist, the service status will be defined as CRITICAL:\r\n\r\n[caption id=\"attachment_192\" align=\"alignnone\" width=\"1350\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows4.png\"><img class=\"wp-image-192 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows4.png\" alt=\"\" width=\"1350\" height=\"476\" \/><\/a> Monitoring rules[\/caption]\r\n\r\nThe default rule specifies that if the file exists, the service will be shown as OK.\r\n\r\n[caption id=\"attachment_193\" align=\"alignnone\" width=\"1349\"]<a href=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows5.png\"><img class=\"wp-image-193 size-full\" src=\"http:\/\/docs.unitplatform.io\/wp-content\/uploads\/2017\/09\/plugin_windows5.png\" alt=\"\" width=\"1349\" height=\"473\" \/><\/a> Default monitoring rule[\/caption]\r\n\r\nClick Finish to end the last step. Now create a new service using the plugin as described <a href=\"http:\/\/docs.unitplatform.io\/en\/using-custom-plugins\/\" target=\"_blank\" rel=\"noopener\">here in this post<\/a>.","_en_post_name":"using-custom-plugins-with-netwall-direct-agent","_en_post_excerpt":"Learn how to use a custom plugin with the Netwall Direct Agent","_en_post_title":"Using custom plugins with Netwall Direct Agent","edit_language":"en","footnotes":""},"categories":[1,6,4,8],"tags":[],"class_list":["post-180","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-monitoring","category-plugins","category-tutorials","category-unit-platform-on-premises"],"_links":{"self":[{"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/posts\/180","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/comments?post=180"}],"version-history":[{"count":9,"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/posts\/180\/revisions"}],"predecessor-version":[{"id":270,"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/posts\/180\/revisions\/270"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/media\/545"}],"wp:attachment":[{"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/media?parent=180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/categories?post=180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.unitplatform.io\/en\/wp-json\/wp\/v2\/tags?post=180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}