Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

UIM uses environment variables as the main way of exposing information to all custom scripts. The most important of these environment variables is UPTIME_HOSTNAME which provides the hostname of the element the service monitor is running against. Next comes the various input variables from the monitor's xml file, which provide the specific details needed for the script itself. The best way to understand how this works is to take a look at an example of the xml definition a monitor, how that looks as service monitor settings in the GUI, and finally how all this information ends up as environment variables in the script.

A good example is the Custom Remote Monitor as this plugin also provides a great starting point for custom monitors that also rely on an agent-side script. But for now we're just going to focus on the XML details and the script that runs directly on the monitoring station itself. The full contents of the xml file are available on GitHub at this link.

...

  • <class>. This is the service monitor's name as seen on the ' Add Service Monitor ' screen in the Uptime Infrastructure Monitor UIM GUI.
  • <exec>.  This This tells Uptime Infrastructure Monitor UIM that our plugin is a MonitorScriptRunner. There are also java-type plugins, but this doc will only focus focuses on Custom Scriptscustom scripts.
  • <erdc_version>. This is the version number of the plugin which is used to identify when new versions are available.
  • <category>.  This This is the primary category on the ' Add Service Monitor ' screen where you'll be able to find this monitor.
  • <category_related>.  This This is a secondary category where the monitor will be is displayed in the 'Related Monitors' list list.
  • The <grid_info> section outlines details about which OS platforms this monitor can run on, as well as which versions of Uptime Infrastructure MonitorUIM. Which It is used by the Extension Manager to filter which plugins to show as available for installedinstallation.
    • <supported_versions>.  This This is the version of Uptime Infrastructure Monitor UIM monitoring station this plugin is compatible with.
    • <supported_platforms>.  This This is a list of which monitoring station platform a monitor can run on. This can be either windows Windows or linuxLinux, or both like in the example above.
    • <upgrade_in_place>.  This This tells Uptime Infrastructure Monitor that UIM that you can update the plugin can be updated without having to re-define the services monitors assigned to it. In most cases, you'll want to set this to true.

...

Info

In most of the plugins created by Uptime Infrastructure Monitor UIM, these will point to either a .bat or a .sh script depending on the OS type. These wrapper scripts then call a php script that does the actual monitoring.

This particular setup is to make makes it easier to support both Windows and Linux with the same script . As as well as minimize the external dependencies on things not bundled into the default install installation of Uptime Infrastructure Monitor. Your UIM. You are free to use whatever scripting languages you want here, depending on what's best suited for the task at hand.

...