Ga naar hoofdinhoud

Python Event Monitor Reference Guide

notitie

Overview

The Python Event Monitor is part of PIM+'s scripting event monitors that enable the integration of custom Python scripts into the monitoring, scheduling, and alerting engine. Scripts can range from simple to complex and are responsible for generating status updates, event texts, and even graph data points throughout the PIM+ interface.

Before using this event monitor, ensure that Python version 3.7 or later is installed on your monitoring server and remote nodes. To confirm the installation, open a command line window, run "python", and check that the Python version is displayed.

info

Use Cases

  • Custom Script Execution: Execute Python scripts for bespoke monitoring actions.
  • Dynamic Response and Data Generation: Scripts can dynamically react to monitoring data and create detailed graph data points.

Monitoring Options

Scripting

  • Script Input: Insert your Python script in the provided text area within the event monitor settings. The script will execute on the PIM+ system and must include network communication capabilities if necessary.

Tokens

  • Available Tokens: Utilize tokens that are dynamically replaced by PIM+ during script execution:
    • %%devicename%% - Replaces with the device name being monitored.
    • %%displayname%% - Replaces with the display name of the device.
    • %%devicegroup%% - Replaces with the device's group name.

Output Requirements

  • Standard Output Format: The event monitor uses the script's output to determine actions:
    • Success(devicename)=Custom message - Indicates a successful check with a custom message.
    • Example: Success(www.pim+.com)=Successfully verified page content on the website.

Multi-Line Output

  • Extended Outputs: Scripts can generate detailed outputs using tokens to format multi-line text in notifications:
    • Example: Success(www.pim+.com)=The following website checks succeeded: Verified response time. Check page content.

Status Levels

  • Event Statuses: Scripts can trigger various status levels:
    • Success(hostname)=All checks completed successfully.
    • Info(hostname)=You might want to look at this.
    • Warning(hostname)=Something went a little bit wrong.
    • Error(hostname)=Something went very wrong.
    • Critical(hostname)=OMG, the server is on fire.

Authentication and Security

  • Script Execution Context: Runs on PIM+'s console or a remote node. Network device interactions require appropriate credentials.

Data Points

  • The data points generated by any scripting event monitor depend on the custom monitoring action it performs.

Sample Output

Sample Output