diff --git a/Documentation/Tutorials/Nagios-Plugins.md b/Documentation/Tutorials/Nagios-Plugins.md new file mode 100644 index 000000000..6c4a00924 --- /dev/null +++ b/Documentation/Tutorials/Nagios-Plugins.md @@ -0,0 +1,84 @@ +# MaxScale Nagios plugins, for Nagios 3.5.1 + +Massimiliano Pinto + +Last Updated: 12th March 2015 + +## Document History + + + + + + + + + + + + +
DateChangeWho
10th March 2015Initial versionMassimiliano Pinto
+ +# MaxScale Requirements + +MaxScale must be configured with 'maxscaled' protocol for the administration interface + + [AdminInterface] + type=service + router=cli + + [AdminListener] + type=listener + service=AdminInterface + protocol=maxscaled + port=6603 + +## Prepare Nagios configuration files (assuming plugins are in /usr/lib64/nagios/plugins and Nagios configuration in /etc/nagios) + + 1) Copy ./nagios/plugins/check_maxscale_*.pl under /usr/lib64/nagios/plugins + 2) Copy ./nagios/plugins/maxscale_commands.cfg and server1.cfg to /etc/nagios/objects/ + 3) Edit /etc/nagios/nagios.cfg + +and add (just after localhost.cfg or commnads.cfg) + + cfg_file=/etc/nagios/objects/maxscale_commands.cfg + cfg_file=/etc/nagios/objects/server1.cfg + +### Please note: +- modify server IP address in server1.cfg, pointing to MaxScale server +- maxadmin executable must be in the nagios server +- default AdminInterface port is 6603 +- default maxadmin executable path is /usr/local/skysql/maxscale/bin/maxadmin + It can be changed by -m option + +Example related to server1.cfg + +# Check MaxScale sessions, on the remote machine. +define service{ + use local-service ; Name of service template to use + host_name server1 + service_description MaxScale_sessions + check_command check_maxscale_resource!6603!admin!skysql!sessions!/path_to/maxadmin + notifications_enabled 0 + } + + 4) Restart Nagios + + +# Nagios Plugin usage + + ./check_maxscale_threads.pl -h + + MaxScale monitor checker plugin for Nagios + + Usage: check_maxscale_threads.pl [-r ] [-H ] [-P ] [-u ] [-p ] [-m ] [-h] + + Options: + -r = threads + -h = provide this usage message + -H = which host to connect to + -P = port to use + -u = username to connect as + -p = password to use for at + -m = /path/to/maxadmin + diff --git a/plugins/nagios/README b/plugins/nagios/README deleted file mode 100644 index 9065796c4..000000000 --- a/plugins/nagios/README +++ /dev/null @@ -1,44 +0,0 @@ -MaxScale Nagios plugins, for Nagios 3.5.1 - -MaxScale must be configured with 'maxscaled' protocol for the administration interface - -[AdminInterface] -type=service -router=cli - -[AdminListener] -type=listener -service=AdminInterface -protocol=maxscaled -port=6603 - -1) copy check_maxscale_*.pl under /usr/lib64/nagios/plugins -2) copy maxscale_commands.cfg, server1.cfg to /etc/nagios/objects/ -3) Edit /etc/nagios/nagios.cfg - -add - -cfg_file=/etc/nagios/objects/maxscale_commands.cfg -cfg_file=/etc/nagios/objects/server1.cfg - -Please note: -- modify server IP address in server1.cfg, pointing to MaxScale server -- maxadmin executable must be in the nagios server -- default AdminInterface port is 6603 -- default maxadmin executable path is /usr/local/skysql/maxscale/bin/maxadmin - It can be changed by -m option - -Example related to server1.cfg - -# Check MaxScale sessions, on the remote machine. -define service{ - use local-service ; Name of service template to use - host_name server1 - service_description MaxScale_sessions - check_command check_maxscale_resource!6603!admin!skysql!sessions!/path_to/maxadmin - notifications_enabled 0 - } - -4) Restart Nagios - - diff --git a/plugins/nagios/maxscale_commands.cfg b/plugins/nagios/maxscale_commands.cfg index ca3446d4e..23bbb3594 100644 --- a/plugins/nagios/maxscale_commands.cfg +++ b/plugins/nagios/maxscale_commands.cfg @@ -1,6 +1,7 @@ ############################################################################### # MAXSCALE_COMMANDS.CFG - SAMPLE COMMAND DEFINITIONS FOR NAGIOS 3.5.1 # +# Massimiliano Pinto # Last Modified: 06-03-2015 # # NOTES: This config file provides you with some example command definitions diff --git a/plugins/nagios/server1.cfg b/plugins/nagios/server1.cfg index d571fb1aa..d0f471ed1 100644 --- a/plugins/nagios/server1.cfg +++ b/plugins/nagios/server1.cfg @@ -101,11 +101,11 @@ define service{ notifications_enabled 0 } -# Define a service to check Script on the remote machine. +# Define a service to check Script on the remote machine, with maxadmin path define service{ use local-service ; Name of service template to use host_name server1 service_description MaxScale_threads - check_command check_maxscale_threads!6603!admin!skysql!threads + check_command check_maxscale_threads!6603!admin!skysql!threads!/usr/local/skysql/maxscale/bin/maxadmin notifications_enabled 0 }