JavaScript Event Monitor Reference Guide
Overview
The JavaScript Event Monitor is a part of PIM+'s scripting event monitors that allows for the integration of custom JavaScript scripts into the monitoring, scheduling, and alerting engine. These scripts can dictate the system's response, generate status updates, event texts, and even populate graphs with data points across the PIM+ interface.
Use Cases
- Custom Script Execution: Execute JavaScript for custom monitoring actions.
- Dynamic Response and Data Generation: Scripts can react dynamically to monitoring data and create visual data points for in-depth analysis.
Monitoring Options
General Monitoring
- Alert on Device Connection Issues: Alerts if the selected device cannot be contacted.
- CPU Usage Alerts: Triggers alerts when CPU usage surpasses defined thresholds.
- File Count Alerts: Sets alerts based on the number of files in a specified directory.
- Disk Space Usage Alerts: Alerts for low disk or partition space. Options to exclude specified drives.
- Memory Usage Alerts: Triggers based on the percentage of used physical memory.
- Ping Response Alerts: Alerts based on ping response times.
- Total Bandwidth Rate Alerts: Based on the total network bandwidth usage.
- Outgoing Bandwidth Rate Alerts: Alerts for total outgoing network bandwidth.
- Incoming Bandwidth Rate Alerts: Alerts for total incoming network bandwidth.
Configuration Options
- SSH Port Number: Specify if using a non-standard port, default is 22.
Script Settings
- Script Input: Place your custom JavaScript code in the provided text area within the event monitor settings. Ensure your script includes error handling and network interaction capabilities if necessary.
Tokens
- Available Tokens: Utilize dynamic tokens that PIM+ replaces at runtime:
%%devicename%%
- The name of the device being monitored.%%displayname%%
- The display name of the device.%%devicegroup%%
- The group name of the device.
Output Requirements
- Status and Event Text: The script should specify the output text for various statuses such as success, warning, error, and critical levels. For example:
Success(hostname)=Message indicating success.
Authentication and Security
- Script Execution Context: Runs on PIM+'s console or a remote node. If interacting with network devices, appropriate credentials are necessary.
Data Points
- Graph Data Points: Scripts can generate data points that are utilized in the PIM+ dashboard to visually represent monitoring metrics.