Using custom plugins with Netwall Direct Agent

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.

First, install the Netwall Direct Agent on a Windows server. The download links are available on the platform under Multisite Monitoring > Network management > Agent-based monitoring.

The code below is written in VBScript and verifies if a file exists or not. We’ll call this file my_first_plugin_vbs.vbs.

file = wscript.arguments(0)

Set Fso = WScript.CreateObject("Scripting.FileSystemObject")
If (Fso.FileExists(file) = true ) Then
	WScript.echo file+"|exist"
Else
	WScript.echo file+"|does not exist"
End If
Set FSO = nothing

To upload the plugin, follow these instructions, with only one difference though: this time we’ll use the “Agent” credential type:

Plugin upload

The 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.

Finally, click on “Test plugin”.

Plugin test

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.

Plugin output

On step 3, create a rule specifying that if the plugin doesn’t exist, the service status will be defined as CRITICAL:

Monitoring rules

The default rule specifies that if the file exists, the service will be shown as OK.

Default monitoring rule

Click Finish to end the last step. Now create a new service using the plugin as described here in this post.