Changeset 3866 for monitoring


Ignore:
Timestamp:
10/23/13 17:56:29 (11 years ago)
Author:
oschonef
Message:
  • cosmetic fixes
Location:
monitoring/plugins/ids
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • monitoring/plugins/ids/check_shib_idp

    • Property svn:keywords set to Id
    r1986 r3866  
    11#!/usr/bin/perl
    22#
    3 # check_shib_idp, version 2012-06-13
     3# $Id$
    44#
    55
     
    111111$url =~ s|^/+||g;
    112112$url =~ s|/+$||g;
    113 my $sp_status_url = sprintf('%s://%s/%s', ($use_ssl ? 'https' : 'http'),
    114                                           $host,
    115                                           $url);
    116 print STDERR "IDP URL: $sp_status_url\n" if ($verbose > 0);
     113my $idp_status_url = sprintf('%s://%s/%s', ($use_ssl ? 'https' : 'http'),
     114                                            $host,
     115                                            $url);
     116print STDERR "IDP URL: $idp_status_url\n" if ($verbose > 0);
    117117
    118118my $browser = LWP::UserAgent->new;
    119 my $response = $browser->get($sp_status_url);
     119my $response = $browser->get($idp_status_url);
    120120if ($response->is_success) {
    121121    my $code    = OK;
  • monitoring/plugins/ids/check_shib_sp

    • Property svn:keywords set to Id
    r1847 r3866  
    11#!/usr/bin/perl
    22#
    3 # check_shib_sp, version 2012-04-03
     3# $Id$
    44#
    55
     
    151151my $cert_warn_days = 31;
    152152my $timeout        = 10;
    153 
     153my $verbose        = 0;
    154154
    155155my $result = GetOptions("H=s" => \$host,
     
    158158                        "S"   => \$use_ssl,
    159159                        "D=i" => \$max_clock_diff,
    160                         "C=i" => \$cert_warn_days);
     160                        "C=i" => \$cert_warn_days,
     161                        'v'   => \$verbose);
     162
    161163if (!($result)) {
    162164    status(UNKNOWN, 'USAGE: -H <host> [-u <url>] [-t <timeout>] [-S] [-D <clock skew> -C <age>');
     
    167169    status(UNKNOWN, 'missing manadorty parameter -H <host>');
    168170}
    169 
    170 #print "Host: $host\nURL: $url\nUSE_SSL: $use_ssl\nCLOCK: $max_clock_diff\nCERT WARN: $cert_warn_days\n";
    171171
    172172local $SIG{ALRM} = sub {
     
    181181                                          $host,
    182182                                          $url);
     183
     184print STDERR "SP URL: $sp_status_url\n" if ($verbose > 0);
     185
    183186my $browser = LWP::UserAgent->new;
    184187my $response = $browser->get($sp_status_url);
     
    190193    };
    191194    if ($@) {
    192         status(CRITICAL, "error parsing XML response: " . $@);
     195        my $msg = $@;
     196        $msg =~ s/^\n*(.*)\s+at.*?\n*$/$1/gs;
     197        status(CRITICAL, "error parsing XML response: " . $msg);
    193198    }
    194199
     
    235240        if ($cert->checkend(0)) {
    236241            status(CRITICAL,
    237                    sprintf('%s certificate is expired since %s',
     242                   sprintf('%s certificate has expired since %s',
    238243                           $key->{'use'}, $cert->notAfter()));
    239244        }
     
    241246            my $expire_days = int(get_diff($cert->notAfter()) / 86400);
    242247            $code           = WARNING;
    243             $message        = sprintf('%s certificate expires in %d day(s)',
     248            $message        = sprintf('%s certificate will expire in %d day(s)',
    244249                                      $key->{'use'}, $expire_days);
    245250        }
Note: See TracChangeset for help on using the changeset viewer.