Re: Question regarding haproxy nagios setup
2011-05-03 0:23 GMT+02:00 Amol mandm_z...@yahoo.com: I was using the nagios plugin for haproxy http://cvs.orion.education.fr/viewvc/viewvc.cgi/nagios-plugins-perl/trunk/plugins/check_haproxy.pl?revision=135view=markup my nagios installation version is Nagios Core 3.2.0 in my host config i have declared the service as define service { usedefault-service host_name server1 service_description HAProxy check_command check_haproxy! http://url/admin?stats;csv'!user!pass servicegroups linux } and my checkcommand.cfg is # command 'check_haproxy health' define command { command_name check_haproxy command_line perl /etc/nagios3/libexec/check_haproxy.pl -u $ARG1$ -U $ARG2$ -P $ARG3$ } i have copied the check_haproxy.pl from my download folder to the path mentioned in the checkcommand on my nagios admin console i see Current Status: CRITICAL (for 0d 1h 4m 44s) Status Information:(null) Performance Data: and an alert is sent to my email even though the load balancing is working fine, i am able to run the command from the command line perl /etc/nagios3/libexec/check_haproxy.pl -u 'http://url/ain?stats;csv' -U user -P pass HAPROXY OK - din_https (Active: 2/2) wbclus (Active: 2/2) | t=0.135153s;2;10;0; sess_din_https=0sessions;;;0;2000 sess_wbclus=0sessions;;;0;2000 please let me know if i am missing something Hello, Maybe you should look at this version : https://github.com/polymorf/check_haproxy Regards Joris
Re: Question regarding haproxy nagios setup
On 2015-06-19 16:08, Mauricio Aguilera wrote: El problema es por el ; antes del csv de la url Tengo el mismo problema y pude detectar que Nagios corta ahí el comando y obviamente se ejecuta mal, intenté pasarle los valores con y ' ', pero nada... Se les ocurre algo? Me gustaría tratar de hacer esta pregunta de nuevo en Inglés. Dado que la mayoría de la población mundial no habla español.
Re: Question regarding haproxy nagios setup
hi Timh, Thanks for the update, yes i tried setting that up and now the initial part of my check_haproxy.pl file looks like this #!/usr/bin/perl -w # nagios: -epn # # Copyright (c) 2010 Stéphane Urbanovski stephane.urbanov...@ac-nancy-metz.fr # # This program is free software; you can redistribute it and/or # modify it under the terms of the GNU General Public License # as published by the Free Software Foundation; either version 2 # of the License, or (at your option) any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty # of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # you should have received a copy of the GNU General Public License # along with this program (or with Nagios); if not, write to the # Free Software Foundation, Inc., 59 Temple Place - Suite 330, # Boston, MA 02111-1307, USA # # $Id: $ use strict; # should never be differently :-) use warnings; use lib '/usr/lib/nagios/plugins'; use Locale::gettext; use File::Basename; # get basename() use POSIX qw(setlocale); use Time::HiRes qw(time); # get microtime use POSIX qw(mktime); ... and status information still comes back as (null) Service State Information Current Status: CRITICAL (for 0d 18h 44m 22s) Status Information: (null) --- On Tue, 5/3/11, Timh B t...@shiwebs.net wrote: From: Timh B t...@shiwebs.net Subject: Re: Question regarding haproxy nagios setup To: Amol mandm_z...@yahoo.com Cc: haproxy@formilux.org Date: Tuesday, May 3, 2011, 4:23 AM On Tue, May 3, 2011 00:23, Amol wrote: I was using the nagios plugin for haproxy http://cvs.orion.education.fr/viewvc/viewvc.cgi/nagios-plugins-perl/trunk/plugins/check_haproxy.pl?revision=135view=markup my nagios installation version is Nagios Core 3.2.0 in my host config i have declared the service as define service { use default-service host_name server1 service_description HAProxy check_command check_haproxy!http://url/admin?stats;csv'!user!pass servicegroups linux } and my checkcommand.cfg is # command 'check_haproxy health' define command { command_name check_haproxy command_line perl /etc/nagios3/libexec/check_haproxy.pl -u $ARG1$ -U $ARG2$ -P $ARG3$ } i have copied the check_haproxy.pl from my download folder to the path mentioned in the checkcommand on my nagios admin console i see Current Status: CRITICAL (for 0d 1h 4m 44s) Status Information: (null) Performance Data: and an alert is sent to my email even though the load balancing is working fine, i am able to run the command from the command line perl /etc/nagios3/libexec/check_haproxy.pl -u 'http://url/ain?stats;csv' -U user -P pass HAPROXY OK - din_https (Active: 2/2) wbclus (Active: 2/2) | t=0.135153s;2;10;0; sess_din_https=0sessions;;;0;2000 sess_wbclus=0sessions;;;0;2000 please let me know if i am missing something Check your haproxy.pl script, add # nagios: -epn right after the /usr/bin/perl-line, it tells nagios not to run it's own perl-parser/interpreter. -- //Timh
Re: Question regarding haproxy nagios setup
what are you trying to check? if the system is online? if so, I use check_http and check for a 200 OK status and for stats I check of a 401 status, if I get something else I would assume something is misconfigured Saludos On Mon, May 2, 2011 at 7:23 PM, Amol mandm_z...@yahoo.com wrote: I was using the nagios plugin for haproxy http://cvs.orion.education.fr/viewvc/viewvc.cgi/nagios-plugins-perl/trunk/plugins/check_haproxy.pl?revision=135view=markup my nagios installation version is Nagios Core 3.2.0 in my host config i have declared the service as define service { usedefault-service host_name server1 service_description HAProxy check_command check_haproxy! http://url/admin?stats;csv'!user!pass servicegroups linux } and my checkcommand.cfg is # command 'check_haproxy health' define command { command_name check_haproxy command_line perl /etc/nagios3/libexec/check_haproxy.pl -u $ARG1$ -U $ARG2$ -P $ARG3$ } i have copied the check_haproxy.pl from my download folder to the path mentioned in the checkcommand on my nagios admin console i see Current Status: CRITICAL (for 0d 1h 4m 44s) Status Information:(null) Performance Data: and an alert is sent to my email even though the load balancing is working fine, i am able to run the command from the command line perl /etc/nagios3/libexec/check_haproxy.pl -u 'http://url/ain?stats;csv' -U user -P pass HAPROXY OK - din_https (Active: 2/2) wbclus (Active: 2/2) | t=0.135153s;2;10;0; sess_din_https=0sessions;;;0;2000 sess_wbclus=0sessions;;;0;2000 please let me know if i am missing something -- Gabriel Sosa Si buscas resultados distintos, no hagas siempre lo mismo. - Einstein
Re: Question regarding haproxy nagios setup
Thanks Gabriel, yes the check_http is what i was looking for since it can now tell me if one of my load balancer server is not responding to http connection request, i might not have to use the nagios plugin --- On Mon, 5/2/11, Gabriel Sosa sosagabr...@gmail.com wrote: From: Gabriel Sosa sosagabr...@gmail.com Subject: Re: Question regarding haproxy nagios setup To: Amol mandm_z...@yahoo.com Cc: haproxy@formilux.org Date: Monday, May 2, 2011, 8:21 PM what are you trying to check? if the system is online? if so, I use check_http and check for a 200 OK status and for stats I check of a 401 status, if I get something else I would assume something is misconfigured Saludos On Mon, May 2, 2011 at 7:23 PM, Amol mandm_z...@yahoo.com wrote: I was using the nagios plugin for haproxy http://cvs.orion.education.fr/viewvc/viewvc.cgi/nagios-plugins-perl/trunk/plugins/check_haproxy.pl?revision=135view=markup my nagios installation version is Nagios Core 3.2.0 in my host config i have declared the service as define service { use default-service host_name server1 service_description HAProxy check_command check_haproxy!http://url/admin?stats;csv'!user!pass servicegroups linux } and my checkcommand.cfg is # command 'check_haproxy health' define command { command_name check_haproxy command_line perl /etc/nagios3/libexec/check_haproxy.pl -u $ARG1$ -U $ARG2$ -P $ARG3$ } i have copied the check_haproxy.pl from my download folder to the path mentioned in the checkcommand on my nagios admin console i see Current Status: CRITICAL (for 0d 1h 4m 44s) Status Information: (null) Performance Data: and an alert is sent to my email even though the load balancing is working fine, i am able to run the command from the command line perl /etc/nagios3/libexec/check_haproxy.pl -u 'http://url/ain?stats;csv' -U user -P pass HAPROXY OK - din_https (Active: 2/2) wbclus (Active: 2/2) | t=0.135153s;2;10;0; sess_din_https=0sessions;;;0;2000 sess_wbclus=0sessions;;;0;2000 please let me know if i am missing something -- Gabriel Sosa Si buscas resultados distintos, no hagas siempre lo mismo. - Einstein