Add option --no-thinpools-ok to silence warning when no pools are found
This commit is contained in:
		
							parent
							
								
									8460dd4ab2
								
							
						
					
					
						commit
						1fa9566e91
					
				
					 1 changed files with 13 additions and 2 deletions
				
			
		|  | @ -1,6 +1,7 @@ | ||||||
| #!/usr/bin/perl | #!/usr/bin/perl | ||||||
| use strict; | use strict; | ||||||
| use warnings; | use warnings; | ||||||
|  | use Getopt::Long; | ||||||
| 
 | 
 | ||||||
| my $warn = 92.0; | my $warn = 92.0; | ||||||
| my $crit = 96.0; | my $crit = 96.0; | ||||||
|  | @ -74,12 +75,22 @@ sub aggregate_errors { | ||||||
|   return; |   return; | ||||||
| } | } | ||||||
| 
 | 
 | ||||||
|  | 
 | ||||||
|  | my $no_thinpools_ok = 0; | ||||||
|  | GetOptions("no-thinpools-ok"  => \$no_thinpools_ok) | ||||||
|  |   or die("Error in command line arguments\n"); | ||||||
|  | 
 | ||||||
| my @thinpools = get_thinpools(); | my @thinpools = get_thinpools(); | ||||||
| 
 | 
 | ||||||
| # No thinpool found? | # No thinpool found? | ||||||
| if (scalar @thinpools == 0) { | if (scalar @thinpools == 0) { | ||||||
|  |   if ($no_thinpools_ok == 1) { | ||||||
|  |     print "OK: No thinpools found.\n"; | ||||||
|  |     exit 0; | ||||||
|  |   } else { | ||||||
|     print "UNKNOWN: No thinpools found.\n"; |     print "UNKNOWN: No thinpools found.\n"; | ||||||
|     exit 3; |     exit 3; | ||||||
|  |   } | ||||||
| } else { | } else { | ||||||
|   check_thinpools(); |   check_thinpools(); | ||||||
|   aggregate_errors(); |   aggregate_errors(); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue