Sei sulla pagina 1di 3

Nagios XI Managing Plugins in Nagios XI

The Industry Standard in IT Infrastructure Monitoring


Purpose
This document describes how to manage plugins on your XI system, including: finding and installing new plugins, defining commands, and using them in your services.

Target Audience
This document is intended for use by Nagios XI Administrators who need to customize their setup beyond what the default XI installation can provide.

Install & Test Your Plugin


There are thousands of community-created Nagios plugins available at http://exchange.nagios.org. You can also find instructions for creating your own plugin at http://www.nagios.org/documentation. Once you've found a useful plugin you'd like to use, it's time to install it. Click the Admin tab in the Nagios XI web interface, then Manage Plugins at the bottom of the left control panel. Click the Browse button and locate your plugin, then click Upload Plugin. It should appear in the list of available plugins on the Nagios XI server. It's useful to be familiar with running your plugins from the command line, for both informational and debugging purposes. They are located in the /usr/local/nagios/libexec directory. Navigate to that directory and run your plugin with the following commands: # cd /usr/local/nagios/libexec # ./plugin_name args... Experiment a bit and figure out the best way to run the plugin. It probably has a help option you can use to learn more: # ./plugin_name -h

Here's an example: # ./check_icmp -H localhost OK - localhost: rta 0.016ms, lost 0%|rta=0.016ms;200.000;500.000;0; pl=0%;40;80;;

Nagios Enterprises, LLC P.O. Box 8154 Saint Paul, MN 55108 USA

US: 1-888-NAGIOS-1 Int'l: +1 651-204-9102 Fax: +1 651-204-9103

Web: www.nagios.com Email: sales@nagios.com

Page 1
Copyright 2011 Nagios Enterprises, LLC Revision 1.0 September, 2011

Nagios XI Managing Plugins in Nagios XI


Define a Command
Now that your plugin is available and you know the command line arguments to run it, you should define a command in Nagios XI. In the XI web interface, browse to the Core Config Manager (CCM) under ConfigureEnter Nagios Core Configuration ManagerCommandsAdd New. Enter a command name in the Command field (usually the same as its filename). In the command line field, enter $USER1$/plugin_name $ARG1$. The $USER1$ macro is replaced with the path to the plugin directory, while the $ARGN$ macros are placeholders for arguments you want to specify later on a per-service basis. If you want, you can omit them or add more ($ARG2$, $ARG3$, etc.) The Command type should be check command if your plugin will monitor a host or service, or misc command if it handles events. If in doubt, leave it unclassified. The rest of this document only covers check commands. Hit Save and then Apply Configuration.

Add a Service
Click Services in the left control panel (still in the Core Config Manager), then Add New. In the Config Name field, enter a name; this is a file name where the configuration will be stored. Associate it with a host by clicking the notepad icon to the right of the Hosts field, then selecting a host from the Available list and moving it to the Selected list. Hit Save. Enter a short description of the service in the Service description field. In the Check command field, select the command you defined from the drop down list. If you had any argument placeholders when you defined the command earlier, enter replacement text in the appropriate fields here. The Template Name at the bottom of the page should say generic-service. If it doesn't, select it from the drop down menu, or you can select a service template that is defined for this type of service. Hit Insert. This will save you from having to fill in all the other configuration options. Save and Apply Configuration again.

Nagios Enterprises, LLC P.O. Box 8154 Saint Paul, MN 55108 USA

US: 1-888-NAGIOS-1 Int'l: +1 651-204-9102 Fax: +1 651-204-9103

Web: www.nagios.com Email: sales@nagios.com

Page 2
Copyright 2011 Nagios Enterprises, LLC Revision 1.0 September, 2011

Nagios XI Managing Plugins in Nagios XI


Check that it's working
Your service be working now, but it's a good idea to double check that everything went as expected. Navigate to ViewsService Detail and look for your new service in the list. It will probably take a few minutes before it runs its first check. Click the service description for a more detailed view. If you expect that your plugin provides performance graphs, click the Advanced tab after your plugin has run a check and make sure you see some output under Performance Data. If you don't see anything there, you will not be able to see performance graphs with this plugin. If for any reason your plugin isn't working or you need to make some changes to this service, you can do so in the Configure tab by clicking Re-configure this service.

Additional References

http://library.nagios.com/training/selfpaced/videos/401-managing-plugins-in-nagios-xi http://support.nagios.com/wiki/index.php/Nagios_XI:FAQs#Problems_with_Check_Commands

Nagios Enterprises, LLC P.O. Box 8154 Saint Paul, MN 55108 USA

US: 1-888-NAGIOS-1 Int'l: +1 651-204-9102 Fax: +1 651-204-9103

Web: www.nagios.com Email: sales@nagios.com

Page 3
Copyright 2011 Nagios Enterprises, LLC Revision 1.0 September, 2011

Potrebbero piacerti anche