How to create a custom monitor?

How to create a custom monitor?

Q: None of monitor types available can handle the task. How can I run a program or script of my choice instead?

A: Right click on an existing host and select “New Monitor”, then select “Custom monitors” category on the left and “Script or Program” monitor.

Select the appropriate host and group settings on a next screen and click on “Finish”. Now select the newly created monitor and proceed to “Monitor Definition” section.

You can use either a script known to Windows Scripting Host, a Nagios Plugin or an external script and/or program to run.

Note that the script/program selected is executed under the Monitoring Service Account Credentials (LocalSystem) by default, so you may need to select specific  credentials in the Credentials section for this monitor to get access to required data.

The following settings are self-explanatory: “Path”, “Arguments”, “Mode”.

 Custom Monitor

External program is run by invoking cmd.exe and passing it the full path to program and the parameters.

If the program/script exit code is zero, then the whatever is printed to the standard output is used as the returned value; otherwise, the output is used as an error message.

You can scale the returned (real) value with “Divide returned value by” setting (1.0 by default, i.e., no change).

Related topics

Can I monitor custom port?