From 2848129d15aa75baea6b5e1e9a003c1bc6bab0bd Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Thu, 12 Mar 2015 16:32:18 +0100 Subject: [PATCH 1/4] Nagios Plugins Tutorial Nagios Plugins Tutorial --- Tutorials/Nagios-Plugins.md | 46 +++++++++++++++++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 Tutorials/Nagios-Plugins.md diff --git a/Tutorials/Nagios-Plugins.md b/Tutorials/Nagios-Plugins.md new file mode 100644 index 000000000..3f1a3bfe6 --- /dev/null +++ b/Tutorials/Nagios-Plugins.md @@ -0,0 +1,46 @@ +# 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 + +## Prepare Nagios configuration files + + 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 + + From 7e551916553f8d7e9cbc746b3fd219cd7594a739 Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Thu, 12 Mar 2015 16:33:53 +0100 Subject: [PATCH 2/4] Nagios Plugins update Nagios Plugins update --- Tutorials/Nagios-Plugins.md | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/Tutorials/Nagios-Plugins.md b/Tutorials/Nagios-Plugins.md index 3f1a3bfe6..c1e35dcb6 100644 --- a/Tutorials/Nagios-Plugins.md +++ b/Tutorials/Nagios-Plugins.md @@ -1,5 +1,24 @@ # MaxScale Nagios plugins, for Nagios 3.5.1 +Massimiliano Pinto + +Last Updated: 12th March 2015 + +## Document History + + + + + + + + + + + + +
DateChangeWho
10th March 2015Initial versionMassimiliano Pinto
+ MaxScale must be configured with 'maxscaled' protocol for the administration interface [AdminInterface] From 99b990a79179aa192809a6b349d5c88e68709bd3 Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Thu, 12 Mar 2015 16:39:58 +0100 Subject: [PATCH 3/4] Nagios Plugins Update Nagios Plugins Update --- Tutorials/Nagios-Plugins.md | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) diff --git a/Tutorials/Nagios-Plugins.md b/Tutorials/Nagios-Plugins.md index c1e35dcb6..4cf32379f 100644 --- a/Tutorials/Nagios-Plugins.md +++ b/Tutorials/Nagios-Plugins.md @@ -19,6 +19,8 @@ Last Updated: 12th March 2015 +# MaxScale Requirements + MaxScale must be configured with 'maxscaled' protocol for the administration interface [AdminInterface] @@ -31,13 +33,13 @@ MaxScale must be configured with 'maxscaled' protocol for the administration int protocol=maxscaled port=6603 -## Prepare Nagios configuration files +## Prepare Nagios configuration files (assuming plugins are in /usr/lib64/nagios/plugins and Nagios configuration in /etc/nagios) - 1) copy check_maxscale_*.pl under /usr/lib64/nagios/plugins - 2) copy maxscale_commands.cfg, server1.cfg to /etc/nagios/objects/ + 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 -add +and add (just after localhost.cfg or commnads.cfg) cfg_file=/etc/nagios/objects/maxscale_commands.cfg cfg_file=/etc/nagios/objects/server1.cfg @@ -63,3 +65,20 @@ define service{ 4) Restart Nagios +# Nagios Plugin usag + + ./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 + From 3dad7ac8f3e23831d721162c44619454f0957b2b Mon Sep 17 00:00:00 2001 From: MassimilianoPinto Date: Thu, 12 Mar 2015 16:45:30 +0100 Subject: [PATCH 4/4] Nagios Documentation Update Nagios Documentation Update --- Tutorials/Nagios-Plugins.md | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/Tutorials/Nagios-Plugins.md b/Tutorials/Nagios-Plugins.md index 4cf32379f..6c4a00924 100644 --- a/Tutorials/Nagios-Plugins.md +++ b/Tutorials/Nagios-Plugins.md @@ -65,20 +65,20 @@ define service{ 4) Restart Nagios -# Nagios Plugin usag +# Nagios Plugin usage - ./check_maxscale_threads.pl -h + ./check_maxscale_threads.pl -h -MaxScale monitor checker plugin for Nagios + MaxScale monitor checker plugin for Nagios -Usage: check_maxscale_threads.pl [-r ] [-H ] [-P ] [-u ] [-p ] [-m ] [-h] + 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 + 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