Changeset 1670


Ignore:
Timestamp:
Sep 23, 2010, 5:33:29 PM (13 years ago)
Author:
ezyang
Message:
Pretty format check_ldap_mmr with USE_NEWLINES.
Location:
trunk/server/fedora/config/etc/nagios
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/server/fedora/config/etc/nagios/check_ldap_mmr

    r1272 r1670  
    11#!/bin/sh
    22
    3 exec /usr/bin/sudo -u signup /etc/nagios/check_ldap_mmr.real
     3exec /usr/bin/sudo -u signup USE_NEWLINES=$USE_NEWLINES /etc/nagios/check_ldap_mmr.real
  • trunk/server/fedora/config/etc/nagios/check_ldap_mmr.real

    r1579 r1670  
    66use Net::LDAP;
    77use strict;
     8
     9my $nl  = $ENV{'USE_NEWLINES'} ? "\n" : "";
     10my $tab = $ENV{'USE_NEWLINES'} ? "  " : "";
    811
    912# Nagios codes
     
    2528my $replicaErrors = 0;
    2629my $conflictErrors = 0;
    27 my $errorstring = "Replication error(s): ";
     30my $errorstring = "Replication error(s): $nl";
    2831foreach my $entr ( @entries ) {
    2932    my $servername=$entr->get_value($server);
     
    3538    $serverlaststart =~ s/(....)(..)(..)(..)(..)(..)./$1-$2-$3\ $4:$5:$6/;
    3639    $serverlastend =~ s/(....)(..)(..)(..)(..)(..)./$1-$2-$3\ $4:$5:$6/;
    37     print "Replication to $servername last operation $serverlaststart ";
    38     print "Status: $serverstatus.     ";
     40    print "Replication to $servername last operation $serverlaststart $nl";
     41    print $tab . "Status: $serverstatus.     $nl";
    3942    if ($statuscode) {
    4043        $replicaErrors++;
     
    4245    }
    4346}
     47print "$nl";
    4448
    4549$result=LDAPSearch($ldap,"nsds5ReplConflict=*",["nsds5ReplConflict"],$replicatedBase);
     
    4852    my $conflictingDN=$entr->dn();
    4953    my $conflictDesc=$entr->get_value("nsds5ReplConflict");
    50     print "Conflict found for DN $conflictingDN ";
    51     print "Reason: $conflictDesc.     ";
     54    print "Conflict found for DN $conflictingDN $nl";
     55    print $tab . "Reason: $conflictDesc.     $nl";
    5256    $conflictErrors++;
    5357    $errorstring = $errorstring . $conflictDesc . ", ";
    5458}
     59print "$nl";
    5560
    5661if ($conflictErrors > 0) {
Note: See TracChangeset for help on using the changeset viewer.