Submit a ticketCall us

Have You Auto Renewed? If not, you're missing out.
The SolarWinds Renewal Program comes with a host of benefits including the most recent product updates, 24/7 technical support, virtual instructor-led training and more. Experience all of this with the convenience of Auto Renewal, and never worry about missing any of these great benefits. Learn More.

Home > Success Center > Server & Application Monitor (SAM) > SAM Custom Template Guide > Create a Nagios Script monitor

Create a Nagios Script monitor

The Nagios script monitor allows you to run custom Nagios scripts in SAM to monitor computers with Nagios installed. Before coding and testing your script, review the Nagios information and components and best practices for SAM.

SAM supports using compiled Nagios Plugins found through the Nagios site and compiled binary files (ELF) used on Linux-based computers.

For Nagios plugins:

  • The plugin needs to be installed on the target system. SAM does not transfer the plugins to the server.
  • When configuring the Nagios Script monitor, leave the script body field empty.
  • For the Command Line field, enter a path location on the remote file system for the plugin location and any required parameters.
  • Nagios plugins typically require the hostname. You may need to enter a parameter -H with the hostname. You can assign and use a variable to provide the hostname by using ${IP} or ${Node.DNS} in the script.

For compiled binary files:

  • Transfer the script to the target system.
  • Leave the Script Working Directory blank.
  • Enter any character in the Script Body. The field cannot be empty but is not used when executing the script.
  • For the Command Line field, enter the full path to the script located on the target system and all Nagios parameters.

Add a Nagios monitor

  1. Click Settings > All Settings > SAM Settings and click Manage Templates.

    The Manage Application Monitor Templates page opens. All available out-of-the-box and custom templates display.

  2. Create or edit a template.

    Search to locate, select, and edit an existing template or click Create New Template.

  3. Click Add Component Monitor(s) and choose Manually Add Component Monitors.
  4. Search for Nagios. When displayed, select the Nagios Script Monitor and click add.

    File:Success_Center/Reusable_content_-_InfoDev/SAM_Template_Reuse/SAM-Admin-MT/090/nagios-script_578x345.png

  5. Select the Authentication Type and matching credentials from the Credentials for Monitoring drop-down menu.

  6. Enter a Working Directory, used for processing the script. A typical directory customers use is /tmp.
  7. Enter a Command Line to run the script including all parameters.

    Depending on the type of script or plugin, the command line may require additional information and parameters. For example, the file path or hostname.

  8. Click Edit Script to enter and test the script.

    Depending on the type of script or plugin, you may need to enter different script information.

    For example, a plugin does not require data in this field. The plugin needs to be installed on the target server.

  9. Test the script by selecting settings for the output, specified node, and specified credentials. Click Get Script Output.

    Output results display using the script code with success or failure and any additional notes.

  10. Click Get Script Output to generate the output and click Save.

    The metrics save to outputs to configure as part of the component monitor. These outputs display at polling intervals for the template.

  11. When complete, click Submit to save the template.

When tested, output generates into customizable sections. Each output section is named by the Unique ID with a Display Name you can edit.

For each output, you can optionally:

  • Convert the value using selected formulas.
  • Configure the statistic thresholds to refine alerting for the component monitor. Set the warning and critical thresholds with specific values or baseline data.
  • Select a roll-up status sort option to display the best or worst status up through the template and component monitor.
  • Add notes to describe the script output.

File:Success_Center/Reusable_content_-_InfoDev/SAM_Template_Reuse/SAM-Admin-MT/090/script-output_783x315.png

Last modified

Tags

Classifications

Public