Script 'mail_helper' called by obssrc
Hello community,

here is the log from the commit of package monitoring-plugins-haproxy for 
openSUSE:Factory checked in at 2025-03-27 22:33:15
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/monitoring-plugins-haproxy (Old)
 and      /work/SRC/openSUSE:Factory/.monitoring-plugins-haproxy.new.2696 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Package is "monitoring-plugins-haproxy"

Thu Mar 27 22:33:15 2025 rev:4 rq:1256412 version:1.1g6790d7f

Changes:
--------
--- 
/work/SRC/openSUSE:Factory/monitoring-plugins-haproxy/monitoring-plugins-haproxy.changes
    2024-02-14 23:19:56.698862115 +0100
+++ 
/work/SRC/openSUSE:Factory/.monitoring-plugins-haproxy.new.2696/monitoring-plugins-haproxy.changes
  2025-03-27 22:33:40.872033295 +0100
@@ -1,0 +2,7 @@
+Wed Mar 26 17:19:10 CET 2025 - r...@suse.de
+
+- add check_haproxy-ignore_down_backends.patch
+  allow ignoring down servers marked as backup
+  (meant for active/passive clusters)
+
+-------------------------------------------------------------------

New:
----
  check_haproxy-ignore_down_backends.patch

BETA DEBUG BEGIN:
  New:
- add check_haproxy-ignore_down_backends.patch
  allow ignoring down servers marked as backup
BETA DEBUG END:

++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++

Other differences:
------------------
++++++ monitoring-plugins-haproxy.spec ++++++
--- /var/tmp/diff_new_pack.eVhI99/_old  2025-03-27 22:33:42.492100355 +0100
+++ /var/tmp/diff_new_pack.eVhI99/_new  2025-03-27 22:33:42.508101017 +0100
@@ -1,7 +1,7 @@
 #
 # spec file for package monitoring-plugins-haproxy
 #
-# Copyright (c) 2024 SUSE LLC
+# Copyright (c) 2025 SUSE LLC
 #
 # All modifications and additions to the file contributed by third parties
 # remain the property of their copyright owners, unless otherwise agreed
@@ -25,6 +25,7 @@
 URL:            https://github.com/Napsty/check_haproxy
 Source0:        check_haproxy-%{version}.tar.gz
 Source1:        gpl-2.0.txt
+Patch0:         check_haproxy-ignore_down_backends.patch
 BuildRequires:  nagios-rpm-macros
 # For directory ownership:
 BuildRequires:  icinga2-bin
@@ -47,7 +48,7 @@
 The plugin checks HAProxy statistic url (csv) and gets UP and DOWN services.
 
 %prep
-%setup -q -n check_haproxy-%{version}
+%autosetup -n check_haproxy-%{version}
 install -m644 %{SOURCE1} LICENSE
 
 %build

++++++ check_haproxy-ignore_down_backends.patch ++++++
--- ./check_haproxy.pl  2025/03/26 16:15:37     1.1
+++ ./check_haproxy.pl  2025/03/26 16:15:54
@@ -123,6 +123,11 @@
        help => _gt('Comma-separated list of backends to ignore'),
        required => 0,
 );
+$np->add_arg (
+       spec => 'ignore-down-backup-servers|B',
+       help => _gt('Ignore servers marked as backup in down state.'),
+       required => 0,
+);
 
 
 $np->getopts;
@@ -141,6 +146,7 @@
 if ( defined ( $ignore_backends ) ) {
        @ignore_backends_list = split(',',$ignore_backends);
 }
+my $ignore_down_backup = $np->opts->get('ignore-down-backup-servers');
 
 # Thresholds :
 # time
@@ -296,14 +302,16 @@
                                if ( $stats{$pxname}{$svname}{'status'} eq 'UP' 
) {
                                        logD( sprintf(_gt("%s '%s' is up on 
'%s' proxy."),$activeDescr,$svname,$pxname) );
                                } elsif ( $stats{$pxname}{$svname}{'status'} eq 
'DOWN' ) {
-                                       if ( defined($crit_backends) ) {
-                                               if ( 
grep(/^$pxname$/,@crit_backends_list) ) {
-                                                       
$np->add_message(CRITICAL, sprintf(_gt("%s '%s' is DOWN on '%s' proxy 
!"),$activeDescr,$svname,$pxname) );
+                                       if ( $active || !$ignore_down_backup ) {
+                                               if ( defined($crit_backends) ) {
+                                                       if ( 
grep(/^$pxname$/,@crit_backends_list) ) {
+                                                               
$np->add_message(CRITICAL, sprintf(_gt("%s '%s' is DOWN on '%s' proxy 
!"),$activeDescr,$svname,$pxname) );
+                                                       }else{
+                                                               
$np->add_message(WARNING, sprintf(_gt("%s '%s' is DOWN on '%s' proxy 
!"),$activeDescr,$svname,$pxname) );
+                                                       }
                                                }else{
-                                                       
$np->add_message(WARNING, sprintf(_gt("%s '%s' is DOWN on '%s' proxy 
!"),$activeDescr,$svname,$pxname) );
+                                                       
$np->add_message(CRITICAL, sprintf(_gt("%s '%s' is DOWN on '%s' proxy 
!"),$activeDescr,$svname,$pxname) );
                                                }
-                                       }else{
-                                               $np->add_message(CRITICAL, 
sprintf(_gt("%s '%s' is DOWN on '%s' proxy !"),$activeDescr,$svname,$pxname) );
                                        }
                                }
                                if ( $stats{$pxname}{$svname}{'act'} eq '1' ) {

Reply via email to